A platform for community discussion. Free, open, simple.
Revert "DEV: Introduce `reviewable_ui_refresh` site setting (#33404)"
Alan Guo Xiang Tanffeec9fb274e
diff --git a/app/assets/javascripts/discourse/app/components/reviewable-refresh/item.gjs b/app/assets/javascripts/discourse/app/components/reviewable-refresh/item.gjsdeleted file mode 100644index 1eed123ec58..00000000000--- a/app/assets/javascripts/discourse/app/components/reviewable-refresh/item.gjs+++ /dev/null@@ -1,13 +0,0 @@-import Component from "@glimmer/component";--export default class ReviewableItem extends Component {- get reviewable() {- return this.args.reviewable;- }-- <template>- <div class="review-container">- {{this.reviewable.type}}- </div>- </template>-}diff --git a/app/assets/javascripts/discourse/app/templates/review-show.gjs b/app/assets/javascripts/discourse/app/templates/review-show.gjsindex 00ab83fa595..9e133febde0 100644--- a/app/assets/javascripts/discourse/app/templates/review-show.gjs+++ b/app/assets/javascripts/discourse/app/templates/review-show.gjs@@ -1,29 +1,6 @@-import Component from "@glimmer/component";-import { service } from "@ember/service";import RouteTemplate from "ember-route-template";import ReviewableItem from "discourse/components/reviewable-item";-import ReviewableItemRefresh from "discourse/components/reviewable-refresh/item";export default RouteTemplate(- class extends Component {- @service currentUser;- @service site;-- /**- * Determines whether to use the refreshed reviewable UI component.- *- * @returns {boolean} True if both conditions are met: user has permission and component exists- */- get shouldUseRefreshUI() {- return this.currentUser.use_reviewable_ui_refresh;- }-- <template>- {{#if this.shouldUseRefreshUI}}- <ReviewableItemRefresh @reviewable={{@controller.reviewable}} />- {{else}}- <ReviewableItem @reviewable={{@controller.reviewable}} />- {{/if}}- </template>- }+ <template><ReviewableItem @reviewable={{@controller.reviewable}} /></template>);diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rbindex bc921581421..7b58cdb6588 100644--- a/app/serializers/current_user_serializer.rb+++ b/app/serializers/current_user_serializer.rb@@ -78,8 +78,7 @@ class CurrentUserSerializer < BasicUserSerializer:can_see_emails,:use_glimmer_post_stream_mode_auto_mode,:can_localize_content?,- :effective_locale,- :use_reviewable_ui_refresh+ :effective_localedelegate :user_stat, to: :object, private: truedelegate :any_posts, :draft_count, :pending_posts_count, :read_faq?, to: :user_stat@@ -343,12 +342,4 @@ class CurrentUserSerializer < BasicUserSerializerdef include_effective_locale?SiteSetting.content_localization_enabledend-- def use_reviewable_ui_refresh- scope.can_see_reviewable_ui_refresh?- end-- def include_use_reviewable_ui_refresh?- scope.can_see_review_queue?- endenddiff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 1a6ec2ec58c..fdcf9b90702 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -2731,7 +2731,6 @@ en:view_raw_email_allowed_groups: "Groups which can view the raw email content of a post if it was created by an incoming email. This includes email headers and other technical information."rich_editor: "Enable the rich editor so all users can switch between the current Markdown mode and the new rich text editor for more intuitive and user-friendly composition. The rich text editor is under active development, so not all features are supported yet — <a href='https://meta.discourse.org/t/test-our-new-composer/352347' target='_blank'>see Meta for more details</a>."viewport_based_mobile_mode: "EXPERIMENTAL: Disable the user-agent-based mobile/desktop modes and use viewport width instead."- reviewable_ui_refresh: "Groups that can use the experimental new UI in the review queue."content_localization_enabled: "Displays localized content for users based on their browser or user language preferences. Such content may include categories, tags, posts, and topics. Supported locales are set in 'content localization supported locales'."content_localization_supported_locales: "List of supported locales that user content can be translated to. Requires 'content localization enabled'."diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 9dea3d1fdc3..251c90ff074 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -4048,10 +4048,6 @@ experimental:rich_editor:client: truedefault: false- reviewable_ui_refresh:- client: true- type: group_list- default: ""experimental_system_themes:type: listdefault: "horizon"diff --git a/lib/guardian.rb b/lib/guardian.rbindex d6d98b44b1d..8888c52d4ae 100644--- a/lib/guardian.rb+++ b/lib/guardian.rb@@ -663,11 +663,6 @@ class Guardianother && authenticated? && other.is_a?(User) && @user == otherend- def can_see_reviewable_ui_refresh?- SiteSetting.reviewable_ui_refresh_map.include?(Group::AUTO_GROUPS[:everyone]) ||- @user.in_any_groups?(SiteSetting.reviewable_ui_refresh_map)- end-privatedef is_my_own?(obj)diff --git a/spec/serializers/current_user_serializer_spec.rb b/spec/serializers/current_user_serializer_spec.rbindex b9860c80e85..a81a1fd612f 100644--- a/spec/serializers/current_user_serializer_spec.rb+++ b/spec/serializers/current_user_serializer_spec.rb@@ -351,34 +351,4 @@ RSpec.describe CurrentUserSerializer do)endend-- describe "#use_reviewable_ui_refresh" do- fab!(:admin)- fab!(:user)- fab!(:group)-- it "does not include the attribute if the user cannot see the reviewable UI refresh" do- serializer = described_class.new(user, scope: Guardian.new(user), root: false)-- expect(serializer.as_json).not_to have_key(:use_reviewable_ui_refresh)- end-- it "returns false if the user cannot see the reviewable UI refresh" do- SiteSetting.reviewable_ui_refresh = ""-- serializer = described_class.new(admin, scope: Guardian.new(admin), root: false)-- expect(serializer.as_json[:use_reviewable_ui_refresh]).to eq(false)- end-- it "returns true if the user can see the reviewable UI refresh" do- SiteSetting.reviewable_ui_refresh = group.id-- group.add(admin)-- serializer = described_class.new(admin, scope: Guardian.new(admin), root: false)-- expect(serializer.as_json[:use_reviewable_ui_refresh]).to eq(true)- end- endenddiff --git a/spec/system/viewing_reviewable_spec.rb b/spec/system/viewing_reviewable_spec.rbdeleted file mode 100644index 50e8ddc6f2b..00000000000--- a/spec/system/viewing_reviewable_spec.rb+++ /dev/null@@ -1,32 +0,0 @@-# frozen_string_literal: true--describe "Viewing reviewable item", type: :system do- fab!(:admin)- fab!(:group)- fab!(:reviewable_flagged_post)-- before { sign_in(admin) }-- context "when user is not part of the groups list of the `reviewable_ui_refresh` site setting" do- before { SiteSetting.reviewable_ui_refresh = "" }-- it "shows the old reviewable UI" do- visit "/review/#{reviewable_flagged_post.id}"-- expect(page).to have_selector(".reviewable-item ")- end- end-- context "when user is part of the groups list of the `reviewable_ui_refresh` site setting" do- before do- SiteSetting.reviewable_ui_refresh = group.name- group.add(admin)- end-- it "shows the new reviewable UI" do- visit "/review/#{reviewable_flagged_post.id}"-- expect(page).to have_selector(".review-container")- end- end-end