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

STRIPESFF-39: ECS - display Cancel confirmation popup on users edit page with not uniq username #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alisher-epam
Copy link

Purpose

The issue arises when a user tries to edit their username but enters a non-unique (already taken) username, then clicks the Cancel button. In this scenario, the Cancel confirmation dialog does not appear as expected.

The reason for this behavior is that submitSucceeded property here is initially set to true, which means the form mistakenly assumes that the submission was successful, even though it wasn’t due to the username conflict. This causes the form to skip the Cancel confirmation prompt.

Approach

Screen.Recording.2024-11-11.at.14.56.53.mp4

@alisher-epam alisher-epam self-assigned this Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

Jest Unit Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit be062e1. ± Comparison against base commit 31ea377.

♻️ This comment has been updated with latest results.

@alisher-epam alisher-epam requested review from zburke and a team November 11, 2024 11:47
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alisher-epam, IIUC, this change pulls submitSucceeded off the list of form-properties the FormSpy subscribes to. It doesn't "set submitSucceeded to true as suggested in the PR description. IOW, the same effect could be achieved by omitting that key, rather than setting it to false, which I think would be a cleaner implementation.

Regardless, I don’t understand how there is anything specific to ECS going on here. Can you explain why you think this is the correct change, and why this bug would be present in an ECS env but not a single-tenant env?

CHANGELOG.md Outdated
@@ -2,6 +2,8 @@

## 8.2.0 IN PROGRESS

* ESC - Cancel confirmation popup does not appear on user edit page after entering not unique Username. Refs STRIPESFF-39.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Petty: s/ESC/ECS/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zburke It is a very interesting and tricky bug. QA could only reproduce it in the ECS environment. Because the username uniqueness can be validated for the current tenant on username input change. That's why the behavior is reproducible via cross-tenant check only.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that you have described ECS-specific behavior but this is not an ECS-specific fix; it will change the behavior for everybody.

If we can't reproduce the behavior in a single-tenant setting, we should not change the behavior in a single-tenant setting. Instead, we should look at why cross-tenant username validation isn't correctly triggering the navigation-confirmation dialog.

Copy link

@@ -121,7 +121,6 @@ class StripesFinalFormWrapper extends Component {
<FormSpy
subscription={{
dirty: true,
submitSucceeded: true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to predict how this change will affect all the other forms in FOLIO. It might be safer to add a separate prop for FormSpy configuration.

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.

3 participants