Updated labels in offer screens when multiple tiers is disabled

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

Removes tier name from labels when multiple tiers is disabled
This commit is contained in:
Rishabh 2021-10-21 22:59:16 +05:30
parent 83eb392403
commit c69f3a4035
3 changed files with 14 additions and 5 deletions

View File

@ -16,6 +16,7 @@ export default class OffersController extends Controller {
@service settings;
@service store;
@service modals;
@service feature;
@service membersUtils;
@service notifications;
@ -104,9 +105,13 @@ export default class OffersController extends Controller {
let yearlyLabel;
const productCurrency = product.monthlyPrice.currency;
const productCurrencySymbol = productCurrency.toUpperCase();
monthlyLabel = `${product.name} - Monthly (${ghPriceAmount(product.monthlyPrice.amount)} ${productCurrencySymbol})`;
yearlyLabel = `${product.name} - Yearly (${ghPriceAmount(product.yearlyPrice.amount)} ${productCurrencySymbol})`;
if (this.feature.get('multipleProducts')) {
monthlyLabel = `${product.name} - Monthly (${ghPriceAmount(product.monthlyPrice.amount)} ${productCurrencySymbol})`;
yearlyLabel = `${product.name} - Yearly (${ghPriceAmount(product.yearlyPrice.amount)} ${productCurrencySymbol})`;
} else {
monthlyLabel = `Monthly (${ghPriceAmount(product.monthlyPrice.amount)} ${productCurrencySymbol})`;
yearlyLabel = `Yearly (${ghPriceAmount(product.yearlyPrice.amount)} ${productCurrencySymbol})`;
}
cadences.push({
label: monthlyLabel,

View File

@ -265,7 +265,7 @@ export default class MembersAccessController extends Controller {
}
const resizeEvents = ['portal-ready', 'portal-preview-updated'];
if (resizeEvents.includes(event.data.type) && event.data.payload?.height && this.portalPreviewIframe.parentNode) {
if (resizeEvents.includes(event.data.type) && event.data.payload?.height && this.portalPreviewIframe?.parentNode) {
this.portalPreviewIframe.parentNode.style.height = `${event.data.payload.height}px`;
}
};

View File

@ -42,14 +42,18 @@
</div>
<h4 class="gh-main-section-header small bn">
Discount information
Discount information
{{#if this.offer.isNew}}
<span class="midgrey">  Once saved, this cannot be changed.</span>
{{/if}}
</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}}