mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
cf6ef942a5
no issue - added `dashboardTwo` feature flag and labs screen toggle - added `dashboard-labs` route with duplicated dashboard controller/template - added redirect to `dashboard` route so it transitions to `dashboard-labs` when the feature is enabled
29 lines
655 B
JavaScript
29 lines
655 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
|
@service feature;
|
|
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
|
|
if (!this.session.user.isAdmin) {
|
|
return this.transitionTo('site');
|
|
}
|
|
|
|
if (!this.feature.dashboardTwo) {
|
|
return this.transitionTo('dashboard');
|
|
}
|
|
}
|
|
|
|
buildRouteInfoMetadata() {
|
|
return {
|
|
mainClasses: ['gh-main-wide']
|
|
};
|
|
}
|
|
|
|
setupController() {
|
|
this.controller.initialise();
|
|
}
|
|
}
|