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:
Ursprung
b365b5dd4f
Commit
61309fd320
1 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
|
@ -2,6 +2,7 @@ import DiscourseURL from "discourse/lib/url";
|
|||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import getUrl from "discourse-common/lib/get-url";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
import Category from "discourse/models/category";
|
||||
|
||||
export default {
|
||||
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;
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Laden …
In neuem Issue referenzieren