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.
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 |
---|---|
For cells 1.0 where the instance has multiple organizations
User creation form | Dropdowns |
---|---|
For cells 1.5+
User creation form | Dropdowns | States |
---|---|---|
See #478605 (closed) for edit user
Implementation guide
- Create a component in
app/assets/javascripts/admin/users/components
. Name it something likenew_user_organization.vue
- Create new helper file in
app/helpers/admin
namedadmin_users_helper.rb
- In
admin_users_helper.rb
create new method namedadmin_new_user_organization_app_data
. Pass the default organization. - Mount
new_user_organization.vue
inapp/views/admin/users/_form.html.haml
- Render avatar for organization passed from
admin_new_user_organization_app_data
- Create
organization_role.vue
file inapp/assets/javascripts/organizations/shared/components
- 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