mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
de560733c5
refs https://github.com/TryGhost/Team/issues/581 Setting post visibility to a label results in undesirable and confusing behaviour with no good way to manage access long-term. Coupled with products being limited to a single product for now we're reverting the UI back to the "Public", "Members", and "Paid" options.
33 lines
798 B
JavaScript
33 lines
798 B
JavaScript
import Component from '@ember/component';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
const VISIBILITIES = [
|
|
{label: 'Public', name: 'public'},
|
|
{label: 'Members only', name: 'members'},
|
|
{label: 'Paid-members only', name: 'paid'}
|
|
];
|
|
|
|
export default Component.extend({
|
|
|
|
settings: service(),
|
|
|
|
// public attrs
|
|
post: null,
|
|
|
|
selectedVisibility: computed('post.visibility', function () {
|
|
return this.get('post.visibility') || this.settings.get('defaultContentVisibility');
|
|
}),
|
|
|
|
init() {
|
|
this._super(...arguments);
|
|
this.availableVisibilities = VISIBILITIES;
|
|
},
|
|
|
|
actions: {
|
|
updateVisibility(newVisibility) {
|
|
this.post.set('visibility', newVisibility);
|
|
}
|
|
}
|
|
});
|