FEATURE: support for chronologically merging posts into existing topic (#21374)

When a user chooses to move a topic/message to an existing topic/message, they can now opt to merge the posts chronologically (using a checkbox in the UI).
This commit is contained in:
Renato Atilio
2023-05-25 15:38:34 -03:00
committed by GitHub
parent 6a65fa982d
commit c539f749f1
11 changed files with 1346 additions and 23 deletions

View File

@ -820,6 +820,7 @@ class TopicsController < ApplicationController
topic_id = params.require(:topic_id)
destination_topic_id = params.require(:destination_topic_id)
params.permit(:participants)
params.permit(:chronological_order)
params.permit(:archetype)
raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff?
@ -832,6 +833,7 @@ class TopicsController < ApplicationController
args = {}
args[:destination_topic_id] = destination_topic_id.to_i
args[:chronological_order] = params[:chronological_order] == "true"
if params[:archetype].present?
args[:archetype] = params[:archetype]
@ -849,6 +851,7 @@ class TopicsController < ApplicationController
params.permit(:category_id)
params.permit(:tags)
params.permit(:participants)
params.permit(:chronological_order)
params.permit(:archetype)
raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff?
@ -1273,6 +1276,7 @@ class TopicsController < ApplicationController
:destination_topic_id
].present?
args[:tags] = params[:tags] if params[:tags].present?
args[:chronological_order] = params[:chronological_order] == "true"
if params[:archetype].present?
args[:archetype] = params[:archetype]