mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Refined tiers list to switch to active list on unarchive
refs https://github.com/TryGhost/Team/issues/1252 - on unarchiving a tier, we switch back to active tier list instead of staying back on archived list
This commit is contained in:
parent
b4c3e1ae40
commit
498efd00cb
@ -29,6 +29,7 @@
|
||||
<GhProductCard
|
||||
@product={{product}}
|
||||
@openEditProduct={{this.openEditProduct}}
|
||||
@onUnarchive={{this.onUnarchive}}
|
||||
/>
|
||||
{{/each}}
|
||||
{{#if (eq this.type "active" )}}
|
||||
|
@ -57,6 +57,11 @@ export default class extends Component {
|
||||
this.showProductModal = true;
|
||||
}
|
||||
|
||||
@action
|
||||
async onUnarchive() {
|
||||
this.type = 'active';
|
||||
}
|
||||
|
||||
@action
|
||||
async openNewProduct() {
|
||||
this.productModel = this.store.createRecord('product');
|
||||
|
@ -76,7 +76,10 @@
|
||||
</li>
|
||||
{{#if (eq this.product.type "paid" )}}
|
||||
<li>
|
||||
<Settings::Members::ArchiveTier @product={{this.product}} />
|
||||
<Settings::Members::ArchiveTier
|
||||
@product={{this.product}}
|
||||
@onUnarchive={{@onUnarchive}}
|
||||
/>
|
||||
</li>
|
||||
{{/if}}
|
||||
</GhDropdown>
|
||||
|
@ -18,7 +18,6 @@ export default class ArchiveTierModalComponent extends Component {
|
||||
|
||||
try {
|
||||
yield product.save();
|
||||
|
||||
return product;
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
|
@ -13,12 +13,12 @@ export default class UnarchiveTierModalComponent extends Component {
|
||||
|
||||
@task({drop: true})
|
||||
*unarchiveTask() {
|
||||
const {product} = this.args.data;
|
||||
const {product, onUnarchive} = this.args.data;
|
||||
product.active = true;
|
||||
|
||||
try {
|
||||
yield product.save();
|
||||
|
||||
onUnarchive?.();
|
||||
return product;
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
|
@ -31,7 +31,8 @@ export default class ArchiveTierComponent extends Component {
|
||||
handleUnarchiveTier() {
|
||||
if (!this.product.isNew) {
|
||||
this.modals.open('modals/tiers/unarchive', {
|
||||
product: this.product
|
||||
product: this.product,
|
||||
onUnarchive: this.args.onUnarchive
|
||||
}, {
|
||||
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user