FIX: only delete the word/phrase when the 'x' icon is clicked (#13547)
This commit is contained in:
parent
6be4699954
commit
3dda926cb2
|
@ -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(() => {
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -377,11 +377,11 @@ table.screened-ip-addresses {
|
|||
.d-icon {
|
||||
margin-right: 0.25em;
|
||||
color: var(--primary-medium);
|
||||
}
|
||||
|
||||
&:hover .d-icon {
|
||||
&:hover {
|
||||
color: var(--danger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.watched-word-form {
|
||||
|
|
Loading…
Reference in New Issue