feat(react): surface edited descriptions on search preview for dataset, datajob, dataflow, chart, dashboard (#2932)

This commit is contained in:
Brian 2021-07-23 04:20:40 +08:00 committed by GitHub
parent 3e328d9511
commit dd43e6b258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 9 deletions

View File

@ -59,7 +59,7 @@ export class ChartEntity implements Entity<Chart> {
urn={data.urn}
platform={data.tool}
name={data.info?.name}
description={data.info?.description}
description={data.editableProperties?.description || data.info?.description}
access={data.info?.access}
owners={data.ownership?.owners}
tags={data?.globalTags || undefined}

View File

@ -70,7 +70,7 @@ export class DashboardEntity implements Entity<Dashboard> {
urn={data.urn}
platform={data.tool}
name={data.info?.name}
description={data.info?.description}
description={data.editableProperties?.description || data.info?.description}
access={data.info?.access}
tags={data.globalTags || undefined}
owners={data.ownership?.owners}

View File

@ -51,7 +51,7 @@ export class DataFlowEntity implements Entity<DataFlow> {
<Preview
urn={data.urn}
name={data.info?.name || ''}
description={data.info?.description}
description={data.editableProperties?.description || data.info?.description}
platformName={platformName}
platformLogo={getLogoFromPlatform(data.orchestrator)}
owners={data.ownership?.owners}
@ -67,7 +67,7 @@ export class DataFlowEntity implements Entity<DataFlow> {
<Preview
urn={data.urn}
name={data.info?.name || ''}
description={data.info?.description || ''}
description={data.editableProperties?.description || data.info?.description || ''}
platformName={platformName}
platformLogo={getLogoFromPlatform(data.orchestrator)}
owners={data.ownership?.owners}

View File

@ -55,7 +55,7 @@ export class DataJobEntity implements Entity<DataJob> {
<Preview
urn={data.urn}
name={data.info?.name || ''}
description={data.info?.description}
description={data.editableProperties?.description || data.info?.description}
platformName={platformName}
platformLogo={getLogoFromPlatform(data.dataFlow?.orchestrator || '')}
owners={data.ownership?.owners}
@ -73,7 +73,7 @@ export class DataJobEntity implements Entity<DataJob> {
<Preview
urn={data.urn}
name={data.info?.name || ''}
description={data.info?.description}
description={data.editableProperties?.description || data.info?.description}
platformName={platformName}
platformLogo={getLogoFromPlatform(data.dataFlow?.orchestrator || '')}
owners={data.ownership?.owners}

View File

@ -68,7 +68,7 @@ export class DatasetEntity implements Entity<Dataset> {
urn={data.urn}
name={data.name}
origin={data.origin}
description={data.description}
description={data.editableProperties?.description || data.description}
platformName={data.platform.name}
platformLogo={data.platform.info?.logoUrl}
owners={data.ownership?.owners}
@ -85,7 +85,7 @@ export class DatasetEntity implements Entity<Dataset> {
urn={data.urn}
name={data.name}
origin={data.origin}
description={data.description}
description={data.editableProperties?.description || data.description}
platformName={data.platform.name}
platformLogo={data.platform.info?.logoUrl}
owners={data.ownership?.owners}

View File

@ -6,6 +6,7 @@ import { GlobalTags, Owner, GlossaryTerms } from '../../types.generated';
import { useEntityRegistry } from '../useEntityRegistry';
import AvatarsGroup from '../shared/avatar/AvatarsGroup';
import TagTermGroup from '../shared/tags/TagTermGroup';
import MarkdownViewer from '../entity/shared/MarkdownViewer';
interface Props {
name: string;
@ -30,6 +31,13 @@ const DescriptionParagraph = styled(Typography.Paragraph)`
}
`;
const DescriptionMarkdownViewer = styled(MarkdownViewer)`
&&& {
margin-bottom: 0px;
padding-left: 8px;
}
`;
const PreviewImage = styled(Image)`
max-height: 48px;
width: auto;
@ -88,7 +96,7 @@ export default function DefaultPreviewCard({
{description.length === 0 ? (
<DescriptionParagraph type="secondary">No description</DescriptionParagraph>
) : (
<DescriptionParagraph>{description}</DescriptionParagraph>
<DescriptionMarkdownViewer source={description} />
)}
{snippet}
</div>

View File

@ -35,6 +35,9 @@ query getSearchResults($input: SearchInput!) {
logoUrl
}
}
editableProperties {
description
}
platformNativeType
tags
properties {
@ -85,6 +88,9 @@ query getSearchResults($input: SearchInput!) {
globalTags {
...globalTagsFields
}
editableProperties {
description
}
}
... on Chart {
urn
@ -107,6 +113,9 @@ query getSearchResults($input: SearchInput!) {
globalTags {
...globalTagsFields
}
editableProperties {
description
}
}
... on DataFlow {
urn
@ -125,6 +134,9 @@ query getSearchResults($input: SearchInput!) {
globalTags {
...globalTagsFields
}
editableProperties {
description
}
}
... on DataJob {
urn
@ -151,6 +163,9 @@ query getSearchResults($input: SearchInput!) {
globalTags {
...globalTagsFields
}
editableProperties {
description
}
}
... on GlossaryTerm {
name