-
Notifications
You must be signed in to change notification settings - Fork 36
Added Map popup logic to hide null title and file icon #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
the option added for records without titles, |
Good catch, Evan. I initially intended to remove the entire <h2> tag and its contents, but I left it there thinking I would enhance the logic so that if `object_transcript` text is provided it would be truncated and printed there in smaller, body font with a simple <a> tag only, no <h2>, and would open the same content that the “View Item” button does.
Would those additions to the PR make it more amenable?
From: EvanWill ***@***.***>
Date: Thursday, February 20, 2025 at 12:37 AM
To: CollectionBuilder/collectionbuilder-csv ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [CollectionBuilder/collectionbuilder-csv] Added Map popup logic to hide null title and file icon (PR #98)
Caution: External Email
the option added for records without titles, popupTemplate = '<h2 class="h4"><a class="text-dark" href="' + itemHref + '">' + '</a></h2><p>'; will create an empty header with an empty links with no text, which is an issue for accessibility.
In your use case example of your project, a better approach might be to move the "location" value you have in the child objects into the "title" (or make the title "Location: X")--this would achieve the same look without causing accessibility issues, using the current CB logic without changes.
—
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_CollectionBuilder_collectionbuilder-2Dcsv_pull_98-23issuecomment-2D2670590497&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=LCSFXzHc1sEiueRwYlXVrfFt_R1jGrHw8hfuconpyiHB2m704OJSw5N3zPeMHnL-&s=Un1J3WVx4DwgizPoAxY79yd6xwCdJeHRhJni1clcFi8&e=>, or unsubscribe<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADTEQ6G5A5GD6TVPR6VQTAL2QVZ2FAVCNFSM6AAAAABXOMDCBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZQGU4TANBZG4&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=LCSFXzHc1sEiueRwYlXVrfFt_R1jGrHw8hfuconpyiHB2m704OJSw5N3zPeMHnL-&s=b1qTs_b1zsK3Tt-7aybZHe83lNza1t-W2a3zIqrpo2Q&e=>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
[Image removed by sender. evanwill]evanwill left a comment (CollectionBuilder/collectionbuilder-csv#98)<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_CollectionBuilder_collectionbuilder-2Dcsv_pull_98-23issuecomment-2D2670590497&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=LCSFXzHc1sEiueRwYlXVrfFt_R1jGrHw8hfuconpyiHB2m704OJSw5N3zPeMHnL-&s=Un1J3WVx4DwgizPoAxY79yd6xwCdJeHRhJni1clcFi8&e=>
the option added for records without titles, popupTemplate = '<h2 class="h4"><a class="text-dark" href="' + itemHref + '">' + '</a></h2><p>'; will create an empty header with an empty links with no text, which is an issue for accessibility.
In your use case example of your project, a better approach might be to move the "location" value you have in the child objects into the "title" (or make the title "Location: X")--this would achieve the same look without causing accessibility issues, using the current CB logic without changes.
—
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_CollectionBuilder_collectionbuilder-2Dcsv_pull_98-23issuecomment-2D2670590497&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=LCSFXzHc1sEiueRwYlXVrfFt_R1jGrHw8hfuconpyiHB2m704OJSw5N3zPeMHnL-&s=Un1J3WVx4DwgizPoAxY79yd6xwCdJeHRhJni1clcFi8&e=>, or unsubscribe<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADTEQ6G5A5GD6TVPR6VQTAL2QVZ2FAVCNFSM6AAAAABXOMDCBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZQGU4TANBZG4&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=LCSFXzHc1sEiueRwYlXVrfFt_R1jGrHw8hfuconpyiHB2m704OJSw5N3zPeMHnL-&s=b1qTs_b1zsK3Tt-7aybZHe83lNza1t-W2a3zIqrpo2Q&e=>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
This email was sent from outside Grinnell College. Treat attachments and links with caution. If this message looks suspicious, use the report phish button.
|
Ouch, sorry for replying via email. I didn't realize it would include so much gunk! I hope/suspect that's mostly due to our ProofPoint obfuscation protection, but I'll try not to do that again! I also did not realize that pushing another change to my fork would automatically append that commit to this PR. That was not my intent, yet, but I hope it does no harm. So, the latest change just removes the entire h2... tag from the popup if there is no |
Merging recent CB changes into my fork.
Pull request
Proposed changes
This simple code change hides both the "null" title and default icon that previously appeared in Map page pop-ups for items that had no title field value.
In my personal project, visible at https://thankful-sea-06fcb2e0f.4.azurestaticapps.net/map.html, each map point corresponds to a stop along the route. End-of-day stops have a title, generally the date of that overnight stop, while intermediate stops are treated as child items of the end-of-day "compound" parent, and they have no title in the CSV data.
Without this change all intermediate map points displayed pop-ups like the one I captured here:
.
I searched the documentation for specifics about Map page pop-up behavior but found very little to work with, so I did not introduce any changes in the documentation. However, I'd like to suggest adding a small section to
/docs/maps.md
describing this behavior as well as other features of the Map pop-up elements.Types of changes
Checklist