web/satellite: Implement coupon code billing UI enabled flag
This flag was previously implemented, but when we reworked the billing UI, we forgot to re-implement it with the new screens. This change fixes that. Change-Id: Ifad2b82f1080928b72d7e572796fcf4287e5ed3f
This commit is contained in:
parent
dc9cbe36ae
commit
f8e8f3a4cc
@ -17,6 +17,7 @@
|
||||
<p class="coupon-area__wrapper__coupon__expiration">{{ expiration }}</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="couponCodeBillingUIEnabled"
|
||||
class="coupon-area__wrapper__add-coupon"
|
||||
@click="toggleCreateModal"
|
||||
>
|
||||
@ -94,10 +95,20 @@ const isActive = computed((): boolean => {
|
||||
return !!c && (c.duration === 'forever' || (!!c.expiresAt && now < c.expiresAt.getTime()));
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the whether applying a new coupon is enabled.
|
||||
*/
|
||||
const couponCodeBillingUIEnabled = computed((): boolean => {
|
||||
return store.state.appStateModule.couponCodeBillingUIEnabled;
|
||||
});
|
||||
|
||||
/**
|
||||
* Opens Add Coupon modal.
|
||||
*/
|
||||
function toggleCreateModal(): void {
|
||||
if (!couponCodeBillingUIEnabled) {
|
||||
return;
|
||||
}
|
||||
analytics.eventTriggered(AnalyticsEvent.APPLY_NEW_COUPON_CLICKED);
|
||||
store.commit(APP_STATE_MUTATIONS.UPDATE_ACTIVE_MODAL, MODALS.newBillingAddCoupon);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user