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

FEATURE: suppress notifications setting for post actions

Dieser Commit ist enthalten in:
Angus McLeod 2020-10-20 11:42:10 +11:00
Ursprung 94c56ef550
Commit 3e86d0ffa6
6 geänderte Dateien mit 27 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -29,7 +29,7 @@ export default Component.extend(UndoChanges, {
hasCustomFields: or('basicTopicFields', 'updateProfile', 'createGroup', 'createCategory'), hasCustomFields: or('basicTopicFields', 'updateProfile', 'createGroup', 'createCategory'),
basicTopicFields: or('createTopic', 'sendMessage', 'openComposer'), basicTopicFields: or('createTopic', 'sendMessage', 'openComposer'),
publicTopicFields: or('createTopic', 'openComposer'), publicTopicFields: or('createTopic', 'openComposer'),
showSkipRedirect: or('createTopic', 'sendMessage'), showPostAdvanced: or('createTopic', 'sendMessage'),
actionTypes: Object.keys(wizardSchema.action.types).map(type => { actionTypes: Object.keys(wizardSchema.action.types).map(type => {
return { return {
id: type, id: type,

Datei anzeigen

@ -117,7 +117,8 @@ const action = {
tags: null, tags: null,
visible: null, visible: null,
custom_fields: null, custom_fields: null,
skip_redirect: null skip_redirect: null,
suppress_notifications: null,
}, },
send_message: { send_message: {
title: null, title: null,
@ -127,7 +128,8 @@ const action = {
skip_redirect: null, skip_redirect: null,
custom_fields: null, custom_fields: null,
required: null, required: null,
recipient: null recipient: null,
suppress_notifications: null
}, },
open_composer: { open_composer: {
title: null, title: null,
@ -218,6 +220,7 @@ const action = {
'code', 'code',
'custom_fields', 'custom_fields',
'skip_redirect', 'skip_redirect',
'suppress_notifications',
'required' 'required'
], ],
required: [ required: [

Datei anzeigen

@ -761,7 +761,7 @@
</div> </div>
{{/if}} {{/if}}
{{#if showSkipRedirect}} {{#if showPostAdvanced}}
<div class="setting full"> <div class="setting full">
<div class="setting-label"> <div class="setting-label">
<label>{{i18n "admin.wizard.action.skip_redirect.label"}}</label> <label>{{i18n "admin.wizard.action.skip_redirect.label"}}</label>
@ -775,6 +775,20 @@
</span> </span>
</div> </div>
</div> </div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.suppress_notifications.label"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.suppress_notifications}}
<span>
{{i18n 'admin.wizard.action.suppress_notifications.description' type='topic'}}
</span>
</div>
</div>
{{/if}} {{/if}}
{{#if routeTo}} {{#if routeTo}}

Datei anzeigen

@ -203,6 +203,9 @@ en:
skip_redirect: skip_redirect:
label: "Redirect" label: "Redirect"
description: "Don't redirect the user to this {{type}} after the wizard completes" 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: send_message:
label: "Send Message" label: "Send Message"
recipient: "Recipient" recipient: "Recipient"

Datei anzeigen

@ -114,6 +114,7 @@ class CustomWizard::AdminWizardController < CustomWizard::AdminController
:type, :type,
:code, :code,
:skip_redirect, :skip_redirect,
:suppress_notifications,
:post, :post,
:post_builder, :post_builder,
:post_template, :post_template,

Datei anzeigen

@ -443,6 +443,8 @@ class CustomWizard::Action
mapper.interpolate(action['post_template']) : mapper.interpolate(action['post_template']) :
data[action['post']] data[action['post']]
params[:import_mode] = ActiveRecord::Type::Boolean.new.cast(action['suppress_notifications'])
add_custom_fields(params) add_custom_fields(params)
end end