diff --git a/app/assets/javascripts/admin/controllers/admin.js.es6 b/app/assets/javascripts/admin/controllers/admin.js.es6
index 2bca382439..a79cf81944 100644
--- a/app/assets/javascripts/admin/controllers/admin.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin.js.es6
@@ -13,7 +13,7 @@ export default Ember.Controller.extend({
return this.currentUser.get("admin") && enableBadges;
},
- @computed("router.currentRouteName")
+ @computed("router._router.currentPath")
adminContentsClassName(currentPath) {
let cssClasses = currentPath
.split(".")
@@ -22,16 +22,15 @@ export default Ember.Controller.extend({
segment !== "index" &&
segment !== "loading" &&
segment !== "show" &&
- segment !== "admin" &&
- segment !== "dashboard"
+ segment !== "admin"
);
})
.map(Ember.String.dasherize)
.join(" ");
// this is done to avoid breaking css customizations
- if (currentPath.indexOf("admin.dashboard") > -1) {
- cssClasses = `${cssClasses} dashboard dashboard-next`;
+ if (cssClasses.includes("dashboard")) {
+ cssClasses = `${cssClasses} dashboard-next`;
}
return cssClasses;
diff --git a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6
index 9a9cba115b..0d087261a1 100644
--- a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6
+++ b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6
@@ -9,7 +9,7 @@ export default Ember.Controller.extend({
pmView: false,
viewingSelf: Ember.computed.alias("user.viewingSelf"),
isGroup: Ember.computed.equal("pmView", "groups"),
- currentPath: Ember.computed.alias("router.currentRouteName"),
+ currentPath: Ember.computed.alias("router._router.currentPath"),
selected: Ember.computed.alias("userTopicsList.selected"),
bulkSelectEnabled: Ember.computed.alias("userTopicsList.bulkSelectEnabled"),
showToggleBulkSelect: true,
diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6
index 661be19aaf..5045cf55c4 100644
--- a/app/assets/javascripts/discourse/controllers/user.js.es6
+++ b/app/assets/javascripts/discourse/controllers/user.js.es6
@@ -7,7 +7,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
indexStream: false,
router: Ember.inject.service(),
userNotifications: Ember.inject.controller("user-notifications"),
- currentPath: Ember.computed.alias("router.currentRouteName"),
+ currentPath: Ember.computed.alias("router._router.currentPath"),
adminTools: optionalService(),
@computed("model.username")
diff --git a/app/assets/javascripts/discourse/templates/group.hbs b/app/assets/javascripts/discourse/templates/group.hbs
index 7e88c925e4..6a7d2e0b14 100644
--- a/app/assets/javascripts/discourse/templates/group.hbs
+++ b/app/assets/javascripts/discourse/templates/group.hbs
@@ -56,7 +56,7 @@
- {{group-navigation group=model currentPath=router.currentRouteName tabs=tabs}}
+ {{group-navigation group=model currentPath=router._router.currentPath tabs=tabs}}
diff --git a/app/assets/javascripts/discourse/templates/group/activity.hbs b/app/assets/javascripts/discourse/templates/group/activity.hbs
index b6ca30345e..24c06e20c9 100644
--- a/app/assets/javascripts/discourse/templates/group/activity.hbs
+++ b/app/assets/javascripts/discourse/templates/group/activity.hbs
@@ -1,5 +1,5 @@
- {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router._router.currentPath}}
{{group-activity-filter filter="posts" categoryId=category_id}}
{{group-activity-filter filter="topics" categoryId=category_id}}
{{#if siteSettings.enable_mentions}}
diff --git a/app/assets/javascripts/discourse/templates/group/manage.hbs b/app/assets/javascripts/discourse/templates/group/manage.hbs
index ff43273d40..5ee0f8591f 100644
--- a/app/assets/javascripts/discourse/templates/group/manage.hbs
+++ b/app/assets/javascripts/discourse/templates/group/manage.hbs
@@ -1,5 +1,5 @@
- {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router._router.currentPath}}
{{#each tabs as |tab|}}
{{#link-to tab.route model.name}}
diff --git a/app/assets/javascripts/discourse/templates/group/messages.hbs b/app/assets/javascripts/discourse/templates/group/messages.hbs
index b567f2d031..1d3edaa440 100644
--- a/app/assets/javascripts/discourse/templates/group/messages.hbs
+++ b/app/assets/javascripts/discourse/templates/group/messages.hbs
@@ -1,5 +1,5 @@
- {{#mobile-nav class='messages-nav' desktopClass='nav-stacked action-list' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='messages-nav' desktopClass='nav-stacked action-list' currentPath=router._router.currentPath}}
{{#link-to 'group.messages.inbox' model.name}}
diff --git a/app/assets/javascripts/discourse/templates/preferences.hbs b/app/assets/javascripts/discourse/templates/preferences.hbs
index 4a78a98f90..3abd833348 100644
--- a/app/assets/javascripts/discourse/templates/preferences.hbs
+++ b/app/assets/javascripts/discourse/templates/preferences.hbs
@@ -1,5 +1,5 @@
{{#d-section pageClass="user-preferences" class="user-secondary-navigation"}}
- {{#mobile-nav class='preferences-nav' desktopClass='preferences-list action-list nav-stacked' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='preferences-nav' desktopClass='preferences-list action-list nav-stacked' currentPath=router._router.currentPath}}
{{#link-to 'preferences.account'}}
{{i18n 'user.preferences_nav.account'}}
diff --git a/app/assets/javascripts/discourse/templates/user-card.hbs b/app/assets/javascripts/discourse/templates/user-card.hbs
index 3c23451b39..d06bb8ae00 100644
--- a/app/assets/javascripts/discourse/templates/user-card.hbs
+++ b/app/assets/javascripts/discourse/templates/user-card.hbs
@@ -3,14 +3,14 @@
{{/if}}
{{user-card-contents
- currentPath=router.currentRouteName
+ currentPath=router._router.currentPath
topic=topic.model
showUser=(action "showUser")
togglePosts=(action "togglePosts")
createNewMessageViaParams=(route-action "createNewMessageViaParams")}}
{{group-card-contents
- currentPath=router.currentRouteName
+ currentPath=router._router.currentPath
topic=topic.model
showUser=(action "showUser")
showGroup=(action "showGroup")
diff --git a/app/assets/javascripts/discourse/templates/user/activity.hbs b/app/assets/javascripts/discourse/templates/user/activity.hbs
index 2b1ea959a3..6c39cc4618 100644
--- a/app/assets/javascripts/discourse/templates/user/activity.hbs
+++ b/app/assets/javascripts/discourse/templates/user/activity.hbs
@@ -1,5 +1,5 @@
{{#d-section pageClass="user-activity" class="user-secondary-navigation" scrollTop="false"}}
- {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router._router.currentPath}}
{{#link-to 'userActivity.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
diff --git a/app/assets/javascripts/discourse/templates/user/notifications.hbs b/app/assets/javascripts/discourse/templates/user/notifications.hbs
index c968b42f9d..fa74e925d3 100644
--- a/app/assets/javascripts/discourse/templates/user/notifications.hbs
+++ b/app/assets/javascripts/discourse/templates/user/notifications.hbs
@@ -1,5 +1,5 @@
{{#d-section pageClass="user-notifications" class="user-secondary-navigation"}}
- {{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=router.currentRouteName}}
+ {{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=router._router.currentPath}}
{{#link-to 'userNotifications.index'}}
{{i18n 'user.filters.all'}}
diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6
index b48b302bbc..3db96d0803 100644
--- a/app/assets/javascripts/discourse/widgets/header.js.es6
+++ b/app/assets/javascripts/discourse/widgets/header.js.es6
@@ -403,8 +403,8 @@ export default createWidget("header", {
}
const currentPath = this.register
- .lookup("controller:application")
- .get("currentPath");
+ .lookup("service:router")
+ .get("router._router.currentPath");
if (currentPath === "full-page-search") {
scrollTop();
@@ -479,8 +479,8 @@ export default createWidget("header", {
state.contextEnabled = false;
const currentPath = this.register
- .lookup("controller:application")
- .get("currentPath");
+ .lookup("service:router")
+ .get("router._router.currentPath");
const blacklist = [/^discovery\.categories/];
const whitelist = [/^topic\./];
const check = function(regex) {