Help popout email support license validation check (#13133)
* Added helper function to check user plan type. * Updated help menu email support license check. * Removed stray output check * Updated function name as per feedback. * Reworked code to use the licensing store over the auth store. * Removed unnecessary variable declaration and return instead. * Updated function name to maintain consistency.
This commit is contained in:
parent
c1f4cb685c
commit
af7b6a46a9
|
@ -1,11 +1,11 @@
|
|||
<script>
|
||||
import FontAwesomeIcon from "./FontAwesomeIcon.svelte"
|
||||
import { Popover, Heading, Body } from "@budibase/bbui"
|
||||
import { licensing } from "stores/portal"
|
||||
import { isEnabled, TENANT_FEATURE_FLAGS } from "helpers/featureFlags"
|
||||
import { licensing } from "stores/portal"
|
||||
import { isPremiumOrAbove } from "helpers/planTitle"
|
||||
|
||||
$: isBusinessAndAbove =
|
||||
$licensing.isBusinessPlan || $licensing.isEnterprisePlan
|
||||
$: premiumOrAboveLicense = isPremiumOrAbove($licensing?.license.plan.type)
|
||||
|
||||
let show
|
||||
let hide
|
||||
|
@ -56,22 +56,25 @@
|
|||
<div class="divider" />
|
||||
{#if isEnabled(TENANT_FEATURE_FLAGS.LICENSING)}
|
||||
<a
|
||||
href={isBusinessAndAbove
|
||||
href={premiumOrAboveLicense
|
||||
? "mailto:support@budibase.com"
|
||||
: "/builder/portal/account/usage"}
|
||||
>
|
||||
<div class="premiumLinkContent" class:disabled={!isBusinessAndAbove}>
|
||||
<div
|
||||
class="premiumLinkContent"
|
||||
class:disabled={!premiumOrAboveLicense}
|
||||
>
|
||||
<div class="icon">
|
||||
<FontAwesomeIcon name="fa-solid fa-envelope" />
|
||||
</div>
|
||||
<Body size="S">Email support</Body>
|
||||
</div>
|
||||
{#if !isBusinessAndAbove}
|
||||
{#if !premiumOrAboveLicense}
|
||||
<div class="premiumBadge">
|
||||
<div class="icon">
|
||||
<FontAwesomeIcon name="fa-solid fa-lock" />
|
||||
</div>
|
||||
<Body size="XS">Business</Body>
|
||||
<Body size="XS">Premium</Body>
|
||||
</div>
|
||||
{/if}
|
||||
</a>
|
||||
|
|
|
@ -25,3 +25,7 @@ export function getFormattedPlanName(userPlanType) {
|
|||
}
|
||||
return `${planName} Plan`
|
||||
}
|
||||
|
||||
export function isPremiumOrAbove(userPlanType) {
|
||||
return ![PlanType.PRO, PlanType.TEAM, PlanType.FREE].includes(userPlanType)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue