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

Make place field in the user form a multiselect dropdown #9116

Closed
Tracked by #120
latin-panda opened this issue May 14, 2024 · 3 comments · Fixed by #9128
Closed
Tracked by #120

Make place field in the user form a multiselect dropdown #9116

latin-panda opened this issue May 14, 2024 · 3 comments · Fixed by #9128
Assignees
Labels
Type: Feature Add something new
Milestone

Comments

@latin-panda
Copy link
Contributor

latin-panda commented May 14, 2024

Is your feature request related to a problem? Please describe.
This is a continuation of #6543

Now, users can be associated with more than one facility. The CHT's Admin app should provide a way to associate those facilities with the user.

Describe the solution you'd like

  • The admin user enables can_have_multiple_places to some specific roles (e.g Supervisor CHW, etc.)

Whenever a new user is added:

  • The admin user clicks on add user
  • The dialog displays, and the place field is a multiselect dropdown.
  • The admin user fills in the information and selects roles and multiple places.
  • The admin submits the form and CHT validates:
    • At least one of the selected roles has can_have_multiple_places
    • Selected places are at the same hierarchy level
    • There's currently validation that says the associated contact must be a child of the selected place. In multiselect case, it should be a child of at least one of the selected places. Validate with the team.
  • CHT displays error in form when validations doesn't pass successfully.
  • Make sure to edit existing user prefills the multiselect field, and saves changes correctly

[MK EDIT 2024-05-14] We should also update the "Place" text.

Describe alternatives you've considered

  • When the validation happens, the user is not created yet, then probably use the settings service to validate can_have_multiple_places permission.
  • The place dropdown shows the hierarchy, check if we have access to that data easily to validate all places are from the same hierarchy level
Screenshot 2024-05-14 at 1 43 59 PM
@latin-panda latin-panda added the Type: Feature Add something new label May 14, 2024
@latin-panda latin-panda added this to the 4.9.0 milestone May 14, 2024
@latin-panda
Copy link
Contributor Author

@michaelkohn, please check if this is correct, and feel free to edit.

@Benmuiruri, please review and let us know if you have any questions.

@Benmuiruri
Copy link
Contributor

@michaelkohn you had started writing an edit but you didn't quite finish it. What was the thought there ?

@michaelkohn
Copy link
Member

@Benmuiruri I was thinking we'd want to update the "place" text with some guidance on what is acceptable (can only have multiple places if the permission is enabled, places have to be at the same level in the hierarchy, etc...), but I think we can just let validation take care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Add something new
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants