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

FI-2038: Prevent modal close on edit #383

Merged
merged 8 commits into from
Aug 24, 2023
Merged

FI-2038: Prevent modal close on edit #383

merged 8 commits into from
Aug 24, 2023

Conversation

AlyssaWang
Copy link
Collaborator

Summary

While editing inputs in the dialog, clicking outside the dialog should no longer automatically close the modal.

Testing Guidance

  • 1) Open inputs dialog by running tests. Click outside the dialog, dialog should close. Double check with a dialog with checkbox inputs.
  • 2) Open inputs dialog again. Modify some input values. Clicking outside the dialog should not close the dialog.

@AlyssaWang AlyssaWang requested a review from arscan August 11, 2023 14:44
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Patch coverage: 75.92% and project coverage change: +0.01% 🎉

Comparison is base (82efcfc) 77.09% compared to head (3e6c3da) 77.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   77.09%   77.10%   +0.01%     
==========================================
  Files         213      213              
  Lines       10476    10510      +34     
  Branches      968      969       +1     
==========================================
+ Hits         8076     8104      +28     
- Misses       1834     1839       +5     
- Partials      566      567       +1     
Flag Coverage Δ
backend 94.51% <ø> (ø)
frontend 69.77% <75.92%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
.../src/components/InputsModal/InputCheckboxGroup.tsx 19.04% <50.00%> (ø)
client/src/components/InputsModal/InputsModal.tsx 59.38% <75.00%> (+2.01%) ⬆️
...c/components/InputsModal/InputOAuthCredentials.tsx 22.75% <100.00%> (ø)
...ent/src/components/InputsModal/InputRadioGroup.tsx 30.00% <100.00%> (ø)
...lient/src/components/InputsModal/InputTextArea.tsx 35.41% <100.00%> (ø)
...ient/src/components/InputsModal/InputTextField.tsx 86.53% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

AlyssaWang and others added 3 commits August 11, 2023 13:58
* add codecov

* turn codecov on

* modify backend target

* add patch coverage

---------

Co-authored-by: Alyssa Wang <awang@mitre.org>
@arscan
Copy link
Contributor

arscan commented Aug 16, 2023

Works as you described, and I can see how this would save users from a potentially bad misclick, though it does seem weird to me that once you edit the form you can't click outside the modal without any obvious reason why it suddenly becomes unclickable. It took me a sec to figure out how to close the modal after editing and it felt like a bug... I looked for an 'X' on the top right but nothing there, then scanned down to the find the 'Cancel' button on the bottom.

I don't know how much this matters. Could @mrnosal take a look at this user experience and either approve or make suggestions? I think it makes sense for him to make the call here. As long as this is a net improvement I'm good with merging it, just want to check w/mike that we aren't replacing one issue with another equal issue

@arscan arscan requested a review from mrnosal August 16, 2023 19:59
@AlyssaWang
Copy link
Collaborator Author

It would be pretty easy to add an X button so happy to do that if needed.

Copy link
Contributor

@mrnosal mrnosal left a comment

Choose a reason for hiding this comment

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

Behavior when edits have been made is consistent for Field, JSON and YAML inputs. Close box added with tooltip to warn of data loss.

@AlyssaWang AlyssaWang merged commit b680f84 into main Aug 24, 2023
7 of 8 checks passed
@AlyssaWang AlyssaWang deleted the FI-2038-modal-close branch August 24, 2023 18:58
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