Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EUWE] Make created filters in Datastores visible and fix commiting filters #13621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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