mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Rename "Keep Post" to "Keep Post Hidden" when hidden (#7767)
* UX: Rename "Keep Post" to "Keep Post Hidden" when hidden This is based on this feedback: https://meta.discourse.org/t/category-group-review-moderation/116478/19 When a post is hidden this makes the operation much more clear. * REFACTOR: Better support for aliases for actions Allow calls on alias actions and delegate to the original one. This is less code but also simplifies tests where the action might be "agree_and_keep" or "agree_and_keep_hidden" which are the same.
This commit is contained in:
@@ -31,6 +31,7 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
|
||||
actions = reviewable.actions_for(guardian)
|
||||
expect(actions.has?(:agree_and_hide)).to eq(true)
|
||||
expect(actions.has?(:agree_and_keep)).to eq(true)
|
||||
expect(actions.has?(:agree_and_keep_hidden)).to eq(false)
|
||||
expect(actions.has?(:agree_and_silence)).to eq(true)
|
||||
expect(actions.has?(:agree_and_suspend)).to eq(true)
|
||||
expect(actions.has?(:delete_spammer)).to eq(true)
|
||||
@@ -54,6 +55,13 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
|
||||
expect(actions.has?(:delete_and_replies)).to eq(false)
|
||||
end
|
||||
|
||||
it "changes `agree_and_keep` to `agree_and_keep_hidden` if it's been hidden" do
|
||||
post.hidden = true
|
||||
actions = reviewable.actions_for(guardian)
|
||||
expect(actions.has?(:agree_and_keep)).to eq(false)
|
||||
expect(actions.has?(:agree_and_keep_hidden)).to eq(true)
|
||||
end
|
||||
|
||||
it "returns `agree_and_restore` if the post is user deleted" do
|
||||
post.update(user_deleted: true)
|
||||
expect(reviewable.actions_for(guardian).has?(:agree_and_restore)).to eq(true)
|
||||
|
||||
Reference in New Issue
Block a user