@finos/legend-extension-dsl-data-quality 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/lib/components/DSL_DataQuality_ClassElementDriver.d.ts.map +1 -1
  2. package/lib/components/DSL_DataQuality_ClassElementDriver.js +12 -5
  3. package/lib/components/DSL_DataQuality_ClassElementDriver.js.map +1 -1
  4. package/lib/components/DataQualityConstraintsSelection.d.ts.map +1 -1
  5. package/lib/components/DataQualityConstraintsSelection.js +42 -4
  6. package/lib/components/DataQualityConstraintsSelection.js.map +1 -1
  7. package/lib/components/DataQualityResultPanel.js +3 -3
  8. package/lib/components/DataQualityResultPanel.js.map +1 -1
  9. package/lib/components/states/DataQualityGraphFetchTreeState.d.ts +2 -3
  10. package/lib/components/states/DataQualityGraphFetchTreeState.d.ts.map +1 -1
  11. package/lib/components/states/DataQualityGraphFetchTreeState.js +2 -5
  12. package/lib/components/states/DataQualityGraphFetchTreeState.js.map +1 -1
  13. package/lib/components/states/DataQualityState.d.ts +1 -2
  14. package/lib/components/states/DataQualityState.d.ts.map +1 -1
  15. package/lib/components/states/DataQualityState.js +5 -8
  16. package/lib/components/states/DataQualityState.js.map +1 -1
  17. package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts +2 -1
  18. package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts.map +1 -1
  19. package/lib/components/utils/DataQualityGraphFetchTreeUtil.js +14 -4
  20. package/lib/components/utils/DataQualityGraphFetchTreeUtil.js.map +1 -1
  21. package/lib/index.css +2 -2
  22. package/lib/index.css.map +1 -1
  23. package/lib/package.json +1 -1
  24. package/package.json +2 -2
  25. package/src/components/DSL_DataQuality_ClassElementDriver.tsx +25 -3
  26. package/src/components/DataQualityConstraintsSelection.tsx +74 -11
  27. package/src/components/DataQualityResultPanel.tsx +5 -5
  28. package/src/components/states/DataQualityGraphFetchTreeState.ts +2 -6
  29. package/src/components/states/DataQualityState.ts +12 -15
  30. package/src/components/utils/DataQualityGraphFetchTreeUtil.ts +42 -16
  31. package/style/_data-quality-validation-builder.scss +7 -2
  32. package/style/index.scss +1 -0
@@ -380,22 +380,27 @@ export const isConstraintsClassesTreeEmpty = (
380
380
  treeData: DataQualityGraphFetchTreeData,
381
381
  ): boolean => treeData.rootIds.length === 0;
382
382
 
383
- export const updateNodeConstraints = (
384
- treeData: DataQualityGraphFetchTreeData,
385
- node: DataQualityGraphFetchTreeNodeData,
386
- constraint: Constraint,
387
- addConstraint: boolean,
388
- ): void => {
389
- //update the node of graph fetch tree present
390
- const updatedTreeNode = node.tree;
391
- if (addConstraint) {
392
- updatedTreeNode.constraints.push(constraint.name);
393
- } else {
394
- updatedTreeNode.constraints = updatedTreeNode.constraints.filter(
395
- (constraintName) => constraintName !== constraint.name,
396
- );
397
- }
398
- };
383
+ export const updateNodeConstraints = action(
384
+ (
385
+ treeData: DataQualityGraphFetchTreeData,
386
+ node: DataQualityGraphFetchTreeNodeData,
387
+ constraints: Constraint[],
388
+ addConstraint: boolean,
389
+ ): void => {
390
+ //update the node of graph fetch tree present
391
+ const updatedTreeNode = node.tree;
392
+ if (addConstraint) {
393
+ constraints.forEach((constraint) => {
394
+ updatedTreeNode.constraints.push(constraint.name);
395
+ });
396
+ } else {
397
+ updatedTreeNode.constraints = updatedTreeNode.constraints.filter(
398
+ (constraintName) =>
399
+ !constraints.find((constraint) => constraint.name === constraintName),
400
+ );
401
+ }
402
+ },
403
+ );
399
404
 
400
405
  export const addQueryBuilderPropertyNode = (
401
406
  treeData: DataQualityGraphFetchTreeData,
@@ -560,3 +565,24 @@ export const addQueryBuilderPropertyNode = (
560
565
  treeData.nodes.set(rootNodeFromTree.id, rootNodeFromTree);
561
566
  }
562
567
  };
568
+
569
+ export const buildDefaultDataQualityRootGraphFetchTree = action(
570
+ (selectedClass: Class): DataQualityRootGraphFetchTree => {
571
+ const dataQualityRootGraphFetchTree = new DataQualityRootGraphFetchTree(
572
+ PackageableElementExplicitReference.create(selectedClass),
573
+ );
574
+ dataQualityRootGraphFetchTree.constraints = selectedClass.constraints.map(
575
+ (constraint) => constraint.name,
576
+ );
577
+ dataQualityRootGraphFetchTree.subTrees = selectedClass.properties
578
+ .filter((property) => property.multiplicity.lowerBound > 0)
579
+ .map(
580
+ (property) =>
581
+ new DataQualityPropertyGraphFetchTree(
582
+ PropertyExplicitReference.create(property),
583
+ undefined,
584
+ ),
585
+ );
586
+ return dataQualityRootGraphFetchTree;
587
+ },
588
+ );
@@ -1013,8 +1013,9 @@
1013
1013
  }
1014
1014
 
1015
1015
  &__node__icon {
1016
- width: 4.5rem;
1017
- min-width: 4.5rem;
1016
+ padding-right: 0.5rem;
1017
+ height: 2.2rem;
1018
+ @include flexCenter;
1018
1019
  }
1019
1020
 
1020
1021
  &__expand-icon,
@@ -1590,6 +1591,10 @@
1590
1591
  background: var(--color-green-200);
1591
1592
  }
1592
1593
  }
1594
+
1595
+ &__validation {
1596
+ width: 12rem;
1597
+ }
1593
1598
  }
1594
1599
 
1595
1600
  &__export__dropdown {
package/style/index.scss CHANGED
@@ -55,6 +55,7 @@
55
55
  .constraints-selection-node {
56
56
  display: flex;
57
57
  flex-direction: column;
58
+ margin-left: 1rem;
58
59
  }
59
60
 
60
61
  .structure-validations-btn {