1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00

Merge pull request #7969 from Budibase/fix/update-billing-messaging

Minor update replacing upgrade terminology for billing notifications
This commit is contained in:
Rory Powell 2022-09-26 16:25:32 +01:00 committed by GitHub
commit 901a10b855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 15 deletions

View file

@ -8,7 +8,7 @@
let accountDowngradeModal
$: accountUrl = $admin.accountPortalUrl
$: upgradeUrl = `${accountUrl}/portal/upgrade`
$: billingUrl = `${accountUrl}/portal/billing`
export function show() {
accountDowngradeModal.show()
@ -24,10 +24,10 @@
title="Your account is now on the Free plan"
size="M"
showCancelButton={$auth.user.accountPortalAccess}
confirmText={$auth.user.accountPortalAccess ? "Upgrade" : "Confirm"}
confirmText={$auth.user.accountPortalAccess ? "Billing" : "Confirm"}
onConfirm={$auth.user.accountPortalAccess
? () => {
window.location.href = upgradeUrl
window.location.href = billingUrl
}
: null}
>
@ -35,7 +35,9 @@
The payment for your subscription has failed and we have downgraded your
account to the <span class="free-plan">Free plan</span>.
</Body>
<Body>Upgrade to restore full functionality.</Body>
<Body>
Please update your billing details to restore full functionality.
</Body>
{#if !$auth.user.accountPortalAccess}
<Body>Please contact the account holder to upgrade.</Body>
{/if}

View file

@ -11,7 +11,7 @@
const paymentFailedTitle = "Payment failed"
$: accountUrl = $admin.accountPortalUrl
$: upgradeUrl = `${accountUrl}/portal/upgrade`
$: billingUrl = `${accountUrl}/portal/billing`
export function show() {
paymentFailedModal.show()
@ -33,14 +33,14 @@
<ModalContent
title={paymentFailedTitle}
size="M"
confirmText="Upgrade"
confirmText="Billing"
onConfirm={() => {
window.location.href = upgradeUrl
window.location.href = billingUrl
}}
>
<Body>The payment for your subscription has failed</Body>
<Body>
Please upgrade your billing details before your account gets downgraded
Please update your billing details before your account gets downgraded
to the free plan
</Body>
<Body weight={800}>

View file

@ -10,15 +10,31 @@ const defaultCacheFn = key => {
temporalStore.actions.setExpiring(key, {}, oneDayInSeconds)
}
const defaultAction = key => {
const upgradeAction = key => {
return defaultNavigateAction(
key,
"Upgrade Plan",
`${get(admin).accountPortalUrl}/portal/upgrade`
)
}
const billingAction = key => {
return defaultNavigateAction(
key,
"Billing",
`${get(admin).accountPortalUrl}/portal/billing`
)
}
const defaultNavigateAction = (key, actionText, url) => {
if (!get(auth).user.accountPortalAccess) {
return {}
}
return {
extraButtonText: "Upgrade Plan",
extraButtonText: actionText,
extraButtonAction: () => {
defaultCacheFn(key)
window.location.href = `${get(admin).accountPortalUrl}/portal/upgrade`
window.location.href = url
},
}
}
@ -65,7 +81,7 @@ const buildUsageInfoBanner = (
? bannerConfig
: {
...bannerConfig,
...defaultAction(cacheKey),
...upgradeAction(cacheKey),
}
}
@ -84,7 +100,7 @@ const buildDayPassBanner = () => {
? ""
: "Please contact your account holder to upgrade."
}`,
...defaultAction(),
...upgradeAction(),
showCloseButton: false,
}
}
@ -115,11 +131,11 @@ const buildPaymentFailedBanner = () => {
criteria: () => {
return get(licensing)?.accountPastDue && !get(licensing).isFreePlan
},
message: `Payment Failed - Please update your billing details or your account will be downgrades in
message: `Payment Failed - Please update your billing details or your account will be downgraded in
${get(licensing)?.pastDueDaysRemaining} day${
get(licensing)?.pastDueDaysRemaining == 1 ? "" : "s"
}`,
...defaultAction(),
...billingAction(),
showCloseButton: false,
tooltip: get(licensing).pastDueEndDate,
}