Skip to content
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

Merged

Conversation

ant-reyes
Copy link

@ant-reyes ant-reyes commented Dec 12, 2022

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:
image

Read Less:
image

Is there a release notes update needed for this change?:

Yes, included.

Additional documentation: N/A

Added contentTruncateForDataverse() to allow dataverse descriptions to have read more/read less buttons.
@qqmyers
Copy link
Member

qqmyers commented Dec 12, 2022

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?

@pdurbin
Copy link
Member

pdurbin commented Dec 13, 2022

Closes # N/A

@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:

@pdurbin
Copy link
Member

pdurbin commented Jan 4, 2023

@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:

@pdurbin pdurbin added Feature: Search/Browse Size: 3 A percentage of a sprint. 2.1 hours. labels Jan 4, 2023
Copy link
Member

@pdurbin pdurbin left a 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).

});
function contentTruncateForDataverse(){
Copy link
Member

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?

@qqmyers
Copy link
Member

qqmyers commented Jan 5, 2023

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.

@mreekie
Copy link

mreekie commented Jan 10, 2023

Prio meeting with Stefano.

  • Moved from Community Backlog to ordered backlog

@pdurbin
Copy link
Member

pdurbin commented Jan 10, 2023

@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!

I added changes suggested by @qqmyers from IQSS#9265 as well as a small change to prevent a horizontal scrollbar from appearing.
@pdurbin
Copy link
Member

pdurbin commented Jan 24, 2023

@ar062800 after dc9a297 this PR is looking much smaller and seems to reuse code more! Are you ready for more review?

@pdurbin
Copy link
Member

pdurbin commented Jan 26, 2023

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.

@pdurbin pdurbin self-assigned this Feb 10, 2023
Copy link
Member

@pdurbin pdurbin left a 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 pdurbin removed their assignment Feb 10, 2023
@kcondon
Copy link
Contributor

kcondon commented Feb 10, 2023

@pdurbin Need refresh from develop due to flyway error.

@pdurbin
Copy link
Member

pdurbin commented Feb 10, 2023

@kcondon done! Sorry for not catching that earlier! 😅 😬

@kcondon kcondon merged commit b7d60be into IQSS:develop Feb 10, 2023
@pdurbin pdurbin added this to the 5.13 milestone Feb 11, 2023
@kcondon kcondon self-assigned this Feb 14, 2023
@sergejzr
Copy link

sergejzr commented May 5, 2023

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.

@pdurbin
Copy link
Member

pdurbin commented May 5, 2023

@sergejzr no, this isn't planned but please feel free to create an issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Search/Browse Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Dataverse - Description text truncated
6 participants