Skip to content

Commit

Permalink
refactor(ui): Show message when related glossary terms are empty. (#5285
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Ankit-Keshari-Vituity authored Jun 29, 2022
1 parent 9e58cd6 commit 8e79a89
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from 'react';
import styled from 'styled-components/macro';
import { TermRelationshipType } from '../../../../types.generated';
import { Message } from '../../../shared/Message';
import { EmptyTab } from '../../shared/components/styled/EmptyTab';
import { ANTD_GRAY } from '../../shared/constants';
import AddRelatedTermsModal from './AddRelatedTermsModal';
import RelatedTerm from './RelatedTerm';
Expand Down Expand Up @@ -62,6 +63,9 @@ export default function GlossaryRelatedTermsResult({ glossaryRelatedTermType, gl
{glossaryRelatedTermUrns.map((urn) => (
<RelatedTerm key={urn} urn={urn} relationshipType={relationshipType} />
))}
{glossaryRelatedTermUrns.length === 0 && (
<EmptyTab tab={glossaryRelatedTermType.toLocaleLowerCase()} />
)}
</ListContainer>
)}
{isShowingAddModal && (
Expand Down
8 changes: 8 additions & 0 deletions datahub-web-react/src/app/entity/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ export const EMPTY_MESSAGES = {
title: 'No domain set',
description: 'Group related entities based on your organizational structure using by adding them to a Domain.',
},
contains: {
title: 'Contains no Terms',
description: 'Terms can contain other terms to represent an "Has A" style relationship.',
},
inherits: {
title: 'Does not inherit from any terms',
description: 'Terms can inherit from other terms to represent an "Is A" style relationship.',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Maybe } from 'graphql/jsutils/Maybe';
import { Container } from '../../../../../../../types.generated';
import { ANTD_GRAY } from '../../../../constants';
import ContainerLink from './ContainerLink';
import { capitalizeFirstLetter } from '../../../../../../shared/textUtil';

const LogoIcon = styled.span`
display: flex;
Expand Down Expand Up @@ -119,7 +120,7 @@ function PlatformContentView(props: Props) {
return (
<PlatformContentWrapper>
{typeIcon && <LogoIcon>{typeIcon}</LogoIcon>}
<PlatformText>{entityType}</PlatformText>
<PlatformText>{capitalizeFirstLetter(entityType)}</PlatformText>
{(!!platformName || !!instanceId || !!parentContainers?.length) && <PlatformDivider />}
{platformName && (
<LogoIcon>
Expand Down

0 comments on commit 8e79a89

Please sign in to comment.