@finos/legend-query-builder 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +4 -4
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +2 -2
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +5 -6
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +8 -13
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +6 -6
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +3 -5
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +5 -6
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +91 -41
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +13 -14
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +1 -1
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
- package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts +1 -0
- package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderSupportedFunctions.js +1 -0
- package/lib/graphManager/QueryBuilderSupportedFunctions.js.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +8 -8
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +17 -26
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +11 -10
- package/lib/stores/QueryBuilderChangeDetectionState.d.ts +4 -4
- package/lib/stores/QueryBuilderChangeDetectionState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderChangeDetectionState.js +9 -9
- package/lib/stores/QueryBuilderChangeDetectionState.js.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.js +4 -4
- package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts +2 -3
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +9 -12
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +8 -5
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +25 -21
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -2
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +16 -12
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderTextEditorState.js +4 -1
- package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +9 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +22 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +2 -2
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js +21 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +2 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +2 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +6 -3
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +4 -2
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +4 -2
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +2 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +2 -2
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js +9 -2
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +4 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +2 -2
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +2 -2
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +2 -2
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +2 -2
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js +3 -3
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
- package/lib/stores/shared/LambdaParameterState.d.ts +2 -2
- package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -1
- package/lib/stores/shared/LambdaParameterState.js +5 -5
- package/lib/stores/shared/LambdaParameterState.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +4 -4
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +11 -15
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationModifierHelper.d.ts +8 -8
- package/lib/stores/shared/ValueSpecificationModifierHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationModifierHelper.js +20 -17
- package/lib/stores/shared/ValueSpecificationModifierHelper.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.js +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
- package/package.json +18 -17
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +4 -2
- package/src/components/QueryBuilderParametersPanel.tsx +2 -2
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +6 -6
- package/src/components/QueryBuilderResultPanel.tsx +19 -15
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +10 -11
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +7 -5
- package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +9 -6
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +1 -1
- package/src/components/filter/QueryBuilderFilterPanel.tsx +1 -1
- package/src/components/shared/BasicValueSpecificationEditor.tsx +192 -48
- package/src/components/shared/CustomDatePicker.tsx +54 -26
- package/src/components/shared/LambdaEditor.tsx +0 -1
- package/src/components/watermark/QueryBuilderWatermark.tsx +1 -3
- package/src/graphManager/QueryBuilderSupportedFunctions.ts +4 -0
- package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +1 -1
- package/src/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +67 -68
- package/src/stores/QueryBuilderChangeDetectionState.ts +13 -11
- package/src/stores/QueryBuilderConstantsState.ts +4 -3
- package/src/stores/QueryBuilderPropertyEditorState.ts +17 -13
- package/src/stores/QueryBuilderState.ts +35 -24
- package/src/stores/QueryBuilderStateBuilder.ts +20 -18
- package/src/stores/QueryBuilderTextEditorState.ts +4 -1
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +1 -1
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +36 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +10 -2
- package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +1 -1
- package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts +26 -1
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +2 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +2 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +14 -3
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +4 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +4 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +2 -0
- package/src/stores/filter/QueryBuilderFilterState.ts +2 -2
- package/src/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.ts +17 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +1 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +1 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +12 -3
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +2 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +2 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +2 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +2 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +1 -0
- package/src/stores/milestoning/QueryBuilderMilestoningState.ts +3 -9
- package/src/stores/shared/LambdaParameterState.ts +9 -5
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +24 -9
- package/src/stores/shared/ValueSpecificationModifierHelper.ts +42 -20
- package/src/stores/watermark/QueryBuilderWatermarkState.ts +1 -4
@@ -201,8 +201,8 @@ export const V1_buildGetAllFunctionExpression = (
|
|
201
201
|
openVariables: string[],
|
202
202
|
compileContext: V1_GraphBuilderContext,
|
203
203
|
processingContext: V1_ProcessingContext,
|
204
|
-
):
|
205
|
-
const
|
204
|
+
): SimpleFunctionExpression => {
|
205
|
+
const expression = V1_buildGenericFunctionExpression(
|
206
206
|
functionName,
|
207
207
|
parameters,
|
208
208
|
openVariables,
|
@@ -218,7 +218,8 @@ export const V1_buildGetAllFunctionExpression = (
|
|
218
218
|
);
|
219
219
|
expression.genericType = precedingExpression.genericType;
|
220
220
|
expression.multiplicity = precedingExpression.multiplicity;
|
221
|
-
|
221
|
+
|
222
|
+
return expression;
|
222
223
|
};
|
223
224
|
|
224
225
|
export const V1_buildExistsFunctionExpression = (
|
@@ -227,7 +228,7 @@ export const V1_buildExistsFunctionExpression = (
|
|
227
228
|
openVariables: string[],
|
228
229
|
compileContext: V1_GraphBuilderContext,
|
229
230
|
processingContext: V1_ProcessingContext,
|
230
|
-
):
|
231
|
+
): SimpleFunctionExpression => {
|
231
232
|
assertTrue(
|
232
233
|
parameters.length === 2,
|
233
234
|
`Can't build exists() expression: exists() expects 1 argument`,
|
@@ -262,22 +263,21 @@ export const V1_buildExistsFunctionExpression = (
|
|
262
263
|
}
|
263
264
|
});
|
264
265
|
}
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
266
|
+
|
267
|
+
return V1_buildBaseSimpleFunctionExpression(
|
268
|
+
[
|
269
|
+
precedingExpression,
|
270
|
+
(parameters[1] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
271
|
+
new V1_ValueSpecificationBuilder(
|
272
|
+
compileContext,
|
273
|
+
processingContext,
|
274
|
+
openVariables,
|
275
|
+
),
|
272
276
|
),
|
273
|
-
|
274
|
-
];
|
275
|
-
const expression = V1_buildBaseSimpleFunctionExpression(
|
276
|
-
processedParameters,
|
277
|
+
],
|
277
278
|
functionName,
|
278
279
|
compileContext,
|
279
280
|
);
|
280
|
-
return [expression, processedParameters];
|
281
281
|
};
|
282
282
|
|
283
283
|
export const V1_buildFilterFunctionExpression = (
|
@@ -286,7 +286,7 @@ export const V1_buildFilterFunctionExpression = (
|
|
286
286
|
openVariables: string[],
|
287
287
|
compileContext: V1_GraphBuilderContext,
|
288
288
|
processingContext: V1_ProcessingContext,
|
289
|
-
):
|
289
|
+
): SimpleFunctionExpression => {
|
290
290
|
assertTrue(
|
291
291
|
parameters.length === 2,
|
292
292
|
`Can't build filter() expression: filter() expects 1 argument`,
|
@@ -318,19 +318,18 @@ export const V1_buildFilterFunctionExpression = (
|
|
318
318
|
});
|
319
319
|
}
|
320
320
|
}
|
321
|
-
const processedParams = [
|
322
|
-
precedingExpression,
|
323
|
-
(parameters[1] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
324
|
-
new V1_ValueSpecificationBuilder(
|
325
|
-
compileContext,
|
326
|
-
processingContext,
|
327
|
-
openVariables,
|
328
|
-
),
|
329
|
-
),
|
330
|
-
];
|
331
321
|
|
332
322
|
const expression = V1_buildBaseSimpleFunctionExpression(
|
333
|
-
|
323
|
+
[
|
324
|
+
precedingExpression,
|
325
|
+
(parameters[1] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
326
|
+
new V1_ValueSpecificationBuilder(
|
327
|
+
compileContext,
|
328
|
+
processingContext,
|
329
|
+
openVariables,
|
330
|
+
),
|
331
|
+
),
|
332
|
+
],
|
334
333
|
functionName,
|
335
334
|
compileContext,
|
336
335
|
);
|
@@ -338,7 +337,8 @@ export const V1_buildFilterFunctionExpression = (
|
|
338
337
|
// return type of filter() is the same as that of the function precedes it
|
339
338
|
expression.genericType = precedingExpression.genericType;
|
340
339
|
expression.multiplicity = precedingExpression.multiplicity;
|
341
|
-
|
340
|
+
|
341
|
+
return expression;
|
342
342
|
};
|
343
343
|
|
344
344
|
export const V1_buildProjectFunctionExpression = (
|
@@ -347,7 +347,7 @@ export const V1_buildProjectFunctionExpression = (
|
|
347
347
|
openVariables: string[],
|
348
348
|
compileContext: V1_GraphBuilderContext,
|
349
349
|
processingContext: V1_ProcessingContext,
|
350
|
-
):
|
350
|
+
): SimpleFunctionExpression => {
|
351
351
|
assertTrue(
|
352
352
|
parameters.length === 3,
|
353
353
|
`Can't build project() expression: project() expects 2 arguments`,
|
@@ -417,26 +417,26 @@ export const V1_buildProjectFunctionExpression = (
|
|
417
417
|
}
|
418
418
|
});
|
419
419
|
|
420
|
-
const processedParams = [
|
421
|
-
precedingExperession,
|
422
|
-
processedColumnExpressions,
|
423
|
-
(parameters[2] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
424
|
-
new V1_ValueSpecificationBuilder(
|
425
|
-
compileContext,
|
426
|
-
processingContext,
|
427
|
-
openVariables,
|
428
|
-
),
|
429
|
-
),
|
430
|
-
];
|
431
420
|
const expression = V1_buildBaseSimpleFunctionExpression(
|
432
|
-
|
421
|
+
[
|
422
|
+
precedingExperession,
|
423
|
+
processedColumnExpressions,
|
424
|
+
(parameters[2] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
425
|
+
new V1_ValueSpecificationBuilder(
|
426
|
+
compileContext,
|
427
|
+
processingContext,
|
428
|
+
openVariables,
|
429
|
+
),
|
430
|
+
),
|
431
|
+
],
|
433
432
|
functionName,
|
434
433
|
compileContext,
|
435
434
|
);
|
436
435
|
expression.genericType = GenericTypeExplicitReference.create(
|
437
436
|
new GenericType(compileContext.resolveType(CORE_PURE_PATH.TDS_ROW).value),
|
438
437
|
);
|
439
|
-
|
438
|
+
|
439
|
+
return expression;
|
440
440
|
};
|
441
441
|
|
442
442
|
export const V1_buildGroupByFunctionExpression = (
|
@@ -445,7 +445,7 @@ export const V1_buildGroupByFunctionExpression = (
|
|
445
445
|
openVariables: string[],
|
446
446
|
compileContext: V1_GraphBuilderContext,
|
447
447
|
processingContext: V1_ProcessingContext,
|
448
|
-
):
|
448
|
+
): SimpleFunctionExpression => {
|
449
449
|
let topLevelLambdaParameters: V1_Variable[] = [];
|
450
450
|
assertTrue(
|
451
451
|
parameters.length === 4,
|
@@ -557,27 +557,27 @@ export const V1_buildGroupByFunctionExpression = (
|
|
557
557
|
),
|
558
558
|
);
|
559
559
|
|
560
|
-
const processedParams = [
|
561
|
-
precedingExperession,
|
562
|
-
processedColumnExpressions,
|
563
|
-
processedAggregationExpressions,
|
564
|
-
(parameters[3] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
565
|
-
new V1_ValueSpecificationBuilder(
|
566
|
-
compileContext,
|
567
|
-
processingContext,
|
568
|
-
openVariables,
|
569
|
-
),
|
570
|
-
),
|
571
|
-
];
|
572
560
|
const expression = V1_buildBaseSimpleFunctionExpression(
|
573
|
-
|
561
|
+
[
|
562
|
+
precedingExperession,
|
563
|
+
processedColumnExpressions,
|
564
|
+
processedAggregationExpressions,
|
565
|
+
(parameters[3] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
566
|
+
new V1_ValueSpecificationBuilder(
|
567
|
+
compileContext,
|
568
|
+
processingContext,
|
569
|
+
openVariables,
|
570
|
+
),
|
571
|
+
),
|
572
|
+
],
|
574
573
|
functionName,
|
575
574
|
compileContext,
|
576
575
|
);
|
577
576
|
expression.genericType = GenericTypeExplicitReference.create(
|
578
577
|
new GenericType(compileContext.resolveType(CORE_PURE_PATH.TDS_ROW).value),
|
579
578
|
);
|
580
|
-
|
579
|
+
|
580
|
+
return expression;
|
581
581
|
};
|
582
582
|
|
583
583
|
export const V1_buildWatermarkFunctionExpression = (
|
@@ -586,7 +586,7 @@ export const V1_buildWatermarkFunctionExpression = (
|
|
586
586
|
openVariables: string[],
|
587
587
|
compileContext: V1_GraphBuilderContext,
|
588
588
|
processingContext: V1_ProcessingContext,
|
589
|
-
):
|
589
|
+
): SimpleFunctionExpression | undefined => {
|
590
590
|
assertTrue(
|
591
591
|
parameters.length === 2,
|
592
592
|
`Can't build forWatermark() expression: forWatermark() expects 1 argument`,
|
@@ -622,8 +622,7 @@ export const V1_buildWatermarkFunctionExpression = (
|
|
622
622
|
});
|
623
623
|
}
|
624
624
|
|
625
|
-
const
|
626
|
-
precedingExpression,
|
625
|
+
const watermarkValueParam = guaranteeNonNullable(
|
627
626
|
(parameters[1] as V1_ValueSpecification).accept_ValueSpecificationVisitor(
|
628
627
|
new V1_ValueSpecificationBuilder(
|
629
628
|
compileContext,
|
@@ -631,9 +630,7 @@ export const V1_buildWatermarkFunctionExpression = (
|
|
631
630
|
openVariables,
|
632
631
|
),
|
633
632
|
),
|
634
|
-
|
635
|
-
|
636
|
-
const watermarkValueParam = guaranteeNonNullable(processedParams[1]);
|
633
|
+
);
|
637
634
|
const watermarkValueParamType =
|
638
635
|
watermarkValueParam.genericType?.value.rawType;
|
639
636
|
assertTrue(
|
@@ -642,14 +639,15 @@ export const V1_buildWatermarkFunctionExpression = (
|
|
642
639
|
);
|
643
640
|
|
644
641
|
const expression = V1_buildBaseSimpleFunctionExpression(
|
645
|
-
|
642
|
+
[precedingExpression, watermarkValueParam],
|
646
643
|
functionName,
|
647
644
|
compileContext,
|
648
645
|
);
|
649
646
|
|
650
647
|
expression.genericType = precedingExpression.genericType;
|
651
648
|
expression.multiplicity = precedingExpression.multiplicity;
|
652
|
-
|
649
|
+
|
650
|
+
return expression;
|
653
651
|
};
|
654
652
|
|
655
653
|
export const V1_buildOLAPGroupByFunctionExpression = (
|
@@ -658,7 +656,7 @@ export const V1_buildOLAPGroupByFunctionExpression = (
|
|
658
656
|
openVariables: string[],
|
659
657
|
compileContext: V1_GraphBuilderContext,
|
660
658
|
processingContext: V1_ProcessingContext,
|
661
|
-
):
|
659
|
+
): SimpleFunctionExpression | undefined => {
|
662
660
|
const processedParams: ValueSpecification[] = [];
|
663
661
|
assertTrue(
|
664
662
|
parameters.length === 5 || parameters.length === 4,
|
@@ -778,7 +776,8 @@ export const V1_buildOLAPGroupByFunctionExpression = (
|
|
778
776
|
expression.genericType = GenericTypeExplicitReference.create(
|
779
777
|
new GenericType(compileContext.resolveType(CORE_PURE_PATH.TDS_ROW).value),
|
780
778
|
);
|
781
|
-
|
779
|
+
|
780
|
+
return expression;
|
782
781
|
};
|
783
782
|
|
784
783
|
export const V1_buildSubTypePropertyExpressionTypeInference = (
|
@@ -91,17 +91,19 @@ export class QueryBuilderDiffViewState {
|
|
91
91
|
}
|
92
92
|
|
93
93
|
export class QueryBuilderChangeDetectionState {
|
94
|
-
querybuilderState: QueryBuilderState;
|
95
|
-
|
94
|
+
readonly querybuilderState: QueryBuilderState;
|
95
|
+
|
96
|
+
readonly initState = ActionState.create();
|
97
|
+
|
98
|
+
querySnapshot?: RawLambda | undefined;
|
99
|
+
hashCodeSnapshot?: string | undefined;
|
96
100
|
diffViewState?: QueryBuilderDiffViewState | undefined;
|
97
|
-
initialQuery?: RawLambda | undefined;
|
98
|
-
initialHashCode?: string | undefined;
|
99
101
|
|
100
102
|
constructor(queryBuilderState: QueryBuilderState) {
|
101
103
|
makeObservable(this, {
|
102
104
|
diffViewState: observable,
|
103
|
-
|
104
|
-
|
105
|
+
querySnapshot: observable,
|
106
|
+
hashCodeSnapshot: observable,
|
105
107
|
hasChanged: computed,
|
106
108
|
initialize: action,
|
107
109
|
showDiffViewPanel: action,
|
@@ -113,12 +115,12 @@ export class QueryBuilderChangeDetectionState {
|
|
113
115
|
|
114
116
|
showDiffViewPanel(): void {
|
115
117
|
assertNonNullable(
|
116
|
-
this.
|
118
|
+
this.querySnapshot,
|
117
119
|
`Can't show changes: change detection is not properly initialized`,
|
118
120
|
);
|
119
121
|
this.diffViewState = new QueryBuilderDiffViewState(
|
120
122
|
this,
|
121
|
-
this.
|
123
|
+
this.querySnapshot,
|
122
124
|
this.querybuilderState.buildQuery(),
|
123
125
|
);
|
124
126
|
}
|
@@ -131,13 +133,13 @@ export class QueryBuilderChangeDetectionState {
|
|
131
133
|
if (!this.initState.hasCompleted) {
|
132
134
|
return false;
|
133
135
|
}
|
134
|
-
return this.querybuilderState.hashCode !== this.
|
136
|
+
return this.querybuilderState.hashCode !== this.hashCodeSnapshot;
|
135
137
|
}
|
136
138
|
|
137
139
|
initialize(initialQuery: RawLambda): void {
|
138
140
|
this.initState.inProgress();
|
139
|
-
this.
|
140
|
-
this.
|
141
|
+
this.hashCodeSnapshot = this.querybuilderState.hashCode;
|
142
|
+
this.querySnapshot = initialQuery;
|
141
143
|
this.initState.complete();
|
142
144
|
}
|
143
145
|
|
@@ -57,11 +57,11 @@ export class QueryBuilderConstantExpressionState implements Hashable {
|
|
57
57
|
this.queryBuilderState = queryBuilderState;
|
58
58
|
this.value = observe_ValueSpecification(
|
59
59
|
value,
|
60
|
-
this.queryBuilderState.
|
60
|
+
this.queryBuilderState.observerContext,
|
61
61
|
);
|
62
62
|
observe_ValueSpecification(
|
63
63
|
variable,
|
64
|
-
this.queryBuilderState.
|
64
|
+
this.queryBuilderState.observerContext,
|
65
65
|
);
|
66
66
|
this.variable = variable;
|
67
67
|
}
|
@@ -73,6 +73,7 @@ export class QueryBuilderConstantExpressionState implements Hashable {
|
|
73
73
|
const valSpec = buildDefaultInstanceValue(
|
74
74
|
this.queryBuilderState.graphManagerState.graph,
|
75
75
|
type,
|
76
|
+
this.queryBuilderState.observerContext,
|
76
77
|
);
|
77
78
|
this.setValueSpec(valSpec);
|
78
79
|
} catch (error) {
|
@@ -92,7 +93,7 @@ export class QueryBuilderConstantExpressionState implements Hashable {
|
|
92
93
|
}
|
93
94
|
this.value = observe_ValueSpecification(
|
94
95
|
value,
|
95
|
-
this.queryBuilderState.
|
96
|
+
this.queryBuilderState.observerContext,
|
96
97
|
);
|
97
98
|
const valueSpecType = value.genericType?.value.rawType;
|
98
99
|
if (
|
@@ -21,8 +21,6 @@ import {
|
|
21
21
|
guaranteeType,
|
22
22
|
type Hashable,
|
23
23
|
hashArray,
|
24
|
-
isCamelCase,
|
25
|
-
prettyCamelCase,
|
26
24
|
prettyCONSTName,
|
27
25
|
} from '@finos/legend-shared';
|
28
26
|
import {
|
@@ -48,6 +46,7 @@ import {
|
|
48
46
|
GenericType,
|
49
47
|
PropertyExplicitReference,
|
50
48
|
PrimitiveType,
|
49
|
+
type ObserverContext,
|
51
50
|
} from '@finos/legend-graph';
|
52
51
|
import {
|
53
52
|
createNullishValue,
|
@@ -63,15 +62,12 @@ import {
|
|
63
62
|
} from './shared/ValueSpecificationModifierHelper.js';
|
64
63
|
import { generateMilestonedPropertyParameterValue } from './milestoning/QueryBuilderMilestoningHelper.js';
|
65
64
|
|
66
|
-
export const prettyPropertyName = (value: string): string =>
|
67
|
-
isCamelCase(value) ? prettyCamelCase(value) : prettyCONSTName(value);
|
68
|
-
|
69
65
|
export const getPropertyChainName = (
|
70
66
|
propertyExpression: AbstractPropertyExpression,
|
71
67
|
humanizePropertyName: boolean,
|
72
68
|
): string => {
|
73
69
|
const propertyNameDecorator = humanizePropertyName
|
74
|
-
?
|
70
|
+
? prettyCONSTName
|
75
71
|
: (val: string): string => val;
|
76
72
|
const chunks = [propertyNameDecorator(propertyExpression.func.value.name)];
|
77
73
|
let currentExpression: ValueSpecification | undefined = propertyExpression;
|
@@ -146,6 +142,7 @@ export const getPropertyPath = (
|
|
146
142
|
export const generateValueSpecificationForParameter = (
|
147
143
|
parameter: VariableExpression,
|
148
144
|
graph: PureModel,
|
145
|
+
observerContext: ObserverContext,
|
149
146
|
): ValueSpecification => {
|
150
147
|
if (parameter.genericType) {
|
151
148
|
const type = parameter.genericType.value.rawType;
|
@@ -161,9 +158,11 @@ export const generateValueSpecificationForParameter = (
|
|
161
158
|
),
|
162
159
|
);
|
163
160
|
if (type !== PrimitiveType.LATESTDATE) {
|
164
|
-
instanceValue_setValues(
|
165
|
-
|
166
|
-
|
161
|
+
instanceValue_setValues(
|
162
|
+
primitiveInstanceValue,
|
163
|
+
[generateDefaultValueForPrimitiveType(type.name as PRIMITIVE_TYPE)],
|
164
|
+
observerContext,
|
165
|
+
);
|
167
166
|
}
|
168
167
|
return primitiveInstanceValue;
|
169
168
|
} else if (type instanceof Enumeration) {
|
@@ -174,7 +173,11 @@ export const generateValueSpecificationForParameter = (
|
|
174
173
|
const enumValueRef = EnumValueExplicitReference.create(
|
175
174
|
type.values[0] as Enum,
|
176
175
|
);
|
177
|
-
instanceValue_setValues(
|
176
|
+
instanceValue_setValues(
|
177
|
+
enumValueInstanceValue,
|
178
|
+
[enumValueRef],
|
179
|
+
observerContext,
|
180
|
+
);
|
178
181
|
}
|
179
182
|
return enumValueInstanceValue;
|
180
183
|
}
|
@@ -213,6 +216,7 @@ const fillDerivedPropertyParameterValues = (
|
|
213
216
|
parameter,
|
214
217
|
derivedPropertyExpressionState.queryBuilderState.graphManagerState
|
215
218
|
.graph,
|
219
|
+
derivedPropertyExpressionState.queryBuilderState.observerContext,
|
216
220
|
),
|
217
221
|
);
|
218
222
|
});
|
@@ -224,7 +228,7 @@ const fillDerivedPropertyParameterValues = (
|
|
224
228
|
),
|
225
229
|
...parameterValues,
|
226
230
|
],
|
227
|
-
derivedPropertyExpressionState.queryBuilderState.
|
231
|
+
derivedPropertyExpressionState.queryBuilderState.observerContext,
|
228
232
|
);
|
229
233
|
};
|
230
234
|
|
@@ -246,7 +250,7 @@ export class QueryBuilderDerivedPropertyExpressionState {
|
|
246
250
|
this.title = getPropertyChainName(propertyExpression, true);
|
247
251
|
this.propertyExpression = observe_AbstractPropertyExpression(
|
248
252
|
propertyExpression,
|
249
|
-
queryBuilderState.
|
253
|
+
queryBuilderState.observerContext,
|
250
254
|
);
|
251
255
|
this.queryBuilderState = queryBuilderState;
|
252
256
|
this.derivedProperty = guaranteeType(
|
@@ -341,7 +345,7 @@ export class QueryBuilderPropertyExpressionState implements Hashable {
|
|
341
345
|
this.queryBuilderState = queryBuilderState;
|
342
346
|
this.propertyExpression = observe_AbstractPropertyExpression(
|
343
347
|
propertyExpression,
|
344
|
-
queryBuilderState.
|
348
|
+
queryBuilderState.observerContext,
|
345
349
|
);
|
346
350
|
this.path = getPropertyPath(propertyExpression);
|
347
351
|
this.title = getPropertyChainName(propertyExpression, true);
|
@@ -61,6 +61,7 @@ import {
|
|
61
61
|
isStubbed_RawLambda,
|
62
62
|
buildLambdaVariableExpressions,
|
63
63
|
buildRawLambdaFromLambdaFunction,
|
64
|
+
type ValueSpecification,
|
64
65
|
} from '@finos/legend-graph';
|
65
66
|
import { buildLambdaFunction } from './QueryBuilderValueSpecificationBuilder.js';
|
66
67
|
import type {
|
@@ -85,7 +86,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
85
86
|
|
86
87
|
readonly changeDetectionState: QueryBuilderChangeDetectionState;
|
87
88
|
readonly queryCompileState = ActionState.create();
|
88
|
-
readonly
|
89
|
+
readonly observerContext: ObserverContext;
|
89
90
|
|
90
91
|
explorerState: QueryBuilderExplorerState;
|
91
92
|
functionsExplorerState: QueryFunctionsExplorerState;
|
@@ -158,8 +159,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
158
159
|
|
159
160
|
resetQueryResult: action,
|
160
161
|
resetQueryContent: action,
|
161
|
-
resetQueryBodyContent: action,
|
162
|
-
resetQueryParameterContent: action,
|
163
162
|
changeClass: action,
|
164
163
|
changeMapping: action,
|
165
164
|
|
@@ -184,7 +183,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
184
183
|
this.resultState = new QueryBuilderResultState(this);
|
185
184
|
this.textEditorState = new QueryBuilderTextEditorState(this);
|
186
185
|
this.unsupportedQueryState = new QueryBuilderUnsupportedQueryState(this);
|
187
|
-
this.
|
186
|
+
this.observerContext = new ObserverContext(
|
188
187
|
this.graphManagerState.pluginManager.getPureGraphManagerPlugins(),
|
189
188
|
);
|
190
189
|
this.changeDetectionState = new QueryBuilderChangeDetectionState(this);
|
@@ -296,13 +295,18 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
296
295
|
);
|
297
296
|
}
|
298
297
|
|
299
|
-
resetQueryResult(): void {
|
298
|
+
resetQueryResult(options?: { preserveResult?: boolean | undefined }): void {
|
300
299
|
const resultState = new QueryBuilderResultState(this);
|
301
300
|
resultState.setPreviewLimit(this.resultState.previewLimit);
|
301
|
+
if (options?.preserveResult) {
|
302
|
+
resultState.setExecutionResult(this.resultState.executionResult);
|
303
|
+
resultState.setExecutionDuration(this.resultState.executionDuration);
|
304
|
+
resultState.latestRunHashCode = this.resultState.latestRunHashCode;
|
305
|
+
}
|
302
306
|
this.resultState = resultState;
|
303
307
|
}
|
304
308
|
|
305
|
-
|
309
|
+
resetQueryContent(): void {
|
306
310
|
this.textEditorState = new QueryBuilderTextEditorState(this);
|
307
311
|
this.unsupportedQueryState = new QueryBuilderUnsupportedQueryState(this);
|
308
312
|
this.milestoningState = new QueryBuilderMilestoningState(this);
|
@@ -316,6 +320,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
316
320
|
this.explorerState.refreshTreeData();
|
317
321
|
this.constantState = new QueryBuilderConstantsState(this);
|
318
322
|
this.functionsExplorerState = new QueryFunctionsExplorerState(this);
|
323
|
+
this.parametersState = new QueryBuilderParametersState(this);
|
319
324
|
this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
|
320
325
|
this.watermarkState = new QueryBuilderWatermarkState(this);
|
321
326
|
this.checkEntitlementsState = new QueryBuilderCheckEntitlementsState(this);
|
@@ -333,15 +338,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
333
338
|
}
|
334
339
|
}
|
335
340
|
|
336
|
-
resetQueryParameterContent(): void {
|
337
|
-
this.parametersState = new QueryBuilderParametersState(this);
|
338
|
-
}
|
339
|
-
|
340
|
-
resetQueryContent(): void {
|
341
|
-
this.resetQueryParameterContent();
|
342
|
-
this.resetQueryBodyContent();
|
343
|
-
}
|
344
|
-
|
345
341
|
changeClass(val: Class): void {
|
346
342
|
this.resetQueryResult();
|
347
343
|
this.resetQueryContent();
|
@@ -386,18 +382,34 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
386
382
|
}
|
387
383
|
|
388
384
|
initializeWithQuery(query: RawLambda): void {
|
389
|
-
this.resetQueryParameterContent();
|
390
385
|
this.rebuildWithQuery(query);
|
386
|
+
this.resetQueryResult();
|
391
387
|
this.changeDetectionState.initialize(query);
|
392
388
|
}
|
393
389
|
|
394
390
|
/**
|
395
391
|
* Process the provided query, and rebuild the query builder state.
|
396
392
|
*/
|
397
|
-
rebuildWithQuery(
|
393
|
+
rebuildWithQuery(
|
394
|
+
query: RawLambda,
|
395
|
+
options?: {
|
396
|
+
preserveParameterValues?: boolean | undefined;
|
397
|
+
preserveResult?: boolean | undefined;
|
398
|
+
},
|
399
|
+
): void {
|
400
|
+
const previousStateParameterValues = new Map<
|
401
|
+
VariableExpression,
|
402
|
+
ValueSpecification | undefined
|
403
|
+
>();
|
398
404
|
try {
|
399
|
-
|
400
|
-
|
405
|
+
if (options?.preserveParameterValues) {
|
406
|
+
// Preserving parameter values
|
407
|
+
this.parametersState.parameterStates.forEach((ps) => {
|
408
|
+
previousStateParameterValues.set(ps.parameter, ps.value);
|
409
|
+
});
|
410
|
+
}
|
411
|
+
this.resetQueryResult({ preserveResult: options?.preserveResult });
|
412
|
+
this.resetQueryContent();
|
401
413
|
|
402
414
|
if (!isStubbed_RawLambda(query)) {
|
403
415
|
const valueSpec = observe_ValueSpecification(
|
@@ -407,7 +419,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
407
419
|
),
|
408
420
|
this.graphManagerState.graph,
|
409
421
|
),
|
410
|
-
this.
|
422
|
+
this.observerContext,
|
411
423
|
);
|
412
424
|
const compiledValueSpecification = guaranteeType(
|
413
425
|
valueSpec,
|
@@ -417,6 +429,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
417
429
|
processQueryLambdaFunction(
|
418
430
|
guaranteeNonNullable(compiledValueSpecification.values[0]),
|
419
431
|
this,
|
432
|
+
previousStateParameterValues,
|
420
433
|
);
|
421
434
|
}
|
422
435
|
if (this.parametersState.parameterStates.length > 0) {
|
@@ -424,8 +437,8 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
424
437
|
}
|
425
438
|
} catch (error) {
|
426
439
|
assertErrorThrown(error);
|
427
|
-
this.resetQueryBodyContent();
|
428
440
|
this.resetQueryResult();
|
441
|
+
this.resetQueryContent();
|
429
442
|
this.unsupportedQueryState.setLambdaError(error);
|
430
443
|
this.unsupportedQueryState.setRawLambda(query);
|
431
444
|
this.setClass(undefined);
|
@@ -433,9 +446,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
433
446
|
query,
|
434
447
|
this.graphManagerState,
|
435
448
|
)
|
436
|
-
.map((param) =>
|
437
|
-
observe_ValueSpecification(param, this.observableContext),
|
438
|
-
)
|
449
|
+
.map((param) => observe_ValueSpecification(param, this.observerContext))
|
439
450
|
.filter(filterByType(VariableExpression));
|
440
451
|
processParameters(parameters, this);
|
441
452
|
}
|
@@ -70,7 +70,6 @@ import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/window/Q
|
|
70
70
|
import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
|
71
71
|
import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
|
72
72
|
import { checkIfEquivalent } from './milestoning/QueryBuilderMilestoningHelper.js';
|
73
|
-
import { QueryBuilderParametersState } from './QueryBuilderParametersState.js';
|
74
73
|
|
75
74
|
const processGetAllExpression = (
|
76
75
|
expression: SimpleFunctionExpression,
|
@@ -608,28 +607,29 @@ export class QueryBuilderValueSpecificationProcessor
|
|
608
607
|
export const processParameters = (
|
609
608
|
parameters: VariableExpression[],
|
610
609
|
queryBuilderState: QueryBuilderState,
|
610
|
+
parameterValues?: Map<VariableExpression, ValueSpecification | undefined>,
|
611
611
|
): void => {
|
612
|
-
const queryParameterState =
|
613
|
-
queryBuilderState,
|
614
|
-
);
|
615
|
-
// Here we won't process the parameters which are present in the previous state
|
616
|
-
// because we don't want to lose the parameter value
|
612
|
+
const queryParameterState = queryBuilderState.parametersState;
|
617
613
|
parameters.forEach((parameter) => {
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
614
|
+
let matchingParameterValue: ValueSpecification | undefined;
|
615
|
+
if (parameterValues) {
|
616
|
+
Array.from(parameterValues.entries()).forEach(([key, value]) => {
|
617
|
+
if (checkIfEquivalent(key, parameter)) {
|
618
|
+
matchingParameterValue = value;
|
619
|
+
}
|
620
|
+
});
|
621
|
+
}
|
622
|
+
const parameterState = new LambdaParameterState(
|
623
|
+
parameter,
|
624
|
+
queryBuilderState.observerContext,
|
625
|
+
queryBuilderState.graphManagerState.graph,
|
626
|
+
);
|
627
|
+
if (matchingParameterValue) {
|
628
|
+
parameterState.setValue(matchingParameterValue);
|
624
629
|
} else {
|
625
|
-
const parameterState = new LambdaParameterState(
|
626
|
-
parameter,
|
627
|
-
queryBuilderState.observableContext,
|
628
|
-
queryBuilderState.graphManagerState.graph,
|
629
|
-
);
|
630
630
|
parameterState.mockParameterValue();
|
631
|
-
queryParameterState.addParameter(parameterState);
|
632
631
|
}
|
632
|
+
queryParameterState.addParameter(parameterState);
|
633
633
|
});
|
634
634
|
queryBuilderState.parametersState = queryParameterState;
|
635
635
|
};
|
@@ -637,11 +637,13 @@ export const processParameters = (
|
|
637
637
|
export const processQueryLambdaFunction = (
|
638
638
|
lambdaFunction: LambdaFunction,
|
639
639
|
queryBuilderState: QueryBuilderState,
|
640
|
+
parameterValues?: Map<VariableExpression, ValueSpecification | undefined>,
|
640
641
|
): void => {
|
641
642
|
if (lambdaFunction.functionType.parameters.length) {
|
642
643
|
processParameters(
|
643
644
|
lambdaFunction.functionType.parameters,
|
644
645
|
queryBuilderState,
|
646
|
+
parameterValues,
|
645
647
|
);
|
646
648
|
}
|
647
649
|
lambdaFunction.expressionSequence.map((expression) =>
|