-
Notifications
You must be signed in to change notification settings - Fork 493
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
Update dataverse.xhtml to add "read more/read less" buttons for dataverse descriptions #9222
Update dataverse.xhtml to add "read more/read less" buttons for dataverse descriptions #9222
Conversation
Added contentTruncateForDataverse() to allow dataverse descriptions to have read more/read less buttons.
So this is copying a javascript method used for datasets to apply it to dataverse/collection descriptions? Is it possible to reuse the function, e.g. by making the selector a parameter? (Rather than duplicating the method with a minor change?) Other than the target element, are there other changes? |
@ar062800 thanks for the pull request! I think you can safely update the description of the PR to say that it closes this issue: By the way, the truncation of dataset descriptions was added in this PR: |
@ar062800 Happy New Year! I'm just checking in. Please read through the feedback from me and @qqmyers above and let us know your thoughts. Thanks! If it's easier, you're welcome to ping me at https://chat.dataverse.org Another thought that come to mind:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ar062800 and I had a Zoom call. We want to remove the hard-coded English values.
We added a release note.
He tried to re-use the function in the rebind file. We can defer this to later (maybe @qqmyers or I can give it a shot before moving this to QA).
src/main/webapp/dataverse.xhtml
Outdated
}); | ||
function contentTruncateForDataverse(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original, the English (or non-English) button text is passed in like this:
function contentTruncate(truncSelector, truncMoreBtn, truncMoreTip, truncLessBtn, truncLessTip){
Can you please do something similar and remove the hard-coded English strings, below?
FWIW : #9265 is one way to reuse the old method. I've tested it briefly. If it works for everyone - if there are other changes in this PR we could try to figure out how to merge. If not, it may still show how to avoid hardcoding the text. |
Prio meeting with Stefano.
|
@ar062800 hi! I'm just checking in. Please let me know if you'd like to do another quick call. Also, you may want to check out the PR from Jim above for inspiration. Like we talked about, the main thing is to avoid having hard coded English strings (so that Dataverse can be translated to French, etc.) Thanks! |
@ar062800 after dc9a297 this PR is looking much smaller and seems to reuse code more! Are you ready for more review? |
I've been chatting with @ar062800 in Matrix. I'm ready to approve this PR (send it to "Ready for QA"). It's in the sprint already so I think it's just a matter of @mreekie adding it to the board. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't run the code myself but I've been talking to @ar062800 and @qqmyers about it. The changes look good. I think it's ready for QA. Approved.
@pdurbin Need refresh from develop due to flyway error. |
@kcondon done! Sorry for not catching that earlier! 😅 😬 |
Good day! The functionality is good, however we would like to keep it long for most of our dataverses. Is it planned to have it adjustable per dataverse (I didn't find such option in the conversations so far)? Otherwise, we will have to hack around ourselves. |
@sergejzr no, this isn't planned but please feel free to create an issue. Thanks. |
Added contentTruncateForDataverse() to allow dataverse descriptions to have "read more/read less" buttons.
What this PR does / why we need it: Our organization has a long description for our dataverse, which takes up too much space on the page. We needed a way to collapse the description. I reused the contentTruncate() function from dv_rebind_bootstrap_ui.js and added it to dataverse.xhtml scripts as contentTruncateForDataverse() to add this functionality.
Which issue(s) this PR closes: N/A
Special notes for your reviewer: N/A
Suggestions on how to test this: N/A
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Read More:
Read Less:
Is there a release notes update needed for this change?:
Yes, included.
Additional documentation: N/A