mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
DEV: Allow freeze_original
argument in topics controller & JS transformer (#30120)
PostMover has a new option called freeze_original implemented in this commit. It was previously unexposed in the controller. This PR permits the param in the controller, and passes it into PostMover. Also, this applies a value transformer for move/merge payload options. In addition a plugin outlet in the move post modal. This allows plugins to add content to the modal, which can modify the payload (and use the freeze_original argument for example)
This commit is contained in:

committed by
GitHub

parent
555ca4da55
commit
68e57190df
@ -857,6 +857,7 @@ class TopicsController < ApplicationController
|
||||
params.permit(:participants)
|
||||
params.permit(:chronological_order)
|
||||
params.permit(:archetype)
|
||||
params.permit(:freeze_original)
|
||||
|
||||
raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff?
|
||||
|
||||
@ -869,6 +870,7 @@ class TopicsController < ApplicationController
|
||||
args = {}
|
||||
args[:destination_topic_id] = destination_topic_id.to_i
|
||||
args[:chronological_order] = params[:chronological_order] == "true"
|
||||
args[:freeze_original] = params[:freeze_original] == "true"
|
||||
|
||||
if params[:archetype].present?
|
||||
args[:archetype] = params[:archetype]
|
||||
@ -891,6 +893,7 @@ class TopicsController < ApplicationController
|
||||
params.permit(:participants)
|
||||
params.permit(:chronological_order)
|
||||
params.permit(:archetype)
|
||||
params.permit(:freeze_original)
|
||||
|
||||
topic = Topic.with_deleted.find_by(id: topic_id)
|
||||
guardian.ensure_can_move_posts!(topic)
|
||||
@ -1399,6 +1402,7 @@ class TopicsController < ApplicationController
|
||||
].present?
|
||||
args[:tags] = params[:tags] if params[:tags].present?
|
||||
args[:chronological_order] = params[:chronological_order] == "true"
|
||||
args[:freeze_original] = true if params[:freeze_original] == "true"
|
||||
|
||||
if params[:archetype].present?
|
||||
args[:archetype] = params[:archetype]
|
||||
|
Reference in New Issue
Block a user