-
Notifications
You must be signed in to change notification settings - Fork 309
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
NAS-131790 / 25.04 / Add option to add confirmation requirement #11053
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks okay, but there are two UX issues:
- I can click on backdrop and form closes without a warning.
- If I press Save, I am still presented with a warning dialog.
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #11053 +/- ##
==========================================
- Coverage 82.37% 82.36% -0.01%
==========================================
Files 1632 1632
Lines 57315 57356 +41
Branches 5913 5928 +15
==========================================
+ Hits 47211 47241 +30
- Misses 10104 10115 +11 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works as expected 👍🏼
Let's add some tests.
@@ -30,6 +30,7 @@ export interface ChainedComponent { | |||
export interface ChainedComponentResponse<T = unknown> { | |||
response: T; | |||
error: unknown; | |||
cancelled?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just look at response
and check if it's falsy.
This PR has been merged and conversations have been locked. |
Changes:
Adds a method in
chained-ref
to enable showing confirm dialog for forms when they are in a changed state so the user doesn't close the form accidentally.Testing:
Test replication form and wizard. Change values and try to close or swap the forms and the confirmation dialog should appear asking if you're sure you want to close this form.