Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Use new topic bulk action functionality for everything #581

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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",
});
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