diff --git a/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx b/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx index ba7f77258711e..b6d7e281e6981 100644 --- a/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx @@ -38,12 +38,13 @@ import { ResourceKind, } from 'teleport/Discover/Shared'; import { + BASE_RESOURCES, getResourcePretitle, - RESOURCES, } from 'teleport/Discover/SelectResource/resources'; import AddApp from 'teleport/Apps/AddApp'; import { useUser } from 'teleport/User/UserContext'; import { storageService } from 'teleport/services/storageService'; +import cfg from 'teleport/config'; import { resourceKindToPreferredResource } from 'teleport/Discover/Shared/ResourceKind'; @@ -51,6 +52,7 @@ import { getMarketingTermMatches } from './getMarketingTermMatches'; import { DiscoverIcon } from './icons'; import { PrioritizedResources, SearchResource } from './types'; +import { SAML_APPLICATIONS } from './resourcesE'; import type { ResourceSpec } from './types'; @@ -73,6 +75,9 @@ export function SelectResource({ onSelect }: SelectResourceProps) { const [resources, setResources] = useState([]); const [defaultResources, setDefaultResources] = useState([]); const [showApp, setShowApp] = useState(false); + const RESOURCES = !cfg.isEnterprise + ? BASE_RESOURCES + : [...BASE_RESOURCES, ...SAML_APPLICATIONS]; function onSearch(s: string, customList?: ResourceSpec[]) { const list = customList || defaultResources; diff --git a/web/packages/teleport/src/Discover/SelectResource/resources.tsx b/web/packages/teleport/src/Discover/SelectResource/resources.tsx index a918f659906ce..83c920d0bf121 100644 --- a/web/packages/teleport/src/Discover/SelectResource/resources.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/resources.tsx @@ -21,7 +21,6 @@ import { Platform } from 'design/platform'; import { assertUnreachable } from 'shared/utils/assertUnreachable'; import { DiscoverEventResource } from 'teleport/services/userEvent'; -import cfg from 'teleport/config'; import { ResourceKind } from '../Shared/ResourceKind'; @@ -37,7 +36,6 @@ import { ResourceSpec, ServerLocation, } from './types'; -import { SAML_APPLICATIONS } from './resourcesE'; const baseServerKeywords = 'server node'; const awsKeywords = 'aws amazon '; @@ -151,7 +149,7 @@ export const KUBERNETES: ResourceSpec[] = [ }, ]; -const BASE_RESOURCES: ResourceSpec[] = [ +export const BASE_RESOURCES: ResourceSpec[] = [ ...APPLICATIONS, ...KUBERNETES, ...WINDOWS_DESKTOPS, @@ -161,10 +159,6 @@ const BASE_RESOURCES: ResourceSpec[] = [ ...DATABASES_UNGUIDED_DOC, ]; -export const RESOURCES = !cfg.isEnterprise - ? BASE_RESOURCES - : [...BASE_RESOURCES, ...SAML_APPLICATIONS]; - export function getResourcePretitle(r: ResourceSpec) { if (!r) { return {};