diff --git a/app/assets/javascripts/admin/addon/components/admin-watched-word.js b/app/assets/javascripts/admin/addon/components/admin-watched-word.js index 8c5fd514966..b198ffcf2b6 100644 --- a/app/assets/javascripts/admin/addon/components/admin-watched-word.js +++ b/app/assets/javascripts/admin/addon/components/admin-watched-word.js @@ -2,6 +2,7 @@ import Component from "@ember/component"; import { equal } from "@ember/object/computed"; import bootbox from "bootbox"; import discourseComputed from "discourse-common/utils/decorators"; +import { action } from "@ember/object"; import I18n from "I18n"; export default Component.extend({ @@ -16,7 +17,8 @@ export default Component.extend({ return replacement.split(","); }, - click() { + @action + deleteWord() { this.word .destroy() .then(() => { diff --git a/app/assets/javascripts/admin/addon/templates/components/admin-watched-word.hbs b/app/assets/javascripts/admin/addon/templates/components/admin-watched-word.hbs index 53d61a9b97a..31cfd51957f 100644 --- a/app/assets/javascripts/admin/addon/templates/components/admin-watched-word.hbs +++ b/app/assets/javascripts/admin/addon/templates/components/admin-watched-word.hbs @@ -1,4 +1,4 @@ -{{d-icon "times"}} {{word.word}} +<span role="button" onclick={{action "deleteWord"}} class="delete-word-record">{{d-icon "times"}}</span> {{word.word}} {{#if (or isReplace isLink)}} → <span class="replacement">{{word.replacement}}</span> {{else if isTag}} diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js index ecc29584f22..5e40f78497f 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js @@ -82,7 +82,7 @@ acceptance("Admin - Watched Words", function (needs) { } }); - await click("#" + $(word).attr("id")); + await click(`#${$(word).attr("id")} .delete-word-record`); assert.equal(count(".watched-words-list .watched-word"), 2); }); diff --git a/app/assets/stylesheets/common/admin/staff_logs.scss b/app/assets/stylesheets/common/admin/staff_logs.scss index c893a174f70..3953f0847d2 100644 --- a/app/assets/stylesheets/common/admin/staff_logs.scss +++ b/app/assets/stylesheets/common/admin/staff_logs.scss @@ -377,10 +377,10 @@ table.screened-ip-addresses { .d-icon { margin-right: 0.25em; color: var(--primary-medium); - } - &:hover .d-icon { - color: var(--danger); + &:hover { + color: var(--danger); + } } }