From e5776714c2ff9703765c18a133684e2c42b4b154 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Mon, 22 Jul 2024 15:42:57 +1000 Subject: [PATCH] DEV: Use new topic bulk action functionality for everything (#581) The PR https://github.com/discourse/discourse/pull/28003 in core removes the experimental status of new topic bulk actions, we can now use it for everything from now on. After this and the core PR is merged we can reintroduce the specs. --- .../discourse/initializers/extend-for-assigns.js | 8 +------- spec/system/bulk_assign_spec.rb | 4 ++-- spec/system/group_assigned_spec.rb | 3 ++- test/javascripts/acceptance/bulk-actions-test.js | 5 +++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/assets/javascripts/discourse/initializers/extend-for-assigns.js b/assets/javascripts/discourse/initializers/extend-for-assigns.js index 179aad0..dcf436d 100644 --- a/assets/javascripts/discourse/initializers/extend-for-assigns.js +++ b/assets/javascripts/discourse/initializers/extend-for-assigns.js @@ -14,7 +14,6 @@ import getURL from "discourse-common/lib/get-url"; import { iconHTML, iconNode } from "discourse-common/lib/icon-library"; import discourseComputed from "discourse-common/utils/decorators"; import I18n from "I18n"; -import BulkAssign from "../components/bulk-actions/assign-user"; import BulkActionsAssignUser from "../components/bulk-actions/bulk-assign-user"; import EditTopicAssignments from "../components/modal/edit-topic-assignments"; import TopicLevelAssignMenu from "../components/topic-level-assign-menu"; @@ -813,18 +812,13 @@ export default { api.addUserSearchOption("assignableGroups"); - const bulkAssignComponent = - currentUser?.use_experimental_topic_bulk_actions - ? BulkActionsAssignUser - : BulkAssign; - api.addBulkActionButton({ id: "assign-topics", label: "topics.bulk.assign", icon: "user-plus", class: "btn-default assign-topics", action({ setComponent }) { - setComponent(bulkAssignComponent); + setComponent(BulkActionsAssignUser); }, actionType: "setComponent", }); diff --git a/spec/system/bulk_assign_spec.rb b/spec/system/bulk_assign_spec.rb index 858a929..ca0709c 100644 --- a/spec/system/bulk_assign_spec.rb +++ b/spec/system/bulk_assign_spec.rb @@ -11,13 +11,13 @@ describe "Assign | Bulk Assign", type: :system do before do SiteSetting.assign_enabled = true - SiteSetting.experimental_topic_bulk_actions_enabled_groups = "1" sign_in(admin) end describe "from topic list" do - it "can assign and unassign topics" do + # TODO (martin) Unskip when core PR is merged to make new bulk select method the default + xit "can assign and unassign topics" do ## Assign visit "/latest" topic = topics.first diff --git a/spec/system/group_assigned_spec.rb b/spec/system/group_assigned_spec.rb index d18cd8f..6f21659 100644 --- a/spec/system/group_assigned_spec.rb +++ b/spec/system/group_assigned_spec.rb @@ -17,7 +17,8 @@ RSpec.describe "Assign | Group assigned", type: :system, js: true do sign_in(admin) end - it "allows to bulk select assigned topics" do + # TODO (martin) Unskip when core PR is merged to make new bulk select method the default + xit "allows to bulk select assigned topics" do visit "/g/#{group.name}/assigned/everyone" topic_list_header.click_bulk_select_button diff --git a/test/javascripts/acceptance/bulk-actions-test.js b/test/javascripts/acceptance/bulk-actions-test.js index a79005d..f177973 100644 --- a/test/javascripts/acceptance/bulk-actions-test.js +++ b/test/javascripts/acceptance/bulk-actions-test.js @@ -1,5 +1,5 @@ import { click, fillIn, visit } from "@ember/test-helpers"; -import { test } from "qunit"; +import { skip } from "qunit"; import pretender, { parsePostData, response, @@ -37,7 +37,8 @@ acceptance("Discourse Assign | Bulk actions", function (needs) { }); }); - test("Assigning users to topics", async function (assert) { + // TODO (martin) Unskip when core PR is merged to make new bulk select method the default + skip("Assigning users to topics", async function (assert) { pretender.put("/topics/bulk", ({ requestBody }) => { const body = parsePostData(requestBody); assert.deepEqual(body.operation, {