diff --git a/frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json b/frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json index d446db98e06..6be83eb87e5 100644 --- a/frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json +++ b/frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json @@ -720,7 +720,6 @@ "When the nodes in the selected StorageClass are spread across fewer than 3 availability zones, the StorageCluster will be deployed with the host based failure domain.": "When the nodes in the selected StorageClass are spread across fewer than 3 availability zones, the StorageCluster will be deployed with the host based failure domain.", "Cluster-Wide and StorageClass": "Cluster-Wide and StorageClass", "Cluster-Wide": "Cluster-Wide", - "and": "and", "Select at least 2 Backing Store resources": "Select at least 2 Backing Store resources", "Select at least 1 Backing Store resource": "Select at least 1 Backing Store resource", "x {{replica}} replicas = {{osdSize, number}} TiB": "x {{replica}} replicas = {{osdSize, number}} TiB", diff --git a/frontend/packages/ceph-storage-plugin/src/utils/common.tsx b/frontend/packages/ceph-storage-plugin/src/utils/common.tsx index cf4499cae49..a63cfeecda1 100644 --- a/frontend/packages/ceph-storage-plugin/src/utils/common.tsx +++ b/frontend/packages/ceph-storage-plugin/src/utils/common.tsx @@ -1,4 +1,3 @@ -import { TFunction } from 'i18next'; import * as React from 'react'; import { getLastLanguage } from '@console/app/src/components/user-preferences/language/getLastLanguage'; @@ -12,12 +11,19 @@ export const checkArbiterCluster = (storageCluster: StorageClusterKind): boolean export const checkFlexibleScaling = (storageCluster: StorageClusterKind): boolean => storageCluster?.spec?.flexibleScaling; -export const commaSeparatedString = (text: string[], t: TFunction): string => - [text.slice(0, -1).join(', '), text.slice(-1)[0]].join( - text.length < 2 ? '' : ` ${t('ceph-storage-plugin~and')} `, - ); - -export const toList = (text: string[]): React.ReactNode => text.map((s) =>
  • {s}
  • ); +export const toList = (text: string[]): React.ReactNode => ( +
    3 ? 'scroll' : 'visible', + maxHeight: '5rem', + overflowX: 'hidden', + }} + > + {text.map((s) => ( +
  • {s}
  • + ))} +
    +); export const calcPercentage = (value: number, total: number) => humanizePercentage((value * 100) / total).string;