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

Communities & Collections tree browser updates - Replaced #2597 #2611

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

wwelling
Copy link
Contributor

@wwelling wwelling commented Nov 9, 2023

References

#2597 (review)

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.

Update community list component spec

Make the show more flat node id unique

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.
@tdonohue tdonohue requested review from tdonohue and artlowel November 9, 2023 17:17
@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 9, 2023
@tdonohue
Copy link
Member

tdonohue commented Nov 9, 2023

NOTE: This is already at +1 since it's just an update version of the #2597 PR which was approved by @artlowel already. This PR has the same changes, but is just based on an updated branch.

Copy link
Member

@tdonohue tdonohue 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 ! Tested this as well and it works. Also verified the small issue which @artlowel previously reported has now been fixed.

@tdonohue tdonohue merged commit f336a8b into DSpace:main Nov 10, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue added this to the 8.0 milestone Nov 10, 2023
@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 10, 2023
@wwelling wwelling deleted the tamu-main-community-list-updates branch November 15, 2023 22:27
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
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants