@growth-operations/ui-shared 1.6.6 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-operations/ui-shared",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -346,16 +346,37 @@ function LegacyBilling({ state }) {
346
346
  );
347
347
  }
348
348
 
349
+ function CompedBilling() {
350
+ return (
351
+ <Alert variant="success">
352
+ <Flex direction="column" gap="extra-small">
353
+ <Text format={{ fontWeight: "bold" }}>Free access</Text>
354
+ <Text>
355
+ Your account has been granted complimentary access as a Growth Operations partner or
356
+ team member. No payment method or subscription is required.
357
+ </Text>
358
+ </Flex>
359
+ </Alert>
360
+ );
361
+ }
362
+
349
363
  export function BillingTab({ context, state, appKey, openIframe = null }) {
350
364
  const mode = state?.entitlement?.mode;
365
+ const isSuperAdmin = state?.user?.is_super_admin === true;
351
366
 
352
367
  return (
353
368
  <Flex direction="column" gap="medium">
354
369
  <Heading>Billing</Heading>
355
- {mode === "legacy" ? (
370
+ {!isSuperAdmin ? (
371
+ <Alert variant="warning" title="Access restricted">
372
+ <Text>Billing settings are only available to super admins.</Text>
373
+ </Alert>
374
+ ) : mode === "legacy" ? (
356
375
  <LegacyBilling state={state} />
357
376
  ) : mode === "credits" ? (
358
377
  <CreditsBilling context={context} state={state} appKey={appKey} openIframe={openIframe} />
378
+ ) : mode === "comped" ? (
379
+ <CompedBilling />
359
380
  ) : (
360
381
  <TrialSubscriptionBilling context={context} state={state} appKey={appKey} openIframe={openIframe} />
361
382
  )}
@@ -50,6 +50,17 @@ export function HealthHero({ appName, state }) {
50
50
  ) : null;
51
51
  }
52
52
 
53
+ if (ent.mode === "comped") {
54
+ return (
55
+ <Flex direction="column" gap="small">
56
+ {name && <Heading>{name}</Heading>}
57
+ <Alert title="Free access" variant="success">
58
+ <Text>Partner or team member access — no subscription required.</Text>
59
+ </Alert>
60
+ </Flex>
61
+ );
62
+ }
63
+
53
64
  if (ent.mode === "credits") {
54
65
  const remaining = ent.remaining ?? 0;
55
66
  const depleted = ent.depleted === true || remaining <= 0;