Skip to content

Commit

Permalink
Merge pull request #13621 from hstastna/Filters_in_datastores_page_re…
Browse files Browse the repository at this point in the history
…freshed2_EUWE_

[EUWE] Make created filters in Datastores visible and fix commiting filters
  • Loading branch information
simaishi authored Jan 23, 2017
2 parents 4385979 + edcebc4 commit f18f3da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def adv_search_button
adv_search_build_lists
# Save the last search loaded (saved)
@edit[@expkey][:exp_last_loaded] = {:id => s.id, :name => s.name, :description => s.description, :typ => s.search_type}
@edit[:new_search_name] = @edit[:adv_search_name] = @edit[@expkey][:exp_last_loaded][:description]
@edit[:new_search_name] = @edit[:adv_search_name] = @edit[@expkey][:exp_last_loaded][:description] unless @edit[@expkey][:exp_last_loaded].nil?
@edit[@expkey][:expression] = copy_hash(@edit[:new][@expkey])
# Build the expression table
@edit[@expkey][:exp_table] = exp_build_table(@edit[@expkey][:expression])
Expand Down
9 changes: 7 additions & 2 deletions app/presenters/tree_builder_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ def x_get_tree_roots(count_only, _options)
end

def x_get_tree_custom_kids(object, count_only, options)
return count_only ? 0 : [] if object[:id] != "global"
objects = MiqSearch.where(:db => options[:leaf]).visible_to_all
objects = MiqSearch.where(:db => options[:leaf])
objects = case object[:id]
when "global" # Global filters
objects.visible_to_all
when "my" # My filters
objects.where(:search_type => "user", :search_key => User.current_user.userid)
end
count_only_or_objects(count_only, objects, "description")
end
end
33 changes: 14 additions & 19 deletions app/views/layouts/exp_atom/_editor.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,20 @@
- exptypes -= [[_(EXP_FIND_TYPE[0]), EXP_FIND_TYPE[1]]]
#exp_atom_editor_div
%fieldset{:style => "width:auto; padding-left: 6px; padding-top: 6px;"}
%ul.searchtoolbar
%li
- t = _('Commit expression element changes')
= link_to(image_tag(image_path('toolbars/commit.png'), :alt => t),
{:action => 'exp_button', :pressed => 'commit'},
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
%li
- t = _("Discard expression element changes")
= link_to(image_tag(image_path('toolbars/discard.png'), :alt => t),
{:action => 'exp_button', :pressed => 'discard'},
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
- t = _('Commit expression element changes')
%button.btn.btn-default{"data-method" => :post,
"data-miq_sparkle_on" => true,
:onclick => "miqAjaxButton('#{url_for(:action => 'exp_button', :pressed => 'commit')}');",
:remote => true,
:title => t}
%i.fa.fa-lg.fa-check
- t = _("Discard expression element changes")
%button.btn.btn-default{"data-method" => :post,
"data-miq_sparkle_on" => true,
:onclick => "miqAjaxButton('#{url_for(:action => 'exp_button', :pressed => 'discard')}');",
:remote => true,
:title => t}
%i.fa-lg.pficon.pficon-close
%div{:style => "padding: 10px;"}
- if @edit[@expkey][:exp_key] == "NOT"
%font{:color => "black"}
Expand Down

0 comments on commit f18f3da

Please sign in to comment.