Skip to content

User Manager page - edit a user #210

@ghost

Description

Note: This is contingent on the base implementation being done or almost done.
The whole purpose of the user manager table is to quickly see every user in the database at a glance and update their attributes. The cleanest way for this (since mass editing likely won't be useful) is to display a modal whenever a user is clicked on with editable fields.

Work off of the branch role_manager_4.4.19

Action Items

  • Upon clicking a row, we should display a reactstrap modal. This is the same way that the Filter modal currently works, except our flag for whether or not to show the modal is whether a userSelectedForEdit exists in our state. If so, we should display the modal. I'd suggest creating a separate component like EditUserModal and pass both the this.onModalClose and userSelectedForEdit as props. When the user is null, the the modal should no longer be showing.
  • Using formik, we just need a single form in the modal with 2 input boxes (one for name and one for email) and two dropdown selectors (one for role and one for status). For the input boxes we just pre-populate the fields with the user's name and email. For the other two, we set the "selected" property to the role and the status.
    Note: Don't hardcode the role and status options for the dropdowns. We already have these in a helper file! Check out applicantInfoHelpers.js and import the "roles" and "statuses." You can set the array of dropdown options to Object.values(roles)
  • Add a "save" button to the form to submit the form. Again, implement this as we did in the filters modal, and call the onModalClose callback with the updated user from the form as a parameter. For "cancel," just call onModalClose with no param to clear out the userSelectedForEdit
  • Wait on the backend endpoint for updating user values. Ben the query wizard will have that done shortly :)

Metadata

Metadata

Assignees

Labels

FrontendFeature for React codeNew FunctionalityFeature that has not yet been implementedPriority 1Get it done!

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions