@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.
Files changed (29) hide show
  1. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  2. package/lib/components/QueryBuilderParametersPanel.js +7 -2
  3. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  4. package/lib/components/QueryLoader.d.ts.map +1 -1
  5. package/lib/components/QueryLoader.js +1 -1
  6. package/lib/components/QueryLoader.js.map +1 -1
  7. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  8. package/lib/components/workflows/ServiceQueryBuilder.js +3 -7
  9. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  10. package/lib/index.css +2 -2
  11. package/lib/index.css.map +1 -1
  12. package/lib/package.json +5 -5
  13. package/lib/stores/QueryBuilderState.d.ts +0 -1
  14. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  15. package/lib/stores/QueryBuilderState.js +1 -13
  16. package/lib/stores/QueryBuilderState.js.map +1 -1
  17. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +1 -6
  18. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  19. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +1 -1
  20. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  21. package/lib/stores/workflows/ServiceQueryBuilderState.js +11 -13
  22. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  23. package/package.json +15 -15
  24. package/src/components/QueryBuilderParametersPanel.tsx +11 -2
  25. package/src/components/QueryLoader.tsx +4 -6
  26. package/src/components/workflows/ServiceQueryBuilder.tsx +4 -10
  27. package/src/stores/QueryBuilderState.ts +1 -22
  28. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +1 -11
  29. 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
- ): Promise<void>;
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
- override async propagateExecutionContextChange(
160
- isGraphBuildingNotRequired?: boolean,
161
- ): Promise<void> {
162
- if (this.selectedExecutionContext) {
163
- const mapping = this.selectedExecutionContext.mapping;
164
- this.changeMapping(mapping, { keepQueryContent: true });
165
- this.changeRuntime(this.selectedExecutionContext.runtimeValue);
166
-
167
- const compatibleClasses = getMappingCompatibleClasses(
168
- mapping,
169
- this.graphManagerState.usableClasses,
170
- );
171
- // if there is no chosen class or the chosen one is not compatible
172
- // with the mapping then pick a compatible class if possible
173
- if (!this.class || !compatibleClasses.includes(this.class)) {
174
- const possibleNewClass = getNullableFirstEntry(compatibleClasses);
175
- if (possibleNewClass) {
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
  }