Skip to content

Commit

Permalink
Initialize tag_tree when switching group tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed Nov 28, 2017
1 parent 7089223 commit f23e760
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,10 @@ def rbac_field_changed(rec_type)
page.replace(@refresh_div,
:partial => @refresh_partial,
:locals => {:type => "classifications", :action_url => 'rbac_group_field_changed'}) if @refresh_div

page.replace("customer_tags_div", :partial => "ops/rbac_group/customer_tags") if params[:use_filter_expression].present?

if params[:use_filter_expression].present?
page.replace("customer_tags_div", :partial => "ops/rbac_group/customer_tags",
:locals => {:tree => @tags_tree, :name => @tags_tree.name})
end
# Only update description field value if ldap group user field was selected
page << "$('#description').val('#{j_str(@edit[:new][:ldap_groups_user])}');" if params[:ldap_groups_user]

Expand Down Expand Up @@ -1152,10 +1153,10 @@ def rbac_group_get_form_vars

if params[:use_filter_expression]
@edit[:new][:use_filter_expression] = params[:use_filter_expression]
rbac_group_right_tree(@edit[:new][:belongsto].keys)
if params[:use_filter_expression] == 'false'
@edit[:new][:use_filter_expression] = false
@group = MiqGroup.find_by(:id => @edit[:group_id])
rbac_group_right_tree(@edit[:new][:belongsto].keys)
elsif params[:use_filter_expression] == 'true'
@edit[:use_filter_expression] = true
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/ops/rbac_group/_customer_tags.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
miqInitSelectPicker();
miqSelectPickerEvent('use_filter_expression', "#{url}")
- if @edit[:new][:use_filter_expression]
= render(:partial => "layouts/group_filter_expression")
= render(:partial => "layouts/group_filter_expression", :locals => {:tree => @tags_tree, :name => @tags_tree.name})
- else
= render(:partial => 'shared/tree', :locals => {:tree => @tags_tree, :name => @tags_tree.name})
- elsif @use_filter_expression
= render(:partial => "layouts/group_filter_expression")
= render(:partial => "layouts/group_filter_expression", :locals => {:tree => @tags_tree, :name => @tags_tree.name})
- else
= _("This user is limited to items with the selected tags.")
%br
Expand Down

0 comments on commit f23e760

Please sign in to comment.