A platform for community discussion. Free, open, simple.
DEV: Add outlets and actions to move topic modal (#24913)
Keegan George388a2c527485
diff --git a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.hbs b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.hbsindex 1c37295002d..e9cf2409476 100644--- a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.hbs+++ b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.hbs@@ -166,23 +166,55 @@"topic.split_topic.instructions" [email protected])}}</p>- <form>- <label>{{i18n "topic.split_topic.topic_name"}}</label>- <TextField- @value={{this.topicName}}- @placeholderKey="composer.title_placeholder"- id="split-topic-name"- />+ <form class="split-new-topic-form">+ <div class="control-group">+ <label>{{i18n "topic.split_topic.topic_name"}}</label>+ <TextField+ @value={{this.topicName}}+ @placeholderKey="composer.title_placeholder"+ id="split-topic-name"+ />+ <PluginOutlet+ @name="split-new-topic-title-after"+ @outletArgs={{hash+ updateTopicName=this.updateTopicName+ }}+ />+ </div>++ <div class="control-group">+ <label>{{i18n "categories.category"}}</label>+ <CategoryChooser+ @value={{this.categoryId}}+ class="small"+ @onChange={{action (mut this.categoryId)}}+ />+ <PluginOutlet+ @name="split-new-topic-category-after"+ @outletArgs={{hash+ updateCategoryId=this.updateCategoryId+ }}+ />+ </div>- <label>{{i18n "categories.category"}}</label>- <CategoryChooser- @value={{this.categoryId}}- class="small"- @onChange={{action (mut this.categoryId)}}- />{{#if this.canAddTags}}- <label>{{i18n "tagging.tags"}}</label>- <TagChooser @tags={{this.tags}} @categoryId={{this.categoryId}} />+ <div class="control-group">+ <label>{{i18n "tagging.tags"}}</label>+ <TagChooser+ @tags={{this.tags}}+ @categoryId={{this.categoryId}}+ />+ <PluginOutlet+ @name="split-new-topic-tag-after"+ @outletArgs={{hash+ updateTags=this.updateTags+ tags=this.tags+ }}+ />+ </div>{{/if}}</form>{{/if}}diff --git a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.jsindex ac94d14e15f..d1f41bb7c6f 100644--- a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js+++ b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js@@ -162,4 +162,19 @@ export default class MoveToTopic extends Component {this.saving = false;}}++ @action+ updateTopicName(newName) {+ this.topicName = newName;+ }++ @action+ updateCategoryId(newId) {+ this.categoryId = newId;+ }++ @action+ updateTags(newTags) {+ this.tags = newTags;+ }}