diff --git a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 index 23cd5d27..205e3580 100644 --- a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 @@ -5,6 +5,7 @@ import { computed } from "@ember/object"; import wizardSchema from '../lib/wizard-schema'; import UndoChanges from '../mixins/undo-changes'; import Component from "@ember/component"; +import { notificationLevels } from '../lib/wizard'; export default Component.extend(UndoChanges, { componentType: 'action', @@ -32,6 +33,12 @@ export default Component.extend(UndoChanges, { name: I18n.t(`admin.wizard.action.${type}.label`) }; }), + availableNotificationLevels: notificationLevels.map((type, index) => { + return { + id: type, + name: I18n.t(`admin.wizard.action.watch_categories.notification_level.${type}`) + }; + }), messageUrl: 'https://thepavilion.io/t/2810', diff --git a/assets/javascripts/discourse/lib/wizard-schema.js.es6 b/assets/javascripts/discourse/lib/wizard-schema.js.es6 index f3c61cd8..599f4708 100644 --- a/assets/javascripts/discourse/lib/wizard-schema.js.es6 +++ b/assets/javascripts/discourse/lib/wizard-schema.js.es6 @@ -143,6 +143,7 @@ const action = { }, watch_categories: { categories: null, + notification_level: null, mute_remainder: null }, add_to_group: { @@ -164,6 +165,7 @@ const action = { 'group', 'url', 'categories', + // 'notification_level', 'mute_remainder' ], advanced: [ @@ -186,7 +188,8 @@ const wizardSchema = { wizard, step, field, - action + action, + } export function buildFieldTypes(types) { diff --git a/assets/javascripts/discourse/lib/wizard.js.es6 b/assets/javascripts/discourse/lib/wizard.js.es6 index 668ebe6a..4351367d 100644 --- a/assets/javascripts/discourse/lib/wizard.js.es6 +++ b/assets/javascripts/discourse/lib/wizard.js.es6 @@ -49,6 +49,14 @@ const userProperties = [ 'trust_level' ]; +const notificationLevels = [ + 'regular', + 'watching', + 'tracking', + 'watching_first_post', + 'muted' +]; + function listProperties(type, opts={}) { let properties = Object.keys(wizardSchema[type].basic); @@ -106,5 +114,6 @@ export { snakeCase, userProperties, listProperties, + notificationLevels, wizardFieldList }; \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs index 40d6b31a..fa119d14 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs @@ -303,6 +303,23 @@ +