Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-24 02:10:29 +01:00
19 Zeilen
579 B
JavaScript
19 Zeilen
579 B
JavaScript
import { computed } from "@ember/object";
|
|
import { makeArray } from "discourse-common/lib/helpers";
|
|
import ComboBox from "select-kit/components/combo-box";
|
|
|
|
export default ComboBox.extend({
|
|
content: computed("groups.[]", "field.content.[]", function () {
|
|
const whitelist = makeArray(this.field.content);
|
|
return this.groups
|
|
.filter((group) => {
|
|
return !whitelist.length || whitelist.indexOf(group.id) > -1;
|
|
})
|
|
.map((g) => {
|
|
return {
|
|
id: g.id,
|
|
name: g.full_name ? g.full_name : g.name,
|
|
};
|
|
});
|
|
}),
|
|
});
|