Skip to content

Commit

Permalink
Disable <Choose a Role> option to prevent error while adding Group
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilda Stastna committed Aug 2, 2019
1 parent ccb234f commit d6ae9a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,7 @@ def rbac_group_set_form_vars
Rbac::Filterer.filtered(MiqUserRole).each do |r|
@edit[:roles][r.name] = r.id
end
@edit[:new][:role] = if @group.miq_user_role.nil? # If adding, set to first role
@edit[:roles][@edit[:roles].keys.sort[0]]
else
@group.miq_user_role.id
end
@edit[:new][:role] = @group.miq_user_role ? @group.miq_user_role.id : @edit[:roles].first

all_tenants, all_projects = Tenant.tenant_and_project_names
placeholder_text_tenant = _('Choose a Project/Tenant')
Expand Down
4 changes: 2 additions & 2 deletions app/views/ops/_rbac_group_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
= link_to(@group.miq_user_role.name, "#", params)
- else
= select_tag('group_role',
options_for_select(@edit[:roles].sort, @edit[:new][:role]),
:class => "selectpicker")
options_for_select(@edit[:roles].sort, selected: @edit[:new][:role], disabled: ["<Choose a Role>", nil]),
:class => "selectpicker")
:javascript
miqInitSelectPicker();
miqSelectPickerEvent("group_role", "#{combo_url}")
Expand Down

0 comments on commit d6ae9a7

Please sign in to comment.