From 03f478fe0ae79694e554a90b1e915c8121cbccbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C5=A0neberger?= Date: Fri, 18 Nov 2022 11:44:14 +0100 Subject: [PATCH] Use pluralize for catalog kind header component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Šneberger --- plugins/catalog/package.json | 1 + .../src/components/CatalogKindHeader/CatalogKindHeader.tsx | 3 ++- yarn.lock | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 1528737aac..244aab8626 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -49,6 +49,7 @@ "@material-ui/lab": "4.0.0-alpha.57", "history": "^5.0.0", "lodash": "^4.17.21", + "pluralize": "^8.0.0", "react-helmet": "6.1.0", "react-use": "^17.2.4", "zen-observable": "^0.9.0" diff --git a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx index b0aaeae658..bb9e98d9c3 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx +++ b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx @@ -31,6 +31,7 @@ import { } from '@backstage/plugin-catalog-react'; import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; +import pluralize from 'pluralize'; const useStyles = makeStyles((theme: Theme) => createStyles({ @@ -132,7 +133,7 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps) { > {Object.keys(options).map(kind => ( - {`${options[kind]}s`} + {`${pluralize(options[kind])}`} ))} diff --git a/yarn.lock b/yarn.lock index 1a5617c798..0f497b5abe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4750,6 +4750,7 @@ __metadata: cross-fetch: ^3.1.5 history: ^5.0.0 lodash: ^4.17.21 + pluralize: ^8.0.0 react-helmet: 6.1.0 react-use: ^17.2.4 zen-observable: ^0.9.0