<commit_before>- url = url_for(:action => 'exp_changed')
- input_attrs = {:maxlength => 500, "data-miq_observe" => {:interval => '.5', :url => url}.to_json}

%span#chosen_regkey_span
  = _("Key:")
  = text_field_tag("chosen_regkey", @edit[@expkey][:exp_regkey], input_attrs)
- unless @edit[@expkey][:exp_key] == "KEY EXISTS"
  %span#chosen_regval_span
    = _("Value:")
    = text_field_tag("chosen_regval", @edit[@expkey][:exp_regval], input_attrs)

- options = options_for_select(MiqExpression.get_col_operators(:regkey), @edit[@expkey][:exp_key])
- select_attrs = {:multiple => false, :class => 'selectpicker', "data-miq_sparkle_on" => true,
  "data-miq_sparkle_off" => true, "data-live-search" => true}
= select_tag('chosen_key', options, select_attrs)

-# IS NULL, IS NOT NULL, IS EMPTY, IS NOT EMPTY, KEY EXISTS, VALUE EXISTS
- unless @edit[@expkey][:exp_key].include?("NULL") || @edit[@expkey][:exp_key].include?("EMPTY") || @edit[@expkey][:exp_key].include?("EXISTS")
  %span#chosen_value_span
    = _("Data:")
    = text_field_tag("chosen_value", @edit[@expkey][:exp_value], input_attrs)

:javascript
  miqInitSelectPicker();
  miqSelectPickerEvent('chosen_key, '#{url}');<commit_msg>Fix Advanced Search in Workloads https://bugzilla.redhat.com/show_bug.cgi?id=1344338<commit_after>- url = url_for(:action => 'exp_changed')
- input_attrs = {:maxlength => 500, "data-miq_observe" => {:interval => '.5', :url => url}.to_json}

%span#chosen_regkey_span
  = _("Key:")
  = text_field_tag("chosen_regkey", @edit[@expkey][:exp_regkey], input_attrs)
- unless @edit[@expkey][:exp_key] == "KEY EXISTS"
  %span#chosen_regval_span
    = _("Value:")
    = text_field_tag("chosen_regval", @edit[@expkey][:exp_regval], input_attrs)

- options = options_for_select(MiqExpression.get_col_operators(:regkey), @edit[@expkey][:exp_key])
- select_attrs = {:multiple => false, :class => 'selectpicker', "data-miq_sparkle_on" => true,
  "data-miq_sparkle_off" => true, "data-live-search" => true}
= select_tag('chosen_key', options, select_attrs)

-# IS NULL, IS NOT NULL, IS EMPTY, IS NOT EMPTY, KEY EXISTS, VALUE EXISTS
- unless @edit[@expkey][:exp_key].include?("NULL") || @edit[@expkey][:exp_key].include?("EMPTY") || @edit[@expkey][:exp_key].include?("EXISTS")
  %span#chosen_value_span
    = _("Data:")
    = text_field_tag("chosen_value", @edit[@expkey][:exp_value], input_attrs)

:javascript
  miqInitSelectPicker();
  miqSelectPickerEvent('chosen_key', '#{url}');
{'fraction_non_alphanumeric': 0.19609438567941415, 'fraction_numerical': 0.006102522375915379, 'mean_word_length': 6.8312101910828025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3011468', 'n_tokens_mistral': 965, 'n_tokens_neox': 929, 'n_words': 144}