@finos/legend-extension-dsl-data-quality 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +1 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.d.ts +46 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.js +116 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.js.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.d.ts +30 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.js +161 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.js.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.d.ts +25 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.js +2 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.js.map +1 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.d.ts +27 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.js +41 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.js.map +1 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.d.ts +19 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.d.ts.map +1 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.js +64 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.js.map +1 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.d.ts +19 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.d.ts.map +1 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.js +41 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.js.map +1 -0
- package/lib/components/DataQualityClassValidationEditor.d.ts +19 -0
- package/lib/components/DataQualityClassValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityClassValidationEditor.js +29 -0
- package/lib/components/DataQualityClassValidationEditor.js.map +1 -0
- package/lib/components/DataQualityConstraintsSelection.d.ts +39 -0
- package/lib/components/DataQualityConstraintsSelection.d.ts.map +1 -0
- package/lib/components/DataQualityConstraintsSelection.js +133 -0
- package/lib/components/DataQualityConstraintsSelection.js.map +1 -0
- package/lib/components/DataQualityDataSpaceBuilder.d.ts +22 -0
- package/lib/components/DataQualityDataSpaceBuilder.d.ts.map +1 -0
- package/lib/components/DataQualityDataSpaceBuilder.js +101 -0
- package/lib/components/DataQualityDataSpaceBuilder.js.map +1 -0
- package/lib/components/DataQualityExplorerPanel.d.ts +29 -0
- package/lib/components/DataQualityExplorerPanel.d.ts.map +1 -0
- package/lib/components/DataQualityExplorerPanel.js +185 -0
- package/lib/components/DataQualityExplorerPanel.js.map +1 -0
- package/lib/components/DataQualityFilterPanel.d.ts +24 -0
- package/lib/components/DataQualityFilterPanel.d.ts.map +1 -0
- package/lib/components/DataQualityFilterPanel.js +32 -0
- package/lib/components/DataQualityFilterPanel.js.map +1 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.d.ts +22 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.d.ts.map +1 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.js +98 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.js.map +1 -0
- package/lib/components/DataQualityResultPanel.d.ts +22 -0
- package/lib/components/DataQualityResultPanel.d.ts.map +1 -0
- package/lib/components/DataQualityResultPanel.js +110 -0
- package/lib/components/DataQualityResultPanel.js.map +1 -0
- package/lib/components/DataQualityResultValues.d.ts +24 -0
- package/lib/components/DataQualityResultValues.d.ts.map +1 -0
- package/lib/components/DataQualityResultValues.js +31 -0
- package/lib/components/DataQualityResultValues.js.map +1 -0
- package/lib/components/DataQualityServiceValidationEditor.d.ts +19 -0
- package/lib/components/DataQualityServiceValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityServiceValidationEditor.js +29 -0
- package/lib/components/DataQualityServiceValidationEditor.js.map +1 -0
- package/lib/components/DataQualitySideBar.d.ts +40 -0
- package/lib/components/DataQualitySideBar.d.ts.map +1 -0
- package/lib/components/DataQualitySideBar.js +78 -0
- package/lib/components/DataQualitySideBar.js.map +1 -0
- package/lib/components/DataQualityStructuralValidationsPanel.d.ts +22 -0
- package/lib/components/DataQualityStructuralValidationsPanel.d.ts.map +1 -0
- package/lib/components/DataQualityStructuralValidationsPanel.js +50 -0
- package/lib/components/DataQualityStructuralValidationsPanel.js.map +1 -0
- package/lib/components/DataQualityTabs.d.ts +22 -0
- package/lib/components/DataQualityTabs.d.ts.map +1 -0
- package/lib/components/DataQualityTabs.js +58 -0
- package/lib/components/DataQualityTabs.js.map +1 -0
- package/lib/components/DataQualityValidationEditor.d.ts +23 -0
- package/lib/components/DataQualityValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityValidationEditor.js +24 -0
- package/lib/components/DataQualityValidationEditor.js.map +1 -0
- package/lib/components/constants/DataQualityConstants.d.ts +24 -0
- package/lib/components/constants/DataQualityConstants.d.ts.map +1 -0
- package/lib/components/constants/DataQualityConstants.js +25 -0
- package/lib/components/constants/DataQualityConstants.js.map +1 -0
- package/lib/components/index.d.ts +19 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +19 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/states/ConstraintState.d.ts +30 -0
- package/lib/components/states/ConstraintState.d.ts.map +1 -0
- package/lib/components/states/ConstraintState.js +55 -0
- package/lib/components/states/ConstraintState.js.map +1 -0
- package/lib/components/states/DataQualityClassValidationState.d.ts +43 -0
- package/lib/components/states/DataQualityClassValidationState.d.ts.map +1 -0
- package/lib/components/states/DataQualityClassValidationState.js +162 -0
- package/lib/components/states/DataQualityClassValidationState.js.map +1 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.d.ts +34 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.d.ts.map +1 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.js +70 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.js.map +1 -0
- package/lib/components/states/DataQualityQueryBuilderState.d.ts +19 -0
- package/lib/components/states/DataQualityQueryBuilderState.d.ts.map +1 -0
- package/lib/components/states/DataQualityQueryBuilderState.js +19 -0
- package/lib/components/states/DataQualityQueryBuilderState.js.map +1 -0
- package/lib/components/states/DataQualityResultState.d.ts +44 -0
- package/lib/components/states/DataQualityResultState.d.ts.map +1 -0
- package/lib/components/states/DataQualityResultState.js +154 -0
- package/lib/components/states/DataQualityResultState.js.map +1 -0
- package/lib/components/states/DataQualityServiceValidationState.d.ts +25 -0
- package/lib/components/states/DataQualityServiceValidationState.d.ts.map +1 -0
- package/lib/components/states/DataQualityServiceValidationState.js +33 -0
- package/lib/components/states/DataQualityServiceValidationState.js.map +1 -0
- package/lib/components/states/DataQualityState.d.ts +67 -0
- package/lib/components/states/DataQualityState.d.ts.map +1 -0
- package/lib/components/states/DataQualityState.js +204 -0
- package/lib/components/states/DataQualityState.js.map +1 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts +51 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts.map +1 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.js +321 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.js.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.d.ts +29 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.d.ts.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.js +30 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.js.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.d.ts +22 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.d.ts.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.js +31 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.d.ts +26 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.js +44 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.d.ts +47 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js +75 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.d.ts +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.js +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.d.ts +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.js +30 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.d.ts +26 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.js +57 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.d.ts +7 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.js +42 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.js.map +1 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.d.ts +24 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.d.ts.map +1 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.js +98 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.js.map +1 -0
- package/lib/graph-manager/index.d.ts +19 -0
- package/lib/graph-manager/index.d.ts.map +1 -0
- package/lib/graph-manager/index.js +19 -0
- package/lib/graph-manager/index.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js +21 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.d.ts +25 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.js +140 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.d.ts +18 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.js +20 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts +41 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js +95 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.d.ts +46 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.js +32 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.js +31 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.js +92 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.js +56 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.js +70 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.d.ts +29 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.js +80 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/package.json +87 -0
- package/package.json +87 -0
- package/src/components/DSL_DataQuality_ClassElementDriver.tsx +175 -0
- package/src/components/DSL_DataQuality_LegendStudioApplicationPlugin.tsx +220 -0
- package/src/components/DSL_DataQuality_LegendStudioPlugin_Extension.ts +39 -0
- package/src/components/DSL_DataQuality_ServiceElementDriver.tsx +57 -0
- package/src/components/DSL_NewDataQualityClassValidationElement.tsx +156 -0
- package/src/components/DSL_NewDataQualityServiceValidationElement.tsx +74 -0
- package/src/components/DataQualityClassValidationEditor.tsx +49 -0
- package/src/components/DataQualityConstraintsSelection.tsx +376 -0
- package/src/components/DataQualityDataSpaceBuilder.tsx +274 -0
- package/src/components/DataQualityExplorerPanel.tsx +584 -0
- package/src/components/DataQualityFilterPanel.tsx +50 -0
- package/src/components/DataQualityMappingAndRuntimeBuilder.tsx +224 -0
- package/src/components/DataQualityResultPanel.tsx +335 -0
- package/src/components/DataQualityResultValues.tsx +61 -0
- package/src/components/DataQualityServiceValidationEditor.tsx +49 -0
- package/src/components/DataQualitySideBar.tsx +216 -0
- package/src/components/DataQualityStructuralValidationsPanel.tsx +105 -0
- package/src/components/DataQualityTabs.tsx +104 -0
- package/src/components/DataQualityValidationEditor.tsx +52 -0
- package/src/components/constants/DataQualityConstants.ts +24 -0
- package/src/components/index.ts +19 -0
- package/src/components/states/ConstraintState.ts +70 -0
- package/src/components/states/DataQualityClassValidationState.ts +308 -0
- package/src/components/states/DataQualityGraphFetchTreeState.ts +125 -0
- package/src/components/states/DataQualityQueryBuilderState.ts +19 -0
- package/src/components/states/DataQualityResultState.ts +217 -0
- package/src/components/states/DataQualityServiceValidationState.ts +56 -0
- package/src/components/states/DataQualityState.ts +354 -0
- package/src/components/utils/DataQualityGraphFetchTreeUtil.ts +592 -0
- package/src/graph/metamodel/DSL_DataQuality_HashUtils.ts +29 -0
- package/src/graph/metamodel/DSL_DataQuality_PureGraphPlugin.ts +36 -0
- package/src/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.ts +55 -0
- package/src/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.ts +107 -0
- package/src/graph-manager/DSL_DataQuality_GraphManagerHelper.ts +46 -0
- package/src/graph-manager/DSL_DataQuality_GraphManagerPreset.ts +31 -0
- package/src/graph-manager/DSL_DataQuality_GraphModifierHelper.ts +113 -0
- package/src/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.ts +59 -0
- package/src/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.ts +153 -0
- package/src/graph-manager/index.ts +19 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.ts +59 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.ts +283 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.ts +27 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.ts +246 -0
- package/src/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.ts +103 -0
- package/src/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.ts +37 -0
- package/src/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.ts +36 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.ts +241 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.ts +113 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.ts +139 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.ts +186 -0
- package/style/_data-quality-validation-builder.scss +1660 -0
- package/style/index.scss +67 -0
- package/tsconfig.json +137 -0
- package/tsconfig.package.json +9 -0
@@ -0,0 +1,156 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import { useEditorStore } from '@finos/legend-application-studio';
|
19
|
+
import { BaseRadioGroup, CustomSelectorInput } from '@finos/legend-art';
|
20
|
+
import type { Mapping } from '@finos/legend-graph';
|
21
|
+
import {
|
22
|
+
type PackageableElementOption,
|
23
|
+
buildElementOption,
|
24
|
+
} from '@finos/legend-lego/graph-editor';
|
25
|
+
import {
|
26
|
+
type RuntimeOption,
|
27
|
+
DataQuality_ClassElementDriver,
|
28
|
+
ELEMENT_CREATION_BASIS,
|
29
|
+
} from './DSL_DataQuality_ClassElementDriver.js';
|
30
|
+
import type { DataSpace } from '@finos/legend-extension-dsl-data-space/graph';
|
31
|
+
|
32
|
+
export const NewDataQualityClassValidationElementEditor = observer(() => {
|
33
|
+
const editorStore = useEditorStore();
|
34
|
+
const applicationStore = editorStore.applicationStore;
|
35
|
+
|
36
|
+
const dataQualityDataSpaceDriver =
|
37
|
+
editorStore.newElementState.getNewElementDriver(
|
38
|
+
DataQuality_ClassElementDriver,
|
39
|
+
);
|
40
|
+
const dqElementCreationBasis =
|
41
|
+
dataQualityDataSpaceDriver.dqElementCreationBasis;
|
42
|
+
const dataSpacesOptions = dataQualityDataSpaceDriver.dataSpaceOptions;
|
43
|
+
const mappingOptions = dataQualityDataSpaceDriver.mappingOptions;
|
44
|
+
const runtimeOptions =
|
45
|
+
dataQualityDataSpaceDriver.compatibleMappingRuntimes.map(
|
46
|
+
buildElementOption,
|
47
|
+
);
|
48
|
+
|
49
|
+
const onDataSpaceChange = (
|
50
|
+
val: PackageableElementOption<DataSpace> | null,
|
51
|
+
): void => {
|
52
|
+
if (val) {
|
53
|
+
dataQualityDataSpaceDriver.setDataSpaceSelected(val);
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
const onMappingChange = (
|
58
|
+
val: PackageableElementOption<Mapping> | null,
|
59
|
+
): void => {
|
60
|
+
if (val) {
|
61
|
+
dataQualityDataSpaceDriver.setMappingSelected(val);
|
62
|
+
} else {
|
63
|
+
dataQualityDataSpaceDriver.setMappingSelected(undefined);
|
64
|
+
}
|
65
|
+
dataQualityDataSpaceDriver.setRuntimeSelected(
|
66
|
+
dataQualityDataSpaceDriver.runtimeOptions.length > 0
|
67
|
+
? dataQualityDataSpaceDriver.runtimeOptions[0]
|
68
|
+
: undefined,
|
69
|
+
);
|
70
|
+
};
|
71
|
+
|
72
|
+
const onRuntimeChange = (val: RuntimeOption | null): void => {
|
73
|
+
if (val) {
|
74
|
+
dataQualityDataSpaceDriver.setRuntimeSelected(val);
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
const handleDQElementCreationBasisChange = (
|
79
|
+
event: React.ChangeEvent<HTMLInputElement>,
|
80
|
+
): void => {
|
81
|
+
const validationElementCreationBasis = (event.target as HTMLInputElement)
|
82
|
+
.value as ELEMENT_CREATION_BASIS;
|
83
|
+
dataQualityDataSpaceDriver.setDqElementCreationBasis(
|
84
|
+
validationElementCreationBasis,
|
85
|
+
);
|
86
|
+
};
|
87
|
+
|
88
|
+
return (
|
89
|
+
<div>
|
90
|
+
<div className="element-creation-basis">
|
91
|
+
<BaseRadioGroup
|
92
|
+
value={dqElementCreationBasis}
|
93
|
+
onChange={handleDQElementCreationBasisChange}
|
94
|
+
row={false}
|
95
|
+
options={[
|
96
|
+
ELEMENT_CREATION_BASIS.DATASPACE_BASED,
|
97
|
+
ELEMENT_CREATION_BASIS.MAPPING_RUNTIME_BASED,
|
98
|
+
]}
|
99
|
+
size={2}
|
100
|
+
/>
|
101
|
+
</div>
|
102
|
+
{dqElementCreationBasis === ELEMENT_CREATION_BASIS.DATASPACE_BASED ? (
|
103
|
+
<div>
|
104
|
+
<div className="panel__content__form__section__header__label">
|
105
|
+
DataSpace
|
106
|
+
</div>
|
107
|
+
<div className="data-quality-explorer__new-element-modal__driver">
|
108
|
+
<CustomSelectorInput
|
109
|
+
className="data-quality-explorer__new-element-modal__driver__dropdown"
|
110
|
+
options={dataSpacesOptions}
|
111
|
+
onChange={onDataSpaceChange}
|
112
|
+
value={dataQualityDataSpaceDriver.dataSpaceSelected}
|
113
|
+
darkMode={
|
114
|
+
!applicationStore.layoutService
|
115
|
+
.TEMPORARY__isLightColorThemeEnabled
|
116
|
+
}
|
117
|
+
/>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
) : (
|
121
|
+
<div>
|
122
|
+
<div className="panel__content__form__section__header__label">
|
123
|
+
Mapping
|
124
|
+
</div>
|
125
|
+
<div className="data-quality-explorer__new-element-modal__driver">
|
126
|
+
<CustomSelectorInput
|
127
|
+
className="data-quality-explorer__new-element-modal__driver__dropdown"
|
128
|
+
options={mappingOptions}
|
129
|
+
onChange={onMappingChange}
|
130
|
+
value={dataQualityDataSpaceDriver.mappingSelected}
|
131
|
+
darkMode={
|
132
|
+
!applicationStore.layoutService
|
133
|
+
.TEMPORARY__isLightColorThemeEnabled
|
134
|
+
}
|
135
|
+
/>
|
136
|
+
</div>
|
137
|
+
<div className="panel__content__form__section__header__label">
|
138
|
+
Runtime
|
139
|
+
</div>
|
140
|
+
<div className="data-quality-explorer__new-element-modal__driver">
|
141
|
+
<CustomSelectorInput
|
142
|
+
className="data-quality-explorer__new-element-modal__driver__dropdown"
|
143
|
+
options={runtimeOptions}
|
144
|
+
onChange={onRuntimeChange}
|
145
|
+
value={dataQualityDataSpaceDriver.runtimeSelected}
|
146
|
+
darkMode={
|
147
|
+
!applicationStore.layoutService
|
148
|
+
.TEMPORARY__isLightColorThemeEnabled
|
149
|
+
}
|
150
|
+
/>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
)}
|
154
|
+
</div>
|
155
|
+
);
|
156
|
+
});
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import { useEditorStore } from '@finos/legend-application-studio';
|
19
|
+
import { CustomSelectorInput } from '@finos/legend-art';
|
20
|
+
import { DataQuality_ServiceElementDriver } from './DSL_DataQuality_ServiceElementDriver.js';
|
21
|
+
import {
|
22
|
+
type PackageableElementOption,
|
23
|
+
buildElementOption,
|
24
|
+
} from '@finos/legend-lego/graph-editor';
|
25
|
+
import type { Service } from '@finos/legend-graph';
|
26
|
+
|
27
|
+
export const NewDataQualityServiceValidationElementEditor = observer(() => {
|
28
|
+
const editorStore = useEditorStore();
|
29
|
+
const applicationStore = editorStore.applicationStore;
|
30
|
+
const dataQualityServiceElementDriver =
|
31
|
+
editorStore.newElementState.getNewElementDriver(
|
32
|
+
DataQuality_ServiceElementDriver,
|
33
|
+
);
|
34
|
+
|
35
|
+
const serviceOptions =
|
36
|
+
editorStore.graphManagerState.usableServices.map(buildElementOption);
|
37
|
+
|
38
|
+
const selectedServiceOption = dataQualityServiceElementDriver.serviceSelected
|
39
|
+
? {
|
40
|
+
label: dataQualityServiceElementDriver.serviceSelected.value.name,
|
41
|
+
value: dataQualityServiceElementDriver.serviceSelected,
|
42
|
+
}
|
43
|
+
: undefined;
|
44
|
+
|
45
|
+
const onServiceOptionChange = (
|
46
|
+
val: PackageableElementOption<Service> | undefined,
|
47
|
+
): void => {
|
48
|
+
if (val) {
|
49
|
+
dataQualityServiceElementDriver.setServiceSelected(val);
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
return (
|
54
|
+
<>
|
55
|
+
<div>
|
56
|
+
<div className="panel__content__form__section__header__label">
|
57
|
+
Service
|
58
|
+
</div>
|
59
|
+
<div className="data-quality-explorer__new-element-modal__driver">
|
60
|
+
<CustomSelectorInput
|
61
|
+
className="data-quality-explorer__new-element-modal__driver__dropdown"
|
62
|
+
options={serviceOptions}
|
63
|
+
onChange={onServiceOptionChange}
|
64
|
+
value={selectedServiceOption}
|
65
|
+
darkMode={
|
66
|
+
!applicationStore.layoutService
|
67
|
+
.TEMPORARY__isLightColorThemeEnabled
|
68
|
+
}
|
69
|
+
/>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
</>
|
73
|
+
);
|
74
|
+
});
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import { useEditorStore } from '@finos/legend-application-studio';
|
19
|
+
import { DataQualityClassValidationState } from './states/DataQualityClassValidationState.js';
|
20
|
+
import { DataQualityClassValidationSideBar } from './DataQualitySideBar.js';
|
21
|
+
import { DataQualityValidationEditor } from './DataQualityValidationEditor.js';
|
22
|
+
import { DataQualityExplorerPanel } from './DataQualityExplorerPanel.js';
|
23
|
+
import { ResizablePanel, ResizablePanelGroup } from '@finos/legend-art';
|
24
|
+
|
25
|
+
export const DataQualityClassValidationEditor = observer(() => {
|
26
|
+
const editorStore = useEditorStore();
|
27
|
+
const dataQualityClassValidationState =
|
28
|
+
editorStore.tabManagerState.getCurrentEditorState(
|
29
|
+
DataQualityClassValidationState,
|
30
|
+
);
|
31
|
+
return (
|
32
|
+
<DataQualityValidationEditor
|
33
|
+
dataQualityState={dataQualityClassValidationState}
|
34
|
+
SideBarBasisComponent={
|
35
|
+
<DataQualityClassValidationSideBar
|
36
|
+
dataQualityClassValidationState={dataQualityClassValidationState}
|
37
|
+
>
|
38
|
+
<ResizablePanelGroup orientation="horizontal">
|
39
|
+
<ResizablePanel minSize={40} direction={1}>
|
40
|
+
<DataQualityExplorerPanel
|
41
|
+
dataQualityState={dataQualityClassValidationState}
|
42
|
+
/>
|
43
|
+
</ResizablePanel>
|
44
|
+
</ResizablePanelGroup>
|
45
|
+
</DataQualityClassValidationSideBar>
|
46
|
+
}
|
47
|
+
/>
|
48
|
+
);
|
49
|
+
});
|
@@ -0,0 +1,376 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import type { DataQualityState } from './states/DataQualityState.js';
|
19
|
+
import { useDrop } from 'react-dnd';
|
20
|
+
import { useCallback } from 'react';
|
21
|
+
import { getClassPropertyIcon } from '@finos/legend-lego/graph-editor';
|
22
|
+
import {
|
23
|
+
type DataQualityGraphFetchTreeData,
|
24
|
+
DataQualityGraphFetchTreeNodeData,
|
25
|
+
isConstraintsClassesTreeEmpty,
|
26
|
+
removeNodeRecursively,
|
27
|
+
} from './utils/DataQualityGraphFetchTreeUtil.js';
|
28
|
+
import type { ConstraintState } from './states/ConstraintState.js';
|
29
|
+
import {
|
30
|
+
type TreeNodeContainerProps,
|
31
|
+
BlankPanelPlaceholder,
|
32
|
+
CheckSquareIcon,
|
33
|
+
ChevronDownIcon,
|
34
|
+
ChevronRightIcon,
|
35
|
+
clsx,
|
36
|
+
PanelDropZone,
|
37
|
+
PURE_UnknownElementTypeIcon,
|
38
|
+
SquareIcon,
|
39
|
+
TimesIcon,
|
40
|
+
TreeView,
|
41
|
+
} from '@finos/legend-art';
|
42
|
+
import { dataQualityClassValidation_setDataQualityGraphFetchTree } from '../graph-manager/DSL_DataQuality_GraphModifierHelper.js';
|
43
|
+
import type { DataQualityClassValidationsConfiguration } from '../graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js';
|
44
|
+
import {
|
45
|
+
type Type,
|
46
|
+
Class,
|
47
|
+
Enumeration,
|
48
|
+
PropertyGraphFetchTree,
|
49
|
+
RootGraphFetchTree,
|
50
|
+
} from '@finos/legend-graph';
|
51
|
+
import { DATA_QUALITY_VALIDATION_TEST_ID } from './constants/DataQualityConstants.js';
|
52
|
+
import { flowResult } from 'mobx';
|
53
|
+
import { DataQualityStructuralValidationsPanel } from './DataQualityStructuralValidationsPanel.js';
|
54
|
+
import {
|
55
|
+
type QueryBuilderExplorerTreeDragSource,
|
56
|
+
QUERY_BUILDER_EXPLORER_TREE_DND_TYPE,
|
57
|
+
} from '@finos/legend-query-builder';
|
58
|
+
|
59
|
+
export const getQueryBuilderExplorerTreeNodeSortRank = (
|
60
|
+
node: DataQualityGraphFetchTreeNodeData,
|
61
|
+
): number => {
|
62
|
+
if (node.type instanceof Class) {
|
63
|
+
return 1;
|
64
|
+
} else if (node.type instanceof Enumeration) {
|
65
|
+
return 2;
|
66
|
+
} else {
|
67
|
+
return 3;
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
export const DataQualityConstraintsTreeNodeContainer = observer(
|
72
|
+
(
|
73
|
+
props: TreeNodeContainerProps<
|
74
|
+
DataQualityGraphFetchTreeNodeData,
|
75
|
+
{
|
76
|
+
dataQualityState: DataQualityState;
|
77
|
+
isReadOnly: boolean;
|
78
|
+
removeNode?: (node: DataQualityGraphFetchTreeNodeData) => void;
|
79
|
+
}
|
80
|
+
>,
|
81
|
+
) => {
|
82
|
+
const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
|
83
|
+
const { dataQualityState, isReadOnly, removeNode } = innerProps;
|
84
|
+
const { dataQualityGraphFetchTreeState } = dataQualityState;
|
85
|
+
let property, type: Type | undefined;
|
86
|
+
if (node.tree instanceof PropertyGraphFetchTree) {
|
87
|
+
property = node.tree.property.value;
|
88
|
+
type = property.genericType.value.rawType;
|
89
|
+
} else if (node.tree instanceof RootGraphFetchTree) {
|
90
|
+
type = node.tree.class.value;
|
91
|
+
}
|
92
|
+
|
93
|
+
const isExpandable = Boolean(node.childrenIds.length);
|
94
|
+
const nodeExpandIcon = isExpandable ? (
|
95
|
+
node.isOpen ? (
|
96
|
+
<ChevronDownIcon />
|
97
|
+
) : (
|
98
|
+
<ChevronRightIcon />
|
99
|
+
)
|
100
|
+
) : (
|
101
|
+
<div />
|
102
|
+
);
|
103
|
+
const nodeTypeIcon = type ? (
|
104
|
+
getClassPropertyIcon(type)
|
105
|
+
) : (
|
106
|
+
<PURE_UnknownElementTypeIcon />
|
107
|
+
);
|
108
|
+
const toggleExpandNode = (): void => onNodeSelect?.(node);
|
109
|
+
const deleteNode = (): void => removeNode?.(node);
|
110
|
+
const toggleChecked = (constraint: ConstraintState): void => {
|
111
|
+
dataQualityGraphFetchTreeState.updateNode(
|
112
|
+
node,
|
113
|
+
constraint.constraint,
|
114
|
+
!constraint.isSelected,
|
115
|
+
);
|
116
|
+
constraint.setIsSelected(!constraint.isSelected);
|
117
|
+
};
|
118
|
+
|
119
|
+
return (
|
120
|
+
<div className="constraints-selection-node">
|
121
|
+
<div
|
122
|
+
className="tree-view__node__container data-quality-validation-graph-fetch-tree__node__container"
|
123
|
+
style={{
|
124
|
+
paddingLeft: `${(level - 1) * (stepPaddingInRem ?? 2)}rem`,
|
125
|
+
display: 'flex',
|
126
|
+
}}
|
127
|
+
>
|
128
|
+
<div className="data-quality-validation-graph-fetch-tree__node__content">
|
129
|
+
<div className="tree-view__node__icon data-quality-validation-graph-fetch-tree__node__icon">
|
130
|
+
<div
|
131
|
+
className="data-quality-validation-graph-fetch-tree__expand-icon"
|
132
|
+
onClick={toggleExpandNode}
|
133
|
+
>
|
134
|
+
{nodeExpandIcon}
|
135
|
+
</div>
|
136
|
+
<div
|
137
|
+
className="data-quality-validation-graph-fetch-tree__type-icon"
|
138
|
+
onClick={toggleExpandNode}
|
139
|
+
>
|
140
|
+
{nodeTypeIcon}
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
<div
|
144
|
+
className="tree-view__node__label data-quality-validation-graph-fetch-tree__node__label"
|
145
|
+
onClick={toggleExpandNode}
|
146
|
+
>
|
147
|
+
{node.label}
|
148
|
+
{
|
149
|
+
<div className="data-quality-validation-graph-fetch-tree__node__type">
|
150
|
+
<div className="data-quality-validation-graph-fetch-tree__node__type__label">
|
151
|
+
{type ? type.name : ''}
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
}
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
{!node.isReadOnly ? (
|
158
|
+
<div className="data-quality-validation-graph-fetch-tree__node__actions">
|
159
|
+
<button
|
160
|
+
className="data-quality-validation-graph-fetch-tree__node__action"
|
161
|
+
title="Remove"
|
162
|
+
tabIndex={-1}
|
163
|
+
onClick={deleteNode}
|
164
|
+
disabled={isReadOnly}
|
165
|
+
>
|
166
|
+
<TimesIcon />
|
167
|
+
</button>
|
168
|
+
</div>
|
169
|
+
) : (
|
170
|
+
<div />
|
171
|
+
)}
|
172
|
+
</div>
|
173
|
+
{node.constraints.length ? (
|
174
|
+
<div
|
175
|
+
style={{
|
176
|
+
paddingLeft: `${(level + 2) * (stepPaddingInRem ?? 2)}rem`,
|
177
|
+
display: 'flex',
|
178
|
+
flexDirection: 'column',
|
179
|
+
}}
|
180
|
+
>
|
181
|
+
{node.constraints.map((constraint) => (
|
182
|
+
<div
|
183
|
+
className="data-quality-validation-graph-fetch-tree__node__label data-quality-validation-graph-fetch-tree__node__constraint"
|
184
|
+
key={constraint.lambdaId}
|
185
|
+
onClick={() => {
|
186
|
+
toggleChecked(constraint);
|
187
|
+
}}
|
188
|
+
>
|
189
|
+
<button
|
190
|
+
className={clsx(
|
191
|
+
'panel__content__form__section__toggler__btn',
|
192
|
+
'data-quality-validation-graph-fetch-tree__constraint__checkbox',
|
193
|
+
{
|
194
|
+
'panel__content__form__section__toggler__btn--toggled':
|
195
|
+
constraint.isSelected,
|
196
|
+
},
|
197
|
+
)}
|
198
|
+
>
|
199
|
+
{constraint.isSelected ? <CheckSquareIcon /> : <SquareIcon />}
|
200
|
+
</button>
|
201
|
+
<div className="data-quality-validation-graph-fetch-tree__constraint__name">
|
202
|
+
{constraint.constraint.name}
|
203
|
+
</div>
|
204
|
+
<div className="data-quality-validation-graph-fetch-tree__constraint__value">
|
205
|
+
{constraint.lambdaString}
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
))}
|
209
|
+
</div>
|
210
|
+
) : (
|
211
|
+
<></>
|
212
|
+
)}
|
213
|
+
</div>
|
214
|
+
);
|
215
|
+
},
|
216
|
+
);
|
217
|
+
|
218
|
+
export const ConstraintsSelectionExplorer = observer(
|
219
|
+
(props: {
|
220
|
+
constraintsClasses: DataQualityGraphFetchTreeData;
|
221
|
+
dataQualityState: DataQualityState;
|
222
|
+
updateTreeData: (data: DataQualityGraphFetchTreeData) => void;
|
223
|
+
}) => {
|
224
|
+
const { constraintsClasses, dataQualityState, updateTreeData } = props;
|
225
|
+
const { applicationStore } = dataQualityState;
|
226
|
+
const getChildNodes = (
|
227
|
+
node: DataQualityGraphFetchTreeNodeData,
|
228
|
+
): DataQualityGraphFetchTreeNodeData[] =>
|
229
|
+
node.childrenIds
|
230
|
+
.map((id) => constraintsClasses.nodes.get(id))
|
231
|
+
.filter(
|
232
|
+
(_node): _node is DataQualityGraphFetchTreeNodeData =>
|
233
|
+
_node instanceof DataQualityGraphFetchTreeNodeData,
|
234
|
+
)
|
235
|
+
.sort((a, b) => a.label.localeCompare(b.label))
|
236
|
+
.sort(
|
237
|
+
(a, b) =>
|
238
|
+
getQueryBuilderExplorerTreeNodeSortRank(b) -
|
239
|
+
getQueryBuilderExplorerTreeNodeSortRank(a),
|
240
|
+
);
|
241
|
+
const removeNode = (node: DataQualityGraphFetchTreeNodeData): void => {
|
242
|
+
removeNodeRecursively(constraintsClasses, node);
|
243
|
+
updateTreeData({ ...constraintsClasses });
|
244
|
+
dataQualityClassValidation_setDataQualityGraphFetchTree(
|
245
|
+
dataQualityState.constraintsConfigurationElement as DataQualityClassValidationsConfiguration,
|
246
|
+
constraintsClasses.tree,
|
247
|
+
);
|
248
|
+
};
|
249
|
+
|
250
|
+
const showStructuralValidations = () => {
|
251
|
+
dataQualityState.setShowStructuralValidations(true);
|
252
|
+
flowResult(dataQualityState.fetchStructuralValidations()).catch(
|
253
|
+
applicationStore.alertUnhandledError,
|
254
|
+
);
|
255
|
+
};
|
256
|
+
|
257
|
+
const disableSyncToDQ = Boolean(
|
258
|
+
!dataQualityState.dataQualityGraphFetchTreeState.treeData,
|
259
|
+
);
|
260
|
+
|
261
|
+
return (
|
262
|
+
<div className="data-quality-validation-graph-fetch-constraints-selection__config-group__content">
|
263
|
+
<div className="data-quality-validation-graph-fetch-constraints-selection__structural-attributes">
|
264
|
+
<button
|
265
|
+
className="btn--dark structure-validations-btn"
|
266
|
+
onClick={showStructuralValidations}
|
267
|
+
disabled={Boolean(disableSyncToDQ)}
|
268
|
+
tabIndex={-1}
|
269
|
+
title="Show Structural Attributes to be validated during run"
|
270
|
+
>
|
271
|
+
Show Structural Attributes
|
272
|
+
</button>
|
273
|
+
</div>
|
274
|
+
<div className="data-quality-validation-graph-fetch-constraints-selection__config-group__item">
|
275
|
+
<TreeView
|
276
|
+
components={{
|
277
|
+
TreeNodeContainer: DataQualityConstraintsTreeNodeContainer,
|
278
|
+
}}
|
279
|
+
className="data-quality-validation-graph-fetch-tree__container__tree"
|
280
|
+
treeData={constraintsClasses}
|
281
|
+
getChildNodes={getChildNodes}
|
282
|
+
innerProps={{
|
283
|
+
dataQualityState,
|
284
|
+
isReadOnly: false,
|
285
|
+
removeNode,
|
286
|
+
}}
|
287
|
+
/>
|
288
|
+
</div>
|
289
|
+
<DataQualityStructuralValidationsPanel
|
290
|
+
dataQualityState={dataQualityState}
|
291
|
+
/>
|
292
|
+
</div>
|
293
|
+
);
|
294
|
+
},
|
295
|
+
);
|
296
|
+
|
297
|
+
export const DataQualityConstraintsSelection = observer(
|
298
|
+
(props: { dataQualityState: DataQualityState }) => {
|
299
|
+
const { dataQualityState } = props;
|
300
|
+
const constraintsConfiguration =
|
301
|
+
dataQualityState.constraintsConfigurationElement;
|
302
|
+
const dataQualityGraphFetchTreeState =
|
303
|
+
dataQualityState.dataQualityGraphFetchTreeState;
|
304
|
+
const treeData = dataQualityGraphFetchTreeState.treeData;
|
305
|
+
|
306
|
+
const updateTreeData = (data: DataQualityGraphFetchTreeData): void => {
|
307
|
+
dataQualityGraphFetchTreeState.setGraphFetchTree(data);
|
308
|
+
};
|
309
|
+
|
310
|
+
const handleDrop = useCallback(
|
311
|
+
(item: QueryBuilderExplorerTreeDragSource): void => {
|
312
|
+
dataQualityGraphFetchTreeState.addProperty(item.node, {
|
313
|
+
refreshTreeData: true,
|
314
|
+
});
|
315
|
+
if (dataQualityGraphFetchTreeState.treeData) {
|
316
|
+
dataQualityClassValidation_setDataQualityGraphFetchTree(
|
317
|
+
constraintsConfiguration as DataQualityClassValidationsConfiguration,
|
318
|
+
dataQualityGraphFetchTreeState.treeData.tree,
|
319
|
+
);
|
320
|
+
}
|
321
|
+
},
|
322
|
+
[dataQualityGraphFetchTreeState, constraintsConfiguration],
|
323
|
+
);
|
324
|
+
|
325
|
+
const [{ isDragOver }, dropTargetConnector] = useDrop<
|
326
|
+
QueryBuilderExplorerTreeDragSource,
|
327
|
+
void,
|
328
|
+
{ isDragOver: boolean }
|
329
|
+
>(
|
330
|
+
() => ({
|
331
|
+
accept: [
|
332
|
+
QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.CLASS_PROPERTY,
|
333
|
+
QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY,
|
334
|
+
],
|
335
|
+
drop: (item, monitor): void => {
|
336
|
+
if (!monitor.didDrop()) {
|
337
|
+
handleDrop(item);
|
338
|
+
} // prevent drop event propagation to accomondate for nested DnD
|
339
|
+
},
|
340
|
+
collect: (monitor) => ({
|
341
|
+
isDragOver: monitor.isOver({ shallow: true }),
|
342
|
+
}),
|
343
|
+
}),
|
344
|
+
[handleDrop],
|
345
|
+
);
|
346
|
+
|
347
|
+
return (
|
348
|
+
<div
|
349
|
+
data-testid={
|
350
|
+
DATA_QUALITY_VALIDATION_TEST_ID.DATA_QUALITY_VALIDATION_TREE
|
351
|
+
}
|
352
|
+
className="constraints-selection-tab"
|
353
|
+
>
|
354
|
+
<PanelDropZone
|
355
|
+
isDragOver={isDragOver}
|
356
|
+
dropTargetConnector={dropTargetConnector}
|
357
|
+
contentClassName="data-quality-validation-graph-fetch-panel"
|
358
|
+
>
|
359
|
+
{(!treeData || isConstraintsClassesTreeEmpty(treeData)) && (
|
360
|
+
<BlankPanelPlaceholder
|
361
|
+
text="Add a scope for constraints"
|
362
|
+
tooltipText="Drag and drop properties here"
|
363
|
+
/>
|
364
|
+
)}
|
365
|
+
{treeData && !isConstraintsClassesTreeEmpty(treeData) && (
|
366
|
+
<ConstraintsSelectionExplorer
|
367
|
+
constraintsClasses={treeData}
|
368
|
+
dataQualityState={dataQualityState}
|
369
|
+
updateTreeData={updateTreeData}
|
370
|
+
/>
|
371
|
+
)}
|
372
|
+
</PanelDropZone>
|
373
|
+
</div>
|
374
|
+
);
|
375
|
+
},
|
376
|
+
);
|