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.
This commit is contained in:
Martin Brennan 2024-07-22 15:42:57 +10:00 committed by GitHub
parent dca24fa6fa
commit e5776714c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 12 deletions

View File

@ -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",
});

View File

@ -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

View File

@ -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

View File

@ -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, {