feat(ingestion) Followups to live ingestion logs in UI (#5676)

* fix live logs collapsing repeatedly

* set refresh interval to null

Co-authored-by: Chris Collins <chriscollins@Chriss-MBP-2.lan>
This commit is contained in:
Chris Collins 2022-08-18 11:37:14 -04:00 committed by GitHub
parent 6f585607de
commit 9da6f12c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -90,16 +90,10 @@ type Props = {
};
export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
const [showExpandedLogs, setShowExpandedLogs] = useState(true);
const [showExpandedLogs, setShowExpandedLogs] = useState(false);
const { data, loading, error, refetch } = useGetIngestionExecutionRequestQuery({ variables: { urn } });
const output = data?.executionRequest?.result?.report || 'No output found.';
useEffect(() => {
if (output.length > 100) {
setShowExpandedLogs(false);
}
}, [output, setShowExpandedLogs]);
const downloadLogs = () => {
downloadFile(output, `exec-${urn}.log`);
};
@ -167,7 +161,7 @@ export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
</Button>
</SectionSubHeader>
<Typography.Paragraph ellipsis>
<pre>{`${logs}${!showExpandedLogs ? '...' : ''}`}</pre>
<pre>{`${logs}${!showExpandedLogs && isOutputExpandable ? '...' : ''}`}</pre>
{isOutputExpandable && (
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}>
{showExpandedLogs ? 'Hide' : 'Show More'}

View File

@ -137,6 +137,7 @@ export const IngestionSourceList = () => {
}
} else if (refreshInterval) {
clearInterval(refreshInterval);
setRefreshInterval(null);
}
}, [filteredSources, refreshInterval, onRefresh]);