@finos/legend-query-builder 4.0.2 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/lib/components/QueryBuilder.js +2 -2
  2. package/lib/components/QueryBuilder.js.map +1 -1
  3. package/lib/components/QueryBuilderDiffPanel.d.ts +5 -0
  4. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderDiffPanel.js +24 -20
  6. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  7. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  8. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +5 -0
  9. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  10. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  11. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +1 -1
  12. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  13. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  14. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +5 -16
  15. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  16. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  17. package/lib/components/filter/QueryBuilderFilterPanel.js +7 -14
  18. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  19. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  20. package/lib/components/shared/LambdaEditor.js +3 -3
  21. package/lib/components/shared/LambdaEditor.js.map +1 -1
  22. package/lib/index.css +1 -17
  23. package/lib/index.css.map +1 -1
  24. package/lib/index.d.ts +2 -0
  25. package/lib/index.d.ts.map +1 -1
  26. package/lib/index.js +2 -0
  27. package/lib/index.js.map +1 -1
  28. package/lib/package.json +1 -1
  29. package/lib/stores/QueryBuilderChangeDetectionState.d.ts +1 -0
  30. package/lib/stores/QueryBuilderChangeDetectionState.d.ts.map +1 -1
  31. package/lib/stores/QueryBuilderChangeDetectionState.js +4 -1
  32. package/lib/stores/QueryBuilderChangeDetectionState.js.map +1 -1
  33. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -0
  34. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  35. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +6 -0
  36. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  37. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  38. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +1 -0
  39. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  40. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +0 -3
  41. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  42. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +0 -12
  43. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  44. package/lib/stores/filter/QueryBuilderFilterState.d.ts +0 -3
  45. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  46. package/lib/stores/filter/QueryBuilderFilterState.js +0 -13
  47. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  48. package/package.json +9 -9
  49. package/src/components/QueryBuilder.tsx +2 -2
  50. package/src/components/QueryBuilderDiffPanel.tsx +103 -73
  51. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +5 -0
  52. package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +8 -0
  53. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +17 -29
  54. package/src/components/filter/QueryBuilderFilterPanel.tsx +19 -28
  55. package/src/components/shared/LambdaEditor.tsx +5 -3
  56. package/src/index.ts +5 -0
  57. package/src/stores/QueryBuilderChangeDetectionState.ts +5 -1
  58. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +7 -0
  59. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +6 -0
  60. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +0 -14
  61. package/src/stores/filter/QueryBuilderFilterState.ts +0 -13
@@ -114,11 +114,15 @@ export class QueryBuilderChangeDetectionState {
114
114
  }
115
115
 
116
116
  showDiffViewPanel(): void {
117
+ this.diffViewState = this.buildQueryBuilderDiffViewState();
118
+ }
119
+
120
+ buildQueryBuilderDiffViewState(): QueryBuilderDiffViewState {
117
121
  assertNonNullable(
118
122
  this.querySnapshot,
119
123
  `Can't show changes: change detection is not properly initialized`,
120
124
  );
121
- this.diffViewState = new QueryBuilderDiffViewState(
125
+ return new QueryBuilderDiffViewState(
122
126
  this,
123
127
  this.querySnapshot,
124
128
  this.querybuilderState.buildQuery(),
@@ -72,6 +72,7 @@ const DEFAULT_PURE_CONFIG_TYPE_NAME = '@type';
72
72
 
73
73
  export class PureSerializationConfig {
74
74
  typeKeyName: string;
75
+ dateTimeFormat: string | undefined;
75
76
  includeType: boolean | undefined;
76
77
  includeEnumType: boolean | undefined;
77
78
  removePropertiesWithNullValues: boolean | undefined;
@@ -85,12 +86,14 @@ export class PureSerializationConfig {
85
86
  typeKeyName: observable,
86
87
  includeType: observable,
87
88
  includeEnumType: observable,
89
+ dateTimeFormat: observable,
88
90
  removePropertiesWithNullValues: observable,
89
91
  removePropertiesWithEmptySets: observable,
90
92
  fullyQualifiedTypePath: observable,
91
93
  includeObjectReference: observable,
92
94
  setTypeName: action,
93
95
  setIncludeObjectReference: action,
96
+ setDateTimeFormat: action,
94
97
  setIncludeType: action,
95
98
  setFullyQualifiedTypePath: action,
96
99
  setRemovePropertiesWithEmptySets: action,
@@ -110,6 +113,10 @@ export class PureSerializationConfig {
110
113
  return config;
111
114
  }
112
115
 
116
+ setDateTimeFormat(val: string | undefined): void {
117
+ this.dateTimeFormat = val;
118
+ }
119
+
113
120
  setTypeName(val: string): void {
114
121
  this.typeKeyName = val;
115
122
  }
@@ -219,6 +219,12 @@ export const processGraphFetchSerializeExpression = (
219
219
  RootGraphFetchTree,
220
220
  `Can't process serialize() expression: serialize() graph-fetch tree root is missing`,
221
221
  );
222
+
223
+ assertTrue(
224
+ graphFetchTreeRoot.subTypeTrees.length === 0,
225
+ `Can't process serialize() expression: subTypeTree is not supported.`,
226
+ );
227
+
222
228
  graphFetchTreeState.setGraphFetchTree(
223
229
  buildGraphFetchTreeData(graphFetchTreeRoot),
224
230
  );
@@ -478,7 +478,6 @@ export class QueryBuilderPostFilterState
478
478
  operators: QueryBuilderPostFilterOperator[] = [];
479
479
  rootIds: string[] = [];
480
480
  nodes = new Map<string, QueryBuilderPostFilterTreeNodeData>();
481
- _suppressClickawayEventListener = false;
482
481
 
483
482
  constructor(
484
483
  tdsState: QueryBuilderTDSState,
@@ -502,7 +501,6 @@ export class QueryBuilderPostFilterState
502
501
  collapseTree: action,
503
502
  expandTree: action,
504
503
  replaceBlankNodeWithNode: action,
505
- suppressClickawayEventListener: action,
506
504
  setRearrangingConditions: action,
507
505
  hashCode: computed,
508
506
  });
@@ -515,10 +513,6 @@ export class QueryBuilderPostFilterState
515
513
  this.isRearrangingConditions = val;
516
514
  }
517
515
 
518
- suppressClickawayEventListener(): void {
519
- this._suppressClickawayEventListener = true;
520
- }
521
-
522
516
  setSelectedNode(val: QueryBuilderPostFilterTreeNodeData | undefined): void {
523
517
  this.selectedNode = val;
524
518
  }
@@ -652,14 +646,6 @@ export class QueryBuilderPostFilterState
652
646
  }
653
647
  }
654
648
 
655
- handleClickaway(): void {
656
- if (this._suppressClickawayEventListener) {
657
- this._suppressClickawayEventListener = false;
658
- return;
659
- }
660
- this.setSelectedNode(undefined);
661
- }
662
-
663
649
  addNodeFromNode(
664
650
  node: QueryBuilderPostFilterTreeNodeData,
665
651
  fromNode: QueryBuilderPostFilterTreeNodeData | undefined,
@@ -380,7 +380,6 @@ export class QueryBuilderFilterState
380
380
  selectedNode?: QueryBuilderFilterTreeNodeData | undefined;
381
381
  isRearrangingConditions = false;
382
382
  operators: QueryBuilderFilterOperator[] = [];
383
- private _suppressClickawayEventListener = false;
384
383
  showPanel = true;
385
384
 
386
385
  constructor(
@@ -396,8 +395,6 @@ export class QueryBuilderFilterState
396
395
  showPanel: observable,
397
396
  setLambdaParameterName: action,
398
397
  setRearrangingConditions: action,
399
- suppressClickawayEventListener: action,
400
- handleClickaway: action,
401
398
  setSelectedNode: action,
402
399
  addNodeFromNode: action,
403
400
  replaceBlankNodeWithNode: action,
@@ -431,16 +428,6 @@ export class QueryBuilderFilterState
431
428
  setRearrangingConditions(val: boolean): void {
432
429
  this.isRearrangingConditions = val;
433
430
  }
434
- suppressClickawayEventListener(): void {
435
- this._suppressClickawayEventListener = true;
436
- }
437
- handleClickaway(): void {
438
- if (this._suppressClickawayEventListener) {
439
- this._suppressClickawayEventListener = false;
440
- return;
441
- }
442
- this.setSelectedNode(undefined);
443
- }
444
431
  setSelectedNode(val: QueryBuilderFilterTreeNodeData | undefined): void {
445
432
  this.selectedNode = val;
446
433
  }