From 5b2a6cc811b97a94248835635660365913877461 Mon Sep 17 00:00:00 2001
From: michaeljguarino <mjg@plural.sh>
Date: Tue, 3 Sep 2024 20:49:25 -0400
Subject: [PATCH] deprecate some growthbook code

---
 www/src/components/Plural.tsx                 | 29 +------------------
 .../marketplace/MarketplaceRepositories.tsx   |  4 +--
 .../sections/cloud/CloudCredentials.tsx       |  8 +----
 3 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/www/src/components/Plural.tsx b/www/src/components/Plural.tsx
index 0857ee7c2..e124b394f 100644
--- a/www/src/components/Plural.tsx
+++ b/www/src/components/Plural.tsx
@@ -1,8 +1,6 @@
-import { Suspense, lazy, useEffect, useState } from 'react'
+import { Suspense, lazy } from 'react'
 import { Navigate, Outlet, Route, Routes, useMatch } from 'react-router-dom'
-import { Toast } from '@pluralsh/design-system'
 
-import { growthbook } from '../helpers/growthbook'
 import { useHistory } from '../router'
 
 import { WrapStripe } from './WrapStripe'
@@ -270,30 +268,6 @@ function OAuthOrFallback() {
   )
 }
 
-function TestBanner() {
-  const [enable, setEnable] = useState(true)
-
-  useEffect(() => {
-    const timeout = setTimeout(() => setEnable(false), 5000)
-
-    return () => clearTimeout(timeout)
-  }, [])
-
-  if (growthbook.isOn('growthbook-test') && enable) {
-    return (
-      <Toast
-        severity="success"
-        marginBottom="medium"
-        marginRight="xxxxlarge"
-      >
-        Growthbook Test!
-      </Toast>
-    )
-  }
-
-  return null
-}
-
 export function PluralInner() {
   return (
     <WrapStripe>
@@ -304,7 +278,6 @@ export function PluralInner() {
             <LegacyExpirationNotice />
             <VerifyEmailConfirmed />
             <DeviceLoginNotif />
-            <TestBanner />
             <Routes>
               {/* --- OAUTH --- */}
               {/* TODO: Enable if route will be used by the app */}
diff --git a/www/src/components/marketplace/MarketplaceRepositories.tsx b/www/src/components/marketplace/MarketplaceRepositories.tsx
index fa40c8cfa..82db36417 100644
--- a/www/src/components/marketplace/MarketplaceRepositories.tsx
+++ b/www/src/components/marketplace/MarketplaceRepositories.tsx
@@ -17,8 +17,6 @@ import orderBy from 'lodash/orderBy'
 
 import { upperFirst } from 'lodash'
 
-import { growthbook } from '../../helpers/growthbook'
-
 import { ResponsiveLayoutSidecarContainer } from '../utils/layout/ResponsiveLayoutSidecarContainer'
 import { ResponsiveLayoutSpacer } from '../utils/layout/ResponsiveLayoutSpacer'
 
@@ -109,7 +107,7 @@ function MarketplaceRepositories({ publisher }: { publisher?: any }) {
 
   const isFiltered = !isEmpty(categories) || !isEmpty(tags)
   const isFilteredOrSearched = isFiltered || search
-  const shouldRenderStacks = growthbook.isOn('stacks') && !isFilteredOrSearched
+  const shouldRenderStacks = !isFilteredOrSearched
 
   useEffect(() => {
     const { current } = scrollRef
diff --git a/www/src/components/shell/onboarding/sections/cloud/CloudCredentials.tsx b/www/src/components/shell/onboarding/sections/cloud/CloudCredentials.tsx
index 2621e831e..d5741875c 100644
--- a/www/src/components/shell/onboarding/sections/cloud/CloudCredentials.tsx
+++ b/www/src/components/shell/onboarding/sections/cloud/CloudCredentials.tsx
@@ -2,14 +2,12 @@ import { useContext, useEffect, useState } from 'react'
 
 import { FormField, ListBoxItem, Select } from '@pluralsh/design-system'
 
-import { growthbook } from '../../../../../helpers/growthbook'
 import { CloudProvider, CloudProviderDisplayName } from '../../context/types'
 import { OnboardingContext } from '../../context/onboarding'
 
 import Provider from './provider/Provider'
 
 const CLOUDS = Object.values(CloudProvider)
-const GROWTHBOOK_AZURE_CLOUD_KEY = 'azure-cloud-shell'
 
 interface ProviderItem {
   key: string
@@ -21,11 +19,7 @@ function CloudCredentials() {
   const [provider, setProvider] = useState<CloudProvider>(
     cloud?.provider || CloudProvider.AWS
   )
-  const providers = (
-    growthbook.isOn(GROWTHBOOK_AZURE_CLOUD_KEY)
-      ? CLOUDS
-      : CLOUDS.filter((c) => c !== CloudProvider.Azure)
-  ).map<ProviderItem>((c) => ({
+  const providers = CLOUDS.map<ProviderItem>((c) => ({
     key: c,
     label: CloudProviderDisplayName[c],
   }))