Skip to content

Commit

Permalink
Hotfix for tag rules
Browse files Browse the repository at this point in the history
  • Loading branch information
binarygit committed Oct 29, 2022
1 parent 7c985d0 commit d191a02
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Expand Up @@ -40,7 +40,7 @@
%td
%tags-with-translation{ object: "rule", max: 1, "tags-attr" => "{{opt[rule.type].tagsAttr}}", "tag-list-attr" => "{{opt[rule.type].tagListAttr}}" }
%td.actions{ rowspan: 2 }
%a{ ng: { click: "deleteTagRule(tagGroup || defaultTagGroup, rule)" }, :class => "delete-tag-rule icon-trash no-text" }
%a{ ng: { click: "deleteTagRule(tagGroup || defaultTagGroup, rule)" }, :class => "delete-tag-rule icon-trash no-text", "data-action": "click->dirty-form#makeDirty" }
%tr
%td
%span.text-normal {{ opt[rule.type].textBottom }}
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/enterprises/form/_tag_rules.html.haml
Expand Up @@ -22,6 +22,6 @@
= t('.no_rules_yet')
.tag_rule{ ng: { repeat: "rule in tagGroup.rules" } }
.add_rule.text-center
%input.button.icon-plus{ type: 'button', value: t('.add_new_rule'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "tagGroup", "new-tag-rule-dialog" => true }
%input.button.icon-plus{ type: 'button', value: t('.add_new_rule'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "tagGroup", "new-tag-rule-dialog" => true, "data-action": "click->dirty-form#makeDirty" }
.add_tag
%input.button.red.icon-plus{ type: 'button', value: t('.add_new_tag'), ng: { click: 'addNewTag()' } }
%input.button.red.icon-plus{ type: 'button', value: t('.add_new_tag'), ng: { click: 'addNewTag()' }, "data-action": "click->dirty-form#makeDirty" }
Expand Up @@ -12,7 +12,7 @@
= t('.no_rules_yet')
.tag_rule{ ng: { repeat: "rule in defaultTagGroup.rules" } }
.add_rule.text-center
%input.button.icon-plus{ type: 'button', value: t('.add_new_button'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "defaultTagGroup", "new-tag-rule-dialog" => true }
%input.button.icon-plus{ type: 'button', value: t('.add_new_button'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "defaultTagGroup", "new-tag-rule-dialog" => true, "data-action": "click->dirty-form#makeDirty" }

= render HelpModalComponent.new(id: "tag_rule_help_modal") do
#tag-rule-help
Expand Down
7 changes: 0 additions & 7 deletions spec/system/admin/tag_rules_spec.rb
Expand Up @@ -248,13 +248,6 @@
end
expect(page).to have_no_selector "#tr_0"
end.to change{ TagRule.count }.by(-2)

# After deleting tags, the form is dirty and we need to confirm leaving
# the page. If we don't do it here, Capybara may timeout waiting for the
# confirmation while resetting the session.
accept_confirm do
visit("about:blank")
end
end
end

Expand Down

0 comments on commit d191a02

Please sign in to comment.