Skip to content

[minor] Fix "get link" detail navbar feature#246

Open
abought wants to merge 1 commit into
globus:mainfrom
abought:fix/2025-02-26-https_url
Open

[minor] Fix "get link" detail navbar feature#246
abought wants to merge 1 commit into
globus:mainfrom
abought:fix/2025-02-26-https_url

Conversation

@abought

@abought abought commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Purpose

The default templates have a feature that doesn't render as written. The copy button is only shown when https_url is defined, but the field is filled in based on a (never-defined) variable called copy_to_clipboard_link.

Short term fix

This is the narrowest possible fix, just to avoid that moment of puzzlement for any new user.

Use the same variable to render the copy widget that was used to render the button.

Reduces tiny risk of breakage by changing the URL variable at point of usage, to match what the page already assumed it was called in detail-nav.html block detail_nav_get_link_button.

Left the nominally reusable partial unchanged. (copy-to-clipboard.html).

Long term

Most people are probably sharing datasets (not single files). The current implementation is not super aligned with user needs, which may explain why no one noticed. This is the smallest possible fix to restore stock functionality.

Example

Before
Screenshot 2025-02-26 at 3 17 02 PM

After
Screenshot 2025-02-26 at 3 16 41 PM

Rather than change the reusable partial, I changed it at the point of usage

* Detail page had already (in the nav part of the DOM) decided to only show this button when https_url was defined, so this coupling to variable name makes sense for the detail page

Eventually feature needs a redesign
@NickolausDS

Copy link
Copy Markdown
Contributor

Could we keep the v2 templates the same, and remove copy_to_clipboard_link entirely from the v3 templates? v3 is not currently the stable default, so changes like these are encouraged there.

@abought

abought commented Feb 26, 2025

Copy link
Copy Markdown
Contributor Author

Given that no one ever noticed and reported this in 4 yr, I suspect there's a lot of latitude. USGS (primary known v3 users) indicate that they're doing a full override.

To clarify:
"Keep the same" = keep the change in this PR, or "replace this commit with an entirely different approach for both templates"?

@NickolausDS

Copy link
Copy Markdown
Contributor

Remove the change in v2, in case some portal out there does make use of these two items being different.

In v3, remove copy_to_clipboard_link entirely in favor of https_url. We could use your implementation instead if we want to support this snippet as something modular which could be used in other contexts, such as a list of files with copy-able links. But supporting that would also require additional work, since id=collapseExample makes that not currently possible with this template. Doing away with the additional copy_to_clipboard_link term seems more appropriate for simplicity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants