Skip to content

Commit af98667

Browse files
fix(ingestion modal): stylistic fixes for ingestion modal (#14236)
Co-authored-by: Aseem Bansal <asmbansal2@gmail.com>
1 parent edee97e commit af98667

File tree

13 files changed

+990
-380
lines changed

13 files changed

+990
-380
lines changed

datahub-web-react/src/app/ingestV2/executions/components/BaseTab.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Typography } from 'antd';
22
import styled from 'styled-components';
33

4+
import colors from '@src/alchemy-components/theme/foundations/colors';
5+
46
export const SectionBase = styled.div`
57
padding: 16px 30px 0;
68
`;
@@ -12,3 +14,17 @@ export const SectionHeader = styled(Typography.Title)`
1214
margin-bottom: 12px;
1315
}
1416
`;
17+
18+
export const DetailsContainer = styled.div`
19+
margin-top: 12px;
20+
21+
pre {
22+
background-color: ${colors.gray[1500]};
23+
border: 1px solid ${colors.gray[1400]};
24+
border-radius: 8px;
25+
padding: 16px;
26+
margin: 0;
27+
color: ${colors.gray[1700]};
28+
overflow-y: auto;
29+
}
30+
`;

datahub-web-react/src/app/ingestV2/executions/components/ExecutionDetailsModal.tsx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LoadingOutlined } from '@ant-design/icons';
22
import { Icon, Modal, Pill } from '@components';
33
import { message } from 'antd';
4-
import React, { useEffect, useState } from 'react';
4+
import React, { useEffect, useMemo, useState } from 'react';
55

66
import { Tab, Tabs } from '@components/components/Tabs/Tabs';
77

@@ -23,6 +23,7 @@ import { ExecutionRequestResult } from '@types';
2323

2424
const modalBodyStyle = {
2525
padding: 0,
26+
height: '80vh',
2627
};
2728

2829
type Props = {
@@ -58,35 +59,37 @@ export const ExecutionDetailsModal = ({ urn, open, onClose }: Props) => {
5859
const interval = setInterval(() => {
5960
if (status === EXECUTION_REQUEST_STATUS_RUNNING) refetch();
6061
}, 2000);
61-
6262
return () => clearInterval(interval);
63-
});
63+
}, [status, refetch]);
6464

65-
const tabs: Tab[] = [
66-
{
67-
component: (
68-
<SummaryTab
69-
urn={urn}
70-
status={status}
71-
result={result}
72-
data={data}
73-
onTabChange={(tab: TabType) => setSelectedTab(tab)}
74-
/>
75-
),
76-
key: TabType.Summary,
77-
name: TabType.Summary,
78-
},
79-
{
80-
component: <LogsTab urn={urn} data={data} />,
81-
key: TabType.Logs,
82-
name: TabType.Logs,
83-
},
84-
{
85-
component: <RecipeTab data={data} />,
86-
key: TabType.Recipe,
87-
name: TabType.Recipe,
88-
},
89-
];
65+
const tabs: Tab[] = useMemo(
66+
() => [
67+
{
68+
component: (
69+
<SummaryTab
70+
urn={urn}
71+
status={status}
72+
result={result}
73+
data={data}
74+
onTabChange={(tab: TabType) => setSelectedTab(tab)}
75+
/>
76+
),
77+
key: TabType.Summary,
78+
name: TabType.Summary,
79+
},
80+
{
81+
component: <LogsTab urn={urn} data={data} />,
82+
key: TabType.Logs,
83+
name: TabType.Logs,
84+
},
85+
{
86+
component: <RecipeTab urn={urn} data={data} />,
87+
key: TabType.Recipe,
88+
name: TabType.Recipe,
89+
},
90+
],
91+
[data, urn, result, status],
92+
);
9093

