A platform for community discussion. Free, open, simple.
DEV: Fix router linting errors (#24012)
Jarek Radoszcbe772f6faa1
diff --git a/app/assets/javascripts/admin/addon/routes/admin-route-map.js b/app/assets/javascripts/admin/addon/routes/admin-route-map.jsindex 1cbe6e46723..89dc7cb2c1f 100644--- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js+++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js@@ -110,7 +110,7 @@ export default function () {"adminCustomizeFormTemplates",{ path: "/form-templates", resetNamespace: true },function () {- this.route("new", { path: "/new" });+ this.route("new");this.route("edit", { path: "/:id" });});@@ -118,7 +118,6 @@ export default function () {"adminWatchedWords",{ path: "/watched_words", resetNamespace: true },function () {- this.route("index", { path: "/" });this.route("action", { path: "/action/:action_id" });});@@ -131,7 +130,7 @@ export default function () {{ path: "/keys", resetNamespace: true },function () {this.route("show", { path: "/:api_key_id" });- this.route("new", { path: "/new" });+ this.route("new");});@@ -174,7 +173,7 @@ export default function () {{ path: "/search_logs", resetNamespace: true },function () {this.route("index", { path: "/" });- this.route("term", { path: "/term" });+ this.route("term");});}@@ -226,7 +225,7 @@ export default function () {this.route("admin-revamp", { resetNamespace: true }, function () {this.route("lobby", { path: "/" }, function () {});- this.route("config", { path: "config" }, function () {+ this.route("config", function () {this.route("area", { path: "/:area" });});});diff --git a/app/assets/javascripts/discourse/app/routes/app-route-map.js b/app/assets/javascripts/discourse/app/routes/app-route-map.jsindex 5c64d985c7f..96a9017994f 100644--- a/app/assets/javascripts/discourse/app/routes/app-route-map.js+++ b/app/assets/javascripts/discourse/app/routes/app-route-map.js@@ -3,10 +3,10 @@ import Site from "discourse/models/site";export default function () {// Error page- this.route("exception", { path: "/exception" });+ this.route("exception");this.route("exception-unknown", { path: "/404" });- this.route("about", { path: "/about", resetNamespace: true });+ this.route("about", { resetNamespace: true });this.route("post", { path: "/p/:id" });@@ -16,11 +16,15 @@ export default function () {{ path: "/t/:slug/:id", resetNamespace: true },function () {this.route("fromParams", { path: "/" });+ // eslint-disable-next-line ember/routes-segments-snake-casethis.route("fromParamsNear", { path: "/:nearPost" });});- this.route("topicBySlugOrId", { path: "/t/:slugOrId", resetNamespace: true });+ this.route("topicBySlugOrId", {+ path: "/t/:slug_or_id",+ resetNamespace: true,+ });this.route("newCategory", { path: "/new-category" });this.route("editCategory", { path: "/c/*slug/edit" }, function () {@@ -52,8 +56,7 @@ export default function () {});});- this.route("filter", { path: "/filter" });-+ this.route("filter");this.route("categories");// default filter for a category@@ -157,7 +160,7 @@ export default function () {this.route("unread");});- this.route("tags", { path: "/tags" }, function () {+ this.route("tags", function () {this.route("show", { path: ":id" });});}@@ -191,30 +194,29 @@ export default function () {});- this.route("review", { path: "/review" }, function () {+ this.route("review", function () {this.route("show", { path: "/:reviewable_id" });- this.route("index", { path: "/" });- this.route("topics", { path: "/topics" });- this.route("settings", { path: "/settings" });+ this.route("topics");+ this.route("settings");});- this.route("signup", { path: "/signup" });- this.route("login", { path: "/login" });+ this.route("signup");+ this.route("login");this.route("email-login", { path: "/session/email-login/:token" });this.route("second-factor-auth", { path: "/session/2fa" });this.route("associate-account", { path: "/associate/:token" });this.route("login-preferences");this.route("forgot-password", { path: "/password-reset" });- this.route("faq", { path: "/faq" });- this.route("guidelines", { path: "/guidelines" });- this.route("conduct", { path: "/conduct" });- this.route("rules", { path: "/rules" });+ this.route("faq");+ this.route("guidelines");+ this.route("conduct");+ this.route("rules");- this.route("tos", { path: "/tos" });- this.route("privacy", { path: "/privacy" });+ this.route("tos");+ this.route("privacy");- this.route("new-topic", { path: "/new-topic" });- this.route("new-message", { path: "/new-message" });+ this.route("new-topic");+ this.route("new-message");this.route("badges", { resetNamespace: true }, function () {this.route("show", { path: "/:id/:slug" });@@ -271,11 +273,7 @@ export default function () {});- this.route(- "invites",- { path: "/invites", resetNamespace: true },- function () {- this.route("show", { path: "/:token" });- }- );+ this.route("invites", { resetNamespace: true }, function () {+ this.route("show", { path: "/:token" });+ });}diff --git a/app/assets/javascripts/discourse/app/routes/topic-by-slug-or-id.js b/app/assets/javascripts/discourse/app/routes/topic-by-slug-or-id.jsindex bef0992ca7f..289e5a6ba16 100644--- a/app/assets/javascripts/discourse/app/routes/topic-by-slug-or-id.js+++ b/app/assets/javascripts/discourse/app/routes/topic-by-slug-or-id.js@@ -6,10 +6,10 @@ export default DiscourseRoute.extend({router: service(),model(params) {- if (params.slugOrId.match(ID_CONSTRAINT)) {- return { url: `/t/topic/${params.slugOrId}` };+ if (params.slug_or_id.match(ID_CONSTRAINT)) {+ return { url: `/t/topic/${params.slug_or_id}` };} else {- return Topic.idForSlug(params.slugOrId).then((data) => {+ return Topic.idForSlug(params.slug_or_id).then((data) => {return { url: `/t/${data.slug}/${data.topic_id}` };});}