mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 10:15:48 +08:00
143f06f2c6
At the moment, there is no way to create a group of related watched words together. If a user needed a set of words to be created together, they'll have to create them individually one at a time. This change attempts to allow related watched words to be created as a group. The idea here is to have a list of words be tied together via a common `WatchedWordGroup` record. Given a list of words, a `WatchedWordGroup` record is created and assigned to each `WatchedWord` record. The existing WatchedWord creation behaviour remains largely unchanged. Co-authored-by: Selase Krakani <skrakani@gmail.com> Co-authored-by: Martin Brennan <martin@discourse.org>
21 lines
588 B
JavaScript
21 lines
588 B
JavaScript
import { computed } from "@ember/object";
|
|
import { makeArray } from "discourse-common/lib/helpers";
|
|
import MultiSelectComponent from "select-kit/components/multi-select";
|
|
|
|
export default MultiSelectComponent.extend({
|
|
pluginApiIdentifiers: ["watched-words"],
|
|
classNames: ["watched-word-input-field"],
|
|
|
|
selectKitOptions: {
|
|
autoInsertNoneItem: false,
|
|
fullWidthOnMobile: true,
|
|
allowAny: true,
|
|
none: "admin.watched_words.form.words_or_phrases",
|
|
},
|
|
|
|
@computed("value.[]")
|
|
get content() {
|
|
return makeArray(this.value).map((x) => this.defaultItem(x, x));
|
|
},
|
|
});
|