A platform for community discussion. Free, open, simple.
FEATURE: Change default upcoming change promotion status to Beta (#41275)
Martin Brennanbf3ccea89fd0
diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 991d0b33a52..882031ae1ef 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -648,7 +648,7 @@ basic:default: "disabled"area: "interface"promote_upcoming_changes_on_status:- default: "stable"+ default: "beta"type: enumchoices:- experimentaldiff --git a/frontend/discourse/app/components/composer-actions-new.gjs b/frontend/discourse/app/components/composer-actions-new.gjsindex bb002b46acf..9a52dbb1e00 100644--- a/frontend/discourse/app/components/composer-actions-new.gjs+++ b/frontend/discourse/app/components/composer-actions-new.gjs@@ -21,6 +21,7 @@ import {PRIVATE_MESSAGE,REPLY,} from "discourse/models/composer";+import { registeredComposerActions } from "discourse/select-kit/components/composer-actions";import { or } from "discourse/truth-helpers";import DButton from "discourse/ui-kit/d-button";import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";@@ -31,6 +32,10 @@ import dIcon from "discourse/ui-kit/helpers/d-icon";import dAutoFocus from "discourse/ui-kit/modifiers/d-auto-focus";import { i18n } from "discourse-i18n";+// Tracks registered composer actions whose `condition` has already thrown, so+// we only log the error once per action instead of on every render.+const warnedConditionIds = new Set();+export default class ComposerActions extends Component {@service composer;@service composerActionState;@@ -134,6 +139,7 @@ export default class ComposerActions extends Component {get(this.composerModel, "whisper");get(this.composerModel, "noBump");get(this.composerModel, "unlistTopic");+ get(this.composerModel, "creatingEvent");}let iconName;@@ -232,7 +238,10 @@ export default class ComposerActions extends Component {this.composerModel);- const composerActionItems = composerActionItemBuilder.build();+ const composerActionItems = [+ ...composerActionItemBuilder.build(),+ ...this._registeredActionItems(),+ ];return applyValueTransformer("composer-actions-content",@@ -246,6 +255,38 @@ export default class ComposerActions extends Component {);}+ _registeredActionItems() {+ return registeredComposerActions()+ .filter((opts) => {+ if (!opts.condition) {+ return true;+ }++ // A misbehaving plugin condition must not take down the whole actions+ // dropdown, so we hide that action and warn once, matching the legacy+ // composer-actions component's behaviour.+ try {+ return !!opts.condition(this);+ } catch (e) {+ if (!warnedConditionIds.has(opts.id)) {+ warnedConditionIds.add(opts.id);+ // eslint-disable-next-line no-console+ console.error(+ `composer-actions: condition for "${opts.id}" threw`,+ e+ );+ }+ return false;+ }+ })+ .map((opts) => ({+ id: opts.id,+ name: i18n(opts.label),+ description: opts.description ? i18n(opts.description) : undefined,+ icon: opts.icon,+ }));+ }+get hasToggles() {return (this.composer.canToggleWhisper ||@@ -366,6 +407,14 @@ export default class ComposerActions extends Component {this.composerActionState.remember({ topic: this.topic, post: this.post });+ const registeredAction = registeredComposerActions().find(+ (registeredComposerAction) => registeredComposerAction.id === actionId+ );+ if (registeredAction) {+ registeredAction.action(this.composerModel, this);+ return;+ }+const handled = await this.composerActionState.selectAction(actionId, {options,composerModel: this.composerModel,diff --git a/frontend/discourse/select-kit/components/composer-actions.js b/frontend/discourse/select-kit/components/composer-actions.jsindex a9ddccf9a75..2ac2d8d694c 100644--- a/frontend/discourse/select-kit/components/composer-actions.js+++ b/frontend/discourse/select-kit/components/composer-actions.js@@ -34,6 +34,10 @@ export function registerComposerAction(opts) {_registeredActions.push(opts);}+export function registeredComposerActions() {+ return _registeredActions;+}+export function _clearRegisteredActions() {_registeredActions = [];_warnedConditionIds = new Set();diff --git a/plugins/discourse-ai/spec/requests/topic_spec.rb b/plugins/discourse-ai/spec/requests/topic_spec.rbindex 25672f01f92..abe3a6bb46d 100644--- a/plugins/discourse-ai/spec/requests/topic_spec.rb+++ b/plugins/discourse-ai/spec/requests/topic_spec.rb@@ -38,7 +38,7 @@ describe ::TopicsController doendit "includes related topics in payload when configured" do- SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}"+ SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"category = Fabricate(:category)topic.update!(category: category)diff --git a/plugins/discourse-calendar/spec/system/composer/create_event_action_spec.rb b/plugins/discourse-calendar/spec/system/composer/create_event_action_spec.rbindex 85c754bf06a..e5881bc2a67 100644--- a/plugins/discourse-calendar/spec/system/composer/create_event_action_spec.rb+++ b/plugins/discourse-calendar/spec/system/composer/create_event_action_spec.rb@@ -24,7 +24,7 @@ describe "Composer - Create event action" doexpect(composer).to have_value(%r{\A\[event start="[^"]+" end="[^"]+" status="public" timezone="[^"]+" reminders="[^"]+"\]\n\[/event\]\z},)- expect(composer.button_label.text).to eq(+ expect(composer.button_label).to have_text(I18n.t("js.discourse_post_event.composer.create_event_button"),)expect(page).to have_css(@@ -50,7 +50,7 @@ describe "Composer - Create event action" dovisit("/new-topic?category_id=#{regular_category.id}")expect(composer).to have_value("")- expect(composer.button_label.text).to eq(I18n.t("js.composer.create_topic"))+ expect(composer.button_label).to have_text(I18n.t("js.composer.create_topic"))endit "lets the user switch back to a regular topic via the dropdown" do@@ -60,10 +60,10 @@ describe "Composer - Create event action" doI18n.t("js.discourse_post_event.composer.create_event_button"),)- composer.open_composer_actions- composer.select_action(I18n.t("js.discourse_post_event.composer_actions.create_topic.label"))+ composer.open_composer_actions_new+ composer.select_action_by_id("create_regular_topic")- expect(composer.button_label.text).to eq(I18n.t("js.composer.create_topic"))+ expect(composer.button_label).to have_text(I18n.t("js.composer.create_topic"))expect(composer).to have_value("")endenddiff --git a/plugins/discourse-workflows/spec/lib/discourse_workflows/nodes/group_spec.rb b/plugins/discourse-workflows/spec/lib/discourse_workflows/nodes/group_spec.rbindex 35aca7dc5d0..5cc4ede7bbb 100644--- a/plugins/discourse-workflows/spec/lib/discourse_workflows/nodes/group_spec.rb+++ b/plugins/discourse-workflows/spec/lib/discourse_workflows/nodes/group_spec.rb@@ -264,16 +264,16 @@ RSpec.describe DiscourseWorkflows::Nodes::Group::V1 do)end- it "handles the everyone pseudogroup without group_users rows", :aggregate_failures do- everyone = Group.refresh_automatic_group!(:everyone)- GroupUser.where(group: everyone, user: member).delete_all+ it "handles the logged_in_users pseudogroup without group_users rows", :aggregate_failures do+ logged_in_users = Group.refresh_automatic_group!(:logged_in_users)+ GroupUser.where(group: logged_in_users, user: member).delete_alloutput =execute_node_output(configuration: {"operation" => "check_membership","username" => member.username,- "group_id" => everyone.id,+ "group_id" => logged_in_users.id,"actor_username" => "system",},)@@ -281,13 +281,13 @@ RSpec.describe DiscourseWorkflows::Nodes::Group::V1 domembership_data = output.first.first.dig("json", "group_membership")expect(membership_data).to include(- "group_id" => everyone.id,- "group_name" => everyone.name,+ "group_id" => logged_in_users.id,+ "group_name" => logged_in_users.name,"user_id" => member.id,"username" => member.username,"in_group" => true,)- expect(GroupUser.exists?(group: everyone, user: member)).to be(false)+ expect(GroupUser.exists?(group: logged_in_users, user: member)).to be(false)endit "raises when the user cannot be found" dodiff --git a/plugins/styleguide/app/controllers/styleguide/styleguide_controller.rb b/plugins/styleguide/app/controllers/styleguide/styleguide_controller.rbindex 1c2b7ab2bc2..b3e3d2bfc17 100644--- a/plugins/styleguide/app/controllers/styleguide/styleguide_controller.rb+++ b/plugins/styleguide/app/controllers/styleguide/styleguide_controller.rb@@ -6,12 +6,17 @@ module Styleguideskip_before_action :check_xhrdef index- if !current_user &&- !SiteSetting.styleguide_allowed_groups_map.include?(Group::AUTO_GROUPS[:everyone])- return raise Discourse::NotFound- end+ allowed_group_ids = SiteSetting.styleguide_allowed_groups_map+ anonymous_allowed =+ allowed_group_ids.include?(Group::AUTO_GROUPS[:anonymous_users]) ||+ (+ !SiteSetting.granular_anonymous_and_logged_in_groups_permissions &&+ allowed_group_ids.include?(Group::AUTO_GROUPS[:everyone])+ )++ return raise Discourse::NotFound if !current_user && !anonymous_allowed- if current_user && !current_user.in_any_groups?(SiteSetting.styleguide_allowed_groups_map)+ if current_user && !current_user.in_any_groups?(allowed_group_ids)return raise Discourse::NotFoundenddiff --git a/plugins/styleguide/spec/requests/styleguide/styleguide_controller_spec.rb b/plugins/styleguide/spec/requests/styleguide/styleguide_controller_spec.rbindex a1781ea9aaf..13820b61f32 100644--- a/plugins/styleguide/spec/requests/styleguide/styleguide_controller_spec.rb+++ b/plugins/styleguide/spec/requests/styleguide/styleguide_controller_spec.rb@@ -4,8 +4,11 @@ RSpec.describe Styleguide::StyleguideController dobefore { SiteSetting.styleguide_enabled = true }describe "#index" do- context "when styleguide_allowed_groups is set to everyone" do- before { SiteSetting.styleguide_allowed_groups = Group::AUTO_GROUPS[:everyone] }+ context "when styleguide_allowed_groups includes anonymous and logged in users" do+ before do+ SiteSetting.styleguide_allowed_groups =+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"+ endit "allows access for anonymous users" doget "/styleguide"diff --git a/plugins/styleguide/spec/system/smoke_test_spec.rb b/plugins/styleguide/spec/system/smoke_test_spec.rbindex d2bbfa102fe..15b59c7f1e0 100644--- a/plugins/styleguide/spec/system/smoke_test_spec.rb+++ b/plugins/styleguide/spec/system/smoke_test_spec.rb@@ -125,7 +125,7 @@ RSpec.describe "Styleguide Smoke Test" docontext "when the styleguide is enabled for everyone" dobefore doCapybara.reset_sessions!- SiteSetting.styleguide_allowed_groups = Group::AUTO_GROUPS[:everyone]+ SiteSetting.styleguide_allowed_groups = Group::AUTO_GROUPS[:anonymous_users]endit "renders a page using HighlightedCode for anonymous users" dodiff --git a/spec/lib/guardian/post_guardian_spec.rb b/spec/lib/guardian/post_guardian_spec.rbindex 52ceaf5409d..6398c8124d4 100644--- a/spec/lib/guardian/post_guardian_spec.rb+++ b/spec/lib/guardian/post_guardian_spec.rb@@ -1191,11 +1191,11 @@ RSpec.describe PostGuardian doexpect(Guardian.new(user).filter_hidden_posts(records)).to contain_exactly(post, hidden_post)end- it "returns hidden posts for everyone when configured" do+ it "does not return hidden posts for anonymous users configured via everyone" doSiteSetting.hidden_post_visible_groups = Group::AUTO_GROUPS[:everyone].to_srecords = Post.where(id: [post.id, hidden_post.id])- expect(Guardian.new.filter_hidden_posts(records)).to contain_exactly(post, hidden_post)+ expect(Guardian.new.filter_hidden_posts(records)).to contain_exactly(post)endit "returns hidden posts from moderated categories for category group moderators" dodiff --git a/spec/lib/upcoming_changes_spec.rb b/spec/lib/upcoming_changes_spec.rbindex e3c76b99d6e..2028eecd969 100644--- a/spec/lib/upcoming_changes_spec.rb+++ b/spec/lib/upcoming_changes_spec.rb@@ -498,6 +498,63 @@ RSpec.describe UpcomingChanges doendend+ # Models the self-hoster upgrade that lowers the default+ # promote_upcoming_changes_on_status from :stable to :beta. A beta change+ # that previously sat below the promotion threshold now meets it, so we must+ # be sure the transition only auto-promotes changes the admin never touched+ # and never overrides an admin's explicit opt-in/opt-out. The opt-out case is+ # the critical one: the stored value equals the YAML default (false), and it+ # only survives because setting_modified_from_default? treats upcoming change+ # settings as modified whenever a DB row exists (see SiteSettingExtension#refresh!).+ describe "lowering promote_upcoming_changes_on_status from :stable to :beta" do+ before do+ mock_upcoming_change_metadata(+ {+ enable_upload_debug_mode: {+ impact: "other,developers",+ status: :beta,+ impact_type: "other",+ impact_role: "developers",+ },+ },+ )+ SiteSetting.promote_upcoming_changes_on_status = :stable+ UpcomingChanges.clear_caches!+ end++ after do+ SiteSetting.remove_override!(setting_name)+ SiteSetting.promote_upcoming_changes_on_status = :stable+ UpcomingChanges.clear_caches!+ end++ it "auto-promotes a change the admin never touched" do+ expect(described_class.enabled?(setting_name)).to eq(false)++ SiteSetting.promote_upcoming_changes_on_status = :beta++ expect(described_class.enabled?(setting_name)).to eq(true)+ end++ it "keeps a change the admin explicitly opted out of disabled" do+ SiteSetting.enable_upload_debug_mode = false+ expect(described_class.enabled?(setting_name)).to eq(false)++ SiteSetting.promote_upcoming_changes_on_status = :beta++ expect(described_class.enabled?(setting_name)).to eq(false)+ end++ it "keeps a change the admin explicitly opted into enabled" do+ SiteSetting.enable_upload_debug_mode = true+ expect(described_class.enabled?(setting_name)).to eq(true)++ SiteSetting.promote_upcoming_changes_on_status = :beta++ expect(described_class.enabled?(setting_name)).to eq(true)+ end+ end+describe ".settings_hidden_while_enabled" do# `enable_upload_debug_mode` stands in for the change; the two real settings# below stand in for the legacy settings it would hide.diff --git a/spec/models/site_spec.rb b/spec/models/site_spec.rbindex 463c2ce7c4d..e5604b46d00 100644--- a/spec/models/site_spec.rb+++ b/spec/models/site_spec.rb@@ -191,12 +191,12 @@ RSpec.describe Site docontext "with lazy loaded categories enabled" dofab!(:user)- before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}" }+ before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:logged_in_users]}" }- it "does not return any categories for anonymous users" do+ it "returns all categories for anonymous users" dosite = Site.new(Guardian.new)- expect(site.categories).to eq([])+ expect(site.categories.map { |c| c[:id] }).to include(category.id)endit "returns only sidebar categories and their ancestors" dodiff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rbindex 12b71e706ab..6a2eedf6c9d 100644--- a/spec/models/user_spec.rb+++ b/spec/models/user_spec.rb@@ -26,7 +26,9 @@ RSpec.describe User dodescribe ".in_any_groups?" dofab!(:group)- it "returns true if any of the group IDs are the 'everyone' auto group" do+ it "returns true if any of the group IDs are the 'everyone' auto group with legacy group permissions" do+ SiteSetting.granular_anonymous_and_logged_in_groups_permissions = false+expect(user.in_any_groups?([group.id, Group::AUTO_GROUPS[:everyone]])).to eq(true)enddiff --git a/spec/queries/reports/list_query_spec.rb b/spec/queries/reports/list_query_spec.rbindex cdc40eebd06..6a4a29565ef 100644--- a/spec/queries/reports/list_query_spec.rb+++ b/spec/queries/reports/list_query_spec.rb@@ -28,16 +28,9 @@ RSpec.describe Reports::ListQuery doendit "sorts reports by title" do- expect(result.map { |r| r[:title] }[0..5]).to eq(- [- I18n.t("reports.activity_by_category.title"),- I18n.t("reports.admin_logins.title"),- I18n.t("reports.page_view_anon_browser_reqs.title"),- I18n.t("reports.dau_by_mau.title"),- I18n.t("reports.daily_engaged_users.title"),- I18n.t("reports.emails.title"),- ],- )+ report_titles = result.map { |report| report[:title] }++ expect(report_titles).to eq(report_titles.sort)endcontext "when using legacy pageviews" dodiff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rbindex 4813b7b7b87..e0d1a6123bf 100644--- a/spec/requests/list_controller_spec.rb+++ b/spec/requests/list_controller_spec.rb@@ -338,7 +338,7 @@ RSpec.describe ListController dobefore { topic.update!(category: subcategory) }it "returns categories and parent categories if true" do- SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}"+ SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"get "/latest.json"diff --git a/spec/requests/search_controller_spec.rb b/spec/requests/search_controller_spec.rbindex 21bd8d5e648..41a3b374dcb 100644--- a/spec/requests/search_controller_spec.rb+++ b/spec/requests/search_controller_spec.rb@@ -525,7 +525,7 @@ RSpec.describe SearchController doendend- before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}" }+ before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}" }it "returns extra categories and parent categories" doget "/search.json", params: { q: "hello" }diff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rbindex dedcaa0589d..393b629616b 100644--- a/spec/requests/topics_controller_spec.rb+++ b/spec/requests/topics_controller_spec.rb@@ -4502,7 +4502,7 @@ RSpec.describe TopicsController doendit "returns a list of categories when `lazy_load_categories_group` site setting is enabled for the current user" do- SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}"+ SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"topic_post_2 = Fabricate(:post, topic: topic)topic_post_3 = Fabricate(:post, topic: topic)diff --git a/spec/requests/user_actions_controller_spec.rb b/spec/requests/user_actions_controller_spec.rbindex abba9adba36..c2b5fde655d 100644--- a/spec/requests/user_actions_controller_spec.rb+++ b/spec/requests/user_actions_controller_spec.rb@@ -32,7 +32,7 @@ RSpec.describe UserActionsController doendit "returns categories when lazy load categories is enabled" do- SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}"+ SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"user_actionsexpect(response.status).to eq(200)category_ids = response.parsed_body["categories"].map { |category| category["id"] }diff --git a/spec/serializers/site_serializer_spec.rb b/spec/serializers/site_serializer_spec.rbindex a7d5ff21cd5..35351a17c0c 100644--- a/spec/serializers/site_serializer_spec.rb+++ b/spec/serializers/site_serializer_spec.rb@@ -227,12 +227,12 @@ RSpec.describe SiteSerializer dofab!(:category)fab!(:sidebar) { Fabricate(:category_sidebar_section_link, linkable: category, user: user) }- before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:everyone]}" }+ before { SiteSetting.lazy_load_categories_groups = "#{Group::AUTO_GROUPS[:logged_in_users]}" }- it "does not include any categories for anonymous users" do+ it "includes categories for anonymous users" doserialized = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json- expect(serialized[:categories]).to eq(nil)+ expect(serialized[:categories].map { |category| category[:id] }).to include(category.id)endit "includes preloaded categories for logged in users" dodiff --git a/spec/support/shared_examples/core_features.rb b/spec/support/shared_examples/core_features.rbindex e7428183f8e..ba364a1727d 100644--- a/spec/support/shared_examples/core_features.rb+++ b/spec/support/shared_examples/core_features.rb@@ -7,6 +7,7 @@ RSpec.shared_examples_for "having working core features" do |skip_examples: []|fab!(:active_user) { Fabricate(:active_user, password: "secure_password") }let(:composer) { PageObjects::Components::Composer.new }+ let(:topic_page) { PageObjects::Pages::Topic.new }if skip_examples.exclude?(:login)describe "Login" do@@ -113,8 +114,8 @@ RSpec.shared_examples_for "having working core features" do |skip_examples: []|it "likes a post" doclick_on(topics.first.title)- find(".toggle-like").click- expect(page).to have_css(".post-action-menu__like-count", text: "1")+ topic_page.click_like_reaction_for(topics.first.posts.first)+ expect(topic_page).to have_like_count_for(topics.first.posts.first, 1)endendenddiff --git a/spec/system/composer/drafts_spec.rb b/spec/system/composer/drafts_spec.rbindex 3a78890b8a4..0cfb4e41e00 100644--- a/spec/system/composer/drafts_spec.rb+++ b/spec/system/composer/drafts_spec.rb@@ -435,8 +435,8 @@ describe "Composer - Drafts" doexpect(Draft.where(user: current_user).count).to eq(1)end- composer.open_composer_actions- composer.select_action(I18n.t("js.composer.composer_actions.reply_as_new_topic.label"))+ composer.open_composer_actions_new+ composer.select_action_by_id("reply_as_new_topic")expect(composer).to be_openedcomposer.fill_title("This is a linked topic title for testing")diff --git a/spec/system/page_objects/components/bookmark_menu.rb b/spec/system/page_objects/components/bookmark_menu.rbindex 9cddba6221c..0102da849e6 100644--- a/spec/system/page_objects/components/bookmark_menu.rb+++ b/spec/system/page_objects/components/bookmark_menu.rb@@ -39,18 +39,17 @@ module PageObjectsdef click_post_bookmark(post_number)find(- ".topic-bookmarks-menu-content .bookmark-menu__row[data-menu-option-id='post-#{post_number}']",+ ".topic-bookmarks-menu-content .bookmark-menu__row[data-menu-option-id='post-#{post_number}'] .bookmark-menu__row-btn",).clickenddef has_post_submenu?- has_css?(".topic-bookmark-post-submenu")+ has_css?(".bookmark-menu__row[data-menu-option-id='jump']") &&+ has_css?(".bookmark-menu__row[data-menu-option-id='delete']")enddef click_post_submenu_option(option_id)- find(- ".topic-bookmark-post-submenu .bookmark-menu__row[data-menu-option-id='#{option_id}'] .btn",- ).click+ find(".bookmark-menu__row[data-menu-option-id='#{option_id}'] .btn").clickenddef has_bookmark_topic_option?diff --git a/spec/system/page_objects/pages/topic.rb b/spec/system/page_objects/pages/topic.rbindex 571a03cd3d2..c209afc6ddf 100644--- a/spec/system/page_objects/pages/topic.rb+++ b/spec/system/page_objects/pages/topic.rb@@ -348,7 +348,25 @@ module PageObjectsenddef click_like_reaction_for(post)- within_post(post) { find(".post-controls .actions .like").click }+ post_container = post_container_for(post)++ if post_container.has_css?(".discourse-reactions-reaction-button", wait: 0)+ post_container.find(".discourse-reactions-reaction-button").click+ else+ post_container.find(".post-action-menu__like").click+ end+ end++ def has_like_count_for?(post, count)+ post_container_for(post).has_css?(+ ".post-action-menu__like-count, .reactions-counter",+ text: count.to_s,+ )+ end++ def post_container_for(post)+ post_number = post.is_a?(Post) ? post.post_number : post+ post_by_number(post_number).ancestor(".topic-post")enddef has_topic_map?diff --git a/spec/system/private_message_spec.rb b/spec/system/private_message_spec.rbindex 39b2b51c827..7be7163f5ab 100644--- a/spec/system/private_message_spec.rb+++ b/spec/system/private_message_spec.rb@@ -29,8 +29,8 @@ describe "Private Message" dovisit "/new-topic"expect(composer).to be_opened- composer.open_composer_actions- composer.select_action(I18n.t("js.composer.composer_actions.create_personal_message.label"))+ composer.open_composer_actions_new+ composer.select_action_by_id("create_private_message")expect(composer.button_label).to have_text(I18n.t("js.composer.create_pm"))end@@ -41,10 +41,8 @@ describe "Private Message" dopm_post_obj.replyexpect(composer).to be_opened- composer.open_composer_actions- expect(composer).to have_no_action(- I18n.t("js.composer.composer_actions.create_personal_message.label"),- )+ composer.open_composer_actions_new+ expect(composer).to have_no_action_id("create_private_message")endit "can switch between topic and personal message modes" do@@ -52,13 +50,13 @@ describe "Private Message" doexpect(composer).to be_opened# Switch to personal message- composer.open_composer_actions- composer.select_action(I18n.t("js.composer.composer_actions.create_personal_message.label"))+ composer.open_composer_actions_new+ composer.select_action_by_id("create_private_message")expect(composer.button_label).to have_text(I18n.t("js.composer.create_pm"))# Switch back to topic- composer.open_composer_actions- composer.select_action(I18n.t("js.composer.composer_actions.create_topic.label"))+ composer.open_composer_actions_new+ composer.select_action_by_id("create_topic")expect(composer.button_label).to have_text(I18n.t("js.composer.create_topic"))endend