From 1c7f7053b0ef0207d5b9e0ae4353f54e2b8d8a7c Mon Sep 17 00:00:00 2001 From: Jordan Snow Date: Wed, 7 Jun 2023 14:02:33 -0400 Subject: [PATCH] Using pluralize for table title Signed-off-by: Jordan Snow --- plugins/catalog/src/components/CatalogTable/CatalogTable.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index a8a513e2f4..67579d5273 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -43,6 +43,7 @@ import { capitalize } from 'lodash'; import React, { ReactNode, useMemo } from 'react'; import { columnFactories } from './columns'; import { CatalogTableRow } from './types'; +import pluralize from 'pluralize'; /** * Props for {@link CatalogTable}. @@ -228,7 +229,7 @@ export const CatalogTable = (props: CatalogTableProps) => { const showPagination = rows.length > 20; const currentKind = filters.kind?.value || ''; const currentType = filters.type?.value || ''; - const titleDisplay = [titlePreamble, currentType, currentKind] + const titleDisplay = [titlePreamble, currentType, pluralize(currentKind)] .filter(s => s) .join(' '); @@ -246,7 +247,7 @@ export const CatalogTable = (props: CatalogTableProps) => { pageSizeOptions: [20, 50, 100], ...tableOptions, }} - title={`${titleDisplay}${currentKind ? 's' : ''} (${entities.length})`} + title={`${titleDisplay} (${entities.length})`} data={rows} actions={actions || defaultActions} subtitle={subtitle}