- Notifications
You must be signed in to change notification settings - Fork928
fix: only allow submitting form if changes have been made#14602
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix: only allow submitting form if changes have been made#14602
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dannykopping commentedSep 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not sure this solution will be very clear for users. IMHO we'd probably want to change thebehaviour of the button, not whether it's enabled or not:
WDYT@stirby? |
I'm not sure I understand the reasoning for having a 'submit' button that we know (and communicate) to do nothing.
I think this might be overlapping with a separate issue#14319 |
Agreed. I'm motivating for a change to the naming of the button as well. |
Okay. And just for confirmation: You'd want the button to be submittable but act as a no-op? |
Yup. I'm no UX designer but that would at least be the most obvious to the user IMHO. If I saw a button that said "Submit without changes", I'd know exactly what that meant. If I made changes and the button turned orange and said "Restart with changes" with a little notice that said that the workspace would be restarted and any non-persistent data would be destroyed, there would similarly be no possibility for confusion, I feel. |
DanielleMaywood commentedSep 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I can only speak for myself but I'd expect the behaviour of this to dosomething. In this scenario, would the "Cancel" button and the "Submit without change" button have any difference in behaviour?
I think this is more related to the other issue#14319 (I agree it should be more obvious but I think that's out of scope for this issue) |
@BrunoQuaresma Do you have any opinions on what the design should be here? |
@DanielleMaywood disabling the button when there are no changes is a broad use pattern and I also agree we could rename the button to make what will happen clearer. Maybe we could change to "Submit and restart" or "Apply and restart"? |
@@ -73,3 +73,58 @@ test("Submit the workspace settings page successfully", async () => { | |||
}); | |||
}); | |||
}); | |||
test("Submit button is only enabled when changes are made", async () => { |
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 for now, having a test for this in Jest is ok, but in the future, you can try to usestorybook and interaction tests :)
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 will leave up to you to decide to change or not the button label
0d4b625
to230de7f
Compare9006b21
intomainUh oh!
There was an error while loading.Please reload this page.
Fixes#14320
This disables the submit button if the form is not dirty, meaning the button can only be enabled if the form has had changes to it.
Screen.Recording.2024-09-09.at.09.38.04.mp4