DEV: uses private API for currentPath (#7911)

* DEV: uses with private API for currentPath

router.currentRouteName as a slightly different API and application.currentPath is deprecated

* another fix
This commit is contained in:
Joffrey JAFFEUX
2019-07-18 23:00:39 +02:00
committed by Robin Ward
parent e8a14a3a65
commit 8dfd0e0374
12 changed files with 19 additions and 20 deletions

View File

@@ -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;