A platform for community discussion. Free, open, simple.
UX: update review queue heading for rejected topics (#37117)
Kris313849409efb
diff --git a/frontend/discourse/app/components/reviewable-refresh/item.gjs b/frontend/discourse/app/components/reviewable-refresh/item.gjsindex 89460e770be..12402d88460 100644--- a/frontend/discourse/app/components/reviewable-refresh/item.gjs+++ b/frontend/discourse/app/components/reviewable-refresh/item.gjs@@ -173,7 +173,7 @@ export default class ReviewableItem extends Component {return ((oldModeratorActions &&createdFromFlag &&- status === 0 &&+ status === PENDING &&(claimOptional || (claimRequired && claimedBy !== null))) ||isAiReviewable);@@ -843,14 +843,10 @@ export default class ReviewableItem extends Component {<h3 class="review-item__aside-title">{{#if this.editing}}{{i18n "review.editing_post"}}- {{else if (eq this.reviewable.status PENDING)}}- {{#if this.displayContextQuestion}}- {{this.reviewable.flaggedReviewableContextQuestion}}- {{else if this.reviewable.userReviewableContextQuestion}}- {{this.reviewable.userReviewableContextQuestion}}- {{else}}- {{i18n "review.moderator_actions"}}- {{/if}}+ {{else if this.displayContextQuestion}}+ {{this.reviewable.flaggedReviewableContextQuestion}}+ {{else if this.reviewable.userReviewableContextQuestion}}+ {{this.reviewable.userReviewableContextQuestion}}{{else}}{{i18n "review.moderator_actions"}}{{/if}}diff --git a/spec/system/page_objects/pages/refreshed_review.rb b/spec/system/page_objects/pages/refreshed_review.rbindex a0a9313941e..fcddc2bb1cb 100644--- a/spec/system/page_objects/pages/refreshed_review.rb+++ b/spec/system/page_objects/pages/refreshed_review.rb@@ -149,6 +149,12 @@ module PageObjectsfind(".reviewable-claimed-topic .unclaim").clickend+ def has_context_question?(reviewable, text)+ within(reviewable_by_id(reviewable.id)) do+ page.has_css?(".review-item__aside-title", text: text)+ end+ end+def has_created_at_history_item?expect(page).to have_css(".timeline-event__icon .d-icon-pen-to-square")expect(page).to have_text("Post created by")diff --git a/spec/system/viewing_reviewable_spec.rb b/spec/system/viewing_reviewable_spec.rbindex c0e0ede0a7b..43387ff4355 100644--- a/spec/system/viewing_reviewable_spec.rb+++ b/spec/system/viewing_reviewable_spec.rb@@ -302,6 +302,20 @@ describe "Viewing reviewable item", type: :system doexpect(page).to have_text("Hello world from system spec!")expect(page).not_to have_text("hello world post contents.")end++ it "shows context question for rejected queued post" do+ reviewable_queued_post.update!(status: Reviewable.statuses[:rejected])++ refreshed_review_page.visit_reviewable(reviewable_queued_post)++ expect(refreshed_review_page).to have_reviewable_with_rejected_status(+ reviewable_queued_post,+ )+ expect(refreshed_review_page).to have_context_question(+ reviewable_queued_post,+ I18n.t("js.review.context_question.approve_post"),+ )+ endenddescribe "when the reviewable item is a user" do