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

Clear tag expression field when editing group tag expression #3866

Merged
Merged
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
6 changes: 5 additions & 1 deletion app/controllers/application_controller/filter.rb
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ def exp_button
when "not"
exp_add_not(@edit[@expkey][:expression], @edit[@expkey][:exp_token])
when "and", "or"
if @edit[@expkey][:exp_typ] == 'tags'
@edit[@expkey][:exp_tag] = nil
@edit[@expkey][:exp_key] = 'CONTAINS'
end
exp_add_joiner(@edit[@expkey][:expression], @edit[@expkey][:exp_token], params[:pressed])
when "commit"
exp_commit(@edit[@expkey][:exp_token])
@@ -39,7 +43,7 @@ def exp_button
@edit[@expkey].history.push(@edit[:new][@expkey])
end
unless %w(and or).include?(params[:pressed]) # Unless adding an AND or OR token
@edit[@expkey][:exp_token] = nil # clear the current selected token
@edit[@expkey][:exp_token] = nil # clear the current selected token
end
changed = (@edit[:new] != @edit[:current])
@edit[@expkey][:exp_table] = exp_build_table(@edit[@expkey][:expression])
6 changes: 3 additions & 3 deletions app/views/layouts/exp_atom/_edit_tags.html.haml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- opts = ["<#{_('Choose')}>"]
- opts += MiqExpression.tag_details(nil, {})

%br
.spacer

= select_tag('chosen_tag', options_for_select(opts, @edit[@expkey][:exp_tag]),
:multiple => false,
@@ -17,10 +17,10 @@
'data-miq_sparkle_off' => true)

- if @edit[@expkey][:exp_tag]
%br
.spacer
%font{:color => "black"}
= h(@edit[@expkey][:exp_key])
%br
.spacer
- if @edit[@expkey][:exp_value] == :user_input
= "<#{_('user input')}>"
- else