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

View File

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

View File

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

View File

@ -86,7 +86,6 @@ export type TableProfilerData = {
export type TableProfilerChartProps = {
dateRangeObject: DateRangeObject;
entityFqn?: string;
showOperationGraph?: boolean;
};
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 { PAGE_HEADERS } from '../../constants/PageHeaders.constant';
import {
allowedServiceForOperationGraph,
DEFAULT_RANGE_DATA,
INITIAL_TEST_RESULT_SUMMARY,
} from '../../constants/profiler.constant';
@ -141,14 +140,6 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
const [dateRangeObject, setDateRangeObject] =
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 isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY;
const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE;
@ -694,10 +685,7 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
)}
{isTableProfile && (
<TableProfilerChart
dateRangeObject={dateRangeObject}
showOperationGraph={showOperationGraph}
/>
<TableProfilerChart dateRangeObject={dateRangeObject} />
)}
{settingModalVisible && (

View File

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