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

NAS-131790 / 25.04 / Add option to add confirmation requirement #11053

Merged
merged 9 commits into from
Nov 22, 2024

Conversation

RehanY147
Copy link
Contributor

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.

@RehanY147 RehanY147 requested a review from a team as a code owner November 17, 2024 22:25
@RehanY147 RehanY147 requested review from undsoft and removed request for a team November 17, 2024 22:25
@bugclerk bugclerk changed the title NAS-131790: Add option to add confirmation requirement NAS-131790 / 25.04 / Add option to add confirmation requirement Nov 17, 2024
@bugclerk
Copy link
Contributor

Copy link
Collaborator

@undsoft undsoft left a 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:

  1. I can click on backdrop and form closes without a warning.
  2. If I press Save, I am still presented with a warning dialog.

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.36%. Comparing base (6d0d1d7) to head (22741ff).
Report is 1 commits behind head on master.

✅ 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.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@undsoft undsoft left a 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;
Copy link
Collaborator

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.

@RehanY147 RehanY147 enabled auto-merge (squash) November 22, 2024 12:25
@RehanY147 RehanY147 merged commit b041a5f into master Nov 22, 2024
9 checks passed
@RehanY147 RehanY147 deleted the NAS-131790-v2 branch November 22, 2024 12:53
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants