Skip to content

Commit

Permalink
Enhance the DRPolicy creation page to select client clusters for RDR
Browse files Browse the repository at this point in the history
Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
  • Loading branch information
GowthamShanmugam committed Oct 29, 2024
1 parent 974d100 commit a4bb217
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
7 changes: 3 additions & 4 deletions locales/en/plugin__odf-console.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"Online": "Online",
"Offline": "Offline",
"Not Installed": "Not Installed",
"1 connected": "1 connected",
"Unavailable": "Unavailable",
"Replication interval": "Replication interval",
"Replication policy": "Replication policy",
Expand All @@ -66,11 +65,11 @@
"checks unsuccessful on the {{clusterName}}:": "checks unsuccessful on the {{clusterName}}:",
"We could not retrieve any information about the managed cluster {{clusterName}}": "We could not retrieve any information about the managed cluster {{clusterName}}",
"Running checks to ensure that the selected managed cluster meets all necessary conditions so it can enroll in a Disaster Recovery policy.": "Running checks to ensure that the selected managed cluster meets all necessary conditions so it can enroll in a Disaster Recovery policy.",
"All disaster recovery prerequisites met for both cluster.": "All disaster recovery prerequisites met for both cluster.",
"All disaster recovery prerequisites met for both clusters.": "All disaster recovery prerequisites met for both clusters.",
"Version mismatch across selected clusters": "Version mismatch across selected clusters",
"The selected clusters are running different versions of Data Foundation. Peering clusters with different versions can lead to potential issues and is not recommended. Ensure all clusters are upgraded to the same version before proceeding with peering to avoid operational risks.": "The selected clusters are running different versions of Data Foundation. Peering clusters with different versions can lead to potential issues and is not recommended. Ensure all clusters are upgraded to the same version before proceeding with peering to avoid operational risks.",
"1 or more cluster do not meet disaster recovery cluster prerequisites.": "1 or more cluster do not meet disaster recovery cluster prerequisites.",
"The selected managed cluster does not meet all necessary conditions to be eligible for disaster recovery policy. Resolve the following issues to proceed with policy creation.": "The selected managed cluster does not meet all necessary conditions to be eligible for disaster recovery policy. Resolve the following issues to proceed with policy creation.",
"1 or more clusters do not meet disaster recovery cluster prerequisites.": "1 or more clusters do not meet disaster recovery cluster prerequisites.",
"The selected managed cluster(s) does not meet all necessary conditions to be eligible for disaster recovery policy. Resolve the following issues to proceed with policy creation.": "The selected managed cluster(s) does not meet all necessary conditions to be eligible for disaster recovery policy. Resolve the following issues to proceed with policy creation.",
"Information unavailable": "Information unavailable",
"Managed Cluster": "Managed Cluster",
"Availability status": "Availability status",
Expand Down
10 changes: 5 additions & 5 deletions packages/mco/components/create-dr-policy/select-cluster-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getName } from '@odf/shared/selectors';
import { RowComponentType } from '@odf/shared/table';
import {
SelectableTable,
TABLE_VARINAT,
TABLE_VARIANT,
} from '@odf/shared/table/selectable-table';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getPageRange, referenceForModel } from '@odf/shared/utils';
Expand Down Expand Up @@ -51,7 +51,7 @@ const ClusterRow: React.FC<RowComponentType<ManagedClusterInfoType>> = ({
}) => {
const { t } = useCustomTranslation();
const { odfInfo, region, isManagedClusterAvailable } = cluster;
const isClientExists = !!odfInfo?.storageClusterInfo?.clientInfo;
const clientName = !!odfInfo?.storageClusterInfo?.clientInfo?.name;
const odfVersion = odfInfo?.odfVersion;
return (
<>
Expand Down Expand Up @@ -91,8 +91,8 @@ const ClusterRow: React.FC<RowComponentType<ManagedClusterInfoType>> = ({
translate={null}
dataLabel={getColumnHelper(COLUMN_NAMES.StorageClients, t).columnName}
>
<Text className={cn({ 'text-muted': !isClientExists })}>
{isClientExists ? t('1 connected') : t('Unavailable')}
<Text className={cn({ 'text-muted': !clientName })}>
{clientName ? clientName : t('Unavailable')}
</Text>
</Td>
<Td
Expand Down Expand Up @@ -161,7 +161,7 @@ const PaginatedClusterTable: React.FC<PaginatedClusterTableProps> = ({
setSelectedRows={onChange}
loaded={isLoaded}
loadError={error}
variant={TABLE_VARINAT.DEFAULT}
variant={TABLE_VARIANT.DEFAULT}
isColumnSelectableHidden
isRowSelectable={(cluster) =>
isRowSelectable(cluster, selectedClusters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export const SelectedClusterValidation: React.FC<SelectedClusterValidationProps>
data-test="odf-not-found-alert"
className="odf-alert mco-create-data-policy__alert"
title={t(
'All disaster recovery prerequisites met for both cluster.'
'All disaster recovery prerequisites met for both clusters.'
)}
variant={AlertVariant.success}
isInline
Expand Down Expand Up @@ -311,13 +311,13 @@ export const SelectedClusterValidation: React.FC<SelectedClusterValidationProps>
data-test="odf-not-found-alert"
className="odf-alert mco-create-data-policy__alert"
title={t(
'1 or more cluster do not meet disaster recovery cluster prerequisites.'
'1 or more clusters do not meet disaster recovery cluster prerequisites.'
)}
variant={AlertVariant.danger}
isInline
>
{t(
'The selected managed cluster does not meet all necessary conditions ' +
'The selected managed cluster(s) does not meet all necessary conditions ' +
'to be eligible for disaster recovery policy. Resolve the following ' +
'issues to proceed with policy creation.'
)}
Expand Down
10 changes: 5 additions & 5 deletions packages/shared/src/table/selectable-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useSortList } from '../hooks/sort-list';
import { getUID } from '../selectors';
import { TableColumnProps, RowComponentType } from './composable-table';

export enum TABLE_VARINAT {
export enum TABLE_VARIANT {
DEFAULT = 'default',
COMPACT = 'compact',
}
Expand Down Expand Up @@ -116,7 +116,7 @@ export const SelectableTable: SelectableTableProps = <
aria-label="Selectable table"
borders={borders}
variant={
variant !== TABLE_VARINAT.DEFAULT ? TABLE_VARINAT.COMPACT : undefined
variant !== TABLE_VARIANT.DEFAULT ? TABLE_VARIANT.COMPACT : undefined
}
>
<Thead translate={null}>
Expand Down Expand Up @@ -157,8 +157,8 @@ export const SelectableTable: SelectableTableProps = <
onSelect: onSelect,
isSelected: isRowSelected(getUID(row), selectedRows),
isDisabled:
(!!isRowSelectable && !isRowSelectable(row)) ||
!hasNoDeletionTimestamp(row),
(!!isRowSelectable && !isRowSelectable(row)) ||
!hasNoDeletionTimestamp(row),
props: {
id: getUID(row),
},
Expand Down Expand Up @@ -192,7 +192,7 @@ type TableProps<T extends K8sResourceCommon> = {
/** Additional classes added to the Table */
className?: string;
isRowSelectable?: IsRowSelectable;
variant?: TABLE_VARINAT;
variant?: TABLE_VARIANT;
};

type SelectableTableProps = <T extends K8sResourceCommon>(
Expand Down

0 comments on commit a4bb217

Please sign in to comment.