mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 11:45:21 -05:00
DEV: Invert bulk action notification checkbox (#36016)
We want to reduce noise in notifications. In this PR, we change the notifications from opt-out to opt-in when performing bulk actions. To reduce churn and regression risk, it uses the same param (`silent`) to the back-end, so it's a UI only change.
This commit is contained in:
@@ -3556,7 +3556,7 @@ en:
|
||||
progress:
|
||||
one: "Progress: <strong>%{count}</strong> topic"
|
||||
other: "Progress: <strong>%{count}</strong> topics"
|
||||
silent: "Perform this action silently."
|
||||
notify: "Notify users of this change."
|
||||
performing: "Performing bulk operations, please wait…"
|
||||
completed: "Bulk operations completed successfully!"
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class BulkTopicActions extends Component {
|
||||
@tracked categoryId;
|
||||
@tracked loading;
|
||||
@tracked errors;
|
||||
@tracked isSilent = false;
|
||||
@tracked notifyUsers = false;
|
||||
@tracked closeNote = null;
|
||||
|
||||
@tracked notificationLevelId = null;
|
||||
@@ -86,7 +86,7 @@ export default class BulkTopicActions extends Component {
|
||||
const topicIds = [];
|
||||
const options = {};
|
||||
|
||||
if (this.isSilent) {
|
||||
if (this.model.allowSilent && !this.notifyUsers) {
|
||||
operation.silent = true;
|
||||
}
|
||||
|
||||
@@ -437,14 +437,14 @@ export default class BulkTopicActions extends Component {
|
||||
{{#if @model.allowSilent}}
|
||||
<div class="topic-bulk-actions-options">
|
||||
<label
|
||||
for="topic-bulk-action-options__silent"
|
||||
for="topic-bulk-action-options__notify"
|
||||
class="checkbox-label"
|
||||
>
|
||||
<Input
|
||||
id="topic-bulk-action-options__silent"
|
||||
id="topic-bulk-action-options__notify"
|
||||
@type="checkbox"
|
||||
@checked={{this.isSilent}}
|
||||
/>{{i18n "topics.bulk.silent"}}</label>
|
||||
@checked={{this.notifyUsers}}
|
||||
/>{{i18n "topics.bulk.notify"}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ module PageObjects
|
||||
find("#dismiss-read-confirm").click
|
||||
end
|
||||
|
||||
def click_silent
|
||||
find("#topic-bulk-action-options__silent").click
|
||||
def click_notify
|
||||
find("#topic-bulk-action-options__notify").click
|
||||
end
|
||||
|
||||
def fill_in_close_note(message)
|
||||
|
||||
@@ -209,6 +209,7 @@ describe "Topic bulk select", type: :system do
|
||||
topic_list.click_topic_checkbox(topics.third)
|
||||
topic_list_header.click_bulk_select_topics_dropdown
|
||||
topic_list_header.click_bulk_button("close-topics")
|
||||
topic_bulk_actions_modal.click_notify
|
||||
topic_bulk_actions_modal.click_bulk_topics_confirm
|
||||
expect(topic_list).to have_closed_status(topics.third)
|
||||
end
|
||||
@@ -234,7 +235,6 @@ describe "Topic bulk select", type: :system do
|
||||
topic_list.click_topic_checkbox(topics.first)
|
||||
topic_list_header.click_bulk_select_topics_dropdown
|
||||
topic_list_header.click_bulk_button("close-topics")
|
||||
topic_bulk_actions_modal.click_silent # Check Silent
|
||||
topic_bulk_actions_modal.click_bulk_topics_confirm
|
||||
expect(topic_list).to have_closed_status(topics.first)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user