Added option to hide default segments for segment select component

refs https://github.com/TryGhost/Team/issues/822

The post access dropdown in the Post settings menu and default access settings should not show the default segments as we only allow segmenting on specific products.
This commit is contained in:
Rishabh 2021-07-02 22:02:04 +05:30 committed by Rishabh Garg
parent 450ad78f61
commit 71120d6855

View File

@ -59,15 +59,19 @@ export default class GhMembersSegmentSelect extends Component {
@task @task
*fetchOptionsTask() { *fetchOptionsTask() {
const options = yield [{ const options = yield [];
name: 'Free members',
segment: 'status:free', if (!this.args.hideDefaultSegments) {
class: 'segment-status-free' options.push({
}, { name: 'Free members',
name: 'Paid members', segment: 'status:free',
segment: 'status:-free', // paid & comped class: 'segment-status-free'
class: 'segment-status-paid' }, {
}]; name: 'Paid members',
segment: 'status:-free', // paid & comped
class: 'segment-status-paid'
});
}
// fetch all labels w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶ // fetch all labels w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶
// TODO: add `include: 'count.members` to query once API is fixed // TODO: add `include: 'count.members` to query once API is fixed