0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 20:02:54 +01:00

Update custom-wizard-group-selector.js.es6

Dieser Commit ist enthalten in:
Philipp 2023-04-21 19:29:25 +02:00 committet von GitHub
Ursprung 007ab7ac37
Commit 7b3d848df0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -1,17 +1,19 @@
import ComboBox from 'select-kit/components/combo-box'; import ComboBox from "select-kit/components/combo-box";
import { computed } from "@ember/object"; import { computed } from "@ember/object";
import { makeArray } from "discourse-common/lib/helpers"; import { makeArray } from "discourse-common/lib/helpers";
export default ComboBox.extend({ export default ComboBox.extend({
content: computed("groups.[]", "field.content.[]", function() { content: computed("groups.[]", "field.content.[]", function () {
const whitelist = makeArray(this.field.content); const whitelist = makeArray(this.field.content);
return this.groups.filter(group => { return this.groups
return !whitelist.length || whitelist.indexOf(group.id) > -1; .filter((group) => {
}).map(g => { return !whitelist.length || whitelist.indexOf(group.id) > -1;
return { })
id: g.id, .map((g) => {
name: g.full_name return {
} id: g.id,
}); name: g.full_name ? g.full_name : g.name,
}) };
}) });
}),
});