UX: move logs/watched_words to customize/watched_words in admin section (#12571)

UX: move logs/watched_words to customize/watched_words in admin section (#12571)

Where is auto-tag and auto-replace? - support - Discourse Meta

diff --git a/app/assets/javascripts/admin/addon/components/watched-word-uploader.js b/app/assets/javascripts/admin/addon/components/watched-word-uploader.js
index 00c8ce4..040154d 100644
--- a/app/assets/javascripts/admin/addon/components/watched-word-uploader.js
+++ b/app/assets/javascripts/admin/addon/components/watched-word-uploader.js
@@ -8,7 +8,7 @@ import discourseComputed from "discourse-common/utils/decorators";
 export default Component.extend(UploadMixin, {
   type: "txt",
   classNames: "watched-words-uploader",
-  uploadUrl: "/admin/logs/watched_words/upload",
+  uploadUrl: "/admin/customize/watched_words/upload",
   addDisabled: alias("uploading"),
 
   validateUploadedFilesOptions() {
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
index 0d0f020..1265e3d 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
@@ -18,7 +18,7 @@ export default Controller.extend({
   ),
   downloadLink: fmt(
     "actionNameKey",
-    "/admin/logs/watched_words/action/%@/download"
+    "/admin/customize/watched_words/action/%@/download"
   ),
 
   findAction(actionName) {
@@ -97,7 +97,7 @@ export default Controller.extend({
         I18n.t("yes_value"),
         (result) => {
           if (result) {
-            ajax(`/admin/logs/watched_words/action/${actionKey}.json`, {
+            ajax(`/admin/customize/watched_words/action/${actionKey}.json`, {
               type: "DELETE",
             }).then(() => {
               const action = this.findAction(actionKey);
diff --git a/app/assets/javascripts/admin/addon/models/watched-word.js b/app/assets/javascripts/admin/addon/models/watched-word.js
index 6b7de3b..9aebef1 100644
--- a/app/assets/javascripts/admin/addon/models/watched-word.js
+++ b/app/assets/javascripts/admin/addon/models/watched-word.js
@@ -5,7 +5,9 @@ import { ajax } from "discourse/lib/ajax";
 const WatchedWord = EmberObject.extend({
   save() {
     return ajax(
-      "/admin/logs/watched_words" + (this.id ? "/" + this.id : "") + ".json",
+      "/admin/customize/watched_words" +
+        (this.id ? "/" + this.id : "") +
+        ".json",
       {
         type: this.id ? "PUT" : "POST",
         data: {
@@ -19,7 +21,7 @@ const WatchedWord = EmberObject.extend({
   },
 
   destroy() {
-    return ajax("/admin/logs/watched_words/" + this.id + ".json", {
+    return ajax("/admin/customize/watched_words/" + this.id + ".json", {
       type: "DELETE",
     });
   },
@@ -27,7 +29,7 @@ const WatchedWord = EmberObject.extend({
 
 WatchedWord.reopenClass({
   findAll() {
-    return ajax("/admin/logs/watched_words.json").then((list) => {
+    return ajax("/admin/customize/watched_words.json").then((list) => {
       const actions = {};
       list.words.forEach((s) => {
         if (!actions[s.action]) {
diff --git a/app/assets/javascripts/admin/addon/routes/admin-route-map.js b/app/assets/javascripts/admin/addon/routes/admin-route-map.js
index bdc27d1..9b888f9 100644
--- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js
+++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js
@@ -97,6 +97,14 @@ export default function () {
             this.route("edit", { path: "/:field_name" });
           }
         );
+        this.route(
+          "adminWatchedWords",
+          { path: "/watched_words", resetNamespace: true },
+          function () {
+            this.route("index", { path: "/" });
+            this.route("action", { path: "/action/:action_id" });
+          }
+        );
       }
     );
 
@@ -152,14 +160,6 @@ export default function () {
             this.route("term", { path: "/term" });
           }
         );
-        this.route(
-          "adminWatchedWords",
-          { path: "/watched_words", resetNamespace: true },
-          function () {
-            this.route("index", { path: "/" });
-            this.route("action", { path: "/action/:action_id" });
-          }
-        );
       }
     );
 
diff --git a/app/assets/javascripts/admin/addon/templates/customize.hbs b/app/assets/javascripts/admin/addon/templates/customize.hbs
index cafafd1..46bdf2f 100644
--- a/app/assets/javascripts/admin/addon/templates/customize.hbs
+++ b/app/assets/javascripts/admin/addon/templates/customize.hbs
@@ -8,6 +8,7 @@
   {{nav-item route="adminEmojis" label="admin.emoji.title" class="admin-customize-emojis"}}
   {{nav-item route="adminPermalinks" label="admin.permalink.title" class="admin-customize-permalinks"}}
   {{nav-item route="adminEmbedding" label="admin.embedding.title" class="admin-customize-embedding"}}
+  {{nav-item route="adminWatchedWords" label="admin.watched_words.title" class="admin-customize-watched-words"}}
 {{/admin-nav}}
 
 <div class="admin-container">
diff --git a/app/assets/javascripts/admin/addon/templates/logs.hbs b/app/assets/javascripts/admin/addon/templates/logs.hbs
index 194f6ec..4cc214e 100644
--- a/app/assets/javascripts/admin/addon/templates/logs.hbs
+++ b/app/assets/javascripts/admin/addon/templates/logs.hbs
@@ -3,7 +3,6 @@
   {{nav-item route="adminLogs.screenedEmails" label="admin.logs.screened_emails.title"}}
   {{nav-item route="adminLogs.screenedIpAddresses" label="admin.logs.screened_ips.title"}}
   {{nav-item route="adminLogs.screenedUrls" label="admin.logs.screened_urls.title"}}
-  {{nav-item route="adminWatchedWords" label="admin.watched_words.title"}}
   {{nav-item route="adminSearchLogs" label="admin.logs.search_logs.title"}}
   {{#if currentUser.admin}}
     {{nav-item path="/logs" label="admin.logs.logster.title"}}
diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
index 36a2e4d..1a3162e 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
@@ -10,7 +10,7 @@ acceptance("Admin - Watched Words", function (needs) {
   needs.user();
 
   test("list words in groups", async function (assert) {
-    await visit("/admin/logs/watched_words/action/block");
+    await visit("/admin/customize/watched_words/action/block");
 
     assert.ok(
       !exists(".watched-words-list"),
@@ -51,7 +51,7 @@ acceptance("Admin - Watched Words", function (needs) {
   });
 
   test("add words", async function (assert) {
-    await visit("/admin/logs/watched_words/action/block");
+    await visit("/admin/customize/watched_words/action/block");
 
     click(".show-words-checkbox");
     fillIn(".watched-word-form input", "poutine");
@@ -68,7 +68,7 @@ acceptance("Admin - Watched Words", function (needs) {
   });
 
   test("remove words", async function (assert) {
-    await visit("/admin/logs/watched_words/action/block");
+    await visit("/admin/customize/watched_words/action/block");
     await click(".show-words-checkbox");
 
     let word = null;
diff --git a/app/assets/javascripts/discourse/tests/fixtures/watched-words-fixtures.js b/app/assets/javascripts/discourse/tests/fixtures/watched-words-fixtures.js
index 6ac2eaa..8fca803 100644
--- a/app/assets/javascripts/discourse/tests/fixtures/watched-words-fixtures.js
+++ b/app/assets/javascripts/discourse/tests/fixtures/watched-words-fixtures.js
@@ -1,5 +1,5 @@
 export default {
-  "/admin/logs/watched_words.json": {
+  "/admin/customize/watched_words.json": {
     actions: ["block", "censor", "require_approval", "flag"],
     words: [
       { id: 1, word: "liquorice", action: "block" },
diff --git a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js b/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
index a59a911..79b84af 100644
--- a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js

[... diff too long, it was truncated ...]

GitHub sha: 61860098

This commit appears in #12571 which was approved by eviltrout. It was merged by techAPJ.

This commit has been mentioned on Discourse Meta. There might be relevant details there: