codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
28 stars 25 forks source link

[Bug] - Include validation for webIds in Add Contacts Modal #561

Closed leekahung closed 9 months ago

leekahung commented 9 months ago

This PR:

Resolves #415 by including an early validation step that exits the handleAddContact function if webId being added does not exist. Minor clean-up to AddContactModal.jsx has also been included.

Screenshots (if applicable):

https://github.com/codeforpdx/PASS/assets/14917816/34243825-53e1-4a86-82bc-9a54cc637ad7

Future Steps:

Related to a new bug, but if you were to include another user with a webId that already exists, but is already included in the contacts list, the new submission will overwrite the information from the existing contact from the list.

https://github.com/codeforpdx/PASS/assets/14917816/79c1b849-9b7d-497b-a90a-3469d7029dd0

leekahung commented 9 months ago

Would need to update tests for the modal to include validation

xscottxbrownx commented 9 months ago

Just looking at your videos above - I think I'd prefer the error be shown on the Username field instead of the notification hook toast popup. It would directly show the user which field is incorrect and needs fixing.

Like triggering the 'error' prop on the field and helper text of 'user does not exist' (or similar) as well.

leekahung commented 9 months ago

Just looking at your videos above - I think I'd prefer the error be shown on the Username field instead of the notification hook toast popup. It would directly show the user which field is incorrect and needs fixing.

Like triggering the 'error' prop on the field and helper text of 'user does not exist' (or similar) as well.

Got it included, see updated clip in description.