0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Removed @classic decorator from integrations controller

refs https://github.com/TryGhost/Ghost/issues/14101

- controller was already mostly up-to-date with Octane patterns
- removed unnecessary use of `@computed` and removed `@classic` decorator
This commit is contained in:
Kevin Ansfield 2022-09-08 09:18:51 +01:00
parent bd87ee3e2a
commit 6fd1b08a3d

View file

@ -1,31 +1,20 @@
import classic from 'ember-classic-decorator';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
/* eslint-disable ghost/ember/alias-model-in-controller */
import Controller from '@ember/controller';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
@classic
export default class IntegrationsController extends Controller {
@service settings;
@service store;
@service config;
_allIntegrations = null;
_allIntegrations = this.store.peekAll('integration');
init() {
super.init(...arguments);
this._allIntegrations = this.store.peekAll('integration');
}
@computed('config.hostSettings.limits')
get zapierDisabled() {
return this.config.get('hostSettings.limits.customIntegrations.disabled');
}
// filter over the live query so that the list is automatically updated
// as integrations are added/removed
@computed('_allIntegrations.@each.{isNew,type}')
get integrations() {
return this._allIntegrations.reject((integration) => {
return integration.isNew || integration.type !== 'custom';
@ -35,10 +24,10 @@ export default class IntegrationsController extends Controller {
// use ember-concurrency so that we can use the derived state to show
// a spinner only in the integrations list and avoid delaying the whole
// screen display
@task(function* () {
@task
*fetchIntegrations() {
return yield this.store.findAll('integration');
})
fetchIntegrations;
}
// used by individual integration routes' `model` hooks
integrationModelHook(prop, value, route, transition) {