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

Make the default tab for browsing communities and collections configurable in DSpace 8

Open abelgomez opened this issue 7 months ago • 2 comments

References

Add references/links to any related issues or PRs:

  • This PR is related to this discussion: https://groups.google.com/g/dspace-tech/c/IU3udR1bZfI/m/unOcszYACwAJ

Description

This PR adds one configuration option for both communities and collections to select a tab (other than the search tab) when it is navigated. This allows a behaviour similar to the one in DSpace 7. When the default tab is not the "search" tab, the "search" tab is moved at the end of the tabs ribbon for aesthetics purposes.

Instructions for Reviewers

After incorporating the changes, simply add the following options to your front-end configuration:

# Community Page Config
community:
  # Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
  # <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
  # When the default tab is not the 'search' tab, the search tab is moved to the last position
  defaultBrowseTab: search

# Collection Page Config
collection:
  # Default tab to be shown when browsing a Collection. Valid values are: search, or browse_<field>
  # <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
  # When the default tab is not the 'search' tab, the search tab is moved to the last position
  defaultBrowseTab: search

List of changes in this PR:

  • The default routes for communities and collections have been modified. Now all tabs in a community/collection have a specific suffix to identify them (e.g.: https://sandbox.dspace.org/communities/8b632938-77c2-487c-81f0-e804f63e68e6/search; https://sandbox.dspace.org/communities/8b632938-77c2-487c-81f0-e804f63e68e6/comcols; etc.). See collection-page-routes.ts and community-page-routes.ts.
  • When a community/collection is accessed, the default tab is checked, and if no tab has been specified (by checking its URL), the route is changed to the default one. See comcol-page-browse-by.component.ts.
  • All other changes are minor: translations and interfaces holding configuration keys.

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). However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • [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.
  • [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • [ ] My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • [x] My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • [x] My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • [ ] 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.
  • [ ] If my PR fixes an issue ticket, I've linked them together.

abelgomez avatar Jul 03 '24 21:07 abelgomez