chaynHQ/bloom-frontend

Enable Super Admin users to update the status of Partner Admin users from active to inactive

Closed this issue · 8 comments

Overview

Enable Super Admin users to update the status of Partner Admin users from active to inactive. This will happen on the /admin/dashboard page.

Action Items

  • Ensure you have a few super admin and partner admin users created in Bloom-backend.

Initial State on page load

  • Additional Card has been added with Title, Autocomplete Input and Button. The form field should require more than 3 letters before displaying options.
  • Get Autocomplete Options from the backend. See the implementation of UpdateTherapyAdminForm. I would like the autocomplete form to work like that form with a debounced asynchronously populated options list. To populate the options field, you will need to send a request to GET /users like the UpdateTherapyAdminForm with the searchQuery that includes the "partner-admin" relation and with partnerAdmin.partnerAdminId field as "IS NOT NULL" (See UpdateTherapyAdminForm if this is not clear).
Screenshot 2023-10-13 at 14 11 47

Once the user email is selected

  • Render a checkbox, prefilled with the current state of the partner admin user. I.e. if they are active currently, the checkbox would be filled.
  • Once the user checks or unchecks the box and presses the submit button. Send the relevant request to PATCH /partner-admin/:id
  • Create some sensible error messages. We aren't too prescriptive about error states. If you loosely follow that pattern of UpdateTherapyAdminForm, that should be enough.
Screenshot 2023-10-13 at 14 11 54

Once the request has been successful

  • Display Success Text
  • Ensure user can reset the form with the "Update another partner admin" form
Screenshot 2023-10-13 at 14 12 00

Please note this ticket is dependent on this ticket in the backend to be completed.

Hi @eleanorreem this looks fun! can I work on this?

Thank you for your interest in contributing to Chayn! Please carefully read the CONTRIBUTING.md file and the README.md file for guidance. Let us know if you have any questions. Good luck!

Hey @SangilYun! Awesome you are now assigned this issue.
As per our Contributing Guidelines, for advanced complexity issues, please consider sharing your progress as you work through this. This helps us ensure that we're on the right path. Thank you!

@eleanorreem @kyleecodes Correct me if I'm wrong but following the description, I noticed current backend implementation(link) doesn't seem to be able to handle IS NOT NULL passed as partnerAdmin.partnerAdminId.

Should I use active: true instead like how UpdateTherapyAdminForm is doing?

Good question. I pinged Chayn developers. Some are off this week so there is a response delay. Thank you for your patience.

Hey @SangilYun, Thanks for your question! It looks like there was some oversight in the backend ticket and it should have handled isNotNull. Sorry about that. I think we would want to be able to get all partner admins (active or inactive) so passing in active: true would not be enough. I will make a ticket to cover this in the backend. This might be a blocker for a little bit!

I have added a backend ticket to unblock you. Hopefully you shoudl be unblocked soon!

As per Chayn policy, after 30 days of inactivity, we will be unassigning this issue. Please comment to stay assigned.