mirror of
https://github.com/discourse/discourse.git
synced 2025-02-19 14:13:17 +08:00
FIX: Move posts modal passing topic instance rather than ID (#30622)
Fixes issue in type difference due to modernization in this commit df9de3022f
This commit is contained in:
parent
20a16ea231
commit
260017de1d
|
@ -70,7 +70,7 @@
|
||||||
<form>
|
<form>
|
||||||
<ChooseMessage
|
<ChooseMessage
|
||||||
@currentTopicId={{@model.topic.id}}
|
@currentTopicId={{@model.topic.id}}
|
||||||
@setSelectedTopicId={{fn (mut this.selectedTopicId)}}
|
@setSelectedTopicId={{fn (mut this.selectedTopic)}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<label>{{i18n "topic.move_to_new_message.participants"}}</label>
|
<label>{{i18n "topic.move_to_new_message.participants"}}</label>
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
@onChange={{fn (mut this.participants)}}
|
@onChange={{fn (mut this.participants)}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{#if this.selectedTopicId}}
|
{{#if this.selectedTopic}}
|
||||||
<hr />
|
<hr />
|
||||||
<label for="chronological-order" class="checkbox-label">
|
<label for="chronological-order" class="checkbox-label">
|
||||||
<Input
|
<Input
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
@currentTopicId={{@model.topic.id}}
|
@currentTopicId={{@model.topic.id}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{#if this.selectedTopicId}}
|
{{#if this.selectedTopic}}
|
||||||
<hr />
|
<hr />
|
||||||
<label for="chronological-order" class="checkbox-label">
|
<label for="chronological-order" class="checkbox-label">
|
||||||
<Input
|
<Input
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default class MoveToTopic extends Component {
|
||||||
@tracked participants = [];
|
@tracked participants = [];
|
||||||
@tracked chronologicalOrder = false;
|
@tracked chronologicalOrder = false;
|
||||||
@tracked selection = "new_topic";
|
@tracked selection = "new_topic";
|
||||||
@tracked selectedTopicId;
|
@tracked selectedTopic;
|
||||||
@tracked flash;
|
@tracked flash;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -49,7 +49,7 @@ export default class MoveToTopic extends Component {
|
||||||
|
|
||||||
get buttonDisabled() {
|
get buttonDisabled() {
|
||||||
return (
|
return (
|
||||||
this.saving || (isEmpty(this.selectedTopicId) && isEmpty(this.topicName))
|
this.saving || (isEmpty(this.selectedTopic) && isEmpty(this.topicName))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ export default class MoveToTopic extends Component {
|
||||||
|
|
||||||
if (type === "existingTopic") {
|
if (type === "existingTopic") {
|
||||||
mergeOptions = {
|
mergeOptions = {
|
||||||
destination_topic_id: this.selectedTopicId,
|
destination_topic_id: this.selectedTopic.id,
|
||||||
chronological_order: this.chronologicalOrder,
|
chronological_order: this.chronologicalOrder,
|
||||||
};
|
};
|
||||||
moveOptions = {
|
moveOptions = {
|
||||||
|
@ -119,7 +119,7 @@ export default class MoveToTopic extends Component {
|
||||||
};
|
};
|
||||||
} else if (type === "existingMessage") {
|
} else if (type === "existingMessage") {
|
||||||
mergeOptions = {
|
mergeOptions = {
|
||||||
destination_topic_id: this.selectedTopicId,
|
destination_topic_id: this.selectedTopic.id,
|
||||||
participants: this.participants.join(","),
|
participants: this.participants.join(","),
|
||||||
archetype: "private_message",
|
archetype: "private_message",
|
||||||
chronological_order: this.chronologicalOrder,
|
chronological_order: this.chronologicalOrder,
|
||||||
|
@ -190,6 +190,6 @@ export default class MoveToTopic extends Component {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
newTopicSelected(topic) {
|
newTopicSelected(topic) {
|
||||||
this.selectedTopicId = topic.id;
|
this.selectedTopic = topic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user