0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 01:10:28 +01:00

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;
});
},
});
}); });
}, },
}; };