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

#3094 - Update date slider to prevent automatic page reloads #3236

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

Simone-Ramundi
Copy link
Contributor

@Simone-Ramundi Simone-Ramundi commented Aug 7, 2024

References

Description

  • Updated the slider implementation in SearchRangeFilterComponent to comply with WCAG 2.1 Success Criterion 3.2.2 (On Input). This improvement ensures that slider value changes no longer trigger automatic page reloads, enhancing user control over when context changes occur.

Instructions for Reviewers

List of changes in this PR:

  • Updated Slider Event Handling: Replaced (onDebounce)="onSubmit()" with (change)="onSliderChange($event)" to prevent automatic page reloads when slider values change. This ensures users have control over when the page context updates.
  • Refactored Form Submission: Decoupled slider value updates from form submission, allowing users to submit changes only when they choose, thus preventing unintended context changes.
  • Enhanced User Control: By separating slider changes from form submission, users can manage when and how context changes occur, aligning with WCAG 2.1 guidelines for user control and context management.

To Reproduce
Steps to reproduce the behavior:

  1. Visit the search page on the sandbox, demo, or localhost (e.g., .../search?query=).
  2. Expand the date filter to reveal the date slider.
  3. Adjust the date slider to filter search results.
  • Expected Behavior: The page should not reload automatically when the date slider is adjusted. The page should only reload when the submit button is clicked after adjusting the slider.
  • Actual Behavior (before changes): The page would reload automatically each time the date slider was adjusted, which interfered with the user's ability to refine search results smoothly.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • 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.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • 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.
  • 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 accessibility component: Discovery related to discovery search or browse system claimed: 4Science 4Science team is working on this issue & will contribute back funded Task is funded via the DSpace Development Fund port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Aug 7, 2024
@alanorth
Copy link
Contributor

alanorth commented Aug 8, 2024

Thank you @Simone-Ramundi! I tested this on DSpace 7.6 and it works well.

@tdonohue the patch is simple and fixes a minor accessibility issue so I think we might be able to merge it with 1 APPROVAL pull request only requires a single approval to merge .

@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Aug 8, 2024
@alanorth alanorth added this to the 9.0 milestone Aug 9, 2024
@alanorth alanorth self-requested a review August 9, 2024 03:26
@alanorth alanorth merged commit fd7fb5d into DSpace:main Aug 9, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Backport failed for dspace-7_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-7_x
git worktree add -d .worktree/backport-3236-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-3236-to-dspace-7_x
git switch --create backport-3236-to-dspace-7_x
git cherry-pick -x 6c2d541b89ef99cdfe07ad66b7c1040a11cae575 56ba23fc3d6b51ed078ffa587f25503b457c97e5

@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-8_x:

@alanorth alanorth removed the port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release label Aug 9, 2024
@alanorth
Copy link
Contributor

alanorth commented Aug 9, 2024

Manually ported to dspace-7_x in #3245.

@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 Aug 9, 2024
@aseyedia aseyedia mentioned this pull request Sep 11, 2024
12 tasks
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 accessibility bug claimed: 4Science 4Science team is working on this issue & will contribute back component: Discovery related to discovery search or browse system funded Task is funded via the DSpace Development Fund
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Warn users before executing an automatic change of context
4 participants