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

Disabled price actions on product save

no refs

Disables Edit/Archive actions on a price while an active save is ongoing for Product to avoid unwanted states due to multiple saves being called.
This commit is contained in:
Rishabh 2021-05-09 23:28:44 +05:30
parent b762d3a873
commit f3766091bd

View file

@ -77,7 +77,8 @@
<div class="mb2">There are no prices for this product</div> <div class="mb2">There are no prices for this product</div>
{{#if this.settings.stripeConnectAccountId}} {{#if this.settings.stripeConnectAccountId}}
{{#unless this.product.isNew}} {{#unless this.product.isNew}}
<button type="button" class="gh-btn gh-btn-green" {{action "openNewPrice"}}> <button type="button" class="gh-btn gh-btn-green" {{action "openNewPrice"}}
disabled={{this.saveTask.isRunning}} >
<span>Add price</span> <span>Add price</span>
</button> </button>
{{/unless}} {{/unless}}
@ -112,11 +113,11 @@
<span>Edit</span> <span>Edit</span>
</button> </button>
{{#if price.active}} {{#if price.active}}
<button class="gh-btn gh-btn-link gh-btn-archive-toggle archived" {{action "archivePrice" price}}> <button class="gh-btn gh-btn-link gh-btn-archive-toggle archived" {{action "archivePrice" price}} disabled={{this.saveTask.isRunning}}>
<span>Archive</span> <span>Archive</span>
</button> </button>
{{else}} {{else}}
<button class="gh-btn gh-btn-link gh-btn-archive-toggle" {{action "activatePrice" price}}> <button class="gh-btn gh-btn-link gh-btn-archive-toggle" {{action "activatePrice" price}} disabled={{this.saveTask.isRunning}}>
<span>Activate</span> <span>Activate</span>
</button> </button>
{{/if}} {{/if}}