diff --git a/datahub-web-react/src/app/browse/BrowseResultCard.tsx b/datahub-web-react/src/app/browse/BrowseResultCard.tsx
index fee19c1ad84c48..6de6d6c6e4fb1e 100644
--- a/datahub-web-react/src/app/browse/BrowseResultCard.tsx
+++ b/datahub-web-react/src/app/browse/BrowseResultCard.tsx
@@ -3,6 +3,7 @@ import { Card, Row, Space, Typography } from 'antd';
import { Link } from 'react-router-dom';
import { ArrowRightOutlined, FolderOutlined } from '@ant-design/icons';
import styled from 'styled-components';
+import { singularizeCollectionName } from '../entity/shared/utils';
const styles = {
row: { padding: 8 },
@@ -28,6 +29,10 @@ export interface BrowseResultProps {
}
export default function BrowseResultCard({ url, count, name, type, onClick }: BrowseResultProps) {
+ let displayType = type;
+ if (count === 1) {
+ displayType = singularizeCollectionName(type);
+ }
return (
@@ -41,7 +46,7 @@ export default function BrowseResultCard({ url, count, name, type, onClick }: Br
{count && (
- {count} {type}
+ {count} {displayType}
)}
diff --git a/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx b/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx
index 569c708afc9dd4..daf247128cd766 100644
--- a/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx
+++ b/datahub-web-react/src/app/entity/glossaryTerm/GlossaryTermEntity.tsx
@@ -40,7 +40,7 @@ export class GlossaryTermEntity implements Entity {
getPathName = () => 'glossary';
- getCollectionName = () => 'Business Glossary';
+ getCollectionName = () => 'Glossary Terms';
getEntityName = () => 'Glossary Term';
diff --git a/datahub-web-react/src/app/entity/shared/utils.ts b/datahub-web-react/src/app/entity/shared/utils.ts
index 1d5c63a34e0af7..3f27d734e89284 100644
--- a/datahub-web-react/src/app/entity/shared/utils.ts
+++ b/datahub-web-react/src/app/entity/shared/utils.ts
@@ -13,3 +13,16 @@ export const truncate = (length: number, input?: string | null) => {
}
return input;
};
+
+export const singularizeCollectionName = (collectionName: string): string => {
+ if (!collectionName) {
+ return collectionName;
+ }
+
+ const lastChar = collectionName[collectionName.length - 1];
+ if (lastChar === 's') {
+ return collectionName.slice(0, -1);
+ }
+
+ return collectionName;
+};
diff --git a/datahub-web-react/src/app/shared/tags/TagTermGroup.tsx b/datahub-web-react/src/app/shared/tags/TagTermGroup.tsx
index e14b31e1cfb1da..b0282d058d9dc7 100644
--- a/datahub-web-react/src/app/shared/tags/TagTermGroup.tsx
+++ b/datahub-web-react/src/app/shared/tags/TagTermGroup.tsx
@@ -38,6 +38,12 @@ const TagLink = styled(Link)`
margin-bottom: 8px;
`;
+const NoElementButton = styled(Button)`
+ :not(:last-child) {
+ margin-right: 8px;
+ }
+`;
+
export default function TagTermGroup({
uneditableTags,
editableTags,
@@ -203,7 +209,7 @@ export default function TagTermGroup({
)}
{canAddTag && (uneditableTags?.tags?.length || 0) + (editableTags?.tags?.length || 0) < 10 && (
-
+
)}
{canAddTerm &&
(uneditableGlossaryTerms?.terms?.length || 0) + (editableGlossaryTerms?.terms?.length || 0) < 10 && (
-
+
)}
{showAddModal && !!entityUrn && !!entityType && (