Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
Update custom-wizard-group-selector.js.es6
Dieser Commit ist enthalten in:
Ursprung
ac5d41d914
Commit
9c43f89cd3
1 geänderte Dateien mit 14 neuen und 15 gelöschten Zeilen
|
@ -1,19 +1,18 @@
|
||||||
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
|
const excludedGroupIds = [1]; // Array mit den IDs der ausgeschlossenen Gruppen
|
||||||
.filter((group) => {
|
return this.groups.filter(group => {
|
||||||
return !whitelist.length || whitelist.indexOf(group.id) > -1;
|
return (!whitelist.length || whitelist.indexOf(group.id) > -1) && excludedGroupIds.indexOf(group.id) === -1;
|
||||||
})
|
}).map(g => {
|
||||||
.map((g) => {
|
|
||||||
return {
|
return {
|
||||||
id: g.id,
|
id: g.id,
|
||||||
name: g.full_name ? g.full_name : g.name,
|
name: g.full_name
|
||||||
};
|
}
|
||||||
});
|
});
|
||||||
}),
|
})
|
||||||
});
|
})
|
||||||
|
|
Laden …
In neuem Issue referenzieren