2021-03-28 11:06:49 +02:00
|
|
|
import CategorySelector from "select-kit/components/category-selector";
|
2020-03-24 10:35:46 +01:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { makeArray } from "discourse-common/lib/helpers";
|
|
|
|
|
|
|
|
export default CategorySelector.extend({
|
2021-03-28 11:06:49 +02:00
|
|
|
content: computed(
|
|
|
|
"categories.[]",
|
|
|
|
"blacklist.[]",
|
|
|
|
"whitelist.[]",
|
|
|
|
function () {
|
|
|
|
return this._super().filter((category) => {
|
|
|
|
const whitelist = makeArray(this.whitelist);
|
|
|
|
return !whitelist.length || whitelist.indexOf(category.id) > -1;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
),
|
|
|
|
});
|