@finos/legend-query-builder 4.15.10 → 4.15.12
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +7 -2
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryLoader.d.ts.map +1 -1
- package/lib/components/QueryLoader.js +1 -1
- package/lib/components/QueryLoader.js.map +1 -1
- package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
- package/lib/components/workflows/ServiceQueryBuilder.js +3 -7
- package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderState.d.ts +0 -1
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +1 -13
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +1 -6
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js +11 -13
- package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
- package/package.json +7 -7
- package/src/components/QueryBuilderParametersPanel.tsx +11 -2
- package/src/components/QueryLoader.tsx +4 -6
- package/src/components/workflows/ServiceQueryBuilder.tsx +4 -10
- package/src/stores/QueryBuilderState.ts +1 -22
- package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +1 -11
- package/src/stores/workflows/ServiceQueryBuilderState.ts +17 -19
@@ -37,7 +37,7 @@ export type CuratedTemplateQuerySpecification = {
|
|
37
37
|
loadCuratedTemplateQuery(
|
38
38
|
templateQuery: CuratedTemplateQuery,
|
39
39
|
queryBuilderState: QueryBuilderState,
|
40
|
-
):
|
40
|
+
): void;
|
41
41
|
};
|
42
42
|
|
43
43
|
export type LoadQueryFilterOption = {
|
@@ -95,11 +95,6 @@ export type QueryBuilderMenuActionConfiguration = {
|
|
95
95
|
) => React.ReactNode;
|
96
96
|
};
|
97
97
|
|
98
|
-
export type QueryBuilderPropagateExecutionContextChangeHelper = (
|
99
|
-
queryBuilderState: QueryBuilderState,
|
100
|
-
isGraphBuildingNotRequired?: boolean,
|
101
|
-
) => (() => Promise<void>) | undefined;
|
102
|
-
|
103
98
|
export interface QueryBuilder_LegendApplicationPlugin_Extension
|
104
99
|
extends LegendApplicationPlugin {
|
105
100
|
/**
|
@@ -163,9 +158,4 @@ export interface QueryBuilder_LegendApplicationPlugin_Extension
|
|
163
158
|
* Get the list of export menu action configurations
|
164
159
|
*/
|
165
160
|
getExtraQueryBuilderExportMenuActionConfigurations?(): QueryBuilderMenuActionConfiguration[];
|
166
|
-
|
167
|
-
/**
|
168
|
-
* Get the list of Query Builder Propagate Execution Context Change Helper
|
169
|
-
*/
|
170
|
-
getExtraQueryBuilderPropagateExecutionContextChangeHelper?(): QueryBuilderPropagateExecutionContextChangeHelper[];
|
171
161
|
}
|
@@ -156,25 +156,23 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
|
|
156
156
|
* - If no class is chosen, try to choose a compatible class
|
157
157
|
* - If the chosen class is compatible with the new chosen mapping, do nothing, otherwise, try to choose a compatible class
|
158
158
|
*/
|
159
|
-
|
160
|
-
|
161
|
-
):
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
this.changeClass(possibleNewClass);
|
177
|
-
}
|
159
|
+
propagateExecutionContextChange(
|
160
|
+
executionContext: ServiceExecutionContext,
|
161
|
+
): void {
|
162
|
+
const mapping = executionContext.mapping;
|
163
|
+
this.changeMapping(mapping, { keepQueryContent: true });
|
164
|
+
this.changeRuntime(executionContext.runtimeValue);
|
165
|
+
|
166
|
+
const compatibleClasses = getMappingCompatibleClasses(
|
167
|
+
mapping,
|
168
|
+
this.graphManagerState.usableClasses,
|
169
|
+
);
|
170
|
+
// if there is no chosen class or the chosen one is not compatible
|
171
|
+
// with the mapping then pick a compatible class if possible
|
172
|
+
if (!this.class || !compatibleClasses.includes(this.class)) {
|
173
|
+
const possibleNewClass = getNullableFirstEntry(compatibleClasses);
|
174
|
+
if (possibleNewClass) {
|
175
|
+
this.changeClass(possibleNewClass);
|
178
176
|
}
|
179
177
|
}
|
180
178
|
}
|