0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-21 17:00:29 +01:00

DEV: Make hide category default when custom wizard is selected

Dieser Commit ist enthalten in:
jumagura 2023-09-19 14:17:06 -04:00
Ursprung 10609f33e2
Commit 0992e9601c
6 geänderte Dateien mit 2 neuen und 30 gelöschten Zeilen

Datei anzeigen

@ -12,14 +12,4 @@
options=(hash none="admin.wizard.select")
}}
</div>
</section>
<section class="field hide-from-composer">
<label>
<Input
@type="checkbox"
@checked={{hideFromComposer}}
{{on "change" (action "toggleHideFromComposer")}}
/>
{{i18n "admin.wizard.category_settings.custom_wizard.hide_from_composer"}}
</label>
</section>

Datei anzeigen

@ -13,10 +13,6 @@ export default {
"wizardListVal",
attrs?.category?.custom_fields?.create_topic_wizard
);
component.set(
"hideFromComposer",
attrs?.category?.custom_fields?.custom_wizard_hide_from_composer
);
},
actions: {
@ -24,12 +20,5 @@ 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
);
},
},
};

Datei anzeigen

@ -89,7 +89,7 @@ export default {
let categories = this._super(options);
return categories.filter((category) => {
return !category.custom_fields?.custom_wizard_hide_from_composer;
return !category.custom_fields?.create_topic_wizard;
});
},
});

Datei anzeigen

@ -133,7 +133,6 @@ 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:

Datei anzeigen

@ -105,7 +105,6 @@ after_initialize do
# preloaded category custom fields
%w[
create_topic_wizard
custom_wizard_hide_from_composer
].each do |custom_field|
Site.preloaded_category_custom_fields << custom_field
end
@ -202,7 +201,7 @@ after_initialize do
::InvitesController.prepend InvitesControllerCustomWizard
::UsersController.prepend CustomWizardUsersController
::Guardian.prepend CustomWizardGuardian
full_path = "#{Rails.root}/plugins/discourse-custom-wizard/assets/stylesheets/wizard/wizard_custom.scss"
if Stylesheet::Importer.respond_to?(:plugin_assets)
Stylesheet::Importer.plugin_assets['wizard_custom'] = Set[full_path]

Datei anzeigen

@ -33,7 +33,6 @@ export default {
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
custom_wizard_hide_from_composer: null,
},
allowed_tags: [],
allowed_tag_groups: [],
@ -78,7 +77,6 @@ export default {
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
custom_wizard_hide_from_composer: null,
},
allowed_tags: [],
allowed_tag_groups: [],
@ -123,7 +121,6 @@ export default {
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
custom_wizard_hide_from_composer: null,
},
allowed_tags: [],
allowed_tag_groups: [],
@ -168,7 +165,6 @@ export default {
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
custom_wizard_hide_from_composer: null,
},
allowed_tags: [],
allowed_tag_groups: [],
@ -210,7 +206,6 @@ export default {
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
custom_wizard_hide_from_composer: "t",
},
allowed_tags: [],
allowed_tag_groups: [],