From de03cbd15ae87e20280736ecdabd5c425f982c32 Mon Sep 17 00:00:00 2001 From: jumagura Date: Mon, 18 Sep 2023 17:39:50 -0400 Subject: [PATCH] DEV: Implement control to hide category from composer dropdown in specified categories --- .../custom-wizard-category-settings.hbs | 11 +++++++++++ .../custom-wizard-category-settings.js.es6 | 11 +++++++++++ config/locales/client.en.yml | 1 + 3 files changed, 23 insertions(+) diff --git a/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.hbs b/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.hbs index 2c6a6975..1d316fe2 100644 --- a/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.hbs +++ b/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.hbs @@ -12,4 +12,15 @@ options=(hash none="admin.wizard.select") }} + +
+ +
\ No newline at end of file diff --git a/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.js.es6 b/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.js.es6 index 7004c317..552ee193 100644 --- a/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.js.es6 +++ b/assets/javascripts/discourse/connectors/category-custom-settings/custom-wizard-category-settings.js.es6 @@ -13,6 +13,10 @@ export default { "wizardListVal", attrs?.category?.custom_fields?.create_topic_wizard ); + component.set( + "hideFromComposer", + attrs?.category?.custom_fields?.custom_wizard_hide_from_composer + ); }, actions: { @@ -20,5 +24,12 @@ export default { this.set("wizardListVal", wizard); this.set("category.custom_fields.create_topic_wizard", wizard); }, + toggleHideFromComposer() { + this.toggleProperty("hideFromComposer"); + this.set( + "category.custom_fields.custom_wizard_hide_from_composer", + this.hideFromComposer + ); + }, }, }; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 98519335..1fd9f158 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -133,6 +133,7 @@ en: custom_wizard: title: "Custom Wizard" create_topic_wizard: "Select a wizard to replace the new topic composer in this category." + hide_from_composer: "Exclude category from composer dropdown" message: wizard: