hide subscription, payment cards and invoices in profile menu when is 'Allow subscription payment' option disabled

frontend build
This commit is contained in:
Peter Papp
2020-08-30 11:05:08 +02:00
parent 8895b5062a
commit ab65ca7a13
10 changed files with 17 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
<PageTab :is-loading="isLoading" class="form-fixed-width">
<!--Stripe Information-->
<PageTabGroup v-if="config.stripe_public_key">
<PageTabGroup v-if="config.stripe_public_key && payments">
<div class="form block-form">
<FormLabel>{{ $t('admin_settings.payments.section_payments') }}</FormLabel>
<InfoBox>
@@ -143,10 +143,7 @@
isLoading: true,
isError: false,
errorMessage: '',
payments: {
status: 1,
configured: undefined,
},
payments: undefined,
stripeCredentials: {
key: '',
secret: '',
@@ -746,8 +743,10 @@
.then(response => {
this.isLoading = false
this.payments.configured = parseInt(response.data.payments_configured)
this.payments.status = parseInt(response.data.payments_active)
this.payments = {
configured: parseInt(response.data.payments_configured),
status: parseInt(response.data.payments_active),
}
})
}
}

View File

@@ -172,7 +172,7 @@
return this.user.data.attributes.subscription ? 'green' : 'purple'
},
canShowSubscriptionSettings() {
return this.config.isSaaS
return this.config.isSaaS && this.config.app_payments_active
},
canShowUpgradeWarning() {
return this.config.storageLimit && this.user.relationships.storage.data.attributes.used > 95