Skip to content

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

UX: better wording when there are no unused tags to delete

Neil Lalonde96511e454808
diff --git a/app/assets/javascripts/discourse/app/controllers/tags-index.js b/app/assets/javascripts/discourse/app/controllers/tags-index.js
index 75806c5fe6b..3d689eb4e7a 100644
--- a/app/assets/javascripts/discourse/app/controllers/tags-index.js
+++ b/app/assets/javascripts/discourse/app/controllers/tags-index.js
@@ -64,6 +64,12 @@ export default Controller.extend({
.then(result => {
const displayN = 20;
const tags = result["tags"];
+
+ if (tags.length === 0) {
+ bootbox.alert(I18n.t("tagging.delete_no_unused_tags"));
+ return;
+ }
+
const joinedTags = tags.slice(0, displayN).join(", ");
var more = Math.max(0, tags.length - displayN);
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index ad29da0b9be..9cc2bc82345 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -3355,6 +3355,7 @@ en:
delete_unused_confirmation_more_tags:
one: "%{tags} and %{count} more"
other: "%{tags} and %{count} more"
+ delete_no_unused_tags: "There are no unused tags."
delete_unused: "Delete Unused Tags"
delete_unused_description: "Delete all tags which are not attached to any topics or personal messages"
cancel_delete_unused: "Cancel"