@finos/legend-query-builder 4.15.11 → 4.15.12

Sign up to get free protection for your applications and to get access to all the features.
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 +1 -1
  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 +5 -5
  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
@@ -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
  }