FEATURE: add agree and edit (#27088)

* FEATURE: add agree and edit

adds agree and edit - an alias for agree and keep -- but with a client action to
edit the post in the composer before the flag is agreed with

---------

Co-authored-by: Juan David Martinez <juan@discourse.org>
This commit is contained in:
Jeff Wong
2024-05-23 11:21:42 -07:00
committed by GitHub
parent 3f099ad268
commit 755f8de6d4
5 changed files with 77 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ class ReviewableFlaggedPost < Reviewable
agree_and_keep_hidden: :agree_and_keep,
agree_and_silence: :agree_and_keep,
agree_and_suspend: :agree_and_keep,
agree_and_edit: :agree_and_keep,
disagree_and_restore: :disagree,
ignore_and_do_nothing: :ignore,
}
@@ -59,6 +60,13 @@ class ReviewableFlaggedPost < Reviewable
build_action(actions, :agree_and_keep_hidden, icon: "thumbs-up", bundle: agree_bundle)
else
build_action(actions, :agree_and_keep, icon: "thumbs-up", bundle: agree_bundle)
build_action(
actions,
:agree_and_edit,
icon: "pencil-alt",
bundle: agree_bundle,
client_action: "edit",
)
end
if guardian.can_delete_post_or_topic?(post)