From 736e497653e652abd1cc7219d21638c1929c9332 Mon Sep 17 00:00:00 2001 From: Michelle Bergquist Date: Thu, 25 Jul 2024 07:57:04 -0600 Subject: [PATCH] leverage entitlements instead of legacy feature fields --- .../src/Sessions/Sessions.story.test.tsx | 1 - .../Sessions.story.test.tsx.snap | 2 +- .../teleport/src/Sessions/useSessions.ts | 2 +- .../src/Support/Support.story.test.tsx | 1 - .../__snapshots__/Support.story.test.tsx.snap | 2 +- web/packages/teleport/src/config.ts | 36 ++++++------------- .../teleport/src/services/sales/index.ts | 8 +---- web/packages/teleport/src/teleportContext.tsx | 14 +++----- 8 files changed, 19 insertions(+), 47 deletions(-) diff --git a/web/packages/teleport/src/Sessions/Sessions.story.test.tsx b/web/packages/teleport/src/Sessions/Sessions.story.test.tsx index dbb5002e0789d..10bf08e92a4ed 100644 --- a/web/packages/teleport/src/Sessions/Sessions.story.test.tsx +++ b/web/packages/teleport/src/Sessions/Sessions.story.test.tsx @@ -35,7 +35,6 @@ test('loaded', async () => { }); test('active sessions CTA', async () => { - cfg.isTeam = true; cfg.isEnterprise = true; const { container } = render(); await screen.findByText(/cluster: teleport/i); diff --git a/web/packages/teleport/src/Sessions/__snapshots__/Sessions.story.test.tsx.snap b/web/packages/teleport/src/Sessions/__snapshots__/Sessions.story.test.tsx.snap index 4e9e0354472ec..346100854617f 100644 --- a/web/packages/teleport/src/Sessions/__snapshots__/Sessions.story.test.tsx.snap +++ b/web/packages/teleport/src/Sessions/__snapshots__/Sessions.story.test.tsx.snap @@ -590,7 +590,7 @@ exports[`active sessions CTA 1`] = ` class="c8" fill="filled" height="36px" - href="https://goteleport.com/r/upgrade-team?e_4.4.0-dev&utm_campaign=CTA_ACTIVE_SESSIONS" + href="https://goteleport.com/r/upgrade-igs?e_4.4.0-dev&utm_campaign=CTA_ACTIVE_SESSIONS" rel="noreferrer" style="text-transform: none;" target="blank" diff --git a/web/packages/teleport/src/Sessions/useSessions.ts b/web/packages/teleport/src/Sessions/useSessions.ts index e3cb8e148fa27..15c647ccad097 100644 --- a/web/packages/teleport/src/Sessions/useSessions.ts +++ b/web/packages/teleport/src/Sessions/useSessions.ts @@ -58,6 +58,6 @@ export default function useSessions(ctx: Ctx, clusterId: string) { sessions, // moderated is available with any enterprise editions showModeratedSessionsCTA: !ctx.isEnterprise, - showActiveSessionsCTA: !cfg.joinActiveSessions, + showActiveSessionsCTA: !cfg.entitlements.JoinActiveSessions.enabled, }; } diff --git a/web/packages/teleport/src/Support/Support.story.test.tsx b/web/packages/teleport/src/Support/Support.story.test.tsx index 8fde26fe5d62f..3ea53548a37b7 100644 --- a/web/packages/teleport/src/Support/Support.story.test.tsx +++ b/web/packages/teleport/src/Support/Support.story.test.tsx @@ -69,7 +69,6 @@ test('support Enterprise', () => { test('support Enterprise with CTA', () => { cfg.isEnterprise = true; - cfg.isTeam = true; const { container } = render( diff --git a/web/packages/teleport/src/Support/__snapshots__/Support.story.test.tsx.snap b/web/packages/teleport/src/Support/__snapshots__/Support.story.test.tsx.snap index c97dccf549604..9fef25df0cafe 100644 --- a/web/packages/teleport/src/Support/__snapshots__/Support.story.test.tsx.snap +++ b/web/packages/teleport/src/Support/__snapshots__/Support.story.test.tsx.snap @@ -1168,7 +1168,7 @@ exports[`support Enterprise with CTA 1`] = `