@finos/legend-query-builder 3.0.6 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
- package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
- package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
- package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
- package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderEvent.js +20 -0
- package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
- package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
- package/lib/components/QueryBuilder.d.ts +0 -1
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +25 -34
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +11 -15
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +16 -20
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts +0 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts +0 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +5 -5
- package/lib/stores/QueryBuilderState.d.ts +1 -2
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +7 -8
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +2 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts +2 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js +18 -15
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js.map +1 -1
- package/package.json +13 -13
- package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
- package/src/__lib__/QueryBuilderEvent.ts +20 -0
- package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
- package/src/components/QueryBuilder.tsx +147 -188
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +7 -12
- package/src/components/QueryBuilderParametersPanel.tsx +6 -10
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -3
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
- package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
- package/src/components/shared/LambdaParameterValuesEditor.tsx +6 -5
- package/src/index.ts +2 -0
- package/src/stores/QueryBuilderState.ts +6 -11
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +1 -1
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.ts +43 -25
@@ -18,6 +18,7 @@ import {
|
|
18
18
|
type ValueSpecification,
|
19
19
|
type LambdaFunction,
|
20
20
|
type PureModel,
|
21
|
+
type RootGraphFetchTree,
|
21
22
|
extractElementNameFromPath,
|
22
23
|
GenericType,
|
23
24
|
GenericTypeExplicitReference,
|
@@ -159,6 +160,34 @@ export const buildPureSerializationConfig = (
|
|
159
160
|
return newFunction;
|
160
161
|
};
|
161
162
|
|
163
|
+
export const buildSerialzieFunctionWithGraphFetch = (
|
164
|
+
tree: RootGraphFetchTree,
|
165
|
+
isChecked: boolean,
|
166
|
+
precedingExpression: ValueSpecification,
|
167
|
+
pureConfig: SimpleFunctionExpression | undefined,
|
168
|
+
): SimpleFunctionExpression => {
|
169
|
+
const graphFetchInstance = new GraphFetchTreeInstanceValue();
|
170
|
+
graphFetchInstance.values = [tree];
|
171
|
+
const serializeFunction = new SimpleFunctionExpression(
|
172
|
+
extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.SERIALIZE),
|
173
|
+
);
|
174
|
+
const graphFetchFunc = new SimpleFunctionExpression(
|
175
|
+
isChecked
|
176
|
+
? extractElementNameFromPath(
|
177
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
|
178
|
+
)
|
179
|
+
: extractElementNameFromPath(
|
180
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
|
181
|
+
),
|
182
|
+
);
|
183
|
+
graphFetchFunc.parametersValues = [precedingExpression, graphFetchInstance];
|
184
|
+
serializeFunction.parametersValues = [graphFetchFunc, graphFetchInstance];
|
185
|
+
if (pureConfig) {
|
186
|
+
serializeFunction.parametersValues.push(pureConfig);
|
187
|
+
}
|
188
|
+
return serializeFunction;
|
189
|
+
};
|
190
|
+
|
162
191
|
export const appendGraphFetch = (
|
163
192
|
graphFetchTreeState: QueryBuilderGraphFetchTreeState,
|
164
193
|
lambdaFunction: LambdaFunction,
|
@@ -184,32 +213,21 @@ export const appendGraphFetch = (
|
|
184
213
|
graphFetchTreeState.treeData &&
|
185
214
|
!isGraphFetchTreeDataEmpty(graphFetchTreeState.treeData)
|
186
215
|
) {
|
187
|
-
const
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
),
|
200
|
-
);
|
201
|
-
graphFetchFunc.parametersValues = [
|
216
|
+
const pureConfig = serializationState.config
|
217
|
+
? buildPureSerializationConfig(
|
218
|
+
serializationState.config as unknown as Record<
|
219
|
+
PropertyKey,
|
220
|
+
boolean
|
221
|
+
>,
|
222
|
+
graphFetchTreeState.queryBuilderState.graphManagerState.graph,
|
223
|
+
)
|
224
|
+
: undefined;
|
225
|
+
const serializeFunction = buildSerialzieFunctionWithGraphFetch(
|
226
|
+
graphFetchTreeState.treeData.tree,
|
227
|
+
graphFetchTreeState.isChecked,
|
202
228
|
precedingExpression,
|
203
|
-
|
204
|
-
|
205
|
-
serializeFunction.parametersValues = [graphFetchFunc, graphFetchInstance];
|
206
|
-
if (serializationState.config) {
|
207
|
-
const configFunction = buildPureSerializationConfig(
|
208
|
-
serializationState.config as unknown as Record<PropertyKey, boolean>,
|
209
|
-
graphFetchTreeState.queryBuilderState.graphManagerState.graph,
|
210
|
-
);
|
211
|
-
serializeFunction.parametersValues.push(configFunction);
|
212
|
-
}
|
229
|
+
pureConfig,
|
230
|
+
);
|
213
231
|
lambdaFunction.expressionSequence[0] = serializeFunction;
|
214
232
|
}
|
215
233
|
} else if (
|