mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
f92c62b59a
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
37 lines
1.0 KiB
JavaScript
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'
|
|
};
|
|
}
|
|
}
|