From 76ac84265f23372b9aba986880ed3ac6c45af2c5 Mon Sep 17 00:00:00 2001 From: Julie Date: Wed, 31 Jul 2024 11:54:59 +0200 Subject: [PATCH] Add platform integration information to Review step --- .../review/ReviewPlatformTable.tsx | 36 +++++++++++++++++++ .../review/ReviewSummary.tsx | 10 ++++-- .../clusterConfiguration/review/index.tsx | 1 + 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewPlatformTable.tsx diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewPlatformTable.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewPlatformTable.tsx new file mode 100644 index 0000000000..4b95c2ac51 --- /dev/null +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewPlatformTable.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { TableVariant } from '@patternfly/react-table'; +import { Table, TableBody } from '@patternfly/react-table/deprecated'; +import { genericTableRowKey } from '../../../../common'; +import { Cluster, PlatformType } from '@openshift-assisted/types/assisted-installer-service'; +import { ExternalPlatformLabels } from '../platformIntegration/constants'; + +export const ReviewPlatformTable = ({ cluster }: { cluster: Cluster }) => { + const rows = React.useMemo(() => { + return [ + { + rowId: 'platform', + cells: [ + { title: 'Platform' }, + { + title: ExternalPlatformLabels[cluster.platform?.type as PlatformType], + props: { 'data-testid': 'platform-type' }, + }, + ], + }, + ]; + }, [cluster.platform?.type]); + + return ( + + +
+ ); +}; diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx index e4f26d401d..accedfae58 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx @@ -17,6 +17,7 @@ import { ReviewClusterDetailTable, ReviewNetworkingTable, ReviewOperatorsTable, + ReviewPlatformTable, TableSummaryExpandable, } from '.'; import { ReviewCustomManifestsTable } from './ReviewCustomManifestsTable'; @@ -51,9 +52,12 @@ export const ReviewSummaryContent = ({ cluster }: { cluster: Cluster }) => { + <> + + + } testId="platform-integration-note" classNameValue={'pf-v5-u-mt-sm'} diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/index.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/index.tsx index 4a5da45d92..f4d92923b4 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/index.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/review/index.tsx @@ -2,3 +2,4 @@ export * from './ReviewClusterDetailTable'; export * from './ReviewOperatorsTable'; export * from './ReviewNetworkingTable'; export * from './TableSummaryExpandable'; +export * from './ReviewPlatformTable';