Skip to content

Convert admin/users view - move modal messages to components

Problem

The admin/users action components construct the message HTML in string. Ideally this should be in done in a template tag.

In !83111 (merged) this was updated to use an eventHub.

Proposal

Move the admin/users action messageHtml to components that can be slotted into the confirm modal.

Implementation

frontend

  1. Update confirm modal to slot in the right component for each action.
  2. Create a modal content component for each messageHtml in app/assets/javascripts/admin/users/components/actions.
  3. Pass the modal content component reference to the confirm modal via eventHub and render it in the modal.
  4. Remove the messageHtml in app/assets/javascripts/admin/users/components/actions.
  5. Update specs.
Edited by Jiaan Louw