Skip to content

Conversation

@Dmytro-Melnyshyn
Copy link
Contributor

@Dmytro-Melnyshyn Dmytro-Melnyshyn commented Dec 26, 2025

Purpose

  1. When the current user edits their record, and there are no service points, the "Select service point" modal shouldn't appear during the user record saving (this can be reproduced if the user logs in as the user they want to edit, with no service points assigned, edits any field and hits save).
  2. Prevent showing the "Are you sure?" modal when saving a record. Some resources are re-fetched during form save, which remounts custom fields components, triggering form.change(), which makes the form dirty and prevents redirection by showing the "Are you sure?" modal (this can be reproduced only when there is a Single select/Multiselect/Radio button custom field, which makes the form dirty in edit mode, and when a user changes the user role, and then hits save).

Approach

  1. Add a check for non-empty servicePoints.
  2. Display loading only when opening the page. Do not show it during form save.

TODOS and Open Questions

Issues

https://folio-org.atlassian.net/browse/UIU-3503

Screencasts

The bug

2025-12-26_17h57_59.mp4

After the fix

2025-12-29_12h16_25.mp4

Learning

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@github-actions
Copy link

github-actions bot commented Dec 26, 2025

Jest Unit Test Results

    1 files  ±0    274 suites  ±0   5m 49s ⏱️ ±0s
1 312 tests ±0  1 309 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 353 runs  ±0  1 350 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit c12dc02. ± Comparison against base commit 4f42410.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
UserEdit should cancel form ‑ UserEdit should cancel form
UserEdit should submit form and call update ‑ UserEdit should submit form and call update
UserEdit should render loading ‑ UserEdit should render loading
withDeclareLost when servicePoints array is empty should not show HandlerManager ‑ withDeclareLost when servicePoints array is empty should not show HandlerManager

♻️ This comment has been updated with latest results.

@Dmytro-Melnyshyn Dmytro-Melnyshyn force-pushed the UIU-3503 branch 2 times, most recently from bad2c32 to 2bf0978 Compare December 29, 2025 09:40
@Dmytro-Melnyshyn Dmytro-Melnyshyn changed the title 3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. UIU-3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. Dec 29, 2025
@Dmytro-Melnyshyn Dmytro-Melnyshyn changed the title UIU-3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. UIU-3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. Do not show loading when saving a user record to prevent triggering the 'Are you sure" modal. Dec 29, 2025
@Dmytro-Melnyshyn Dmytro-Melnyshyn changed the title UIU-3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. Do not show loading when saving a user record to prevent triggering the 'Are you sure" modal. UIU-3503: Add condition to check for non-empty servicePoints before showing handler in withServicePoints component. Do not show loading when saving a user record to prevent triggering the 'Are you sure' modal. Dec 29, 2025
@sonarqubecloud
Copy link

@Dmytro-Melnyshyn Dmytro-Melnyshyn merged commit 5d7baa1 into master Dec 29, 2025
15 checks passed
@Dmytro-Melnyshyn Dmytro-Melnyshyn deleted the UIU-3503 branch December 29, 2025 11:40
Dmytro-Melnyshyn added a commit that referenced this pull request Dec 29, 2025
… showing handler in `withServicePoints` component. Do not show loading when saving a user record to prevent triggering the 'Are you sure' modal. (#3002)
Dmytro-Melnyshyn added a commit that referenced this pull request Dec 29, 2025
… showing handler in `withServicePoints` component. Do not show loading when saving a user record to prevent triggering the 'Are you sure' modal. (#3002)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants