diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/ResultBox.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/ResultBox.tsx index 0c4928a948..1bbbf6dc1f 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/ResultBox.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/ResultBox.tsx @@ -1,10 +1,10 @@ +import clsx from 'clsx'; import React from 'react'; import { CompareThresholdsModel, ComparisonCheckResultModel, TableComparisonModel } from '../../../api'; -import clsx from 'clsx'; import Input from '../../Input'; import { CheckName } from './ResultPanel'; @@ -142,28 +142,28 @@ const ResultBox = ({ {secondBool && ( - <> - - Results: +
+ + Results - - Valid: + + Correct results: {item.valid_results} - + + Warning: + {item.warnings} + + Errors: {item.errors} - - Fatal: + + Fatal errors: {item.fatals} - - Warning: - {item.warnings} - - + Show mismatches
- +
)} ); diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/SelectGroupColumnsTable.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/SelectGroupColumnsTable.tsx index 55d7762351..628f976744 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/SelectGroupColumnsTable.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/SelectGroupColumnsTable.tsx @@ -59,7 +59,7 @@ export const SelectGroupColumnsTable = ({ const message = `The last known distinct count statistics for this column detected more than ${dqoLimit} rows or the statistics were not collected for this table yet`; return ( - + {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((item, index) => { diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/FirstLineNameConfiguration.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/FirstLineNameConfiguration.tsx index aeb424ee5f..a2364a0d35 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/FirstLineNameConfiguration.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/FirstLineNameConfiguration.tsx @@ -224,7 +224,7 @@ export default function FirstLineNameConfiguration({ 0 ? '' @@ -241,6 +241,14 @@ export default function FirstLineNameConfiguration({ ) : null}
+
); diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/SelectColumnGrouping.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/SelectColumnGrouping.tsx index 0dc6ce57c8..02badaf403 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/SelectColumnGrouping.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/CreatingComparison/SelectColumnGrouping.tsx @@ -177,7 +177,7 @@ export default function SelectColumnGrouping({ onClick={() => onChangeEditColumnGrouping(false)} /> ) : ( - 'Column' + item + 'Column ' + item )} ))} diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditProfilingReferenceTable.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditProfilingReferenceTable.tsx index d5583b94c8..95c4622789 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditProfilingReferenceTable.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditProfilingReferenceTable.tsx @@ -97,12 +97,11 @@ export const EditProfilingReferenceTable = ({ }; const onUpdateChecksUI = ( - checksUI: any, type: 'row' | 'column', disabled?: boolean, severity?: TSeverityValues ) => { - const checks = checksUI.categories.find( + const checks = checksUI?.categories?.find( (item: any) => String(item.category) === `comparisons/${ @@ -120,6 +119,7 @@ export const EditProfilingReferenceTable = ({ String(item.check_name).includes('column') ); } + if (disabled !== undefined) { selectedCheck.configured = disabled; if (type === 'row') { @@ -374,6 +374,27 @@ export const EditProfilingReferenceTable = ({ }; const compareTables = async () => { + const runChecks = async () => { + setIsUpdated(false); + try { + const res = await JobApiClient.runChecks(undefined, false, undefined, { + check_search_filters: categoryCheck + ? categoryCheck?.run_checks_job_template + : { + connection: connection, + fullTableName: schema + '.' + table, + tableComparisonName: + reference?.table_comparison_configuration_name, + enabled: true, + checkCategory: 'comparisons', + checkType: checkTypes as CheckSearchFiltersCheckTypeEnum + } + }); + setJobId(res.data?.jobId?.jobId); + } catch (err) { + console.error(err); + } + }; onUpdate( connection, schema, @@ -382,27 +403,9 @@ export const EditProfilingReferenceTable = ({ timePartitioned, reference, handleChange, - checksUI + checksUI, + runChecks ); - setIsUpdated(false); - try { - const res = await JobApiClient.runChecks(undefined, false, undefined, { - check_search_filters: categoryCheck - ? categoryCheck?.run_checks_job_template - : { - connection: connection, - fullTableName: schema + '.' + table, - tableComparisonName: - reference?.table_comparison_configuration_name, - enabled: true, - checkCategory: 'comparisons', - checkType: checkTypes as CheckSearchFiltersCheckTypeEnum - } - }); - setJobId(res.data?.jobId?.jobId); - } catch (err) { - console.error(err); - } }; const deleteData = async (params: { [key: string]: string | boolean }) => { @@ -559,6 +562,7 @@ export const EditProfilingReferenceTable = ({ ); } + console.log(checksUI); return (
@@ -623,7 +627,6 @@ export const EditProfilingReferenceTable = ({ } showRowCount={showRowCount} onUpdateChecksUI={onUpdateChecksUI} - checksUI={checksUI} setIsUpdated={setIsUpdated} tableComparisonResults={tableComparisonResults} showColumnCount={showColumnCount} @@ -641,7 +644,6 @@ export const EditProfilingReferenceTable = ({ onChange={onChangeCompareRowCount} reference={reference} onUpdateChecksUI={onUpdateChecksUI} - checksUI={checksUI} type="row" /> ) : ( @@ -663,7 +665,6 @@ export const EditProfilingReferenceTable = ({ onChange={onChangeCompareColumnCount} reference={reference} onUpdateChecksUI={onUpdateChecksUI} - checksUI={checksUI} type="column" /> ) : ( diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditingComparison/EditingViewFirstLine.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditingComparison/EditingViewFirstLine.tsx index 4a3e48b9a9..1f603fe224 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditingComparison/EditingViewFirstLine.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/EditingComparison/EditingViewFirstLine.tsx @@ -84,12 +84,20 @@ export default function EditingViewFirstLine({
-
+
Table comparison configuration name:{' '}
- {editConfigurationParameters.name} + {editConfigurationParameters.name}
+
void; @@ -21,29 +21,15 @@ export default function SelecColumnGroupingOverlook({ Data grouping on compared table:{' '} {dataGroupingArray ?.map((item) => item?.compared_table_column_name ?? '') - .map((x, index) => - index !== - (dataGroupingArray?.map( - (item) => item?.compared_table_column_name ?? '' - ).length ?? 9) - - 1 - ? x + ',' - : x - )} + .filter(Boolean) + .join(', ')}
Data grouping on reference table:{' '} {dataGroupingArray ?.map((item) => item?.reference_table_column_name ?? '') - .map((x, index) => - index !== - (dataGroupingArray?.map( - (item) => item?.reference_table_column_name ?? '' - ).length ?? 9) - - 1 - ? x + ',' - : x - )} + .filter(Boolean) + .join(', ')}
); diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/ProfilingReferenceTableList.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/ProfilingReferenceTableList.tsx index 75da7a42a4..375edb100e 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/ProfilingReferenceTableList.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/ProfilingReferenceTableList.tsx @@ -27,24 +27,29 @@ export const ProfilingReferenceTableList = ({
{references.length !== 0 ? ( - + + ) : null} +
{references && references.map((reference, index) => ( - {itemsToRender.map((itemData, jIndex) => ( diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonUtils.ts b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonUtils.ts index b7140422ab..fcb3b1926c 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonUtils.ts +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonUtils.ts @@ -64,13 +64,13 @@ export const calculateColor = ( } if (colorVar?.fatals && Number(colorVar.fatals) !== 0) { - return 'bg-red-200'; + return 'bg-[#EF8079]'; } else if (colorVar?.errors && Number(colorVar.errors) !== 0) { - return 'bg-orange-200'; + return 'bg-[#EFB87E]'; } else if (colorVar?.warnings && Number(colorVar.warnings) !== 0) { - return 'bg-yellow-200'; + return 'bg-[#EFEC82]'; } else if (colorVar?.valid_results && Number(colorVar.valid_results) !== 0) { - return 'bg-green-200'; + return 'bg-[#5CBCAB]'; } else { return ''; } @@ -84,7 +84,8 @@ export const onUpdate = ( timePartitioned: 'daily' | 'monthly' | undefined, reference: TableComparisonModel | undefined, handleChange: (value: CheckContainerModel) => Promise, - tableChecksToUpdate: any + tableChecksToUpdate: any, + callback?: () => Promise ) => { if (checkTypes === CheckTypes.PROFILING) { TableComparisonsApi.updateTableComparisonProfiling( @@ -93,9 +94,13 @@ export const onUpdate = ( table, reference?.table_comparison_configuration_name ?? '', reference - ).catch((err) => { - console.error(err); - }); + ) + .then(() => { + callback && callback(); + }) + .catch((err) => { + console.error(err); + }); } else if (checkTypes === CheckTypes.MONITORING) { if (timePartitioned === 'daily') { TableComparisonsApi.updateTableComparisonMonitoringDaily( @@ -104,9 +109,13 @@ export const onUpdate = ( table, reference?.table_comparison_configuration_name ?? '', reference - ).catch((err) => { - console.error(err); - }); + ) + .then(() => { + callback && callback(); + }) + .catch((err) => { + console.error(err); + }); } else if (timePartitioned === 'monthly') { TableComparisonsApi.updateTableComparisonMonitoringMonthly( connection, @@ -114,9 +123,13 @@ export const onUpdate = ( table, reference?.table_comparison_configuration_name ?? '', reference - ).catch((err) => { - console.error(err); - }); + ) + .then(() => { + callback && callback(); + }) + .catch((err) => { + console.error(err); + }); } } else if (checkTypes === CheckTypes.PARTITIONED) { if (timePartitioned === 'daily') { diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableLevelResults.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableLevelResults.tsx index 20e653d688..8cf979047e 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableLevelResults.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableLevelResults.tsx @@ -10,35 +10,35 @@ export default function TableLevelResults({ type }: TTableLevelResults) { return ( -
+
+ - + { tableComparisonResults?.table_comparison_results?.[type ?? ''] ?.valid_results } - - {tableComparisonResults?.table_comparison_results?.[type ?? '']?.errors} - - - {tableComparisonResults?.table_comparison_results?.[type ?? '']?.fatals} - - { tableComparisonResults?.table_comparison_results?.[type ?? ''] ?.warnings } + + {tableComparisonResults?.table_comparison_results?.[type ?? '']?.errors} + + + {tableComparisonResults?.table_comparison_results?.[type ?? '']?.fatals} + {type.includes('row') ? (
Table comparison configuration name Reference connection Reference schema Reference table name +
+ Action +
+
{reference.reference_table?.schema_name} + {reference.reference_table?.table_name} {' '} + { + selectReference(reference); + }} + disabled={canUserCreateTableComparison === false} + > + + + Edit table comparison + + - Delete table comparison diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/SeverityInputBlock.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/SeverityInputBlock.tsx index f2c8e690b6..4f6d4d2a07 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/SeverityInputBlock.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/SeverityInputBlock.tsx @@ -1,18 +1,16 @@ import React from 'react'; -import Input from '../../../Input'; import { CompareThresholdsModel, TableComparisonModel } from '../../../../api'; +import Input from '../../../Input'; import { TSeverityValues } from './TableComparisonConstans'; type TSeverityInputBlock = { onChange: (obj: Partial) => void; reference: TableComparisonModel; onUpdateChecksUI: ( - checksUI: any, type: 'row' | 'column', disabled?: boolean, severity?: TSeverityValues ) => void; - checksUI: any; type: 'row' | 'column'; }; @@ -20,7 +18,6 @@ export default function SeverityInputBlock({ onChange, reference, onUpdateChecksUI, - checksUI, type }: TSeverityInputBlock) { return ( @@ -40,7 +37,7 @@ export default function SeverityInputBlock({ ? undefined : Number(e.target.value) }); - onUpdateChecksUI(checksUI, type, undefined, { + onUpdateChecksUI(type, undefined, { warning: String(e.target.value).length === 0 ? undefined @@ -65,7 +62,7 @@ export default function SeverityInputBlock({ ? undefined : Number(e.target.value) }); - onUpdateChecksUI(checksUI, type, undefined, { + onUpdateChecksUI(type, undefined, { error: String(e.target.value).length === 0 ? undefined @@ -90,7 +87,7 @@ export default function SeverityInputBlock({ ? undefined : Number(e.target.value) }); - onUpdateChecksUI(checksUI, type, undefined, { + onUpdateChecksUI(type, undefined, { fatal: String(e.target.value).length === 0 ? undefined diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonOverwiewBody.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonOverwiewBody.tsx index 887d07f8b3..4ed0c3b157 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonOverwiewBody.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableComparisonOverwiewBody.tsx @@ -83,6 +83,7 @@ export default function TableComparisonOverwiewBody({ } empty={true} placeholder="" + className="pr-2" /> - Results:Results - Valid: + Correct results: - Errors: - Fatal: + Warning: + Errors: + Fatal errors: - + Show mismatches
; showRowCount: boolean; onUpdateChecksUI: ( - checksUI: any, type: 'row' | 'column', disabled?: boolean, severity?: TSeverityValues ) => void; - checksUI: any; setIsUpdated: React.Dispatch>; tableComparisonResults: any; showColumnCount: boolean; @@ -33,7 +31,6 @@ const TableRow: React.FC = ({ settableLevelComparisonExtended, showRowCount, onUpdateChecksUI, - checksUI, setIsUpdated, tableComparisonResults, showColumnCount, @@ -88,7 +85,7 @@ const TableRow: React.FC = ({ { - onUpdateChecksUI(checksUI, 'row', checked); + onUpdateChecksUI('row', checked); setIsUpdated(true); }} /> @@ -121,7 +118,7 @@ const TableRow: React.FC = ({ { - onUpdateChecksUI(checksUI, 'column', checked); + onUpdateChecksUI('column', checked); setIsUpdated(true); }} /> diff --git a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableReferenceComparisons.tsx b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableReferenceComparisons.tsx index 3a9c3ef417..be164d8b24 100644 --- a/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableReferenceComparisons.tsx +++ b/dqops/src/main/frontend/src/components/Connection/TableView/TableComparison/TableReferenceComparisons.tsx @@ -132,71 +132,29 @@ export const TableReferenceComparisons = ({ setIsEditing(true); setIsCreting(false); } else { - let url = ''; - if (checkTypes === CheckTypes.PROFILING) { - url = `${ROUTES.TABLE_LEVEL_PAGE( - checkTypes, - connection, - schema, - table, - 'table-comparisons' - )}`; - dispatch( - addFirstLevelTab(checkTypes, { - url, - value: ROUTES.TABLE_LEVEL_VALUE( - checkTypes, - connection, - schema, - table - ), - state: {}, - label: table - }) - ); - } else if (timePartitioned === 'daily') { - url = `${ROUTES.TABLE_LEVEL_PAGE( - checkTypes, - connection, - schema, - table, - 'daily_comparisons' - )}`; - dispatch( - addFirstLevelTab(checkTypes, { - url, - value: ROUTES.TABLE_LEVEL_VALUE( - checkTypes, - connection, - schema, - table - ), - state: {}, - label: table - }) - ); - } else if (timePartitioned === 'monthly') { - url = `${ROUTES.TABLE_LEVEL_PAGE( - checkTypes, - connection, - schema, - table, - 'monthly_comparisons' - )}`; - dispatch( - addFirstLevelTab(checkTypes, { - url, - value: ROUTES.TABLE_LEVEL_VALUE( - checkTypes, - connection, - schema, - table - ), - state: {}, - label: table - }) - ); - } + const url = `${ROUTES.TABLE_LEVEL_PAGE( + checkTypes, + connection, + schema, + table, + 'table-comparisons' + )}`; + dispatch( + addFirstLevelTab(checkTypes, { + url, + value: ROUTES.TABLE_LEVEL_VALUE( + checkTypes, + connection, + schema, + table + ), + state: { + checksUI + }, + label: table + }) + ); + if (isCreating === true) { getNewTableComparison(); } diff --git a/dqops/src/main/frontend/src/pages/TableProfilingChecks/index.tsx b/dqops/src/main/frontend/src/pages/TableProfilingChecks/index.tsx index e130aff7e7..35c66cf2db 100644 --- a/dqops/src/main/frontend/src/pages/TableProfilingChecks/index.tsx +++ b/dqops/src/main/frontend/src/pages/TableProfilingChecks/index.tsx @@ -16,7 +16,6 @@ import { import { CheckResultOverviewApi } from '../../services/apiClient'; import { CheckTypes } from '../../shared/routes'; import { useDecodedParams } from '../../utils'; -import { table } from 'console'; const TableProfilingChecks = () => { const { @@ -98,9 +97,7 @@ const TableProfilingChecks = () => { }; return ( -
+