@finos/legend-query-builder 3.0.6 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
  6. package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderEvent.js +20 -0
  8. package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
  9. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
  10. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  11. package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
  12. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  13. package/lib/components/QueryBuilder.d.ts +0 -1
  14. package/lib/components/QueryBuilder.d.ts.map +1 -1
  15. package/lib/components/QueryBuilder.js +25 -34
  16. package/lib/components/QueryBuilder.js.map +1 -1
  17. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
  18. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderConstantExpressionPanel.js +11 -15
  20. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  21. package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
  22. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
  24. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderParametersPanel.js +16 -20
  26. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  27. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
  28. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
  30. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  31. package/lib/components/QueryBuilderSideBar.d.ts +0 -1
  32. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  33. package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
  34. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  35. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
  36. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  37. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
  38. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  39. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
  40. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  41. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
  42. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
  44. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  45. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
  46. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
  54. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
  56. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
  60. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  61. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
  62. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
  64. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  65. package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
  66. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  67. package/lib/components/shared/LambdaEditor.d.ts +0 -1
  68. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  69. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
  70. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
  72. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  73. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
  74. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  75. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
  76. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  77. package/lib/index.css +2 -2
  78. package/lib/index.css.map +1 -1
  79. package/lib/index.d.ts +2 -0
  80. package/lib/index.d.ts.map +1 -1
  81. package/lib/index.js +2 -0
  82. package/lib/index.js.map +1 -1
  83. package/lib/package.json +5 -5
  84. package/lib/stores/QueryBuilderState.d.ts +1 -2
  85. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  86. package/lib/stores/QueryBuilderState.js +7 -8
  87. package/lib/stores/QueryBuilderState.js.map +1 -1
  88. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +2 -1
  89. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +1 -1
  91. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  92. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts +2 -1
  93. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts.map +1 -1
  94. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js +18 -15
  95. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js.map +1 -1
  96. package/package.json +13 -13
  97. package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
  98. package/src/__lib__/QueryBuilderEvent.ts +20 -0
  99. package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
  100. package/src/components/QueryBuilder.tsx +147 -188
  101. package/src/components/QueryBuilderConstantExpressionPanel.tsx +7 -12
  102. package/src/components/QueryBuilderParametersPanel.tsx +6 -10
  103. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
  104. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -3
  105. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
  106. package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
  107. package/src/components/shared/LambdaParameterValuesEditor.tsx +6 -5
  108. package/src/index.ts +2 -0
  109. package/src/stores/QueryBuilderState.ts +6 -11
  110. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +1 -1
  111. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.ts +43 -25
@@ -18,6 +18,7 @@ import {
18
18
  type ValueSpecification,
19
19
  type LambdaFunction,
20
20
  type PureModel,
21
+ type RootGraphFetchTree,
21
22
  extractElementNameFromPath,
22
23
  GenericType,
23
24
  GenericTypeExplicitReference,
@@ -159,6 +160,34 @@ export const buildPureSerializationConfig = (
159
160
  return newFunction;
160
161
  };
161
162
 
163
+ export const buildSerialzieFunctionWithGraphFetch = (
164
+ tree: RootGraphFetchTree,
165
+ isChecked: boolean,
166
+ precedingExpression: ValueSpecification,
167
+ pureConfig: SimpleFunctionExpression | undefined,
168
+ ): SimpleFunctionExpression => {
169
+ const graphFetchInstance = new GraphFetchTreeInstanceValue();
170
+ graphFetchInstance.values = [tree];
171
+ const serializeFunction = new SimpleFunctionExpression(
172
+ extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.SERIALIZE),
173
+ );
174
+ const graphFetchFunc = new SimpleFunctionExpression(
175
+ isChecked
176
+ ? extractElementNameFromPath(
177
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
178
+ )
179
+ : extractElementNameFromPath(
180
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
181
+ ),
182
+ );
183
+ graphFetchFunc.parametersValues = [precedingExpression, graphFetchInstance];
184
+ serializeFunction.parametersValues = [graphFetchFunc, graphFetchInstance];
185
+ if (pureConfig) {
186
+ serializeFunction.parametersValues.push(pureConfig);
187
+ }
188
+ return serializeFunction;
189
+ };
190
+
162
191
  export const appendGraphFetch = (
163
192
  graphFetchTreeState: QueryBuilderGraphFetchTreeState,
164
193
  lambdaFunction: LambdaFunction,
@@ -184,32 +213,21 @@ export const appendGraphFetch = (
184
213
  graphFetchTreeState.treeData &&
185
214
  !isGraphFetchTreeDataEmpty(graphFetchTreeState.treeData)
186
215
  ) {
187
- const graphFetchInstance = new GraphFetchTreeInstanceValue();
188
- graphFetchInstance.values = [graphFetchTreeState.treeData.tree];
189
- const serializeFunction = new SimpleFunctionExpression(
190
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.SERIALIZE),
191
- );
192
- const graphFetchFunc = new SimpleFunctionExpression(
193
- graphFetchTreeState.isChecked
194
- ? extractElementNameFromPath(
195
- QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
196
- )
197
- : extractElementNameFromPath(
198
- QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
199
- ),
200
- );
201
- graphFetchFunc.parametersValues = [
216
+ const pureConfig = serializationState.config
217
+ ? buildPureSerializationConfig(
218
+ serializationState.config as unknown as Record<
219
+ PropertyKey,
220
+ boolean
221
+ >,
222
+ graphFetchTreeState.queryBuilderState.graphManagerState.graph,
223
+ )
224
+ : undefined;
225
+ const serializeFunction = buildSerialzieFunctionWithGraphFetch(
226
+ graphFetchTreeState.treeData.tree,
227
+ graphFetchTreeState.isChecked,
202
228
  precedingExpression,
203
- graphFetchInstance,
204
- ];
205
- serializeFunction.parametersValues = [graphFetchFunc, graphFetchInstance];
206
- if (serializationState.config) {
207
- const configFunction = buildPureSerializationConfig(
208
- serializationState.config as unknown as Record<PropertyKey, boolean>,
209
- graphFetchTreeState.queryBuilderState.graphManagerState.graph,
210
- );
211
- serializeFunction.parametersValues.push(configFunction);
212
- }
229
+ pureConfig,
230
+ );
213
231
  lambdaFunction.expressionSequence[0] = serializeFunction;
214
232
  }
215
233
  } else if (