From 903e061d6db868ed71bd9fc89cf5f422a0750116 Mon Sep 17 00:00:00 2001 From: Aleksy Date: Mon, 4 Nov 2024 05:52:33 +0100 Subject: [PATCH 01/14] displaying red border on use_ai check if user has unpaid version --- .../DataQualityChecks/FieldControl.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dqops/src/main/frontend/src/components/DataQualityChecks/FieldControl.tsx b/dqops/src/main/frontend/src/components/DataQualityChecks/FieldControl.tsx index 9d80ec014f..0bb6af3dc4 100644 --- a/dqops/src/main/frontend/src/components/DataQualityChecks/FieldControl.tsx +++ b/dqops/src/main/frontend/src/components/DataQualityChecks/FieldControl.tsx @@ -1,10 +1,12 @@ import clsx from 'clsx'; import React, { useMemo } from 'react'; +import { useSelector } from 'react-redux'; import { FieldModel, ParameterDefinitionSpecDataTypeEnum, ParameterDefinitionSpecDisplayHintEnum } from '../../api'; +import { IRootState } from '../../redux/reducers'; import CheckboxColumn from '../Checkbox/CheckBoxColumn'; import ColumnsRecordDialog from '../ColumnsRecordDialog/ColumnsRecordDialog'; import ExtendedTextAre from '../ExtendedTextArea'; @@ -35,6 +37,7 @@ const FieldControl = ({ onSave, checkBoxNotRed }: ISensorParametersFieldSettingsProps) => { + const { userProfile } = useSelector((state: IRootState) => state.job); const type = field?.definition?.data_type; const label = field?.definition?.display_name; const tooltip = field?.definition?.help_text; @@ -81,10 +84,21 @@ const FieldControl = ({ (value === undefined || value === '' || (Array.isArray(value) && value.length === 0)); + + const isActionInvalid = + field.definition?.field_name === 'use_ai' && + userProfile.can_use_ai_anomaly_detection !== true; + return (
{type === 'boolean' && ( -
+
+ {isActionInvalid && value && ( +
+ )} handleChange({ boolean_value: value })} checked={value} From fef015d3b31f0fb543069a506e42ce0a285dc055 Mon Sep 17 00:00:00 2001 From: Aleksy Date: Mon, 4 Nov 2024 06:38:12 +0100 Subject: [PATCH 02/14] displaying columns tab correctly --- .../src/components/ConnectionLayout/index.tsx | 13 ++++++---- dqops/src/main/frontend/src/utils/index.ts | 26 +++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/dqops/src/main/frontend/src/components/ConnectionLayout/index.tsx b/dqops/src/main/frontend/src/components/ConnectionLayout/index.tsx index 4119bb1f2b..b93831c618 100644 --- a/dqops/src/main/frontend/src/components/ConnectionLayout/index.tsx +++ b/dqops/src/main/frontend/src/components/ConnectionLayout/index.tsx @@ -42,7 +42,12 @@ import { getFirstLevelActiveTab, getFirstLevelState } from '../../redux/selectors'; -import { getIsAnyChecksEnabled, useDecodedParams } from '../../utils'; +import { + getIsAnyChecksEnabled, + getRouteValidLabel, + isValidRouteWithoutTab, + useDecodedParams +} from '../../utils'; import ConfirmDialog from '../CustomTree/ConfirmDialog'; interface ConnectionLayoutProps { @@ -175,7 +180,7 @@ const ConnectionLayout = ({ route }: ConnectionLayoutProps) => { if (foundRoute) { const params = match.params as any; - if (params?.tab) { + if (params?.tab || isValidRouteWithoutTab(foundRoute)) { let newRoute = foundRoute; let routeWithoutTab = foundRoute; const segments = foundRoute.split('/'); @@ -187,13 +192,11 @@ const ConnectionLayout = ({ route }: ConnectionLayoutProps) => { newRoute = newRoute.replace(`:${key}`, String(value)); routeWithoutTab = routeWithoutTab.replace(`:${key}`, String(value)); }); - dispatch( addFirstLevelTab(checkTypes, { url: newRoute, value: routeWithoutTab, - label: - routeWithoutTab.split('/')[routeWithoutTab.split('/').length - 1] + label: getRouteValidLabel(routeWithoutTab) }) ); } diff --git a/dqops/src/main/frontend/src/utils/index.ts b/dqops/src/main/frontend/src/utils/index.ts index c20f4aa3b8..3af1dbecbe 100644 --- a/dqops/src/main/frontend/src/utils/index.ts +++ b/dqops/src/main/frontend/src/utils/index.ts @@ -957,3 +957,29 @@ export const getProviderTypeTitle = ( return ''; } }; + +export const getRouteValidLabel = (route: string) => { + if (route.includes('/columns/all')) { + return 'Columns'; + } + // if (route.endsWith('checks/advanced-profiling')) { + // return 'Profiling checks'; + // } + // if (route.endsWith('monitoring/daily')) { + // return 'Daily monitoring'; + // } + // if (route.endsWith('monitoring/monthly')) { + // return 'Monthly monitoring'; + // } + // if (route.endsWith('partitioned/daily')) { + // return 'Daily partitioned checks'; + // } + // if (route.endsWith('partitioned/monthly')) { + // return 'Monthly partitioned checks'; + // } + return route.split('/')[route.split('/').length - 1]; +}; + +export const isValidRouteWithoutTab = (route: string) => { + return route.endsWith('/columns/all'); +}; From 4e07851512c4c14cd3f8a67fade92663f8bbb6d4 Mon Sep 17 00:00:00 2001 From: Aleksy Date: Mon, 4 Nov 2024 07:05:39 +0100 Subject: [PATCH 03/14] opening PageTabs corectly on sources without nested /:tab --- .../frontend/src/contexts/treeContext.tsx | 11 +++-- dqops/src/main/frontend/src/utils/index.ts | 40 +++++++++++-------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/dqops/src/main/frontend/src/contexts/treeContext.tsx b/dqops/src/main/frontend/src/contexts/treeContext.tsx index cf64695c5f..997a28b29b 100644 --- a/dqops/src/main/frontend/src/contexts/treeContext.tsx +++ b/dqops/src/main/frontend/src/contexts/treeContext.tsx @@ -1330,7 +1330,6 @@ function TreeProvider(props: any) { const schemaNode = findTreeNode(treeData, tableNode?.parentId ?? ''); const connectionNode = findTreeNode(treeData, schemaNode?.parentId ?? ''); - let url = ''; let value = ''; if (node.level === TREE_LEVEL.TABLE_CHECKS) { @@ -1340,7 +1339,7 @@ function TreeProvider(props: any) { schemaNode?.label ?? '', tableNode?.label ?? '' ); - value = ROUTES.TABLE_PROFILING_VALUE( + value = ROUTES.TABLE_PROFILING( checkType, connectionNode?.label ?? '', schemaNode?.label ?? '', @@ -1354,7 +1353,7 @@ function TreeProvider(props: any) { tableNode?.label ?? '', 'daily' ); - value = ROUTES.TABLE_MONITORING_VALUE( + value = ROUTES.TABLE_MONITORING( checkType, connectionNode?.label ?? '', schemaNode?.label ?? '', @@ -1369,7 +1368,7 @@ function TreeProvider(props: any) { tableNode?.label ?? '', 'monthly' ); - value = ROUTES.TABLE_MONITORING_VALUE( + value = ROUTES.TABLE_MONITORING( checkType, connectionNode?.label ?? '', schemaNode?.label ?? '', @@ -1384,7 +1383,7 @@ function TreeProvider(props: any) { tableNode?.label ?? '', 'daily' ); - value = ROUTES.TABLE_PARTITIONED_VALUE( + value = ROUTES.TABLE_PARTITIONED( checkType, connectionNode?.label ?? '', schemaNode?.label ?? '', @@ -1399,7 +1398,7 @@ function TreeProvider(props: any) { tableNode?.label ?? '', 'monthly' ); - value = ROUTES.TABLE_PARTITIONED_VALUE( + value = ROUTES.TABLE_PARTITIONED( checkType, connectionNode?.label ?? '', schemaNode?.label ?? '', diff --git a/dqops/src/main/frontend/src/utils/index.ts b/dqops/src/main/frontend/src/utils/index.ts index 3af1dbecbe..cd58e028d0 100644 --- a/dqops/src/main/frontend/src/utils/index.ts +++ b/dqops/src/main/frontend/src/utils/index.ts @@ -962,24 +962,32 @@ export const getRouteValidLabel = (route: string) => { if (route.includes('/columns/all')) { return 'Columns'; } - // if (route.endsWith('checks/advanced-profiling')) { - // return 'Profiling checks'; - // } - // if (route.endsWith('monitoring/daily')) { - // return 'Daily monitoring'; - // } - // if (route.endsWith('monitoring/monthly')) { - // return 'Monthly monitoring'; - // } - // if (route.endsWith('partitioned/daily')) { - // return 'Daily partitioned checks'; - // } - // if (route.endsWith('partitioned/monthly')) { - // return 'Monthly partitioned checks'; - // } + if (route.endsWith('checks/advanced-profiling')) { + return 'Profiling checks'; + } + if (route.endsWith('monitoring/daily')) { + return 'Daily monitoring'; + } + if (route.endsWith('monitoring/monthly')) { + return 'Monthly monitoring'; + } + if (route.endsWith('partitioned/daily')) { + return 'Daily period checks'; + } + if (route.endsWith('partitioned/monthly')) { + return 'Monthly period checks'; + } return route.split('/')[route.split('/').length - 1]; }; export const isValidRouteWithoutTab = (route: string) => { - return route.endsWith('/columns/all'); + return ( + route.endsWith('/columns/all') || + route.endsWith('monitoring/daily') || + route.endsWith('monitoring/monthly') || + route.endsWith('partitioned/daily') || + route.endsWith('partitioned/monthly') || + route.endsWith('checks/advanced-profiling') || + route.endsWith('/:category/:checkName') + ); }; From 551cb89453bb9a267bb389519b68218c5bcd4e6a Mon Sep 17 00:00:00 2001 From: Piotr Czarnas Date: Mon, 4 Nov 2024 09:50:32 +0100 Subject: [PATCH 04/14] Version number change to 1.10.1 --- .run/dqo run.run.xml | 2 +- CHANGELOG.md | 11 ++--------- VERSION | 2 +- distribution/pom.xml | 2 +- distribution/python/dqops/version.py | 4 ++-- dqo | 2 +- dqo.cmd | 2 +- dqops/pom.xml | 2 +- dqops/src/main/frontend/package.json | 2 +- dqops/src/main/resources/banner.txt | 2 +- lib/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.run/dqo run.run.xml b/.run/dqo run.run.xml index 7a6225e898..25d82fbec0 100644 --- a/.run/dqo run.run.xml +++ b/.run/dqo run.run.xml @@ -5,7 +5,7 @@