mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
🔥 Removed multipleProducts, tierWelcomePages, and tierName flags
refs https://github.com/TryGhost/Team/issues/1616
This commit is contained in:
parent
949077e6df
commit
eee3a9aa90
29 changed files with 182 additions and 423 deletions
|
@ -73,30 +73,28 @@ export default class GhMembersSegmentSelect extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
// fetch all tiers w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
// fetch all tiers w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
segment: `tier:${tier.slug}`,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
segment: `tier:${tier.slug}`,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
});
|
||||
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.segment) {
|
||||
this.args.onChange?.(tiersGroup.options[0].segment);
|
||||
}
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.segment) {
|
||||
this.args.onChange?.(tiersGroup.options[0].segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{#if (and (feature "multipleProducts") (gt this.tiers.length 1))}}
|
||||
{{#if (gt this.tiers.length 1)}}
|
||||
<tr>
|
||||
<td colspan="2"><hr class="gh-portal-links-group-divider" /></td>
|
||||
</tr>
|
||||
|
@ -379,4 +379,4 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -74,28 +74,21 @@
|
|||
{{/unless}}
|
||||
|
||||
{{#if this.showVisibilityInput}}
|
||||
{{#if (feature "multipleProducts")}}
|
||||
<GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="visibility">
|
||||
<label for="visibility-input">{{capitalize @post.displayName}} access</label>
|
||||
<GhPsmVisibilityInput @post={{this.post}} @triggerId="visibility-input" />
|
||||
</GhFormGroup>
|
||||
<GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="visibility">
|
||||
<label for="visibility-input">{{capitalize @post.displayName}} access</label>
|
||||
<GhPsmVisibilityInput @post={{this.post}} @triggerId="visibility-input" />
|
||||
</GhFormGroup>
|
||||
|
||||
{{#if (eq this.post.visibility "tiers")}}
|
||||
<GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="tiers" @class="nt3">
|
||||
<GhPostSettingsMenu::VisibilitySegmentSelect
|
||||
@tiers={{this.post.tiers}}
|
||||
@onChange={{action "setVisibility"}}
|
||||
@renderInPlace={{true}}
|
||||
@hideOptionsWhenAllSelected={{true}}
|
||||
/>
|
||||
<GhErrorMessage @errors={{this.post.errors}} @property="tiers" data-test-error="tiers" />
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
<label for="visibility-input">Post access</label>
|
||||
<GhPsmVisibilityInput @post={{this.post}} @triggerId="visibility-input" />
|
||||
</div>
|
||||
{{#if (eq this.post.visibility "tiers")}}
|
||||
<GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="tiers" @class="nt3">
|
||||
<GhPostSettingsMenu::VisibilitySegmentSelect
|
||||
@tiers={{this.post.tiers}}
|
||||
@onChange={{action "setVisibility"}}
|
||||
@renderInPlace={{true}}
|
||||
@hideOptionsWhenAllSelected={{true}}
|
||||
/>
|
||||
<GhErrorMessage @errors={{this.post.errors}} @property="tiers" data-test-error="tiers" />
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -69,31 +69,29 @@ export default class VisibilitySegmentSelect extends Component {
|
|||
*fetchOptionsTask() {
|
||||
const options = yield [];
|
||||
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
// fetch all tiers with count
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
this.tiers = tiers;
|
||||
// fetch all tiers with count
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
this.tiers = tiers;
|
||||
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
id: tier.id,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
id: tier.id,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
});
|
||||
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.tiers) {
|
||||
this.setSegment([tiersGroup.options[0]]);
|
||||
}
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.tiers) {
|
||||
this.setSegment([tiersGroup.options[0]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ const VISIBILITIES = [
|
|||
@classic
|
||||
export default class GhPsmVisibilityInput extends Component {
|
||||
@service settings;
|
||||
@service feature;
|
||||
|
||||
|
||||
// public attrs
|
||||
post = null;
|
||||
|
||||
|
@ -25,11 +24,9 @@ export default class GhPsmVisibilityInput extends Component {
|
|||
init() {
|
||||
super.init(...arguments);
|
||||
this.availableVisibilities = [...VISIBILITIES];
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
this.availableVisibilities.push(
|
||||
{label: 'Specific tier(s)', name: 'tiers'}
|
||||
);
|
||||
}
|
||||
this.availableVisibilities.push(
|
||||
{label: 'Specific tier(s)', name: 'tiers'}
|
||||
);
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -18,7 +18,7 @@ const FILTER_PROPERTIES = [
|
|||
{label: 'Created', name: 'created_at', group: 'Basic', valueType: 'date'},
|
||||
|
||||
// Member subscription
|
||||
{label: 'Membership tier', name: 'tier', group: 'Subscription', valueType: 'array', feature: 'multipleProducts'},
|
||||
{label: 'Membership tier', name: 'tier', group: 'Subscription', valueType: 'array'},
|
||||
{label: 'Member status', name: 'status', group: 'Subscription'},
|
||||
{label: 'Billing period', name: 'subscriptions.plan_interval', group: 'Subscription'},
|
||||
{label: 'Stripe subscription status', name: 'subscriptions.status', group: 'Subscription'},
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<header class="modal-header">
|
||||
<h1>Tiers is a one-way street!</h1>
|
||||
</header>
|
||||
<a class="close" href="" role="button" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>Tiers for paid memberships is currently in an early access beta. Once enabled, it cannot be switched off. <a href="http://ghost.org/help/tiers" target="_blank" rel="noopener noreferrer">Learn more here</a></p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="gh-btn" type="button" {{action "closeModal"}}><span>Cancel</span></button>
|
||||
<button class="gh-btn gh-btn-primary" type="button" {{action "confirm"}}><span>Enable Tiers</span></button>
|
||||
</div>
|
|
@ -1,23 +0,0 @@
|
|||
import ModalComponent from 'ghost-admin/components/modal-base';
|
||||
import {inject as service} from '@ember/service';
|
||||
import {task} from 'ember-concurrency';
|
||||
|
||||
export default ModalComponent.extend({
|
||||
feature: service(),
|
||||
// Allowed actions
|
||||
confirm: () => {},
|
||||
|
||||
actions: {
|
||||
confirm() {
|
||||
this.enableTiers.perform();
|
||||
}
|
||||
},
|
||||
|
||||
enableTiers: task(function* () {
|
||||
try {
|
||||
yield this.feature.set('multipleProducts', true);
|
||||
} finally {
|
||||
this.send('closeModal');
|
||||
}
|
||||
}).drop()
|
||||
});
|
|
@ -44,83 +44,58 @@
|
|||
</GhFormGroup>
|
||||
{{#if this.membersUtils.isStripeEnabled}}
|
||||
<div {{did-insert this.refreshAfterStripeConnected}}>
|
||||
{{#if this.showPortalTiers}}
|
||||
<div class="mb3 mt5">
|
||||
<h4 class="gh-portal-setting-title">Tiers available at signup</h4>
|
||||
</div>
|
||||
<div class="mb3 mt5">
|
||||
<h4 class="gh-portal-setting-title">Tiers available at signup</h4>
|
||||
</div>
|
||||
<div class="form-group mb0 for-checkbox">
|
||||
<label
|
||||
class="checkbox"
|
||||
for="free-plan"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={{this.membersUtils.isFreeChecked}}
|
||||
id="free-plan"
|
||||
name="free-plan"
|
||||
disabled={{or
|
||||
(not this.membersUtils.isStripeEnabled)
|
||||
(not-eq this.settings.membersSignupAccess "all")
|
||||
}}
|
||||
class="gh-input post-settings-featured"
|
||||
{{on "click" (action "togglePlan" "free")}}
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>Free</p>
|
||||
</label>
|
||||
</div>
|
||||
{{#each this.tiers as |tier|}}
|
||||
<div class="form-group mb0 for-checkbox">
|
||||
<label
|
||||
class="checkbox"
|
||||
for="free-plan"
|
||||
for={{tier.id}}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={{this.membersUtils.isFreeChecked}}
|
||||
id="free-plan"
|
||||
name="free-plan"
|
||||
id={{tier.id}}
|
||||
name={{tier.id}}
|
||||
checked={{tier.checked}}
|
||||
disabled={{or
|
||||
(not this.membersUtils.isStripeEnabled)
|
||||
(not-eq this.settings.membersSignupAccess "all")
|
||||
}}
|
||||
class="gh-input post-settings-featured"
|
||||
{{on "click" (action "togglePlan" "free")}}
|
||||
{{on "click" (action "toggleTier" tier.id)}}
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>Free</p>
|
||||
<p>{{tier.name}}</p>
|
||||
</label>
|
||||
</div>
|
||||
{{#each this.tiers as |tier|}}
|
||||
<div class="form-group mb0 for-checkbox">
|
||||
<label
|
||||
class="checkbox"
|
||||
for={{tier.id}}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
id={{tier.id}}
|
||||
name={{tier.id}}
|
||||
checked={{tier.checked}}
|
||||
disabled={{or
|
||||
(not this.membersUtils.isStripeEnabled)
|
||||
(not-eq this.settings.membersSignupAccess "all")
|
||||
}}
|
||||
class="gh-input post-settings-featured"
|
||||
{{on "click" (action "toggleTier" tier.id)}}
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>{{tier.name}}</p>
|
||||
</label>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{#if this.showPortalPrices}}
|
||||
<div class="mb3 {{if (and (feature "multipleProducts") this.showPortalTiers) "mt5" ""}}">
|
||||
<div class="mb3 mt5">
|
||||
<h4 class="gh-portal-setting-title">Prices available at signup</h4>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#unless this.showPortalTiers}}
|
||||
<div class="form-group mb0 for-checkbox">
|
||||
<label
|
||||
class="checkbox"
|
||||
for="free-plan"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={{this.membersUtils.isFreeChecked}}
|
||||
id="free-plan"
|
||||
name="free-plan"
|
||||
disabled={{or
|
||||
(not this.membersUtils.isStripeEnabled)
|
||||
(not-eq this.settings.membersSignupAccess "all")
|
||||
}}
|
||||
class="gh-input post-settings-featured"
|
||||
{{on "click" (action "togglePlan" "free")}}
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>Free</p>
|
||||
</label>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{#if this.showPortalPrices}}
|
||||
<div class="form-group mb0 for-checkbox">
|
||||
<label
|
||||
|
@ -371,7 +346,7 @@
|
|||
<div class="gh-portal-preview-container {{if this.showLinksPage "hide"}}">
|
||||
<div class="gh-portal-site-frame-cover"> </div>
|
||||
<GhSiteIframe
|
||||
class="gh-portal-siteiframe {{if (feature "multipleProducts") "gh-portal-siteiframe-enabled"}}"
|
||||
class="gh-portal-siteiframe gh-portal-siteiframe-enabled"
|
||||
@src={{this.portalPreviewUrl}}
|
||||
@guid={{this.portalPreviewGuid}}
|
||||
@invisibleUntilLoaded="portal-ready" />
|
||||
|
|
|
@ -110,18 +110,7 @@ export default ModalComponent.extend({
|
|||
return tiers;
|
||||
}),
|
||||
|
||||
showPortalTiers: computed('tiers', 'feature.multipleProducts', function () {
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}),
|
||||
|
||||
showPortalPrices: computed('tiers', 'feature.multipleProducts', function () {
|
||||
if (!this.feature.get('multipleProducts')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
showPortalPrices: computed('tiers', function () {
|
||||
const visibleTiers = this.model.tiers?.filter((tier) => {
|
||||
return tier.visibility === 'public' && tier.type === 'paid';
|
||||
});
|
||||
|
|
|
@ -104,24 +104,22 @@
|
|||
<p class="response w-100"><span class="red">{{this.stripePlanError}}</span></p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{#if (feature "tierWelcomePages")}}
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.model.tier.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
/>
|
||||
{{#if this.isFreeTier}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
{{else}}
|
||||
<p>Redirect to this URL after signup for premium membership</p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.model.tier.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
/>
|
||||
{{#if this.isFreeTier}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
{{else}}
|
||||
<p>Redirect to this URL after signup for premium membership</p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ export default class SettingsMembersDefaultPostAccess extends Component {
|
|||
@tracked showSegmentError;
|
||||
|
||||
get options() {
|
||||
const defaultOptions = [{
|
||||
return [{
|
||||
name: 'Public',
|
||||
description: 'All site visitors to your site, no login required',
|
||||
value: 'public',
|
||||
|
@ -27,21 +27,17 @@ export default class SettingsMembersDefaultPostAccess extends Component {
|
|||
value: 'paid',
|
||||
icon: 'members-paid',
|
||||
icon_color: 'pink'
|
||||
}, {
|
||||
name: 'Specific tier(s)',
|
||||
description: 'Members with any of the selected tiers',
|
||||
value: 'tiers',
|
||||
icon: 'members-segment',
|
||||
icon_color: 'yellow'
|
||||
}];
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
defaultOptions.push({
|
||||
name: 'Specific tier(s)',
|
||||
description: 'Members with any of the selected tiers',
|
||||
value: 'tiers',
|
||||
icon: 'members-segment',
|
||||
icon_color: 'yellow'
|
||||
});
|
||||
}
|
||||
return defaultOptions;
|
||||
}
|
||||
|
||||
get hasVisibilityFilter() {
|
||||
return this.feature.get('multipleProducts') && !['public', 'members', 'paid'].includes(this.settings.get('defaultContentVisibility'));
|
||||
return !['public', 'members', 'paid'].includes(this.settings.get('defaultContentVisibility'));
|
||||
}
|
||||
|
||||
get visibilityTiers() {
|
||||
|
|
|
@ -69,31 +69,29 @@ export default class TiersSegmentSelect extends Component {
|
|||
*fetchOptionsTask() {
|
||||
const options = yield [];
|
||||
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
// fetch all tiers with count
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
this.tiers = tiers;
|
||||
// fetch all tiers with count
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const tiers = yield this.store.query('tier', {filter: 'type:paid', limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
this.tiers = tiers;
|
||||
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
if (tiers.length > 0) {
|
||||
const tiersGroup = {
|
||||
groupName: 'Tiers',
|
||||
options: []
|
||||
};
|
||||
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
id: tier.id,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
tiers.forEach((tier) => {
|
||||
tiersGroup.options.push({
|
||||
name: tier.name,
|
||||
id: tier.id,
|
||||
count: tier.count?.members,
|
||||
class: 'segment-tier'
|
||||
});
|
||||
});
|
||||
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.tiers) {
|
||||
this.setSegment([tiersGroup.options[0]]);
|
||||
}
|
||||
options.push(tiersGroup);
|
||||
if (this.args.selectDefaultTier && !this.args.tiers) {
|
||||
this.setSegment([tiersGroup.options[0]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,13 +111,8 @@ export default class OffersController extends Controller {
|
|||
let yearlyLabel;
|
||||
const tierCurrency = tier.monthlyPrice.currency;
|
||||
const tierCurrencySymbol = tierCurrency.toUpperCase();
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
monthlyLabel = `${tier.name} - Monthly (${ghPriceAmount(tier.monthlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
yearlyLabel = `${tier.name} - Yearly (${ghPriceAmount(tier.yearlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
} else {
|
||||
monthlyLabel = `Monthly (${ghPriceAmount(tier.monthlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
yearlyLabel = `Yearly (${ghPriceAmount(tier.yearlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
}
|
||||
monthlyLabel = `${tier.name} - Monthly (${ghPriceAmount(tier.monthlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
yearlyLabel = `${tier.name} - Yearly (${ghPriceAmount(tier.yearlyPrice.amount)} ${tierCurrencySymbol})`;
|
||||
|
||||
cadences.push({
|
||||
label: monthlyLabel,
|
||||
|
|
|
@ -50,7 +50,6 @@ export default class LabsController extends Controller {
|
|||
importSuccessful = false;
|
||||
showDeleteAllModal = false;
|
||||
showEarlyAccessModal = false;
|
||||
showEnableTiersModal = false;
|
||||
submitting = false;
|
||||
uploadButtonText = 'Import';
|
||||
importMimeType = null;
|
||||
|
@ -159,11 +158,6 @@ export default class LabsController extends Controller {
|
|||
this.toggleProperty('showEarlyAccessModal');
|
||||
}
|
||||
|
||||
@action
|
||||
toggleEnableTiersModal() {
|
||||
this.toggleProperty('showEnableTiersModal');
|
||||
}
|
||||
|
||||
@action
|
||||
async toggleIsOAuthEnabled() {
|
||||
if (this.isOAuthEnabled) {
|
||||
|
|
|
@ -361,36 +361,17 @@ export default class MembersAccessController extends Controller {
|
|||
|
||||
@task({drop: true})
|
||||
*saveSettingsTask(options) {
|
||||
if (!this.feature.get('multipleProducts')) {
|
||||
yield this.validateStripePlans({updatePortalPreview: false});
|
||||
|
||||
if (this.stripePlanError) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.settings.get('errors').length !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
yield this.saveTier();
|
||||
const result = yield this.settings.save();
|
||||
|
||||
this.updatePortalPreview(options);
|
||||
|
||||
return result;
|
||||
} else {
|
||||
if (this.settings.get('errors').length !== 0) {
|
||||
return;
|
||||
}
|
||||
// When no filer is selected in `Specific tier(s)` option
|
||||
if (!this.settings.get('defaultContentVisibility')) {
|
||||
return;
|
||||
}
|
||||
const result = yield this.settings.save();
|
||||
yield this.freeTier.save();
|
||||
this.updatePortalPreview(options);
|
||||
return result;
|
||||
if (this.settings.get('errors').length !== 0) {
|
||||
return;
|
||||
}
|
||||
// When no filer is selected in `Specific tier(s)` option
|
||||
if (!this.settings.get('defaultContentVisibility')) {
|
||||
return;
|
||||
}
|
||||
const result = yield this.settings.save();
|
||||
yield this.freeTier.save();
|
||||
this.updatePortalPreview(options);
|
||||
return result;
|
||||
}
|
||||
|
||||
async saveTier() {
|
||||
|
|
|
@ -56,7 +56,6 @@ export default class FeatureService extends Service {
|
|||
nightShift;
|
||||
|
||||
// labs flags
|
||||
@feature('multipleProducts') multipleProducts;
|
||||
@feature('dashboardV5') dashboardV5;
|
||||
@feature('oauthLogin') oauthLogin;
|
||||
@feature('membersActivity') membersActivity;
|
||||
|
@ -66,8 +65,6 @@ export default class FeatureService extends Service {
|
|||
@feature('multipleNewslettersUI') multipleNewslettersUI;
|
||||
@feature('tweetGridCard') tweetGridCard;
|
||||
@feature('improvedOnboarding') improvedOnboarding;
|
||||
@feature('tierWelcomePages') tierWelcomePages;
|
||||
@feature('tierName') tierName;
|
||||
@feature('membersTableStatus') membersTableStatus;
|
||||
@feature('selectablePortalLinks') selectablePortalLinks;
|
||||
@feature('publishingFlow') publishingFlow;
|
||||
|
|
|
@ -121,7 +121,7 @@ export default class MembersUtilsService extends Service {
|
|||
settingsParam.append('portalPrices', encodeURIComponent(portalPlans));
|
||||
}
|
||||
|
||||
if (portalTiers && this.feature.get('multipleProducts')) {
|
||||
if (portalTiers) {
|
||||
settingsParam.append('portalProducts', encodeURIComponent(portalTiers));
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,7 @@
|
|||
</h4>
|
||||
<div class="gh-main-section-content grey">
|
||||
<GhFormGroup @errors={{this.errors}} @property="product-cadence">
|
||||
{{#if (feature "multipleProducts")}}
|
||||
<label for="product-cadence" class="fw6">Tier – cadence</label>
|
||||
{{else}}
|
||||
<label for="product-cadence" class="fw6">Cadence</label>
|
||||
{{/if}}
|
||||
<span class="gh-select">
|
||||
<OneWaySelect
|
||||
@value={{this.cadence}}
|
||||
|
|
|
@ -47,10 +47,8 @@
|
|||
<h3>{{offer.name}}</h3>
|
||||
</LinkTo>
|
||||
<LinkTo @route="offer" @model={{offer}} class="gh-list-data">
|
||||
{{#if (feature "multipleProducts")}}
|
||||
<span>{{offer.tier.name}}</span>
|
||||
<span class="midgrey">-</span>
|
||||
{{/if}}
|
||||
<span>{{offer.tier.name}}</span>
|
||||
<span class="midgrey">-</span>
|
||||
<span class="midgrey">{{if (eq offer.cadence 'month') 'Monthly' 'Yearly'}} </span>
|
||||
</LinkTo>
|
||||
<LinkTo @route="offer" @model={{offer}} class="gh-list-data">
|
||||
|
|
|
@ -359,9 +359,3 @@
|
|||
@close={{action "toggleDeleteAllModal"}}
|
||||
@modifier="action wide" />
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showEnableTiersModal}}
|
||||
<GhFullscreenModal @modal="enable-tiers"
|
||||
@close={{action "toggleEnableTiersModal"}}
|
||||
@modifier="action wide" />
|
||||
{{/if}}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="gh-setting-members-portalpreview">
|
||||
<div class="gh-setting-members-portal-mock {{if (feature "multipleProducts") "mock-enabled"}}">
|
||||
<div class="gh-setting-members-portal-mock mock-enabled">
|
||||
{{#if (or (eq this.settings.membersSignupAccess 'none') this.switchFromNoneTask.isRunning)}}
|
||||
<div class="gh-setting-members-portal-disabled" data-test-portal-preview-disabled>
|
||||
<span class="lightgrey">{{svg-jar "portal-logo-stroke"}}</span>
|
||||
|
@ -91,46 +91,24 @@
|
|||
<div class="gh-expandable-content">
|
||||
{{#liquid-if this.freeOpen}}
|
||||
<div class="gh-setting-content-extended" data-test-free-settings-expanded>
|
||||
{{#if (feature "multipleProducts")}}
|
||||
<GhTierCard
|
||||
@tier={{this.freeTier}}
|
||||
@tiers={{this.tiers}}
|
||||
@openEditTier={{this.openEditTier}}
|
||||
<GhTierCard
|
||||
@tier={{this.freeTier}}
|
||||
@tiers={{this.tiers}}
|
||||
@openEditTier={{this.openEditTier}}
|
||||
/>
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.freeTier.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
data-test-input="free-welcome-page"
|
||||
/>
|
||||
{{/if}}
|
||||
{{#if (or (not (feature "tierWelcomePages")) (not (feature "multipleProducts")))}}
|
||||
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="free-welcome-page">
|
||||
<label for="freeWelcomePage">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="freeWelcomePage"
|
||||
@value={{readonly this.settings.membersFreeSignupRedirect}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setFreeSignupRedirect}}
|
||||
@validateUrl={{this.validateFreeSignupRedirect}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
data-test-input="old-free-welcome-page"
|
||||
/>
|
||||
<GhErrorMessage
|
||||
@errors={{this.settings.errors}}
|
||||
@property="membersFreeSignupRedirect"
|
||||
/>
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
</GhFormGroup>
|
||||
{{else}}
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.freeTier.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
data-test-input="free-welcome-page"
|
||||
/>
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
</GhFormGroup>
|
||||
</div>
|
||||
{{/liquid-if}}
|
||||
</div>
|
||||
|
@ -167,82 +145,11 @@
|
|||
{{#if this.fetchDefaultTier.isRunning}}
|
||||
Loading...
|
||||
{{else}}
|
||||
{{#if (feature "multipleProducts")}}
|
||||
<GhMembershipTiersAlpha
|
||||
@updatePortalPreview={{this.updatePortalPreview}}
|
||||
@tiers={{this.paidTiers}}
|
||||
@confirmTierSave={{this.confirmTierSave}}
|
||||
/>
|
||||
{{else}}
|
||||
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="prices">
|
||||
<div class="gh-settings-members-pricelabelcont">
|
||||
<label for="monthlyPrice">Prices</label>
|
||||
<span>–</span>
|
||||
<div>
|
||||
<span class="gh-setting-members-currency gh-select">
|
||||
<div class="gh-setting-members-currencylabel">
|
||||
<span>{{this.currency}}</span>
|
||||
{{svg-jar "arrow-down-small"}}
|
||||
</div>
|
||||
<OneWaySelect
|
||||
@value={{this.selectedCurrency}}
|
||||
id="currency"
|
||||
name="currency"
|
||||
@options={{readonly this.allCurrencies}}
|
||||
@optionValuePath="value"
|
||||
@optionLabelPath="label"
|
||||
@update={{this.setStripePlansCurrency}}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gh-setting-members-prices">
|
||||
|
||||
<div class="gh-input-group">
|
||||
<GhTextInput
|
||||
@id="monthlyPrice"
|
||||
@value={{readonly this.stripeMonthlyAmount}}
|
||||
@type="number"
|
||||
@input={{action (mut this.stripeMonthlyAmount) value="target.value"}}
|
||||
@focus-out={{action "validateStripePlans"}}
|
||||
/>
|
||||
<span class="gh-input-append"><span class="ttu">{{this.currency}}</span>/month</span>
|
||||
</div>
|
||||
<div class="gh-input-group">
|
||||
<GhTextInput
|
||||
@id="yearlyPrice"
|
||||
@value={{readonly this.stripeYearlyAmount}}
|
||||
@type="number"
|
||||
@input={{action (mut this.stripeYearlyAmount) value="target.value"}}
|
||||
@focus-out={{this.validateStripePlans}}
|
||||
@placeholder=''
|
||||
data-test-title-input={{true}}
|
||||
/>
|
||||
<span class="gh-input-append"><span class="ttu">{{this.currency}}</span>/year</span>
|
||||
</div>
|
||||
</div>
|
||||
{{#if this.stripePlanError}}
|
||||
<p class="response w-100"><span class="red">{{this.stripePlanError}}</span></p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
{{#if (or (not (feature "tierWelcomePages")) (not (feature "multipleProducts")))}}
|
||||
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="paid-welcome-page">
|
||||
<label for="paidWelcomePage">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@value={{readonly this.settings.membersPaidSignupRedirect}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setPaidSignupRedirect}}
|
||||
@validateUrl={{this.validatePaidSignupRedirect}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
/>
|
||||
<GhErrorMessage
|
||||
@errors={{this.settings.errors}}
|
||||
@property="membersPaidSignupRedirect"
|
||||
/>
|
||||
<p>Redirect to this URL after signup for premium membership</p>
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
<GhMembershipTiersAlpha
|
||||
@updatePortalPreview={{this.updatePortalPreview}}
|
||||
@tiers={{this.paidTiers}}
|
||||
@confirmTierSave={{this.confirmTierSave}}
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/liquid-if}}
|
||||
|
|
|
@ -73,7 +73,11 @@ export default [
|
|||
{
|
||||
id: 12,
|
||||
key: 'labs',
|
||||
value: '{}',
|
||||
value: JSON.stringify({
|
||||
// Keep the GA flags that are not yet cleaned up in frontend code here
|
||||
multipleNewsletters: true,
|
||||
multipleNewslettersUI: true
|
||||
}),
|
||||
group: 'labs',
|
||||
created_at: '2015-01-12T18:29:01.000Z',
|
||||
created_by: 1,
|
||||
|
|
|
@ -6,7 +6,6 @@ import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-sup
|
|||
import {beforeEach, describe, it} from 'mocha';
|
||||
import {blur, click, currentRouteName, currentURL, fillIn, find, findAll, triggerEvent} from '@ember/test-helpers';
|
||||
import {datepickerSelect} from 'ember-power-datepicker/test-support';
|
||||
import {enableLabsFlag} from '../helpers/labs-flag';
|
||||
import {enableMailgun} from '../helpers/mailgun';
|
||||
import {enableNewsletters} from '../helpers/newsletters';
|
||||
import {enableStripe} from '../helpers/stripe';
|
||||
|
@ -845,7 +844,6 @@ describe('Acceptance: Editor', function () {
|
|||
const role = this.server.create('role', {name: 'Administrator'});
|
||||
user = this.server.create('user', {roles: [role]});
|
||||
this.server.loadFixtures('settings');
|
||||
enableLabsFlag(this.server, 'multipleNewsletters');
|
||||
return await authenticateSession();
|
||||
});
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ describe('Acceptance: Member details', function () {
|
|||
this.server.loadFixtures('settings');
|
||||
enableLabsFlag(this.server, 'membersLastSeenFilter');
|
||||
enableLabsFlag(this.server, 'membersTimeFilters');
|
||||
enableLabsFlag(this.server, 'multipleProducts');
|
||||
|
||||
enableStripe(this.server);
|
||||
enableNewsletters(this.server, true);
|
||||
|
|
|
@ -3,7 +3,6 @@ import sinon from 'sinon';
|
|||
import {authenticateSession} from 'ember-simple-auth/test-support';
|
||||
import {blur, click, currentURL, fillIn, find, findAll, focus} from '@ember/test-helpers';
|
||||
import {datepickerSelect} from 'ember-power-datepicker/test-support';
|
||||
import {enableLabsFlag} from '../../helpers/labs-flag';
|
||||
import {enableNewsletters} from '../../helpers/newsletters';
|
||||
import {enableStripe} from '../../helpers/stripe';
|
||||
import {expect} from 'chai';
|
||||
|
@ -21,7 +20,6 @@ describe('Acceptance: Members filtering', function () {
|
|||
beforeEach(async function () {
|
||||
this.server.loadFixtures('configs');
|
||||
this.server.loadFixtures('settings');
|
||||
enableLabsFlag(this.server, 'multipleProducts');
|
||||
enableStripe(this.server);
|
||||
enableNewsletters(this.server, true);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support';
|
||||
import {blur, click, currentURL, fillIn, find, findAll} from '@ember/test-helpers';
|
||||
import {enableLabsFlag} from '../../helpers/labs-flag';
|
||||
import {expect} from 'chai';
|
||||
import {setupApplicationTest} from 'ember-mocha';
|
||||
import {setupMirage} from 'ember-cli-mirage/test-support';
|
||||
|
@ -11,9 +10,6 @@ describe('Acceptance: Settings - Membership', function () {
|
|||
setupMirage(hooks);
|
||||
|
||||
beforeEach(function () {
|
||||
enableLabsFlag(this.server, 'multipleProducts');
|
||||
enableLabsFlag(this.server, 'tierWelcomePages');
|
||||
enableLabsFlag(this.server, 'tierName');
|
||||
});
|
||||
|
||||
beforeEach(async function () {
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import {authenticateSession} from 'ember-simple-auth/test-support';
|
||||
import {click, currentURL, fillIn, find, findAll} from '@ember/test-helpers';
|
||||
import {enableLabsFlag} from '../../helpers/labs-flag';
|
||||
import {expect} from 'chai';
|
||||
import {setupApplicationTest} from 'ember-mocha';
|
||||
import {setupMirage} from 'ember-cli-mirage/test-support';
|
||||
import {visit} from '../../helpers/visit';
|
||||
|
||||
describe('Acceptance: Settings - Newsletters (multipleNewslettersUI)', function () {
|
||||
describe('Acceptance: Settings - Newsletters', function () {
|
||||
const hooks = setupApplicationTest();
|
||||
setupMirage(hooks);
|
||||
|
||||
|
@ -16,9 +15,6 @@ describe('Acceptance: Settings - Newsletters (multipleNewslettersUI)', function
|
|||
const role = this.server.create('role', {name: 'Owner'});
|
||||
this.server.create('user', {roles: [role]});
|
||||
|
||||
enableLabsFlag(this.server, 'multipleNewsletters');
|
||||
enableLabsFlag(this.server, 'multipleNewslettersUI');
|
||||
|
||||
return await authenticateSession();
|
||||
});
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ describe('Integration: Component: gh-psm-visibility-input', function () {
|
|||
await render(hbs`{{gh-psm-visibility-input post=post}}`);
|
||||
|
||||
expect(this.element, 'top-level elements').to.exist;
|
||||
expect(findAll('option'), 'number of options').to.have.length(3);
|
||||
expect(findAll('option'), 'number of options').to.have.length(4);
|
||||
expect(find('select').value, 'selected option value').to.equal('members');
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ describe('Integration: Component: gh-psm-visibility-input', function () {
|
|||
await render(hbs`{{gh-psm-visibility-input post=post}}`);
|
||||
|
||||
expect(this.element, 'top-level elements').to.exist;
|
||||
expect(findAll('option'), 'number of options').to.have.length(3);
|
||||
expect(findAll('option'), 'number of options').to.have.length(4);
|
||||
expect(find('select').value, 'selected option value').to.equal('public');
|
||||
|
||||
await fillIn('select', 'paid');
|
||||
|
|
Loading…
Add table
Reference in a new issue