diff --git a/containers/clusterForms/shared/clusterRunning/index.tsx b/containers/clusterForms/shared/clusterRunning/index.tsx index 0edd316d..ab359951 100644 --- a/containers/clusterForms/shared/clusterRunning/index.tsx +++ b/containers/clusterForms/shared/clusterRunning/index.tsx @@ -9,6 +9,10 @@ const ClusterRunning: FunctionComponent = () => { const { managementCluster } = useAppSelector(({ api }) => api); + const { clusterName, domainName, subDomainName, vaultAuth } = managementCluster ?? {}; + + const fullDomainName = `${subDomainName ? `${subDomainName}.${domainName}` : domainName}`; + const onOpenConsole = useCallback(() => { dispatch(setSelectedCluster(managementCluster)); }, [dispatch, managementCluster]); @@ -16,9 +20,9 @@ const ClusterRunning: FunctionComponent = () => { return ( ); }; diff --git a/containers/clusterForms/shared/setupForm/index.tsx b/containers/clusterForms/shared/setupForm/index.tsx index d3215cd8..b456673d 100644 --- a/containers/clusterForms/shared/setupForm/index.tsx +++ b/containers/clusterForms/shared/setupForm/index.tsx @@ -22,7 +22,6 @@ import Typography from '../../../../components/typography'; import ControlledCheckbox from '../../../../components/controlledFields/checkbox'; import { EMAIL_REGEX, LOWER_KEBAB_CASE_REGEX } from '../../../../constants'; import { InstallValues, InstallationType } from '../../../../types/redux'; -import { GitProvider } from '../../../../types'; import { EXCLUSIVE_PLUM } from '../../../../constants/colors'; import { BISCAY } from '../../../../constants/colors'; @@ -50,15 +49,15 @@ const SetupForm: FunctionComponent = () => { const subDomainHelperText = !subDomain ? '' : `${subDomain}.${domainName}`; - const { cloudDomains, cloudRegions, installationStep, installType, values, gitProvider } = - useAppSelector(({ api, installation }) => ({ + const { cloudDomains, cloudRegions, installationStep, installType, values } = useAppSelector( + ({ api, installation }) => ({ cloudDomains: api.cloudDomains, cloudRegions: api.cloudRegions, installationStep: installation.installationStep, installType: installation.installType, values: installation.values, - gitProvider: installation.gitProvider, - })); + }), + ); const cloudRegionLabel = useMemo( () => diff --git a/cypress.config.ts b/cypress.config.ts index f9f677f1..27b54f3f 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -54,10 +54,4 @@ export default defineConfig({ viewportWidth: 1440, viewportHeight: 900, - - e2e: { - setupNodeEvents(on, config) { - // implement node event listeners here - }, - }, }); diff --git a/tests/mocks/mockClusterResponse.ts b/tests/mocks/mockClusterResponse.ts index 2e814f4c..2defd20f 100644 --- a/tests/mocks/mockClusterResponse.ts +++ b/tests/mocks/mockClusterResponse.ts @@ -14,6 +14,7 @@ export const mockClusterResponse: ClusterResponse = { cluster_id: '4dg3dv', cluster_type: ClusterType.MANAGEMENT, domain_name: 'k-ray.space', + subdomain_name: '', dns_provider: 'civo', git_provider: 'github', git_host: 'github.com', @@ -23,6 +24,7 @@ export const mockClusterResponse: ClusterResponse = { admin_email: 'derrick@kubeshop.io', cloud_provider: InstallationType.AWS, domain_name: 'kgetpods.biz', + subdomain_name: '', cluster_id: 'nice', creation_timestamp: '1693932566', dns_provider: 'civo', @@ -49,6 +51,7 @@ export const mockClusterResponse: ClusterResponse = { admin_email: 'derrick@kubeshop.io', cloud_provider: InstallationType.DIGITAL_OCEAN, domain_name: 'kgetpods.biz', + subdomain_name: '', cluster_id: 'one', creation_timestamp: '1693932566', dns_provider: 'civo', @@ -75,6 +78,7 @@ export const mockClusterResponse: ClusterResponse = { admin_email: 'derrick@kubeshop.io', cloud_provider: InstallationType.LOCAL, domain_name: 'kgetpods.biz', + subdomain_name: '', cluster_id: 'draft', creation_timestamp: '1693932566', dns_provider: 'civo', @@ -101,6 +105,7 @@ export const mockClusterResponse: ClusterResponse = { admin_email: 'derrick@kubeshop.io', cloud_provider: InstallationType.GOOGLE, domain_name: 'kgetpods.biz', + subdomain_name: '', cluster_id: 'four', creation_timestamp: '1693932566', dns_provider: 'civo', diff --git a/types/provision/index.ts b/types/provision/index.ts index 45fece75..c5f5e4c3 100644 --- a/types/provision/index.ts +++ b/types/provision/index.ts @@ -57,6 +57,7 @@ export interface ClusterResponse { cloud_provider: InstallationType; cloud_region: string; domain_name: string; + subdomain_name: string; dns_provider: string; cluster_id: string; cluster_type: ClusterType.MANAGEMENT; @@ -73,6 +74,7 @@ export interface ClusterResponse { cloud_region: string; creation_timestamp: string; domain_name: string; + subdomain_name: string; dns_provider: string; environment?: EnvironmentResponse; git_auth: { @@ -142,6 +144,7 @@ export interface Cluster { cloudRegion?: string; creationDate?: string; domainName: string; + subDomainName?: string; dnsProvider: string; environment?: ClusterEnvironment; gitProvider: string; diff --git a/utils/mapClustersFromRaw.ts b/utils/mapClustersFromRaw.ts index f8f30e85..0494ecc2 100644 --- a/utils/mapClustersFromRaw.ts +++ b/utils/mapClustersFromRaw.ts @@ -14,6 +14,7 @@ export const mapClusterFromRaw = (cluster: ClusterResponse) => { cloudProvider: cluster.cloud_provider, cloudRegion: cluster.cloud_region, domainName: cluster.domain_name, + subDomainName: cluster.subdomain_name, dnsProvider: cluster.dns_provider, gitAuth: { gitOwner: cluster.git_auth.git_owner, @@ -82,6 +83,7 @@ export const mapClusterFromRaw = (cluster: ClusterResponse) => { status: curVal.status, type: curVal.cluster_type as ClusterType, domainName: curVal.domain_name, + subDomainName: curVal.subdomain_name, gitProvider: cluster.git_provider, adminEmail: cluster.alerts_email, gitAuth: {