diff --git a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 index 29685a93..3264541b 100644 --- a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 @@ -6,7 +6,8 @@ const ACTION_TYPES = [ { id: 'send_message', name: 'Send Message' }, { id: 'send_to_api', name: 'Send to API' }, { id: 'add_to_group', name: 'Add to Group' }, - { id: 'route_to', name: 'Route To' } + { id: 'route_to', name: 'Route To' }, + { id: 'open_composer', name: 'Open Composer' } ]; const PROFILE_FIELDS = [ @@ -35,6 +36,21 @@ export default Ember.Component.extend({ routeTo: Ember.computed.equal('action.type', 'route_to'), disableId: Ember.computed.not('action.isNew'), + @computed('action.type') + basicTopicFields(actionType) { + return ['create_topic', 'send_message', 'open_composer'].indexOf(actionType) > -1; + }, + + @computed('action.type') + publicTopicFields(actionType) { + return ['create_topic', 'open_composer'].indexOf(actionType) > -1; + }, + + @computed('action.type') + newTopicFields(actionType) { + return ['create_topic', 'send_message'].indexOf(actionType) > -1; + }, + @computed('availableFields') builderWizardFields(fields) { return fields.map((f) => ` w{${f.id}}`); diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs index 59fa22ab..824030bd 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs @@ -16,41 +16,7 @@ -{{#if createTopic}} -