kernel-community / services

Implementation of Kernel services
https://www.kernel.community/
MIT License
15 stars 16 forks source link

Groups app frontend validations and alerts #32

Open rorysaur opened 2 years ago

rorysaur commented 2 years ago

In the Groups app create/edit form:

  1. Name cannot be blank.
  2. Member IDs cannot be blank.
  3. Member IDs must be in the correct format (comma-delineated strings) AND each member ID must correspond to an existing member. (This entire validation will be unnecessary once #30 is completed.)

Validate these on Save.

  1. If all validations pass and the save is successful, there should be an alert below the Save button saying: a. for create: "Your group has been created! [View your group.] (with link to the group's View page)" b. for edit: "Your changes have been saved! [View your group.] (ditto)"
  2. If any validations fail: a. There should be an alert below the Save button saying: "Something went wrong. Check for errors above." b. There should be a message below each failing field specifying what the problem is.
  3. If all validations pass but the save fails for any reason, there should be an alert saying: "Something went wrong." with the error message appended if there is one.

Additionally, gray out and disable the Save button while waiting for the save.

See the Adventures create/edit form (ProjectForm) for examples of all of the above, including per-field validations and validation messages, success and error alerts, how to link to the new entity's page, and disabling the Save button.

thestrabusiness commented 2 years ago

Will take a shot at this!

thestrabusiness commented 2 years ago

Got a draft PR opened just now. Still need to clean some things up which I should be able to take a shot at tomorrow evening.