determined icon indicating copy to clipboard operation
determined copied to clipboard

fix: add user modal should not disable submit button (DET-10277)

Open jesse-amano-hpe opened this issue 10 months ago • 5 comments

Ticket

DET-10277

Description

Fixes an issue where the submit button is only disabled/enabled on page (re)load, causing the submit button to become permanently disabled if any form errors are registered when the user changes tabs (other behaviors might produce the same effect, the one we consistently reproduced the issue with was changing browser tabs).

This seems like a bug that would've been around for almost a year, maybe longer, but it's more noticeable now that there are more fields after the first that could have validation errors and give admins reasons to change tabs while the modal is still open.

Test Plan

e2e tests cover creating and editing users with this modal.

Checklist

  • [x] Changes have been manually QA'd
  • [ ] User-facing API changes need the "User-facing API Change" label.
  • [ ] Release notes should be added as a separate file under docs/release-notes/. See Release Note for details.
  • [ ] Licenses should be included for new code which was copied and/or modified from any external code.

jesse-amano-hpe avatar May 01 '24 22:05 jesse-amano-hpe

Deploy Preview for determined-ui ready!

Name Link
Latest commit d57febad88b174de01dc0ede4b35ce26dc7d28c4
Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66392c2d614e4d0008640526
Deploy Preview https://deploy-preview-9285--determined-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 01 '24 22:05 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 37.98%. Comparing base (9cab46d) to head (d57feba). Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9285      +/-   ##
==========================================
- Coverage   44.63%   37.98%   -6.65%     
==========================================
  Files        1275      951     -324     
  Lines      156285   116474   -39811     
  Branches     2449     2454       +5     
==========================================
- Hits        69756    44243   -25513     
+ Misses      86289    71991   -14298     
  Partials      240      240              
Flag Coverage Δ
harness ?
web 35.06% <100.00%> (+0.01%) :arrow_up:

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

Files Coverage Δ
webui/react/src/components/CreateUserModal.tsx 89.71% <100.00%> (+1.61%) :arrow_up:

... and 324 files with indirect coverage changes

codecov[bot] avatar May 01 '24 22:05 codecov[bot]

did something change? i still see the same behavior

@keita-determined I missed a spot on the edit modal until just now (because of the timing of onFieldsChange I guess?) but the submit button should be properly enabled when the form is complete (in either the create or edit workflow), disabled otherwise.

jesse-amano-hpe avatar May 06 '24 19:05 jesse-amano-hpe

this doesnt seem to work in edit user modal.

https://github.com/determined-ai/determined/assets/109113616/1efd2a02-5236-41ef-bffc-0a0e579fe21c

keita-determined avatar May 06 '24 21:05 keita-determined

this doesnt seem to work in edit user modal.

Screen.Recording.2024-05-06.at.2.02.56.PM.mov

@keita-determined if no password is set while editing the user, the user's existing password (if any) is left alone; it's only an error to leave the password blank when creating a user. Should we require that something (e.g. Display Name) is changed before enabling the Save button?

jesse-amano-hpe avatar May 06 '24 21:05 jesse-amano-hpe