3c5e334041
refs https://github.com/TryGhost/Team/issues/801
- This reverts commit de560733c5
- brings back members segment select component to post access, which allows setting access to specific labels/products
- only works behind the alpha feature flag - `multipleProducts`
30 lines
823 B
JavaScript
30 lines
823 B
JavaScript
import Transform from '@ember-data/serializer/transform';
|
|
|
|
// post visibility supports `'members'` and `'paid'` as special-case options
|
|
// but that doesn't map well for options in our token select inputs so we
|
|
// expand/convert them here to make usage elsewhere easier
|
|
|
|
export default class VisibilityString extends Transform {
|
|
deserialize(serialized) {
|
|
if (serialized === 'members') {
|
|
return 'status:free,status:-free';
|
|
}
|
|
if (serialized === 'paid') {
|
|
return 'status:-free';
|
|
}
|
|
|
|
return serialized;
|
|
}
|
|
|
|
serialize(deserialized) {
|
|
if (deserialized === 'status:free,status:-free') {
|
|
return 'members';
|
|
}
|
|
if (deserialized === 'status:-free') {
|
|
return 'paid';
|
|
}
|
|
|
|
return deserialized;
|
|
}
|
|
}
|