9194
return (
9295
<Modal
@@ -96,7 +99,7 @@ export const ExecutionDetailsModal = ({ urn, open, onClose }: Props) => {
9699
titlePill={titlePill}
97100
open={open}
98101
onCancel={onClose}
99-
buttons={[{ text: 'Close', variant: 'outline', onClick: onClose }]}
102+
buttons={[]}
100103
>
101104
{!data && loading && <Message type="loading" content="Loading execution run details..." />}
102105
{error && message.error('Failed to load execution run details :(')}

datahub-web-react/src/app/ingestV2/executions/components/LogsTab.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { DownloadOutlined } from '@ant-design/icons';
2-
import { Button, Typography } from 'antd';
32
import React from 'react';
43
import styled from 'styled-components';
54

6-
import { SectionHeader } from '@app/ingestV2/executions/components/BaseTab';
5+
import { DetailsContainer, SectionHeader } from '@app/ingestV2/executions/components/BaseTab';
76
import { downloadFile } from '@app/search/utils/csvUtils';
7+
import { Button, Text, Tooltip } from '@src/alchemy-components';
88

99
import { GetIngestionExecutionRequestQuery } from '@graphql/ingestion.generated';
1010

@@ -14,7 +14,7 @@ const SectionSubHeader = styled.div`
1414
align-items: center;
1515
`;
1616

17-
const SubHeaderParagraph = styled(Typography.Paragraph)`
17+
const SubHeaderParagraph = styled(Text)`
1818
margin-bottom: 0px;
1919
`;
2020

@@ -35,15 +35,20 @@ export const LogsTab = ({ urn, data }: { urn: string; data: GetIngestionExecutio
3535
<LogsSection>
3636
<SectionHeader level={5}>Logs</SectionHeader>
3737
<SectionSubHeader>
38-
<SubHeaderParagraph type="secondary">View logs that were collected during the sync.</SubHeaderParagraph>
39-
<Button type="text" onClick={downloadLogs}>
40-
<DownloadOutlined />
41-
Download
42-
</Button>
38+
<SubHeaderParagraph color="gray" colorLevel={600}>
39+
View logs that were collected during the sync.
40+
</SubHeaderParagraph>
41+
<Tooltip title="Download Logs">
42+
<Button variant="text" onClick={downloadLogs}>
43+
<DownloadOutlined />
44+
</Button>
45+
</Tooltip>
4346
</SectionSubHeader>
44-
<Typography.Paragraph ellipsis>
45-
<pre>{output}</pre>
46-
</Typography.Paragraph>
47+
<DetailsContainer>
48+
<Text size="sm">
49+
<pre>{output}</pre>
50+
</Text>
51+
</DetailsContainer>
4752
</LogsSection>
4853
);
4954
};
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { Typography } from 'antd';
1+
import { DownloadOutlined } from '@ant-design/icons';
22
import React from 'react';
33
import styled from 'styled-components';
44
import YAML from 'yamljs';
55

6-
import { SectionBase, SectionHeader } from '@app/ingestV2/executions/components/BaseTab';
6+
import { DetailsContainer, SectionBase, SectionHeader } from '@app/ingestV2/executions/components/BaseTab';
7+
import { downloadFile } from '@app/search/utils/csvUtils';
8+
import { Button, Text, Tooltip } from '@src/alchemy-components';
79
import colors from '@src/alchemy-components/theme/foundations/colors';
810

911
import { GetIngestionExecutionRequestQuery } from '@graphql/ingestion.generated';
@@ -14,15 +16,15 @@ const SectionSubHeader = styled.div`
1416
align-items: center;
1517
`;
1618

17-
const SubHeaderParagraph = styled(Typography.Paragraph)`
19+
const SubHeaderParagraph = styled(Text)`
1820
margin-bottom: 0px;
1921
`;
2022

2123
const RecipeSection = styled(SectionBase)`
2224
border-top: 1px solid ${colors.gray[1400]};
2325
`;
2426

25-
export const RecipeTab = ({ data }: { data: GetIngestionExecutionRequestQuery | undefined }) => {
27+
export const RecipeTab = ({ urn, data }: { urn: string; data: GetIngestionExecutionRequestQuery | undefined }) => {
2628
const recipeJson = data?.executionRequest?.input?.arguments?.find((arg) => arg.key === 'recipe')?.value;
2729
let recipeYaml: string;
2830
try {
@@ -31,17 +33,28 @@ export const RecipeTab = ({ data }: { data: GetIngestionExecutionRequestQuery |
3133
recipeYaml = '';
3234
}
3335

36+
const downloadRecipe = () => {
37+
downloadFile(recipeYaml, `recipe-${urn}.yaml`);
38+
};
39+
3440
return (
3541
<RecipeSection>
3642
<SectionHeader level={5}>Recipe</SectionHeader>
3743
<SectionSubHeader>
38-
<SubHeaderParagraph type="secondary">
44+
<SubHeaderParagraph color="gray" colorLevel={600}>
3945
The configurations used for this sync with the data source.
4046
</SubHeaderParagraph>
47+
<Tooltip title="Download Recipe">
48+
<Button variant="text" onClick={downloadRecipe}>
49+
<DownloadOutlined />
50+
</Button>
51+
</Tooltip>
4152
</SectionSubHeader>
42-
<Typography.Paragraph ellipsis>
43-
<pre>{recipeYaml || 'No recipe found.'}</pre>
44-
</Typography.Paragraph>
53+
<DetailsContainer>
54+
<Text size="sm">
55+
<pre>{recipeYaml || 'No recipe found.'}</pre>
56+
</Text>
57+
</DetailsContainer>
4558
</RecipeSection>
4659
);
4760
};

0 commit comments

Comments
 (0)