1
0
Fork 0

DEV: Add initializer logic to filter categories

Dieser Commit ist enthalten in:
jumagura 2023-09-18 17:40:44 -04:00
Ursprung b365b5dd4f
Commit 61309fd320

Datei anzeigen

@ -2,6 +2,7 @@ import DiscourseURL from "discourse/lib/url";
import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import getUrl from "discourse-common/lib/get-url"; import getUrl from "discourse-common/lib/get-url";
import { observes } from "discourse-common/utils/decorators"; import { observes } from "discourse-common/utils/decorators";
import Category from "discourse/models/category";
export default { export default {
name: "custom-wizard-edits", name: "custom-wizard-edits",
@ -83,6 +84,16 @@ export default {
} }
}, },
}); });
api.modifyClass("component:category-chooser", {
categoriesByScope(options = {}) {
let categories = this._super(options);
return categories.filter((category) => {
return !category.custom_fields?.custom_wizard_hide_from_composer;
});
},
});
}); });
}, },
}; };