2022-01-17 13:05:27 +03:00
|
|
|
import AdminRoute from 'ghost-admin/routes/admin';
|
2021-03-29 14:49:09 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2022-01-17 13:05:27 +03:00
|
|
|
export default class MembershipSettingsRoute extends AdminRoute {
|
2022-01-27 14:40:11 +03:00
|
|
|
@service notifications;
|
2021-03-29 14:49:09 +03:00
|
|
|
@service settings;
|
|
|
|
|
2022-01-27 14:40:11 +03:00
|
|
|
beforeModel(transition) {
|
|
|
|
super.beforeModel(...arguments);
|
|
|
|
|
|
|
|
if (transition.to.queryParams?.supportAddressUpdate === 'success') {
|
|
|
|
this.notifications.showAlert(
|
|
|
|
`Support email address has been updated`,
|
|
|
|
{type: 'success', key: 'members.settings.support-address.updated'}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-29 14:49:09 +03:00
|
|
|
model() {
|
|
|
|
this.settings.reload();
|
|
|
|
}
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
willTransition(transition) {
|
|
|
|
return this.controller.leaveRoute(transition);
|
|
|
|
}
|
2022-02-10 13:41:36 +03:00
|
|
|
};
|
2021-03-29 14:49:09 +03:00
|
|
|
|
|
|
|
buildRouteInfoMetadata() {
|
|
|
|
return {
|
2021-05-14 17:35:07 +03:00
|
|
|
titleToken: 'Settings - Membership'
|
2021-03-29 14:49:09 +03:00
|
|
|
};
|
|
|
|
}
|
2021-05-17 14:40:08 +03:00
|
|
|
|
|
|
|
resetController(controller, isExiting) {
|
|
|
|
if (isExiting) {
|
|
|
|
controller.reset();
|
|
|
|
}
|
|
|
|
}
|
2021-03-29 14:49:09 +03:00
|
|
|
}
|