DEV: Add outlets and actions to move topic modal (#24913)

This commit is contained in:
Keegan George 2023-12-15 08:50:29 -08:00 committed by GitHub
parent 2477bcc32e
commit 388a2c5274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 15 deletions

View File

@ -166,23 +166,55 @@
"topic.split_topic.instructions" count=@model.selectedPostsCount
)
}}</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
selectedPosts=@model.selectedPosts
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
selectedPosts=@model.selectedPosts
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
selectedPosts=@model.selectedPosts
updateTags=this.updateTags
tags=this.tags
}}
/>
</div>
{{/if}}
</form>
{{/if}}

View File

@ -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;
}
}