Skip to content

Communities & Collections tree browser updates#2597

Closed
tamu-sad-iii wants to merge 4 commits intoDSpace:mainfrom
TAMULib:community-list-updates
Closed

Communities & Collections tree browser updates#2597
tamu-sad-iii wants to merge 4 commits intoDSpace:mainfrom
TAMULib:community-list-updates

Conversation

@tamu-sad-iii
Copy link
Copy Markdown
Contributor

@tamu-sad-iii tamu-sad-iii commented Nov 3, 2023

References

Description

This PR fixes two issues with the community collection list page:

  • The show more button not rendering after selection and more pages available.
  • When multiple show more nodes without unique id, the nodes are not being placed or expanding correctly.

Instructions for Reviewers

Set communityList.pageSize to a small number (less than half the number of top-level communities and less then subcommunities under a community).

communityList:
  # No. of communities to list per expansion (show more)
  pageSize: 4

Navigate to Communities & Collections page. Click show more pages and expand communities/subcommunities which multiple pages at the same level. The described issues above should no longer occur.

List of changes in this PR:

  • The condition to render the show more button has been updated to render when more pages are available after selection. Previously it was not rendering after a selection and more pages are available.
  • The id of the show more node added to the tree must be unique otherwise it is placed at the wrong level and clicking pages the wrong page (level). To make the node id unique, it was appended with hyphen and a newly generated UUID. The condition during getNextPage was updated to match node.id startsWith collection or community.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

`loadingNode` ends up being the current `node` after clicking it preventing it from rendering when more pages available.
The nodes with same id are conflicting when added to the tree. Clicking on the second with same id places the show more button under the wrong branch and expands the wrong page.
@tamu-sad-iii tamu-sad-iii changed the title Communities & Collection tree browser updates Communities & Collections tree browser updates Nov 3, 2023
@tdonohue tdonohue added usability component: Discovery related to discovery search or browse system 1 APPROVAL pull request only requires a single approval to merge component: Community Community display or editing port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Nov 3, 2023
@tdonohue tdonohue requested review from artlowel and tdonohue November 9, 2023 15:15
Copy link
Copy Markdown
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wwtamu

The fixes work, and the code looks good.

One more bug in a similar vein I noticed while testing this: if you have multiple nodes in the tree with the same name (e.g. currently the "biochemistry" top level communities on demo.dspace.org) and you open more than one, then close one, they all close at once. And the chevron for the ones you didn't click won't be updated.

I'm willing to bet the fix is as simple as changing the names here to ids

This PR doesn't cause that bug, but it seems a suitable one to fix as well, if you still have the time

@tamu-sad-iii tamu-sad-iii deleted the community-list-updates branch November 9, 2023 17:12
@tamu-sad-iii
Copy link
Copy Markdown
Contributor Author

Here is the successor PR, #2611. Let's see if we get those green check marks.

@tamu-sad-iii
Copy link
Copy Markdown
Contributor Author

@artlowel would you like the above comment pulled out into an issue? I will look for a solution in the meantime.

@tamu-sad-iii
Copy link
Copy Markdown
Contributor Author

Closed as commits split during CI build resolution.

@tdonohue
Copy link
Copy Markdown
Member

tdonohue commented Nov 9, 2023

@wwtamu : Please be aware we are finishing the 7.6.1 release this week (and early next week). So, I'll likely move the PR #2611 forward "as-is" unless you find a very quick solution. (I'll wait to merge that PR though until tomorrow to give you a chance to look into it)

If the solution @artlowel suggests above is the correct fix, it may not need a separate ticket or PR (as it sounds like a tiny fix). But, if we find the issue is bigger than that, then we should move it to a separate ticket and find a volunteer to look into it (likely after 7.6.1)

@tamu-sad-iii
Copy link
Copy Markdown
Contributor Author

No objections here.

tdonohue added a commit that referenced this pull request Nov 10, 2023
Communities & Collections tree browser updates - Replaced #2597
tdonohue added a commit that referenced this pull request Nov 10, 2023
[Port dspace-7_x] Communities & Collections tree browser updates - Replaced #2597
@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge component: Community Community display or editing component: Discovery related to discovery search or browse system usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants