0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Updated set pricing wizard if custom price exists

no refs

If a custom price is already set before completing the wizard, the set pricing wizard hides the UI to create default custom prices as it doesn't make sense and instead shows a custom message.
This commit is contained in:
Rishabh 2021-05-11 00:17:28 +05:30
parent 67d0c94c40
commit d3ac517056
2 changed files with 126 additions and 116 deletions

View file

@ -1,4 +1,7 @@
<div class="gh-launch-wizard-settings-container"> <div class="gh-launch-wizard-settings-container">
{{#if this.isHidden}}
<p> Price already set</p>
{{else}}
<div class="gh-stack overflow-y-auto flex-grow-1"> <div class="gh-stack overflow-y-auto flex-grow-1">
<div class="gh-stack-item flex-column"> <div class="gh-stack-item flex-column">
<div class="w-100"> <div class="w-100">
@ -120,6 +123,7 @@
</div> </div>
</div> </div>
</div> </div>
{{/if}}
<div class="gh-launch-wizard-nav-buttons"> <div class="gh-launch-wizard-nav-buttons">
<button type="button" class="gh-btn gh-btn-outline gh-btn-icon-dark gh-btn-large w-30" {{on "click" @backStep}}><span>{{svg-jar "arrow-left-tail"}}</span></button> <button type="button" class="gh-btn gh-btn-outline gh-btn-icon-dark gh-btn-large w-30" {{on "click" @backStep}}><span>{{svg-jar "arrow-left-tail"}}</span></button>

View file

@ -41,6 +41,13 @@ export default class GhLaunchWizardSetPricingComponent extends Component {
return true; return true;
} }
get isHidden() {
if (this.product) {
return this.product.get('stripePrices') && this.product.get('stripePrices').length > 0;
}
return true;
}
get isPaidPriceDisabled() { get isPaidPriceDisabled() {
return this.disabled || !this.membersUtils.isStripeEnabled; return this.disabled || !this.membersUtils.isStripeEnabled;
} }
@ -194,7 +201,6 @@ export default class GhLaunchWizardSetPricingComponent extends Component {
...data, ...data,
product: null product: null
}); });
this.args.nextStep();
} }
} }