Hide manage or renew button when customer uses invoicing + css updates (#10436)
* Hide manage or renew button when customer uses invoicing + css updates * Remove usages of 'pro' and 'pro plan' from ui * Enterprise plan -> Enterprise on enforce single sign on * lint
This commit is contained in:
parent
a896a75f8f
commit
47933b9a92
|
@ -43,12 +43,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$: quotaUsage = $licensing.quotaUsage
|
$: quotaUsage = $licensing.quotaUsage
|
||||||
|
|
||||||
$: license = $auth.user?.license
|
$: license = $auth.user?.license
|
||||||
|
$: plan = license?.plan
|
||||||
|
$: usesInvoicing = plan?.usesInvoicing
|
||||||
|
|
||||||
$: accountPortalAccess = $auth?.user?.accountPortalAccess
|
$: accountPortalAccess = $auth?.user?.accountPortalAccess
|
||||||
$: quotaReset = quotaUsage?.quotaReset
|
$: quotaReset = quotaUsage?.quotaReset
|
||||||
$: canManagePlan =
|
$: canManagePlan =
|
||||||
($admin.cloud && accountPortalAccess) || (!$admin.cloud && $auth.isAdmin)
|
($admin.cloud && accountPortalAccess) || (!$admin.cloud && $auth.isAdmin)
|
||||||
|
|
||||||
|
$: showButton = !usesInvoicing && accountPortalAccess
|
||||||
|
|
||||||
const setMonthlyUsage = () => {
|
const setMonthlyUsage = () => {
|
||||||
monthlyUsage = []
|
monthlyUsage = []
|
||||||
if (quotaUsage.monthly) {
|
if (quotaUsage.monthly) {
|
||||||
|
@ -121,7 +127,7 @@
|
||||||
const setTextRows = () => {
|
const setTextRows = () => {
|
||||||
textRows = []
|
textRows = []
|
||||||
|
|
||||||
if (cancelAt) {
|
if (cancelAt && !usesInvoicing) {
|
||||||
textRows.push({ message: "Subscription has been cancelled" })
|
textRows.push({ message: "Subscription has been cancelled" })
|
||||||
textRows.push({
|
textRows.push({
|
||||||
message: `${getDaysRemaining(cancelAt)} days remaining`,
|
message: `${getDaysRemaining(cancelAt)} days remaining`,
|
||||||
|
@ -213,7 +219,7 @@
|
||||||
description="YOUR CURRENT PLAN"
|
description="YOUR CURRENT PLAN"
|
||||||
title={planTitle()}
|
title={planTitle()}
|
||||||
{primaryActionText}
|
{primaryActionText}
|
||||||
primaryAction={accountPortalAccess ? goToAccountPortal : undefined}
|
primaryAction={showButton ? goToAccountPortal : undefined}
|
||||||
{textRows}
|
{textRows}
|
||||||
>
|
>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -224,33 +230,23 @@
|
||||||
<Usage {usage} warnWhenFull={WARN_USAGE.includes(usage.name)} />
|
<Usage {usage} warnWhenFull={WARN_USAGE.includes(usage.name)} />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
<Layout gap="XS" noPadding>
|
||||||
|
<Heading size="S">Monthly limits</Heading>
|
||||||
|
<div class="detail">
|
||||||
|
<TooltipWrapper tooltip={new Date(quotaReset)}>
|
||||||
|
<Detail size="M">
|
||||||
|
Resets in {daysRemainingInMonth} days
|
||||||
|
</Detail>
|
||||||
|
</TooltipWrapper>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
<Layout noPadding gap="M">
|
||||||
|
{#each monthlyUsage as usage}
|
||||||
|
<Usage {usage} warnWhenFull={WARN_USAGE.includes(usage.name)} />
|
||||||
|
{/each}
|
||||||
|
</Layout>
|
||||||
</Layout>
|
</Layout>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if monthlyUsage.length}
|
|
||||||
<div class="column">
|
|
||||||
<Layout noPadding gap="M">
|
|
||||||
<Layout gap="XS" noPadding>
|
|
||||||
<Heading size="S">Monthly limits</Heading>
|
|
||||||
<div class="detail">
|
|
||||||
<TooltipWrapper tooltip={new Date(quotaReset)}>
|
|
||||||
<Detail size="M">
|
|
||||||
Resets in {daysRemainingInMonth} days
|
|
||||||
</Detail>
|
|
||||||
</TooltipWrapper>
|
|
||||||
</div>
|
|
||||||
</Layout>
|
|
||||||
<Layout noPadding gap="M">
|
|
||||||
{#each monthlyUsage as usage}
|
|
||||||
<Usage
|
|
||||||
{usage}
|
|
||||||
warnWhenFull={WARN_USAGE.includes(usage.name)}
|
|
||||||
/>
|
|
||||||
{/each}
|
|
||||||
</Layout>
|
|
||||||
</Layout>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
</DashCard>
|
</DashCard>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
<Heading>Backups</Heading>
|
<Heading>Backups</Heading>
|
||||||
{#if !$licensing.backupsEnabled}
|
{#if !$licensing.backupsEnabled}
|
||||||
<Tags>
|
<Tags>
|
||||||
<Tag icon="LockClosed">Pro plan</Tag>
|
<Tag icon="LockClosed">Premium</Tag>
|
||||||
</Tags>
|
</Tags>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -378,7 +378,7 @@
|
||||||
</div>
|
</div>
|
||||||
{#if !$licensing.enforceableSSO}
|
{#if !$licensing.enforceableSSO}
|
||||||
<Tags>
|
<Tags>
|
||||||
<Tag icon="LockClosed">Enterprise plan</Tag>
|
<Tag icon="LockClosed">Enterprise</Tag>
|
||||||
</Tags>
|
</Tags>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -213,7 +213,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
{#if isCloud && !brandingEnabled}
|
{#if isCloud && !brandingEnabled}
|
||||||
<Tags>
|
<Tags>
|
||||||
<Tag icon="LockClosed">Pro</Tag>
|
<Tag icon="LockClosed">Premium</Tag>
|
||||||
</Tags>
|
</Tags>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<Heading size="M">Groups</Heading>
|
<Heading size="M">Groups</Heading>
|
||||||
{#if !$licensing.groupsEnabled}
|
{#if !$licensing.groupsEnabled}
|
||||||
<Tags>
|
<Tags>
|
||||||
<Tag icon="LockClosed">Pro plan</Tag>
|
<Tag icon="LockClosed">Business</Tag>
|
||||||
</Tags>
|
</Tags>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue