diff --git a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 index 8fcca367..dbfa4e93 100644 --- a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 @@ -29,7 +29,7 @@ export default Component.extend(UndoChanges, { hasCustomFields: or('basicTopicFields', 'updateProfile', 'createGroup', 'createCategory'), basicTopicFields: or('createTopic', 'sendMessage', 'openComposer'), publicTopicFields: or('createTopic', 'openComposer'), - showSkipRedirect: or('createTopic', 'sendMessage'), + showPostAdvanced: or('createTopic', 'sendMessage'), actionTypes: Object.keys(wizardSchema.action.types).map(type => { return { id: type, diff --git a/assets/javascripts/discourse/lib/wizard-schema.js.es6 b/assets/javascripts/discourse/lib/wizard-schema.js.es6 index 840b84a5..7d34a79d 100644 --- a/assets/javascripts/discourse/lib/wizard-schema.js.es6 +++ b/assets/javascripts/discourse/lib/wizard-schema.js.es6 @@ -117,7 +117,8 @@ const action = { tags: null, visible: null, custom_fields: null, - skip_redirect: null + skip_redirect: null, + suppress_notifications: null, }, send_message: { title: null, @@ -127,7 +128,8 @@ const action = { skip_redirect: null, custom_fields: null, required: null, - recipient: null + recipient: null, + suppress_notifications: null }, open_composer: { title: null, @@ -218,6 +220,7 @@ const action = { 'code', 'custom_fields', 'skip_redirect', + 'suppress_notifications', 'required' ], required: [ diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs index c212deab..98840175 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs @@ -762,7 +762,7 @@ {{/if}} - {{#if showSkipRedirect}} + {{#if showPostAdvanced}}
@@ -776,6 +776,20 @@
+ +
+
+ +
+ +
+ {{input type='checkbox' checked=action.suppress_notifications}} + + + {{i18n 'admin.wizard.action.suppress_notifications.description' type='topic'}} + +
+
{{/if}} {{#if routeTo}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index db02af96..2ec64e81 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -203,6 +203,9 @@ en: skip_redirect: label: "Redirect" description: "Don't redirect the user to this {{type}} after the wizard completes" + suppress_notifications: + label: "Suppress Notifications" + description: "Suppress normal notifications triggered by post creation" send_message: label: "Send Message" recipient: "Recipient" diff --git a/controllers/custom_wizard/admin/wizard.rb b/controllers/custom_wizard/admin/wizard.rb index ac5eeb8a..2caa3dde 100644 --- a/controllers/custom_wizard/admin/wizard.rb +++ b/controllers/custom_wizard/admin/wizard.rb @@ -114,6 +114,7 @@ class CustomWizard::AdminWizardController < CustomWizard::AdminController :type, :code, :skip_redirect, + :suppress_notifications, :post, :post_builder, :post_template, diff --git a/lib/custom_wizard/action.rb b/lib/custom_wizard/action.rb index e37a9a4c..65ad3cef 100644 --- a/lib/custom_wizard/action.rb +++ b/lib/custom_wizard/action.rb @@ -443,6 +443,8 @@ class CustomWizard::Action mapper.interpolate(action['post_template']) : data[action['post']] + params[:import_mode] = ActiveRecord::Type::Boolean.new.cast(action['suppress_notifications']) + add_custom_fields(params) end