Dropped use of @classic decorator in transforms

refs https://github.com/TryGhost/Admin/pull/2242

- there was no further EmberObject specific usage to migrate for these classes so the @classic decorator is not necessary
This commit is contained in:
Kevin Ansfield 2022-02-02 18:48:59 +00:00
parent 83fb74613c
commit 850a223dd4
12 changed files with 2 additions and 26 deletions

View File

@ -1,7 +1,5 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
@classic
export default class FacebookUrlUser extends Transform {
deserialize(serialized) {
if (serialized) {

View File

@ -1,7 +1,5 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
@classic
export default class JsonString extends Transform {
deserialize(serialized) {
let _serialized = serialized === '' ? null : serialized;

View File

@ -1,9 +1,7 @@
import MemberProduct from 'ghost-admin/models/member-product';
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
@classic
export default class MemberProductTransform extends Transform {
deserialize(serialized) {
let subscriptions, subscriptionArray;

View File

@ -1,9 +1,7 @@
import MemberSubscription from 'ghost-admin/models/member-subscription';
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
@classic
export default class MemberSubscriptionTransform extends Transform {
deserialize(serialized) {
let subscriptions, subscriptionArray;

View File

@ -1,8 +1,6 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import moment from 'moment';
@classic
export default class MomentDate extends Transform {
deserialize(serialized) {
if (serialized) {

View File

@ -1,8 +1,6 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import moment from 'moment';
@classic
export default class MomentUtc extends Transform {
deserialize(serialized) {
if (serialized) {

View File

@ -1,9 +1,7 @@
import NavigationItem from 'ghost-admin/models/navigation-item';
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
@classic
export default class NavigationSettings extends Transform {
deserialize(serialized, options) {
let navItems, settingsArray;
@ -27,8 +25,8 @@ export default class NavigationSettings extends Transform {
if (isEmberArray(deserialized)) {
settingsArray = deserialized.map((item) => {
let label = item.get('label').trim();
let url = item.get('url').trim();
let label = item.label.trim();
let url = item.url.trim();
return {label, url};
}).compact();

View File

@ -1,9 +1,7 @@
import ProductBenefitItem from '../models/product-benefit-item';
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
@classic
export default class ProductBenefits extends Transform {
deserialize(serialized) {
let benefitsItems, benefitsArray;

View File

@ -1,7 +1,5 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
@classic
export default class Raw extends Transform {
deserialize(serialized) {
return serialized;

View File

@ -1,11 +1,9 @@
import classic from 'ember-classic-decorator';
/* eslint-disable camelcase */
import SlackObject from 'ghost-admin/models/slack-integration';
import Transform from '@ember-data/serializer/transform';
import {isArray as isEmberArray} from '@ember/array';
import {isEmpty} from '@ember/utils';
@classic
export default class SlackSettings extends Transform {
deserialize(serialized) {
let settingsArray;

View File

@ -1,9 +1,7 @@
import StripePrice from 'ghost-admin/models/stripe-price';
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
@classic
export default class StripePriceTransform extends Transform {
deserialize(serialized) {
if (serialized === null || serialized === undefined) {

View File

@ -1,7 +1,5 @@
import Transform from '@ember-data/serializer/transform';
import classic from 'ember-classic-decorator';
@classic
export default class TwitterUrlUser extends Transform {
deserialize(serialized) {
if (serialized) {