Ghost/ghost/admin/app/routes/settings/integrations/zapier.js
Kevin Ansfield f92c62b59a Switched API key regeneration modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
- migrated Zapier controller to native class syntax
- fixed regeneration confirmation text not being visible on Zapier screen
2022-11-14 09:55:34 +00:00

37 lines
1.0 KiB
JavaScript

import AdminRoute from 'ghost-admin/routes/admin';
import {inject} from 'ghost-admin/decorators/inject';
import {inject as service} from '@ember/service';
export default class ZapierRoute extends AdminRoute {
@service router;
@inject config;
beforeModel() {
super.beforeModel(...arguments);
if (this.config.hostSettings?.limits?.customIntegrations?.disabled) {
return this.transitionTo('settings.integrations');
}
}
model(params, transition) {
// use the integrations controller to fetch all integrations and pick
// out the one we want. Allows navigation back to integrations screen
// without a loading state
return this
.controllerFor('settings.integrations')
.integrationModelHook('slug', 'zapier', this, transition);
}
resetController(controller) {
controller.regeneratedApiKey = null;
}
buildRouteInfoMetadata() {
return {
titleToken: 'Zapier'
};
}
}