Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear the currently selected token
Browse files Browse the repository at this point in the history
lgalis committed Apr 28, 2018
1 parent bcdae47 commit e82149f
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller/filter.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,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])
Original file line number Diff line number Diff line change
@@ -296,7 +296,7 @@ def update_from_expression_editor(params)
case exp_typ
when 'field', 'find'
MiqExpression.value2human(exp_field).split(':').last
when 'tag'
when 'tag', 'tags'
MiqExpression.value2human(exp_tag).split(':').last
when 'count'
MiqExpression.value2human(exp_count).split('.').last
8 changes: 4 additions & 4 deletions app/views/layouts/exp_atom/_edit_tags.html.haml
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
exp_model Model in use for this expression
- opts = ["<#{_('Choose')}>"]
- opts += MiqExpression.tag_details(nil, {})
- opts += @edit[@expkey].tags_for_display_filters

%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

0 comments on commit e82149f

Please sign in to comment.