Skip to content

A platform for community discussion. Free, open, simple.

UX: add a confirmation modal to "Remove All Tags" action (#11973)

Arpit Jalan309adb82bab4
diff --git a/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js b/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js
index 909a8dc6c45..9aedc048a56 100644
--- a/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js
+++ b/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js
@@ -255,7 +255,16 @@ export default Controller.extend(ModalFunctionality, {
},
removeTags() {
- this.performAndRefresh({ type: "remove_tags" });
+ bootbox.confirm(
+ I18n.t("topics.bulk.confirm_remove_tags", {
+ count: this.get("model.topics").length,
+ }),
+ (result) => {
+ if (result) {
+ this.performAndRefresh({ type: "remove_tags" });
+ }
+ }
+ );
},
},
});
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index f3f023fb4de..dc54758f622 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2266,7 +2266,10 @@ en:
choose_new_tags: "Choose new tags for these topics:"
choose_append_tags: "Choose new tags to append for these topics:"
changed_tags: "The tags of those topics were changed."
- remove_tags: "Remove Tags"
+ remove_tags: "Remove All Tags"
+ confirm_remove_tags:
+ one: "All tags will be removed from this topic. Are you sure?"
+ other: "All tags will be removed from <b>%{count}</b> topics. Are you sure?"
progress:
one: "Progress: <strong>%{count}</strong> topic"
other: "Progress: <strong>%{count}</strong> topics"