0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/custom-wizard-group-selector.js

20 Zeilen
579 B
JavaScript

2020-03-24 10:35:46 +01:00
import { computed } from "@ember/object";
import { makeArray } from "discourse-common/lib/helpers";
2024-11-22 17:11:51 +01:00
import ComboBox from "select-kit/components/combo-box";
2020-03-24 10:35:46 +01:00
export default ComboBox.extend({
content: computed("groups.[]", "field.content.[]", function () {
2020-03-30 08:16:03 +02:00
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,
};
});
}),
});