fix(ingestion): show dash for null values in sources and execution tables (#13705)

This commit is contained in:
v-tarasevich-blitz-brain 2025-06-09 04:49:27 +03:00 committed by GitHub
parent 7e72dca891
commit 4574768b3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 8 deletions

View File

@ -35,6 +35,6 @@ export function ExecutedByColumn({ source, actor }: SourceColumnProps) {
return <span>CLI Execution</span>;
default:
return <span>N/A</span>;
return <span>-</span>;
}
}

View File

@ -1,4 +1,4 @@
import { Table } from '@components';
import { Column, Table } from '@components';
import { SorterResult } from 'antd/lib/table/interface';
import * as QueryString from 'query-string';
import React from 'react';
@ -14,6 +14,7 @@ import {
OwnerColumn,
ScheduleColumn,
} from '@app/ingestV2/source/IngestionSourceTableColumns';
import { IngestionSourceTableData } from '@app/ingestV2/source/types';
import { getIngestionSourceStatus } from '@app/ingestV2/source/utils';
import { TabType, tabUrlMap } from '@app/ingestV2/types';
import filtersToQueryStringParams from '@app/searchV2/utils/filtersToQueryStringParams';
@ -23,7 +24,7 @@ import { IngestionSource } from '@types';
const StyledTable = styled(Table)`
table-layout: fixed;
`;
` as typeof Table;
interface Props {
sources: IngestionSource[];
@ -51,7 +52,7 @@ function IngestionSourceTable({
const history = useHistory();
const entityRegistry = useEntityRegistryV2();
const tableData = sources.map((source) => ({
const tableData: IngestionSourceTableData[] = sources.map((source) => ({
urn: source.urn,
type: source.type,
name: source.name,
@ -68,7 +69,7 @@ function IngestionSourceTable({
owners: source.ownership?.owners,
}));
const tableColumns = [
const tableColumns: Column<IngestionSourceTableData>[] = [
{
title: 'Name',
key: 'name',
@ -87,7 +88,7 @@ function IngestionSourceTable({
{
title: 'Last Run',
key: 'lastRun',
render: (record) => <DateTimeColumn time={record.lastExecTime ?? 0} placeholder={<>Never run</>} />,
render: (record) => <DateTimeColumn time={record.lastExecTime} />,
width: '15%',
},
{
@ -96,7 +97,7 @@ function IngestionSourceTable({
render: (record) => (
<StatusColumn
status={record.lastExecStatus}
onClick={() => setFocusExecutionUrn(record.lastExecUrn)}
onClick={() => record.lastExecUrn && setFocusExecutionUrn(record.lastExecUrn)}
dataTestId="ingestion-source-table-status"
/>
),

View File

@ -109,7 +109,7 @@ export function ScheduleColumn({ schedule, timezone }: { schedule: string; timez
},
}}
>
{scheduleText || 'Not scheduled'}
{scheduleText || '-'}
</TextContainer>
);
}
@ -122,6 +122,9 @@ export function OwnerColumn({ owners, entityRegistry }: { owners: Owner[]; entit
};
});
const singleOwner = owners.length === 1 ? owners[0].owner : undefined;
if (owners.length === 0) return <>-</>;
return (
<>
{singleOwner && (

View File

@ -0,0 +1,16 @@
import { Owner } from '@types';
export interface IngestionSourceTableData {
urn: string;
type: string;
name: string;
platformUrn?: string;
schedule?: string;
timezone?: string | null;
execCount?: number | null;
lastExecUrn?: string;
lastExecTime?: number | null;
lastExecStatus?: string | null;
cliIngestion: boolean;
owners?: Owner[] | null;
}