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

Clear url parameters for entity search tabs #2734

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Atmire-Kristof
Copy link
Contributor

@Atmire-Kristof Atmire-Kristof commented Jan 10, 2024

References

Description

Clears all url parameters when switching search tabs on entity pages to avoid using non-existent filters/sort/configurations/pages etc. on the new search tab.
Clears url parameters and component properties when applying startsWith or value on browse-by pages, avoiding a conflict between the two described in #2739

Instructions for Reviewers

How to test entity pages:

  • Visit an entity item page containing more than one search tab, with one search tab containing a filter or sort option not available on the other tab
  • Select a value for that filter/sort option
  • Click the other tab
  • All parameters except the tab identifier should be cleared and search is still functional
  • Perform the same test, but one tab containing more pages of results than the other, selecting the last page and clicking the other tab, you should end up on the first page of the new search tab

How to test browse-by pages:

  • Visit a browse-by metadata page (e.g. subject)
  • Select a value
  • Search for a different value. It should clear the previous value and ONLY display the "startsWith" value you just entered, as well as any results matching it
  • Selecting a value after a search should also clear the "startsWith" parameter, in order for only the clicked value to be visible

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.

@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge labels Jan 10, 2024
@tdonohue tdonohue added this to the 8.0 milestone Jan 10, 2024
@Atmire-Kristof
Copy link
Contributor Author

Applied an additional fix for #2739, since it's related to the same issue of clearing url parameters.

Copy link

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

@tdonohue
Copy link
Member

tdonohue commented May 3, 2024

@Atmire-Kristof : This has code conflicts. If you wish to have it still considered for 8.0, please get this PR cleaned up and updated to latest main. Otherwise, we'll have to reschedule for 9.0. Thanks!

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.

@Atmire-Kristof : I tested/reviewed this today. While, I can verify it fixes both #2729 and #2739, this PR is currently failing several existing specs/tests in StartsWithDateComponent. Please update this PR to either pass those tests or fix those tests.

@toniprieto
Copy link
Contributor

I don't think #2739 should be considered a bug. The second parameter 'startWith' is used to filter the list of items by title that have the previously selected value. For example, if you select the subject 'financial therapy' on the current demo site (https://demo.dspace.org/browse/subject?value=financial%20therapy&bbm.return=5), you can then filter this list by titles that start with 'Book' (https://demo.dspace.org/browse/subject?value=financial%20therapy&bbm.return=5&bbm.page=1&startsWith=Book).

@tdonohue tdonohue removed this from the 8.0 milestone Jun 24, 2024
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 bug
Projects
Status: 👀 Under Review
3 participants