fix(ui): Revert to initial behavior and always display the system profile graph #12869 (#12919)

This commit is contained in:
Shailesh Parmar 2023-08-21 15:36:57 +05:30 committed by GitHub
parent 2f3a50e95f
commit ae71a11a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 98 deletions

View File

@ -36,7 +36,6 @@ import { getEntityBreadcrumbs, getEntityName } from 'utils/EntityUtils';
import { getEncodedFqn } from 'utils/StringsUtils'; import { getEncodedFqn } from 'utils/StringsUtils';
import { getTableTabPath } from '../../constants/constants'; import { getTableTabPath } from '../../constants/constants';
import { import {
allowedServiceForOperationGraph,
DEFAULT_RANGE_DATA, DEFAULT_RANGE_DATA,
STEPS_FOR_ADD_TEST_CASE, STEPS_FOR_ADD_TEST_CASE,
} from '../../constants/profiler.constant'; } from '../../constants/profiler.constant';
@ -232,10 +231,6 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({
<TableProfilerChart <TableProfilerChart
dateRangeObject={DEFAULT_RANGE_DATA} dateRangeObject={DEFAULT_RANGE_DATA}
entityFqn={entityTypeFQN} entityFqn={entityTypeFQN}
showOperationGraph={
table.serviceType &&
allowedServiceForOperationGraph.includes(table.serviceType)
}
/> />
)} )}
{isColumnFqn && ( {isColumnFqn && (

View File

@ -47,12 +47,7 @@ describe('TableProfilerChart component test', () => {
const mockGetSystemProfileList = getSystemProfileList as jest.Mock; const mockGetSystemProfileList = getSystemProfileList as jest.Mock;
const mockGetTableProfilesList = getTableProfilesList as jest.Mock; const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
act(() => { act(() => {
render( render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
<TableProfilerChart
showOperationGraph
dateRangeObject={mockDateRangeObject}
/>
);
}); });
expect( expect(
@ -77,12 +72,7 @@ describe('TableProfilerChart component test', () => {
const mockGetSystemProfileList = getSystemProfileList as jest.Mock; const mockGetSystemProfileList = getSystemProfileList as jest.Mock;
const mockGetTableProfilesList = getTableProfilesList as jest.Mock; const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
await act(async () => { await act(async () => {
render( render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
<TableProfilerChart
showOperationGraph
dateRangeObject={mockDateRangeObject}
/>
);
}); });
// API should be call once // API should be call once
@ -111,12 +101,7 @@ describe('TableProfilerChart component test', () => {
const mockGetTableProfilesList = getTableProfilesList as jest.Mock; const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
await act(async () => { await act(async () => {
render( render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
<TableProfilerChart
showOperationGraph
dateRangeObject={mockDateRangeObject}
/>
);
}); });
// API should be call with proper Param value // API should be call with proper Param value

View File

@ -38,7 +38,6 @@ import { TableProfilerChartProps } from '../TableProfiler.interface';
const TableProfilerChart = ({ const TableProfilerChart = ({
dateRangeObject, dateRangeObject,
entityFqn = '', entityFqn = '',
showOperationGraph = false,
}: TableProfilerChartProps) => { }: TableProfilerChartProps) => {
const { datasetFQN } = useParams<{ datasetFQN: string }>(); const { datasetFQN } = useParams<{ datasetFQN: string }>();
const { t } = useTranslation(); const { t } = useTranslation();
@ -116,8 +115,6 @@ const TableProfilerChart = ({
title={t('label.data-volume')} title={t('label.data-volume')}
/> />
</Col> </Col>
{showOperationGraph && (
<>
<Col span={24}> <Col span={24}>
<Card <Card
className="shadow-none global-border-radius" className="shadow-none global-border-radius"
@ -154,9 +151,7 @@ const TableProfilerChart = ({
</Typography.Title> </Typography.Title>
</Col> </Col>
<Col span={4}> <Col span={4}>
<ProfilerLatestValue <ProfilerLatestValue information={operationMetrics.information} />
information={operationMetrics.information}
/>
</Col> </Col>
<Col span={20}> <Col span={20}>
<CustomBarChart <CustomBarChart
@ -167,8 +162,6 @@ const TableProfilerChart = ({
</Row> </Row>
</Card> </Card>
</Col> </Col>
</>
)}
</Row> </Row>
); );
}; };

View File

@ -86,7 +86,6 @@ export type TableProfilerData = {
export type TableProfilerChartProps = { export type TableProfilerChartProps = {
dateRangeObject: DateRangeObject; dateRangeObject: DateRangeObject;
entityFqn?: string; entityFqn?: string;
showOperationGraph?: boolean;
}; };
export interface ProfilerSettingModalState { export interface ProfilerSettingModalState {

View File

@ -70,7 +70,6 @@ import { ReactComponent as TableProfileIcon } from '../../assets/svg/table-profi
import { API_RES_MAX_SIZE } from '../../constants/constants'; import { API_RES_MAX_SIZE } from '../../constants/constants';
import { PAGE_HEADERS } from '../../constants/PageHeaders.constant'; import { PAGE_HEADERS } from '../../constants/PageHeaders.constant';
import { import {
allowedServiceForOperationGraph,
DEFAULT_RANGE_DATA, DEFAULT_RANGE_DATA,
INITIAL_TEST_RESULT_SUMMARY, INITIAL_TEST_RESULT_SUMMARY,
} from '../../constants/profiler.constant'; } from '../../constants/profiler.constant';
@ -141,14 +140,6 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
const [dateRangeObject, setDateRangeObject] = const [dateRangeObject, setDateRangeObject] =
useState<DateRangeObject>(DEFAULT_RANGE_DATA); useState<DateRangeObject>(DEFAULT_RANGE_DATA);
const showOperationGraph = useMemo(() => {
if (table?.serviceType) {
return allowedServiceForOperationGraph.includes(table.serviceType);
}
return false;
}, [table]);
const isColumnProfile = activeTab === TableProfilerTab.COLUMN_PROFILE; const isColumnProfile = activeTab === TableProfilerTab.COLUMN_PROFILE;
const isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY; const isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY;
const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE; const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE;
@ -694,10 +685,7 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
)} )}
{isTableProfile && ( {isTableProfile && (
<TableProfilerChart <TableProfilerChart dateRangeObject={dateRangeObject} />
dateRangeObject={dateRangeObject}
showOperationGraph={showOperationGraph}
/>
)} )}
{settingModalVisible && ( {settingModalVisible && (

View File

@ -22,7 +22,6 @@ import { CSMode } from '../enums/codemirror.enum';
import { DMLOperationType } from '../generated/api/data/createTableProfile'; import { DMLOperationType } from '../generated/api/data/createTableProfile';
import { import {
ColumnProfilerConfig, ColumnProfilerConfig,
DatabaseServiceType,
DataType, DataType,
PartitionIntervalType, PartitionIntervalType,
PartitionIntervalUnit, PartitionIntervalUnit,
@ -395,9 +394,3 @@ export const TIME_BASED_PARTITION = [
PartitionIntervalType.IngestionTime, PartitionIntervalType.IngestionTime,
PartitionIntervalType.TimeUnit, PartitionIntervalType.TimeUnit,
]; ];
export const allowedServiceForOperationGraph = [
DatabaseServiceType.BigQuery,
DatabaseServiceType.Redshift,
DatabaseServiceType.Snowflake,
];