mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 03:42:27 +03:00
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:
parent
83fb74613c
commit
850a223dd4
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user