Skip to content

Add Organization field to new user creation form

Problem

When a user creates a group or project, the Organization is implied to be the current Organization.

For admins, when creating a new user in the Admin Area, the UI will be a bit misleading as they will have a form to create the user, and the Current.organization will be set by the navigation dropdown in the sidebar. Not a great UX.

image

Technically the Organization should come from the admin user create form just for UX reasons. Even if it just defaults to the drop down value, but at least it would be explicit.

Proposal

  • Add a field to the new user form that allows admins to select an Organization that the user should be created in

For cells 1.0 where the instance is limited to a single organization

User creation form Dropdowns
image.png image.png

For cells 1.0 where the instance has multiple organizations

User creation form Dropdowns

image.png

image.png

image.png

For cells 1.5+

User creation form Dropdowns States
image.png image.png image.png

See #478605 (closed) for edit user

Implementation guide

  1. Create a component in app/assets/javascripts/admin/users/components. Name it something like new_user_organization.vue
  2. Create new helper file in app/helpers/admin named admin_users_helper.rb
  3. In admin_users_helper.rb create new method named admin_new_user_organization_app_data. Pass the default organization.
  4. Mount new_user_organization.vue in app/views/admin/users/_form.html.haml
  5. Render avatar for organization passed from admin_new_user_organization_app_data
  6. Create organization_role.vue file in app/assets/javascripts/organizations/shared/components
  7. When the organization_role.vue file is changed, update a hidden input where the name of the input matches the param in the controller.
Edited by Mike Nichols