mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-02 13:53:06 +00:00
fix(datajobs): fetch dataflow properties from a relationship (#3487)
This commit is contained in:
parent
1fec105b24
commit
c1ca2977f4
@ -895,6 +895,20 @@ export const dataJob1 = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
incoming: null,
|
||||||
|
outgoing: null,
|
||||||
|
parentFlow: {
|
||||||
|
start: 0,
|
||||||
|
count: 1,
|
||||||
|
total: 1,
|
||||||
|
relationships: [
|
||||||
|
{
|
||||||
|
type: 'IsPartOf',
|
||||||
|
direction: RelationshipDirection.Outgoing,
|
||||||
|
entity: dataFlow1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
} as DataJob;
|
} as DataJob;
|
||||||
|
|
||||||
export const dataJob2 = {
|
export const dataJob2 = {
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
import { MockedProvider } from '@apollo/client/testing';
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import React from 'react';
|
||||||
|
import { dataJob1, mocks } from '../../../../../../Mocks';
|
||||||
|
import { EntityType } from '../../../../../../types.generated';
|
||||||
|
import TestPageContainer from '../../../../../../utils/test-utils/TestPageContainer';
|
||||||
|
import { getDataForEntityType } from '../../../containers/profile/utils';
|
||||||
|
import EntityContext from '../../../EntityContext';
|
||||||
|
import { DataJobFlowTab } from '../DataJobFlowTab';
|
||||||
|
|
||||||
|
describe('DataJobFlowTab', () => {
|
||||||
|
it('renders fields', async () => {
|
||||||
|
const { getByText } = render(
|
||||||
|
<MockedProvider mocks={mocks} addTypename={false}>
|
||||||
|
<TestPageContainer initialEntries={['/dataset/urn:li:dataset:3']}>
|
||||||
|
<EntityContext.Provider
|
||||||
|
value={{
|
||||||
|
urn: 'urn:li:dataJob:1',
|
||||||
|
entityType: EntityType.DataJob,
|
||||||
|
entityData: getDataForEntityType({
|
||||||
|
data: dataJob1,
|
||||||
|
entityType: EntityType.DataJob,
|
||||||
|
getOverrideProperties: () => ({}),
|
||||||
|
}),
|
||||||
|
baseEntity: { dataJob: dataJob1 },
|
||||||
|
updateEntity: jest.fn(),
|
||||||
|
routeToTab: jest.fn(),
|
||||||
|
refetch: jest.fn(),
|
||||||
|
lineage: undefined,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DataJobFlowTab />
|
||||||
|
</EntityContext.Provider>
|
||||||
|
</TestPageContainer>
|
||||||
|
</MockedProvider>,
|
||||||
|
);
|
||||||
|
expect(getByText('DataFlowInfoName')).toBeInTheDocument();
|
||||||
|
expect(getByText('DataFlowInfo1 Description')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
@ -54,10 +54,10 @@ const PreviewImage = styled(Image)`
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const EntityTitle = styled(Typography.Text)<{ titleSizePx?: number }>`
|
const EntityTitle = styled(Typography.Text)<{ $titleSizePx?: number }>`
|
||||||
&&& {
|
&&& {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-size: ${(props) => props.titleSizePx || 16}px;
|
font-size: ${(props) => props.$titleSizePx || 16}px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
@ -154,13 +154,13 @@ export default function DefaultPreviewCard({
|
|||||||
<PlatformDivider />
|
<PlatformDivider />
|
||||||
<PlatformText>{type}</PlatformText>
|
<PlatformText>{type}</PlatformText>
|
||||||
</PlatformInfo>
|
</PlatformInfo>
|
||||||
<Link to={url} onClick={onClick}>
|
<EntityTitle onClick={onClick} $titleSizePx={titleSizePx}>
|
||||||
<EntityTitle titleSizePx={titleSizePx}>{name || ' '}</EntityTitle>
|
{name || ' '}
|
||||||
</Link>
|
</EntityTitle>
|
||||||
<TagContainer>
|
|
||||||
<TagTermGroup uneditableGlossaryTerms={glossaryTerms} uneditableTags={tags} maxShow={3} />
|
|
||||||
</TagContainer>
|
|
||||||
</Link>
|
</Link>
|
||||||
|
<TagContainer>
|
||||||
|
<TagTermGroup uneditableGlossaryTerms={glossaryTerms} uneditableTags={tags} maxShow={3} />
|
||||||
|
</TagContainer>
|
||||||
</TitleContainer>
|
</TitleContainer>
|
||||||
{description && description.length > 0 && (
|
{description && description.length > 0 && (
|
||||||
<DescriptionContainer>
|
<DescriptionContainer>
|
||||||
|
@ -8,6 +8,28 @@ fragment relationshipFields on Entity {
|
|||||||
description
|
description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
... on DataFlow {
|
||||||
|
orchestrator
|
||||||
|
flowId
|
||||||
|
cluster
|
||||||
|
info {
|
||||||
|
name
|
||||||
|
description
|
||||||
|
project
|
||||||
|
}
|
||||||
|
ownership {
|
||||||
|
...ownershipFields
|
||||||
|
}
|
||||||
|
globalTags {
|
||||||
|
...globalTagsFields
|
||||||
|
}
|
||||||
|
glossaryTerms {
|
||||||
|
...glossaryTerms
|
||||||
|
}
|
||||||
|
editableProperties {
|
||||||
|
description
|
||||||
|
}
|
||||||
|
}
|
||||||
... on Dashboard {
|
... on Dashboard {
|
||||||
...dashboardRelationshipsLeaf
|
...dashboardRelationshipsLeaf
|
||||||
...dashboardFields
|
...dashboardFields
|
||||||
|
Loading…
x
Reference in New Issue
Block a user