@finos/legend-application-query 5.2.5 → 5.2.8
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.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +22 -11
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +12 -7
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/QueryBuilderSetupPanel.js +1 -1
- package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +2 -0
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +21 -5
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +2 -2
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +22 -105
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -2
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +8 -10
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +23 -17
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts +2 -2
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js +15 -12
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +2 -2
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +23 -28
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +7 -7
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +5 -3
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +8 -8
- package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPreviewDataHelper.js +17 -14
- package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +34 -24
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +1 -2
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +17 -26
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +124 -0
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -0
- package/lib/stores/QueryBuilderStateBuilder.js +310 -0
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -0
- package/lib/stores/{QueryBuilderTestUtils.d.ts → QueryBuilderStateTestUtils.d.ts} +2 -2
- package/lib/stores/QueryBuilderStateTestUtils.d.ts.map +1 -0
- package/lib/stores/{QueryBuilderTestUtils.js → QueryBuilderStateTestUtils.js} +2 -2
- package/lib/stores/QueryBuilderStateTestUtils.js.map +1 -0
- package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderTypeaheadHelper.js +14 -12
- package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +3 -11
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +10 -319
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +27 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +156 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -0
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +37 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +79 -2
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +14 -9
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.js +62 -19
- package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js +3 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +17 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +10 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +3 -20
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +31 -73
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +17 -4
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +110 -21
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +20 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +62 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts +2 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +4 -4
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts +9 -2
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js +28 -5
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js +2 -2
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts +11 -2
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js +106 -5
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts +25 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js +186 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +9 -4
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js +129 -13
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts +20 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js +96 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js +1 -1
- package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.d.ts → QueryBuilderPostFilterStateBuilder.d.ts} +4 -3
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.js → QueryBuilderPostFilterStateBuilder.js} +30 -21
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +1 -4
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts +19 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +74 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -0
- package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.d.ts → QueryBuilderFilterValueSpecificationBuilder.d.ts} +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.js → QueryBuilderFilterValueSpecificationBuilder.js} +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -0
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js +5 -5
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js.map +1 -1
- package/package.json +15 -15
- package/src/components/QueryBuilder.tsx +47 -28
- package/src/components/QueryBuilderResultPanel.tsx +21 -14
- package/src/components/QueryBuilderSetupPanel.tsx +1 -1
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +50 -10
- package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +2 -2
- package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +41 -175
- package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +9 -12
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +62 -28
- package/src/components/fetch-structure/QueryBuilderProjectionPanel.tsx +74 -48
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +33 -41
- package/src/components/filter/QueryBuilderFilterPanel.tsx +7 -7
- package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +3 -1
- package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +5 -8
- package/src/stores/QueryBuilderPreviewDataHelper.ts +27 -18
- package/src/stores/QueryBuilderPropertyEditorState.ts +40 -31
- package/src/stores/QueryBuilderState.ts +26 -32
- package/src/stores/QueryBuilderStateBuilder.ts +584 -0
- package/src/stores/{QueryBuilderTestUtils.ts → QueryBuilderStateTestUtils.ts} +1 -1
- package/src/stores/QueryBuilderTypeaheadHelper.ts +23 -16
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +24 -584
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +254 -0
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +114 -0
- package/src/stores/explorer/QueryBuilderExplorerState.ts +93 -32
- package/src/stores/explorer/QueryBuilderPropertySearchPanelState.ts +3 -1
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +33 -2
- package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +53 -118
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +166 -26
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +131 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +7 -6
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.ts +68 -4
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.ts +2 -2
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionState.ts +182 -3
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.ts +426 -0
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +267 -21
- package/src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.ts +228 -0
- package/src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.ts → QueryBuilderPostFilterStateBuilder.ts} +68 -48
- package/src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +1 -11
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +155 -0
- package/src/stores/filter/{QueryBuilderValueSpecificationBuilder.ts → QueryBuilderFilterValueSpecificationBuilder.ts} +0 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperatorHelper.ts +5 -5
- package/tsconfig.json +10 -5
- package/tsconfig.package.json +1 -1
- package/lib/stores/QueryBuilderTestUtils.d.ts.map +0 -1
- package/lib/stores/QueryBuilderTestUtils.js.map +0 -1
- package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts +0 -56
- package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts.map +0 -1
- package/lib/stores/QueryBuilderValueSpecificationProcessor.js +0 -548
- package/lib/stores/QueryBuilderValueSpecificationProcessor.js.map +0 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.d.ts.map +0 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.js.map +0 -1
- package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.d.ts.map +0 -1
- package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.js.map +0 -1
- package/src/stores/QueryBuilderValueSpecificationProcessor.ts +0 -1254
@@ -15,16 +15,18 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import {
|
18
|
-
|
18
|
+
LambdaFunctionInstanceValue,
|
19
19
|
AbstractPropertyExpression,
|
20
20
|
extractElementNameFromPath,
|
21
21
|
PrimitiveInstanceValue,
|
22
22
|
matchFunctionName,
|
23
23
|
VariableExpression,
|
24
24
|
FunctionExpression,
|
25
|
+
type SimpleFunctionExpression,
|
25
26
|
} from '@finos/legend-graph';
|
26
27
|
import {
|
27
28
|
assertTrue,
|
29
|
+
assertType,
|
28
30
|
guaranteeIsString,
|
29
31
|
guaranteeNonNullable,
|
30
32
|
guaranteeType,
|
@@ -32,7 +34,6 @@ import {
|
|
32
34
|
} from '@finos/legend-shared';
|
33
35
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../QueryBuilder_Const.js';
|
34
36
|
import type { QueryBuilderAggregateColumnState } from '../aggregation/QueryBuilderAggregationState.js';
|
35
|
-
import { FETCH_STRUCTURE_MODE } from '../../QueryBuilderFetchStructureState.js';
|
36
37
|
import type { QueryBuilderPostFilterOperator } from './QueryBuilderPostFilterOperator.js';
|
37
38
|
import {
|
38
39
|
type QueryBuilderPostFilterState,
|
@@ -48,13 +49,14 @@ import {
|
|
48
49
|
QueryBuilderDerivationProjectionColumnState,
|
49
50
|
} from '../QueryBuilderProjectionColumnState.js';
|
50
51
|
import { toGroupOperation } from '../../../QueryBuilderGroupOperationHelper.js';
|
52
|
+
import { QueryBuilderProjectionState } from '../QueryBuilderProjectionState.js';
|
53
|
+
import type { QueryBuilderState } from '../../../QueryBuilderState.js';
|
51
54
|
|
52
55
|
const findProjectionColumnState = (
|
53
56
|
propertyExpression: AbstractPropertyExpression,
|
54
57
|
postFilterState: QueryBuilderPostFilterState,
|
55
58
|
): QueryBuilderProjectionColumnState | QueryBuilderAggregateColumnState => {
|
56
|
-
const
|
57
|
-
postFilterState.projectionState.fetchStructureState;
|
59
|
+
const projectionState = postFilterState.projectionState;
|
58
60
|
const properyExpressionName = propertyExpression.func.name;
|
59
61
|
assertTrue(
|
60
62
|
Object.values(TDS_COLUMN_GETTER).includes(
|
@@ -75,8 +77,8 @@ const findProjectionColumnState = (
|
|
75
77
|
'Can`t process TDS column expression: Column should be a string primitive instance value',
|
76
78
|
);
|
77
79
|
const columnStates = [
|
78
|
-
...
|
79
|
-
...
|
80
|
+
...projectionState.aggregationState.columns,
|
81
|
+
...projectionState.columns,
|
80
82
|
];
|
81
83
|
const columnState = guaranteeNonNullable(
|
82
84
|
columnStates.find((c) => c.columnName === columnName),
|
@@ -180,7 +182,7 @@ export const buildPostFilterConditionState = (
|
|
180
182
|
return postConditionState;
|
181
183
|
};
|
182
184
|
|
183
|
-
const
|
185
|
+
const processPostFilterTree = (
|
184
186
|
expression: FunctionExpression,
|
185
187
|
postFilterState: QueryBuilderPostFilterState,
|
186
188
|
parentPostFilterNodeId: string | undefined,
|
@@ -189,10 +191,10 @@ const processPostFilterExpression = (
|
|
189
191
|
? postFilterState.getNode(parentPostFilterNodeId)
|
190
192
|
: undefined;
|
191
193
|
if (
|
192
|
-
[
|
194
|
+
matchFunctionName(expression.functionName, [
|
193
195
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.AND,
|
194
196
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.OR,
|
195
|
-
]
|
197
|
+
])
|
196
198
|
) {
|
197
199
|
const groupNode = new QueryBuilderPostFilterTreeGroupNodeData(
|
198
200
|
parentPostFilterNodeId,
|
@@ -200,7 +202,7 @@ const processPostFilterExpression = (
|
|
200
202
|
);
|
201
203
|
postFilterState.nodes.set(groupNode.id, groupNode);
|
202
204
|
expression.parametersValues.forEach((postFilterExpression) =>
|
203
|
-
|
205
|
+
processPostFilterTree(
|
204
206
|
guaranteeType(
|
205
207
|
postFilterExpression,
|
206
208
|
FunctionExpression,
|
@@ -235,43 +237,61 @@ const processPostFilterExpression = (
|
|
235
237
|
}
|
236
238
|
};
|
237
239
|
|
238
|
-
export const
|
239
|
-
|
240
|
-
|
240
|
+
export const processTDSPostFilterExpression = (
|
241
|
+
expression: SimpleFunctionExpression,
|
242
|
+
queryBuilderState: QueryBuilderState,
|
241
243
|
): void => {
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
lambdaFunc
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
lambdaFunc.
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
244
|
+
if (
|
245
|
+
queryBuilderState.fetchStructureState.implementation instanceof
|
246
|
+
QueryBuilderProjectionState
|
247
|
+
) {
|
248
|
+
const projectionState =
|
249
|
+
queryBuilderState.fetchStructureState.implementation;
|
250
|
+
const postFilterState = projectionState.postFilterState;
|
251
|
+
const fetchStructureState = projectionState.fetchStructureState;
|
252
|
+
const postFilterLambda = expression.parametersValues[1];
|
253
|
+
assertType(
|
254
|
+
postFilterLambda,
|
255
|
+
LambdaFunctionInstanceValue,
|
256
|
+
`Can't process post-filter expression: expects argument #1 to be a lambda function`,
|
257
|
+
);
|
258
|
+
|
259
|
+
assertType(
|
260
|
+
fetchStructureState.implementation,
|
261
|
+
QueryBuilderProjectionState,
|
262
|
+
`Can't process post-filter lambda: post-filter lambda must use projection fetch structure`,
|
263
|
+
);
|
264
|
+
assertTrue(
|
265
|
+
Boolean(projectionState.columns.length),
|
266
|
+
`Can't process post-filter lambda: post-filter lambda must have at least one projection column `,
|
267
|
+
);
|
268
|
+
const lambdaFunc = guaranteeNonNullable(
|
269
|
+
postFilterLambda.values[0],
|
270
|
+
`Can't process post-filter lambda: post-filter lambda function is missing`,
|
271
|
+
);
|
272
|
+
assertTrue(
|
273
|
+
lambdaFunc.expressionSequence.length === 1,
|
274
|
+
`Can't process post-filter lambda: only support post-filter lambda body with 1 expression`,
|
275
|
+
);
|
276
|
+
const rootExpression = guaranteeType(
|
277
|
+
lambdaFunc.expressionSequence[0],
|
278
|
+
FunctionExpression,
|
279
|
+
`Can't process post-filter lambda: only support post-filter lambda body of type 'FunctionExpression'`,
|
280
|
+
);
|
281
|
+
assertTrue(
|
282
|
+
lambdaFunc.functionType.parameters.length === 1,
|
283
|
+
`Can't process post-filter lambda: only support post-filter lambda with 1 parameter`,
|
284
|
+
);
|
285
|
+
postFilterState.setLambdaParameterName(
|
286
|
+
guaranteeType(
|
287
|
+
lambdaFunc.functionType.parameters[0],
|
288
|
+
VariableExpression,
|
289
|
+
`Can't process post-filter lambda: only support filter() lambda with 1 parameter of type 'VariableExpression'`,
|
290
|
+
).name,
|
291
|
+
);
|
292
|
+
processPostFilterTree(rootExpression, postFilterState, undefined);
|
293
|
+
|
294
|
+
projectionState.setShowPostFilterPanel(true);
|
295
|
+
postFilterState.simplifyTree();
|
296
|
+
}
|
277
297
|
};
|
@@ -21,15 +21,10 @@ import {
|
|
21
21
|
type LambdaFunction,
|
22
22
|
type ValueSpecification,
|
23
23
|
} from '@finos/legend-graph';
|
24
|
-
import {
|
25
|
-
assertTrue,
|
26
|
-
guaranteeNonNullable,
|
27
|
-
isNonNullable,
|
28
|
-
} from '@finos/legend-shared';
|
24
|
+
import { guaranteeNonNullable, isNonNullable } from '@finos/legend-shared';
|
29
25
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../QueryBuilder_Const.js';
|
30
26
|
import { fromGroupOperation } from '../../../QueryBuilderGroupOperationHelper.js';
|
31
27
|
import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
|
32
|
-
import { FETCH_STRUCTURE_MODE } from '../../QueryBuilderFetchStructureState.js';
|
33
28
|
import {
|
34
29
|
QueryBuilderPostFilterTreeConditionNodeData,
|
35
30
|
QueryBuilderPostFilterTreeGroupNodeData,
|
@@ -105,11 +100,6 @@ export const appendPostFilter = (
|
|
105
100
|
) {
|
106
101
|
return lambda;
|
107
102
|
}
|
108
|
-
assertTrue(
|
109
|
-
postFilterState.projectionState.fetchStructureState.fetchStructureMode ===
|
110
|
-
FETCH_STRUCTURE_MODE.PROJECTION,
|
111
|
-
'Can only apply post-filter while fetching projection columns',
|
112
|
-
);
|
113
103
|
const multiplicityOne =
|
114
104
|
postFilterState.projectionState.queryBuilderState.graphManagerState.graph.getTypicalMultiplicity(
|
115
105
|
TYPICAL_MULTIPLICITY_TYPE.ONE,
|
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
} from '@finos/legend-shared';
|
29
29
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
30
30
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
31
|
-
import { buildPostFilterConditionState } from '../
|
31
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
32
32
|
import type {
|
33
33
|
PostFilterConditionState,
|
34
34
|
QueryBuilderPostFilterState,
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
import { UnsupportedOperationError } from '@finos/legend-shared';
|
25
25
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
26
26
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
27
|
-
import { buildPostFilterConditionState } from '../
|
27
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
28
28
|
import type {
|
29
29
|
PostFilterConditionState,
|
30
30
|
QueryBuilderPostFilterState,
|
@@ -37,7 +37,7 @@ import {
|
|
37
37
|
} from '@finos/legend-shared';
|
38
38
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
39
39
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
40
|
-
import { buildPostFilterConditionState } from '../
|
40
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
41
41
|
import type {
|
42
42
|
PostFilterConditionState,
|
43
43
|
QueryBuilderPostFilterState,
|
@@ -29,7 +29,7 @@ import {
|
|
29
29
|
} from '@finos/legend-shared';
|
30
30
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
31
31
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
32
|
-
import { buildPostFilterConditionState } from '../
|
32
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
33
33
|
import type {
|
34
34
|
PostFilterConditionState,
|
35
35
|
QueryBuilderPostFilterState,
|
@@ -22,7 +22,7 @@ import {
|
|
22
22
|
SUPPORTED_FUNCTIONS,
|
23
23
|
} from '@finos/legend-graph';
|
24
24
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
25
|
-
import { buildPostFilterConditionState } from '../
|
25
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
26
26
|
import type {
|
27
27
|
PostFilterConditionState,
|
28
28
|
QueryBuilderPostFilterState,
|
@@ -30,7 +30,7 @@ import {
|
|
30
30
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
31
31
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
32
32
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
33
|
-
import { buildPostFilterConditionState } from '../
|
33
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
34
34
|
import type {
|
35
35
|
PostFilterConditionState,
|
36
36
|
QueryBuilderPostFilterState,
|
@@ -22,7 +22,7 @@ import {
|
|
22
22
|
PRIMITIVE_TYPE,
|
23
23
|
} from '@finos/legend-graph';
|
24
24
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
25
|
-
import { buildPostFilterConditionState } from '../
|
25
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
26
26
|
import {
|
27
27
|
type PostFilterConditionState,
|
28
28
|
type QueryBuilderPostFilterState,
|
@@ -29,7 +29,7 @@ import {
|
|
29
29
|
} from '@finos/legend-shared';
|
30
30
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
31
31
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
32
|
-
import { buildPostFilterConditionState } from '../
|
32
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
33
33
|
import type {
|
34
34
|
PostFilterConditionState,
|
35
35
|
QueryBuilderPostFilterState,
|
@@ -22,7 +22,7 @@ import {
|
|
22
22
|
SUPPORTED_FUNCTIONS,
|
23
23
|
} from '@finos/legend-graph';
|
24
24
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
25
|
-
import { buildPostFilterConditionState } from '../
|
25
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
26
26
|
import type {
|
27
27
|
PostFilterConditionState,
|
28
28
|
QueryBuilderPostFilterState,
|
@@ -25,7 +25,7 @@ import {
|
|
25
25
|
import { UnsupportedOperationError } from '@finos/legend-shared';
|
26
26
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../QueryBuilder_Const.js';
|
27
27
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
28
|
-
import { buildPostFilterConditionState } from '../
|
28
|
+
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
29
29
|
import type {
|
30
30
|
PostFilterConditionState,
|
31
31
|
QueryBuilderPostFilterState,
|
@@ -0,0 +1,155 @@
|
|
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 {
|
18
|
+
AbstractPropertyExpression,
|
19
|
+
LambdaFunctionInstanceValue,
|
20
|
+
matchFunctionName,
|
21
|
+
SimpleFunctionExpression,
|
22
|
+
VariableExpression,
|
23
|
+
} from '@finos/legend-graph';
|
24
|
+
import {
|
25
|
+
assertTrue,
|
26
|
+
assertType,
|
27
|
+
guaranteeNonNullable,
|
28
|
+
guaranteeType,
|
29
|
+
returnUndefOnError,
|
30
|
+
UnsupportedOperationError,
|
31
|
+
} from '@finos/legend-shared';
|
32
|
+
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
|
33
|
+
import { toGroupOperation } from '../QueryBuilderGroupOperationHelper.js';
|
34
|
+
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
35
|
+
import { validatePropertyExpressionChain } from '../QueryBuilderValueSpecificationHelper.js';
|
36
|
+
import {
|
37
|
+
type QueryBuilderFilterState,
|
38
|
+
QueryBuilderFilterTreeConditionNodeData,
|
39
|
+
QueryBuilderFilterTreeGroupNodeData,
|
40
|
+
} from './QueryBuilderFilterState.js';
|
41
|
+
|
42
|
+
const processFilterTree = (
|
43
|
+
expression: SimpleFunctionExpression,
|
44
|
+
filterState: QueryBuilderFilterState,
|
45
|
+
parentFilterNodeId: string | undefined,
|
46
|
+
): void => {
|
47
|
+
const parentNode = parentFilterNodeId
|
48
|
+
? filterState.getNode(parentFilterNodeId)
|
49
|
+
: undefined;
|
50
|
+
if (
|
51
|
+
matchFunctionName(expression.functionName, [
|
52
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.AND,
|
53
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.OR,
|
54
|
+
])
|
55
|
+
) {
|
56
|
+
const groupNode = new QueryBuilderFilterTreeGroupNodeData(
|
57
|
+
parentFilterNodeId,
|
58
|
+
toGroupOperation(expression.functionName),
|
59
|
+
);
|
60
|
+
filterState.nodes.set(groupNode.id, groupNode);
|
61
|
+
expression.parametersValues.forEach((filterExpression) =>
|
62
|
+
processFilterTree(
|
63
|
+
guaranteeType(
|
64
|
+
filterExpression,
|
65
|
+
SimpleFunctionExpression,
|
66
|
+
`Can't process filter group expression: each child expression must be a function expression`,
|
67
|
+
),
|
68
|
+
filterState,
|
69
|
+
groupNode.id,
|
70
|
+
),
|
71
|
+
);
|
72
|
+
filterState.addNodeFromNode(groupNode, parentNode);
|
73
|
+
} else {
|
74
|
+
const propertyExpression = expression.parametersValues[0];
|
75
|
+
if (propertyExpression instanceof AbstractPropertyExpression) {
|
76
|
+
const currentPropertyExpression = propertyExpression.parametersValues[0];
|
77
|
+
if (currentPropertyExpression instanceof AbstractPropertyExpression) {
|
78
|
+
validatePropertyExpressionChain(
|
79
|
+
currentPropertyExpression,
|
80
|
+
filterState.queryBuilderState.graphManagerState.graph,
|
81
|
+
);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
for (const operator of filterState.operators) {
|
85
|
+
// NOTE: this allow plugin author to either return `undefined` or throw error
|
86
|
+
// if there is a problem with building the lambda. Either case, the plugin is
|
87
|
+
// considered as not supporting the lambda.
|
88
|
+
const filterConditionState = returnUndefOnError(() =>
|
89
|
+
operator.buildFilterConditionState(filterState, expression),
|
90
|
+
);
|
91
|
+
if (filterConditionState) {
|
92
|
+
filterState.addNodeFromNode(
|
93
|
+
new QueryBuilderFilterTreeConditionNodeData(
|
94
|
+
undefined,
|
95
|
+
filterConditionState,
|
96
|
+
),
|
97
|
+
parentNode,
|
98
|
+
);
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
throw new UnsupportedOperationError(
|
103
|
+
`Can't process filter() expression: no compatible filter operator processer available from plugins`,
|
104
|
+
);
|
105
|
+
}
|
106
|
+
};
|
107
|
+
|
108
|
+
export const processFilterExpression = (
|
109
|
+
expression: SimpleFunctionExpression,
|
110
|
+
queryBuilderState: QueryBuilderState,
|
111
|
+
): void => {
|
112
|
+
const filterState = queryBuilderState.filterState;
|
113
|
+
const filterLambda = expression.parametersValues[1];
|
114
|
+
assertType(
|
115
|
+
filterLambda,
|
116
|
+
LambdaFunctionInstanceValue,
|
117
|
+
`Can't process filter() expression: filter() expects argument #1 to be a lambda function`,
|
118
|
+
);
|
119
|
+
|
120
|
+
const lambdaFunc = guaranteeNonNullable(
|
121
|
+
filterLambda.values[0],
|
122
|
+
`Can't process filter() lambda: filter() lambda function is missing`,
|
123
|
+
);
|
124
|
+
assertTrue(
|
125
|
+
lambdaFunc.expressionSequence.length === 1,
|
126
|
+
`Can't process filter() lambda: only support filter() lambda body with 1 expression`,
|
127
|
+
);
|
128
|
+
const rootExpression = guaranteeType(
|
129
|
+
lambdaFunc.expressionSequence[0],
|
130
|
+
SimpleFunctionExpression,
|
131
|
+
`Can't process filter() lambda: only support filter() lambda body with 1 expression`,
|
132
|
+
);
|
133
|
+
|
134
|
+
assertTrue(
|
135
|
+
lambdaFunc.functionType.parameters.length === 1,
|
136
|
+
`Can't process filter() lambda: only support filter() lambda with 1 parameter`,
|
137
|
+
);
|
138
|
+
filterState.setLambdaParameterName(
|
139
|
+
guaranteeType(
|
140
|
+
lambdaFunc.functionType.parameters[0],
|
141
|
+
VariableExpression,
|
142
|
+
`Can't process filter() lambda: only support filter() lambda with 1 parameter`,
|
143
|
+
).name,
|
144
|
+
);
|
145
|
+
|
146
|
+
processFilterTree(rootExpression, filterState, undefined);
|
147
|
+
|
148
|
+
/**
|
149
|
+
* NOTE: Since group operations like and/or do not take more than 2 parameters, if there are
|
150
|
+
* more than 2 clauses in each group operations, then these clauses are converted into an
|
151
|
+
* unbalanced tree. However, this would look quite bad for UX, as such, we simplify the tree.
|
152
|
+
* After building the filter state.
|
153
|
+
*/
|
154
|
+
filterState.simplifyTree();
|
155
|
+
};
|
File without changes
|
@@ -36,8 +36,8 @@ import {
|
|
36
36
|
} from '../QueryBuilderFilterState.js';
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../QueryBuilder_Const.js';
|
38
38
|
import { buildGenericLambdaFunctionInstanceValue } from '../../QueryBuilderValueSpecificationHelper.js';
|
39
|
-
import { buildPropertyExpressionChain } from '../../QueryBuilderValueSpecificationBuilder.js';
|
40
39
|
import type { QueryBuilderFilterOperator } from '../QueryBuilderFilterOperator.js';
|
40
|
+
import { buildPropertyExpressionChain } from '../../QueryBuilderValueSpecificationBuilderHelper.js';
|
41
41
|
|
42
42
|
const getPropertyExpressionChainVariable = (
|
43
43
|
propertyExpression: AbstractPropertyExpression,
|
@@ -261,12 +261,12 @@ export const buildFilterConditionExpression = (
|
|
261
261
|
*/
|
262
262
|
const buildFilterConditionStateWithExists = (
|
263
263
|
filterState: QueryBuilderFilterState,
|
264
|
-
|
264
|
+
parentExpression: SimpleFunctionExpression,
|
265
265
|
operatorFunctionFullPath: string,
|
266
266
|
): [FilterConditionState | undefined, SimpleFunctionExpression | undefined] => {
|
267
267
|
if (
|
268
268
|
matchFunctionName(
|
269
|
-
|
269
|
+
parentExpression.functionName,
|
270
270
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.EXISTS,
|
271
271
|
)
|
272
272
|
) {
|
@@ -277,7 +277,7 @@ const buildFilterConditionStateWithExists = (
|
|
277
277
|
// e.g. |Firm.all()->filter(x|$x.employees->exists(x_1|$x_1->subType(@Develper).id->exists(x_2|$x_2 == 1))
|
278
278
|
// In the first exists() lambda, `$x_1->subType(@Develper).id` is an `AbstractPropertyExpression`.
|
279
279
|
const existsLambdaExpressions: AbstractPropertyExpression[] = [];
|
280
|
-
let mainFilterExpression: SimpleFunctionExpression =
|
280
|
+
let mainFilterExpression: SimpleFunctionExpression = parentExpression;
|
281
281
|
while (
|
282
282
|
matchFunctionName(
|
283
283
|
mainFilterExpression.functionName,
|
@@ -338,7 +338,7 @@ const buildFilterConditionStateWithExists = (
|
|
338
338
|
TYPICAL_MULTIPLICITY_TYPE.ONE,
|
339
339
|
);
|
340
340
|
const initialPropertyExpression = guaranteeType(
|
341
|
-
|
341
|
+
parentExpression.parametersValues[0],
|
342
342
|
AbstractPropertyExpression,
|
343
343
|
);
|
344
344
|
let flattenedPropertyExpressionChain = new AbstractPropertyExpression(
|
package/tsconfig.json
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
"noImplicitOverride": true,
|
22
22
|
"noUncheckedIndexedAccess": true,
|
23
23
|
"exactOptionalPropertyTypes": true,
|
24
|
-
"forceConsistentCasingInFileNames":
|
24
|
+
"forceConsistentCasingInFileNames": false,
|
25
25
|
"outDir": "./lib",
|
26
26
|
"tsBuildInfoFile": "./build/prod.tsbuildinfo",
|
27
27
|
"rootDir": "./src",
|
@@ -59,12 +59,13 @@
|
|
59
59
|
"./src/stores/QueryBuilderResultState.ts",
|
60
60
|
"./src/stores/QueryBuilderSetupState.ts",
|
61
61
|
"./src/stores/QueryBuilderState.ts",
|
62
|
-
"./src/stores/
|
62
|
+
"./src/stores/QueryBuilderStateBuilder.ts",
|
63
|
+
"./src/stores/QueryBuilderStateTestUtils.ts",
|
63
64
|
"./src/stores/QueryBuilderTypeaheadHelper.ts",
|
64
65
|
"./src/stores/QueryBuilderUnsupportedState.ts",
|
65
66
|
"./src/stores/QueryBuilderValueSpecificationBuilder.ts",
|
67
|
+
"./src/stores/QueryBuilderValueSpecificationBuilderHelper.ts",
|
66
68
|
"./src/stores/QueryBuilderValueSpecificationHelper.ts",
|
67
|
-
"./src/stores/QueryBuilderValueSpecificationProcessor.ts",
|
68
69
|
"./src/stores/QueryEditorStore.ts",
|
69
70
|
"./src/stores/QueryEditorStoreTestUtils.ts",
|
70
71
|
"./src/stores/QueryParametersState.ts",
|
@@ -76,15 +77,18 @@
|
|
76
77
|
"./src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts",
|
77
78
|
"./src/stores/fetch-structure/QueryBuilderFetchStructureState.ts",
|
78
79
|
"./src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts",
|
80
|
+
"./src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts",
|
79
81
|
"./src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts",
|
80
82
|
"./src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.ts",
|
81
83
|
"./src/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.ts",
|
82
84
|
"./src/stores/fetch-structure/projection/QueryBuilderProjectionState.ts",
|
85
|
+
"./src/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.ts",
|
83
86
|
"./src/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.ts",
|
84
87
|
"./src/stores/fetch-structure/projection/QueryResultSetModifierState.ts",
|
85
88
|
"./src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregateOperator.ts",
|
86
89
|
"./src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregateOperatorLoader.ts",
|
87
90
|
"./src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationState.ts",
|
91
|
+
"./src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.ts",
|
88
92
|
"./src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperatorHelper.ts",
|
89
93
|
"./src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_Average.ts",
|
90
94
|
"./src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_Count.ts",
|
@@ -99,8 +103,8 @@
|
|
99
103
|
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterOperator.ts",
|
100
104
|
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterOperatorLoader.ts",
|
101
105
|
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterState.ts",
|
106
|
+
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.ts",
|
102
107
|
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts",
|
103
|
-
"./src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.ts",
|
104
108
|
"./src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts",
|
105
109
|
"./src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts",
|
106
110
|
"./src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts",
|
@@ -115,7 +119,8 @@
|
|
115
119
|
"./src/stores/filter/QueryBuilderFilterOperator.ts",
|
116
120
|
"./src/stores/filter/QueryBuilderFilterOperatorLoader.ts",
|
117
121
|
"./src/stores/filter/QueryBuilderFilterState.ts",
|
118
|
-
"./src/stores/filter/
|
122
|
+
"./src/stores/filter/QueryBuilderFilterStateBuilder.ts",
|
123
|
+
"./src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts",
|
119
124
|
"./src/stores/filter/operators/QueryBuilderFilterOperatorHelper.ts",
|
120
125
|
"./src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts",
|
121
126
|
"./src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts",
|
package/tsconfig.package.json
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
"noImplicitOverride": true,
|
22
22
|
"noUncheckedIndexedAccess": true,
|
23
23
|
"exactOptionalPropertyTypes": true,
|
24
|
-
"forceConsistentCasingInFileNames":
|
24
|
+
"forceConsistentCasingInFileNames": false,
|
25
25
|
"outDir": "./lib",
|
26
26
|
"tsBuildInfoFile": "./build/package.tsbuildinfo",
|
27
27
|
"rootDir": "./"
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderTestUtils.d.ts","sourceRoot":"","sources":["../../src/stores/QueryBuilderTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,qCAAqC,EAG3C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,OAAO,EACL,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,2BAA2B,aAC5B,MAAM,EAAE,cACN,SAAS,GAAG,SAAS,qBAE7B;IACE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GACD,SAAS,0CAET,qCAAqC,GACrC,SAAS,KACZ,QAAQ,iBAAiB,CAgD3B,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderTestUtils.js","sourceRoot":"","sources":["../../src/stores/QueryBuilderTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAGL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AACrG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yCAAyC,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAC9C,QAAkB,EAClB,SAAiC,EACjC,gBAMa,EACb,qCAEa,EACe,EAAE;IAC9B,MAAM,aAAa,GAAG,wBAAwB,CAAC,MAAM,EAAE,CAAC;IACxD,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,+BAA+B,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5E,MAAM,gBAAgB,GAAG,6BAA6B,CACpD,yCAAyC,EAAE,EAC3C,wBAAwB,CAAC,MAAM,EAAE,CAClC,CAAC;IACF,MAAM,iBAAiB,GAAG,8BAA8B,CAAC,aAAa,CAAC,CAAC;IACxE,MAAM,4BAA4B,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAChE,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAC7C,gBAAgB,EAChB,iBAAiB,EACjB,IAAI,wBAAwB,EAAE,CAC/B,CAAC;IACF,IAAI,SAAS,EAAE;QACb,iBAAiB,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;KACtD;IACD,IAAI,gBAAgB,EAAE;QACpB,MAAM,KAAK,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACxD,iBAAiB,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CACvD,gBAAgB,CAAC,MAAM,CACxB,CAAC;QACF,iBAAiB,CAAC,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAC1D,gBAAgB,CAAC,OAAO,CACzB,CAAC;QACF,IAAI,gBAAgB,CAAC,OAAO,EAAE;YAC5B,iBAAiB,CAAC,eAAe,CAAC,YAAY,GAAG,KAAK,CAAC,UAAU,CAC/D,gBAAgB,CAAC,OAAO,CACzB,CAAC;SACH;KACF;IACD,IAAI,qCAAqC,EAAE;QACzC,IAAI;aACD,KAAK,CACJ,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,EAChD,6BAA6B,CAC9B;aACA,iBAAiB,CAChB,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,uCAAuC,CACtF,qCAAqC,CACtC,CACF,CAAC;QAEJ,MAAM,UAAU,CACd,iBAAiB,CAAC,aAAa,CAAC,2BAA2B,EAAE,CAC9D,CAAC;KACH;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC"}
|