Skip to content

Commit

Permalink
DEV: Use new topic bulk action functionality for everything
Browse files Browse the repository at this point in the history
The PR discourse/discourse#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.
  • Loading branch information
martin-brennan committed Jul 22, 2024
1 parent dca24fa commit bb7ac79
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,18 +813,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",
});
Expand Down
4 changes: 2 additions & 2 deletions spec/system/bulk_assign_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

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
Expand Down
3 changes: 2 additions & 1 deletion spec/system/group_assigned_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
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
Expand Down
5 changes: 3 additions & 2 deletions test/javascripts/acceptance/bulk-actions-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { skip } from "qunit";
import pretender, {
parsePostData,
response,
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit bb7ac79

Please sign in to comment.