dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Make 'id's unique in PaginationComponent

Open mwoodiupui opened this issue 1 year ago • 4 comments

Description

When displaying a Community with both child Collections and sub-Communities, the pagination controls for the two lists will have duplicate id attributes. SiteImprove considers this an accessibility issue. This patch generates a UUID member in PaginationComponent and uses it in the template to make the ids unique.

Instructions for Reviewers

To test, you will need a Community with child Collections and sub-Communities, so that both lists appear.

List of changes in this PR:

  • The component's class exposes a public elementId field, which is initialized to a UUID in the constructor.
  • The template appends this to id attributes as appropriate.
  • The .spec is updated to provide UUIDService for injection.

NOTE: the .spec is broken: "NullInjectorError: No provider for UUIDService!" NOTE: after the above is fixed, the .spec will probably fail because it is looking for fixed attribute values. I will work on that after the suite is repaired enough to run at all.

Checklist

  • [x] 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.
  • [x] My PR passes ESLint validation using yarn lint
  • [x] My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • [x] 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.
  • [x] 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.
  • [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • [x] If my PR fixes an issue ticket, I've linked them together.

mwoodiupui avatar Feb 26 '24 21:02 mwoodiupui

Hi @mwoodiupui, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Mar 08 '24 15:03 github-actions[bot]

Hi @mwoodiupui, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Mar 20 '24 14:03 github-actions[bot]

Hi @mwoodiupui, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Apr 19 '24 15:04 github-actions[bot]

"Help wanted" because I need some advice on how to make the specs work.

mwoodiupui avatar Apr 26 '24 15:04 mwoodiupui