fix(ui): #15214 open detailed logs for each runs (#15226)

* fix(ui): #15214 open detailed logs for each runs

* address comments
This commit is contained in:
Chirag Madlani 2024-02-17 00:28:53 +05:30 committed by GitHub
parent 50dd74253a
commit 5b0d75bf3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 1 deletions

View File

@ -259,6 +259,35 @@ describe('Test IngestionRecentRun component', () => {
expect(await screen.findAllByText(/label.log-plural/)).toHaveLength(1);
});
it('should show additional details for clicked on non latest run', async () => {
(getRunHistoryForPipeline as jest.Mock).mockResolvedValueOnce({
data: [...executionRuns],
paging: { total: 4 },
});
await act(async () => {
render(<IngestionRecentRuns ingestion={mockIngestion} />);
});
const runs = await screen.findAllByTestId('pipeline-status');
const partialSuccess = await screen.findByText(/Partial Success/);
expect(partialSuccess).toBeInTheDocument();
expect(runs).toHaveLength(3);
await act(async () => {
// click on last run
fireEvent.click(runs[runs.length - 1]);
});
expect(await findByRole(document.body, 'dialog')).toBeInTheDocument();
expect(await screen.findByText(/Source/)).toBeInTheDocument();
expect(await screen.findByText(/Sink/)).toBeInTheDocument();
expect(await screen.findAllByText(/label.log-plural/)).toHaveLength(1);
});
it('should show stacktrace when click on logs', async () => {
(getRunHistoryForPipeline as jest.Mock).mockResolvedValueOnce({
data: [...executionRuns],

View File

@ -158,6 +158,11 @@ export const IngestionRecentRuns: FunctionComponent<Props> = ({
}
}, [ingestion, ingestion.fullyQualifiedName]);
const handleRunStatusClick = (status: PipelineStatus) => {
setExpandedKeys([]);
setSelectedStatus(status);
};
return (
<Space className={classNames} size={2}>
{loading ? (
@ -175,7 +180,7 @@ export const IngestionRecentRuns: FunctionComponent<Props> = ({
}
data-testid="pipeline-status"
key={i}
onClick={() => setSelectedStatus(r)}>
onClick={() => handleRunStatusClick(r)}>
{startCase(r?.pipelineState)}
</Tag>
) : (
@ -186,6 +191,7 @@ export const IngestionRecentRuns: FunctionComponent<Props> = ({
}
data-testid="pipeline-status"
key={i}
onClick={() => handleRunStatusClick(r)}
/>
);
@ -225,6 +231,7 @@ export const IngestionRecentRuns: FunctionComponent<Props> = ({
<Modal
centered
destroyOnClose
closeIcon={<></>}
maskClosable={false}
okButtonProps={{ style: { display: 'none' } }}