@finos/legend-query-builder 4.15.11 → 4.15.13
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/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 +5 -5
- 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 +15 -15
- 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
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
buildLambdaVariableExpressions,
|
|
70
70
|
buildRawLambdaFromLambdaFunction,
|
|
71
71
|
PrimitiveType,
|
|
72
|
+
PackageableElementExplicitReference,
|
|
72
73
|
RuntimePointer,
|
|
73
74
|
QueryExplicitExecutionContext,
|
|
74
75
|
attachFromQuery,
|
|
75
|
-
PackageableElementExplicitReference,
|
|
76
76
|
} from '@finos/legend-graph';
|
|
77
77
|
import { buildLambdaFunction } from './QueryBuilderValueSpecificationBuilder.js';
|
|
78
78
|
import type {
|
|
@@ -108,7 +108,6 @@ import { QUERY_BUILDER_EVENT } from '../__lib__/QueryBuilderEvent.js';
|
|
|
108
108
|
import { QUERY_BUILDER_SETTING_KEY } from '../__lib__/QueryBuilderSetting.js';
|
|
109
109
|
import { QueryBuilderChangeHistoryState } from './QueryBuilderChangeHistoryState.js';
|
|
110
110
|
import { type QueryBuilderWorkflowState } from './query-workflow/QueryBuilderWorkFlowState.js';
|
|
111
|
-
import type { QueryBuilder_LegendApplicationPlugin_Extension } from './QueryBuilder_LegendApplicationPlugin_Extension.js';
|
|
112
111
|
|
|
113
112
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
114
113
|
export interface QueryableSourceInfo {}
|
|
@@ -351,26 +350,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
|
351
350
|
return queryExeContext;
|
|
352
351
|
}
|
|
353
352
|
|
|
354
|
-
async propagateExecutionContextChange(
|
|
355
|
-
isGraphBuildingNotRequired?: boolean,
|
|
356
|
-
): Promise<void> {
|
|
357
|
-
const propagateFuncHelpers = this.applicationStore.pluginManager
|
|
358
|
-
.getApplicationPlugins()
|
|
359
|
-
.flatMap(
|
|
360
|
-
(plugin) =>
|
|
361
|
-
(
|
|
362
|
-
plugin as QueryBuilder_LegendApplicationPlugin_Extension
|
|
363
|
-
).getExtraQueryBuilderPropagateExecutionContextChangeHelper?.() ?? [],
|
|
364
|
-
);
|
|
365
|
-
for (const helper of propagateFuncHelpers) {
|
|
366
|
-
const propagateFuncHelper = helper(this, isGraphBuildingNotRequired);
|
|
367
|
-
if (propagateFuncHelper) {
|
|
368
|
-
await propagateFuncHelper();
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
353
|
/**
|
|
375
354
|
* Gets information about the current queryBuilderState.
|
|
376
355
|
* This information can be used as a part of analytics
|
|
@@ -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
|
}
|