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
As a researcher, I want URLs I enter in metadata fields to be clickable (i.e. alternativeURL) so that it's easier to follow links #3337
Comments
@shlake Currently that displayFormat is only used for compound types. This is the first case of a URL in a primitive type. Using display format may be the correct path, but just setting it won't actually change anything with the current logic. |
You are correct, I was going to update the ticket on Monday - me setting the displayFormat to the above code (as the other URLs are set to), does not make it hyperlinked when displaying with other metadata (on the metadata tab). |
Just a note that we have run into a similar problem in our software metadata block. We have primitive types that we'd like to have render as links. We set the displayFormat to <a href="#VALUE">#VALUE</a>, as mentioned above. I checked the database to verify that they had made it in properly. @scolapasta Is there any fundamental reason to restrict displayFormat to just the compound fields? |
I'm a little confused about if there's a bug to fix or if documentation for the tsv format is lacking (#3168). Or both. 😄 |
Maybe start with updating/clarifying the documentation https://docs.google.com/document/d/1idh4wvCcoxSo7rPkolOkTD5Wvn6PQO__uXqkf7eQujA/edit#heading=h.xqa9co8gtrwh Maybe the problem is with the "way it works" (documentation) or a bug with how things are being displayed (thinking that a field with a href value "should" be displayed as a hyperlink, and it isn't). |
There is an issue to solve which is to have formatting for URLs. There are a few ways we can consider this. @tdilauro the displayFormat was added for compound fields, because that's where you were "grouping" things and that's really what it's for. We should actually be handing type URL better. Something like software is more tricky because what if that's not used for a URL? In that case, we may want consider allowing html in that field, like we do for some others. (I think the rule is if it is a textbox you can do html and it is rendered - whitelisted, of course). |
@scolapasta Sorry, I meant fields in our software metadata block, not the software field. There are other fields in this block, as well, but these are the field types that represent links:
|
Hi, I am experiencing the same issue and after reading your comments, I am a bit confused: is it a bug or a matter of misconfiguration? |
Hi @jggautier , |
Hi @edzale, You're right. This issue is unresolved. Changing the displayFormat of the primitive field "alternativeURL" to I defer to @djbrooke to help answer when it'll be handled. (I edited your comment to make the displayFormat display as code |
Hi @jggautier |
@edzale to be clear, you're talking specifically about the "Alternative URL" field, right? The screenshot below is from the dataset you mentioned and like you said, it isn't clickable: |
@pdurbin, that's right, I am talking about the "Alternative URL" field. |
Hi @pdurbin Alternative URL has working perfectly at my end, by modify alternativeURL record in the datasetfieldtype table, add I saw citation.tsv has not included "displayFormat" with |
@umuchlish wow! That looks like a fairly easy fix! This issue isn't in our current sprint but do you think you'd be able to make a pull request so we can move this issue from "Inbox" to "Code Review" at https://waffle.io/IQSS/dataverse ? |
Sure Philip. |
@umuchlish great! Here's the line to change:
|
@umuchlish thanks for pull request #4711! I just moved it to code review at https://waffle.io/IQSS/dataverse . It looks fine to me. Thanks! |
I was going to add this to a comment in the PR, but I wanted to float the suggestion here in the issue, in case there was reason not to follow this approach. I have noticed that the The links for citation fields alternativeURL, publicationURL, keywordVocabularyURI, topicClassVocabURI, producerURL, distributorURL, are all missing this attribute. I suggest that we add it for all of these and make sure to keep an eye of other links in the @scolapasta @sbarbosadataverse @jggautier Thoughts? |
Another thought that's almost certainly out of scope for this issue, but related to the discussion of consistency with handling external links, would be adding @mheppler @djbrooke (and anybody else interested) - think it's worth a new issue? |
I think that if we're adding one attribute to the links in this metadata block, then it perfectly in scope to also add a second, especially if it is a security AND performance improvement! |
Performance is mostly "don't let javascript heavy page slow down current page" - so more avoiding making it worse than making it better. Still worth doing in my view. |
@umuchlish - thanks for the PR. Are you able and willing to make the change that @mheppler suggested above? @pameyer - can you please create a separate issue for your suggestion? |
Hi djbrooke, ah yes, that would be better. |
In 6ffb28d I added Thank you again to @umuchlish for the pull request! The fix should also benefit @shlake and @edzale who have commented on this issue as well as others. I moved this issue to QA at https://waffle.io/IQSS/dataverse It's small so I'd love it if we could get this in 4.9. |
@sekmiller authored and I tested and committed a SQL update for existing installations: 630a8d1 New installations get the fix from the change to the citation.tsv. |
The new (v4.4) alternativeURL metadata field should be clickable when citation metadata is displayed.
On metadata entry, the Watermark says "Enter full URL".
Solution: In citation.tsv file the field displayFormat is empty. In all the other metadata fields that are "URL" fields (and are clickable) have the following as the displayFormat:
<a href="#VALUE">#VALUE</a>
So I think that is what alternativeURL should have:
displayFormat =
<a href="#VALUE">#VALUE</a>
On this record you can see the non-clickable link:
https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.5072/FK2/YJMBUN
The text was updated successfully, but these errors were encountered: