A platform for community discussion. Free, open, simple.
DEV: Invert bulk action notification checkbox (#36016)
Ted Johansson9a76339be6c3
diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 507243630d7..4617b0b0b1d 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -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!"diff --git a/frontend/discourse/app/components/modal/bulk-topic-actions.gjs b/frontend/discourse/app/components/modal/bulk-topic-actions.gjsindex f6a66f5e152..3acf579fd42 100644--- a/frontend/discourse/app/components/modal/bulk-topic-actions.gjs+++ b/frontend/discourse/app/components/modal/bulk-topic-actions.gjs@@ -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}}diff --git a/spec/system/page_objects/modals/topic_bulk_actions.rb b/spec/system/page_objects/modals/topic_bulk_actions.rbindex d459e83b8b9..e366d5f8b44 100644--- a/spec/system/page_objects/modals/topic_bulk_actions.rb+++ b/spec/system/page_objects/modals/topic_bulk_actions.rb@@ -16,8 +16,8 @@ module PageObjectsfind("#dismiss-read-confirm").clickend- def click_silent- find("#topic-bulk-action-options__silent").click+ def click_notify+ find("#topic-bulk-action-options__notify").clickenddef fill_in_close_note(message)diff --git a/spec/system/topic_bulk_select_spec.rb b/spec/system/topic_bulk_select_spec.rbindex a763d4997c9..14ece57c855 100644--- a/spec/system/topic_bulk_select_spec.rb+++ b/spec/system/topic_bulk_select_spec.rb@@ -209,6 +209,7 @@ describe "Topic bulk select", type: :system dotopic_list.click_topic_checkbox(topics.third)topic_list_header.click_bulk_select_topics_dropdowntopic_list_header.click_bulk_button("close-topics")+ topic_bulk_actions_modal.click_notifytopic_bulk_actions_modal.click_bulk_topics_confirmexpect(topic_list).to have_closed_status(topics.third)end@@ -234,7 +235,6 @@ describe "Topic bulk select", type: :system dotopic_list.click_topic_checkbox(topics.first)topic_list_header.click_bulk_select_topics_dropdowntopic_list_header.click_bulk_button("close-topics")- topic_bulk_actions_modal.click_silent # Check Silenttopic_bulk_actions_modal.click_bulk_topics_confirmexpect(topic_list).to have_closed_status(topics.first)end