Ghost/ghost/admin/app/routes/dashboard.js
Simon Backx 8502ebb96a Moving over the new Dashboard to replace the old (#2389)
refs: https://github.com/TryGhost/Team/issues/1631

Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
2022-05-17 09:34:34 +02:00

29 lines
766 B
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
export default class DashboardRoute extends AuthenticatedRoute {
async beforeModel() {
super.beforeModel(...arguments);
if (this.session.user.isContributor) {
return this.transitionTo('posts');
} else if (!this.session.user.isAdmin) {
return this.transitionTo('site');
}
}
buildRouteInfoMetadata() {
return {
mainClasses: ['gh-main-wide']
};
}
// trigger a background load of members plus labels for filter dropdown
setupController() {
super.setupController(...arguments);
}
model() {
return this.controllerFor('dashboard').loadSiteStatusTask.perform();
}
}