Ghost/ghost/admin/app/routes/settings/integrations/amp.js
Peter Zimon 737db37175 Added Integrations as a subpage of Settings
- Restructured Admin so that Integrations becomes a subpage of Settings.
2021-10-18 14:47:59 +02:00

40 lines
1.0 KiB
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(CurrentUserSettings, {
settings: service(),
beforeModel() {
this._super(...arguments);
this.transitionAuthor(this.session.user);
this.transitionEditor(this.session.user);
return this.settings.reload();
},
actions: {
save() {
this.controller.send('save');
},
willTransition(transition) {
let controller = this.controller;
let modelIsDirty = this.settings.get('hasDirtyAttributes');
if (modelIsDirty) {
transition.abort();
controller.send('toggleLeaveSettingsModal', transition);
return;
}
}
},
buildRouteInfoMetadata() {
return {
titleToken: 'AMP'
};
}
});