From 034812ac02cae06a60212d0a1c0434d7d97dad23 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 2 Sep 2022 19:14:29 +0100 Subject: [PATCH] Dropped use of @classic decorator in adapters refs https://github.com/TryGhost/Ghost/issues/14101 - `@classic` decorator is not required on adapter classes - small cleanup of Octane migration code --- ghost/admin/app/adapters/api-key.js | 2 -- ghost/admin/app/adapters/application.js | 2 -- ghost/admin/app/adapters/email.js | 2 -- ghost/admin/app/adapters/embedded-relation-adapter.js | 2 -- ghost/admin/app/adapters/label.js | 4 +--- ghost/admin/app/adapters/member.js | 2 -- ghost/admin/app/adapters/offer.js | 2 -- ghost/admin/app/adapters/page.js | 2 -- ghost/admin/app/adapters/setting.js | 2 -- ghost/admin/app/adapters/tag.js | 4 +--- ghost/admin/app/adapters/theme.js | 2 -- ghost/admin/app/adapters/tier.js | 2 -- ghost/admin/app/adapters/user.js | 2 -- 13 files changed, 2 insertions(+), 28 deletions(-) diff --git a/ghost/admin/app/adapters/api-key.js b/ghost/admin/app/adapters/api-key.js index 1fc9d39586..ab8dbeb346 100644 --- a/ghost/admin/app/adapters/api-key.js +++ b/ghost/admin/app/adapters/api-key.js @@ -1,7 +1,5 @@ import ApplicationAdapter from './application'; -import classic from 'ember-classic-decorator'; -@classic export default class ApiKey extends ApplicationAdapter { queryRecord(store, type, query) { if (!query || query.id !== 'me') { diff --git a/ghost/admin/app/adapters/application.js b/ghost/admin/app/adapters/application.js index 6dae562acb..024ce27bb8 100644 --- a/ghost/admin/app/adapters/application.js +++ b/ghost/admin/app/adapters/application.js @@ -1,7 +1,5 @@ import EmbeddedRelationAdapter from 'ghost-admin/adapters/embedded-relation-adapter'; -import classic from 'ember-classic-decorator'; -@classic export default class Application extends EmbeddedRelationAdapter { shouldBackgroundReloadRecord() { return false; diff --git a/ghost/admin/app/adapters/email.js b/ghost/admin/app/adapters/email.js index 6efb0ff62f..0e26d9c786 100644 --- a/ghost/admin/app/adapters/email.js +++ b/ghost/admin/app/adapters/email.js @@ -1,7 +1,5 @@ import ApplicationAdapter from './application'; -import classic from 'ember-classic-decorator'; -@classic export default class Email extends ApplicationAdapter { retry(model) { let url = `${this.buildURL('email', model.get('id'))}retry/`; diff --git a/ghost/admin/app/adapters/embedded-relation-adapter.js b/ghost/admin/app/adapters/embedded-relation-adapter.js index 9e391e16be..50980a6a7d 100644 --- a/ghost/admin/app/adapters/embedded-relation-adapter.js +++ b/ghost/admin/app/adapters/embedded-relation-adapter.js @@ -1,5 +1,4 @@ import BaseAdapter from 'ghost-admin/adapters/base'; -import classic from 'ember-classic-decorator'; import {get} from '@ember/object'; import {isNone} from '@ember/utils'; import {underscore} from '@ember/string'; @@ -14,7 +13,6 @@ import {underscore} from '@ember/string'; // If a model has an embedded hasMany relation, the related type will be included: // roles: DS.hasMany('role', { embedded: 'always' }) => ?include=roles -@classic export default class EmbeddedRelationAdapter extends BaseAdapter { find(store, type, id, snapshot) { return this.ajax(this.buildIncludeURL(store, type.modelName, id, snapshot, 'find'), 'GET'); diff --git a/ghost/admin/app/adapters/label.js b/ghost/admin/app/adapters/label.js index 1d5adc3e3a..e0d423a615 100644 --- a/ghost/admin/app/adapters/label.js +++ b/ghost/admin/app/adapters/label.js @@ -1,12 +1,10 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; import SlugUrl from 'ghost-admin/utils/slug-url'; -import classic from 'ember-classic-decorator'; -@classic export default class Label extends ApplicationAdapter { buildURL(_modelName, _id, _snapshot, _requestType, query) { let url = super.buildURL(...arguments); return SlugUrl(url, query); } -} \ No newline at end of file +} diff --git a/ghost/admin/app/adapters/member.js b/ghost/admin/app/adapters/member.js index ab0dc3f26e..b9f5b6c1d3 100644 --- a/ghost/admin/app/adapters/member.js +++ b/ghost/admin/app/adapters/member.js @@ -1,7 +1,5 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; -import classic from 'ember-classic-decorator'; -@classic export default class Member extends ApplicationAdapter { queryRecord(store, type, query) { if (query && query.id) { diff --git a/ghost/admin/app/adapters/offer.js b/ghost/admin/app/adapters/offer.js index e95e0afc5c..5fa0daf892 100644 --- a/ghost/admin/app/adapters/offer.js +++ b/ghost/admin/app/adapters/offer.js @@ -1,7 +1,5 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; -import classic from 'ember-classic-decorator'; -@classic export default class Offer extends ApplicationAdapter { queryRecord(store, type, query) { if (query && query.id) { diff --git a/ghost/admin/app/adapters/page.js b/ghost/admin/app/adapters/page.js index 20942a080a..4a73a826ef 100644 --- a/ghost/admin/app/adapters/page.js +++ b/ghost/admin/app/adapters/page.js @@ -1,7 +1,5 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; -import classic from 'ember-classic-decorator'; -@classic export default class Page extends ApplicationAdapter { // posts and pages now include everything by default buildIncludeURL(store, modelName, id, snapshot, requestType, query) { diff --git a/ghost/admin/app/adapters/setting.js b/ghost/admin/app/adapters/setting.js index 3135978a8e..f6d3a1dc58 100644 --- a/ghost/admin/app/adapters/setting.js +++ b/ghost/admin/app/adapters/setting.js @@ -1,7 +1,5 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; -import classic from 'ember-classic-decorator'; -@classic export default class Setting extends ApplicationAdapter { updateRecord(store, type, record) { let data = {}; diff --git a/ghost/admin/app/adapters/tag.js b/ghost/admin/app/adapters/tag.js index 1b2c2778cb..bcc3168972 100644 --- a/ghost/admin/app/adapters/tag.js +++ b/ghost/admin/app/adapters/tag.js @@ -1,12 +1,10 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; import SlugUrl from 'ghost-admin/utils/slug-url'; -import classic from 'ember-classic-decorator'; -@classic export default class Tag extends ApplicationAdapter { buildURL(_modelName, _id, _snapshot, _requestType, query) { let url = super.buildURL(...arguments); return SlugUrl(url, query); } -} \ No newline at end of file +} diff --git a/ghost/admin/app/adapters/theme.js b/ghost/admin/app/adapters/theme.js index 13d61ee8f4..c3c6c2587f 100644 --- a/ghost/admin/app/adapters/theme.js +++ b/ghost/admin/app/adapters/theme.js @@ -1,7 +1,5 @@ import ApplicationAdapter from './application'; -import classic from 'ember-classic-decorator'; -@classic export default class Theme extends ApplicationAdapter { activate(model) { let url = `${this.buildURL('theme', model.get('id'))}activate/`; diff --git a/ghost/admin/app/adapters/tier.js b/ghost/admin/app/adapters/tier.js index df3161c3a1..c237aceda3 100644 --- a/ghost/admin/app/adapters/tier.js +++ b/ghost/admin/app/adapters/tier.js @@ -1,7 +1,5 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; -import classic from 'ember-classic-decorator'; -@classic export default class Tier extends ApplicationAdapter { queryRecord(store, type, query) { if (query && query.id) { diff --git a/ghost/admin/app/adapters/user.js b/ghost/admin/app/adapters/user.js index 08d1333d1c..3d3bc4e241 100644 --- a/ghost/admin/app/adapters/user.js +++ b/ghost/admin/app/adapters/user.js @@ -1,8 +1,6 @@ import ApplicationAdapter from 'ghost-admin/adapters/application'; import SlugUrl from 'ghost-admin/utils/slug-url'; -import classic from 'ember-classic-decorator'; -@classic export default class User extends ApplicationAdapter { buildURL(_modelName, _id, _snapshot, _requestType, query) { let url = super.buildURL(...arguments);