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 { equal } from "@ember/object/computed";
|
||||||
import bootbox from "bootbox";
|
import bootbox from "bootbox";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
import { action } from "@ember/object";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
@ -16,7 +17,8 @@ export default Component.extend({
|
||||||
return replacement.split(",");
|
return replacement.split(",");
|
||||||
},
|
},
|
||||||
|
|
||||||
click() {
|
@action
|
||||||
|
deleteWord() {
|
||||||
this.word
|
this.word
|
||||||
.destroy()
|
.destroy()
|
||||||
.then(() => {
|
.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)}}
|
{{#if (or isReplace isLink)}}
|
||||||
→ <span class="replacement">{{word.replacement}}</span>
|
→ <span class="replacement">{{word.replacement}}</span>
|
||||||
{{else if isTag}}
|
{{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);
|
assert.equal(count(".watched-words-list .watched-word"), 2);
|
||||||
});
|
});
|
||||||
|
|
|
@ -377,10 +377,10 @@ table.screened-ip-addresses {
|
||||||
.d-icon {
|
.d-icon {
|
||||||
margin-right: 0.25em;
|
margin-right: 0.25em;
|
||||||
color: var(--primary-medium);
|
color: var(--primary-medium);
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .d-icon {
|
&:hover {
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue