@finos/legend-query-builder 4.2.4 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +3 -1
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderResultPanel.js +11 -2
  6. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  7. package/lib/components/QueryBuilderSideBar.d.ts +16 -0
  8. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderSideBar.js +85 -7
  10. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  11. package/lib/components/QueryChat.d.ts.map +1 -1
  12. package/lib/components/QueryChat.js +1 -1
  13. package/lib/components/QueryChat.js.map +1 -1
  14. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +2 -2
  15. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  16. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  17. package/lib/components/explorer/QueryBuilderExplorerPanel.js +5 -1
  18. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  19. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  20. package/lib/components/workflows/ClassQueryBuilder.js +13 -9
  21. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  22. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  23. package/lib/components/workflows/MappingQueryBuilder.js +13 -11
  24. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  25. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  26. package/lib/components/workflows/ServiceQueryBuilder.js +3 -2
  27. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  28. package/lib/index.css +1 -1
  29. package/lib/index.d.ts +1 -0
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +1 -0
  32. package/lib/index.js.map +1 -1
  33. package/lib/package.json +1 -1
  34. package/lib/stores/QueryBuilderExecutionContextState.d.ts +34 -0
  35. package/lib/stores/QueryBuilderExecutionContextState.d.ts.map +1 -0
  36. package/lib/stores/QueryBuilderExecutionContextState.js +59 -0
  37. package/lib/stores/QueryBuilderExecutionContextState.js.map +1 -0
  38. package/lib/stores/QueryBuilderInternalizeState.d.ts +24 -0
  39. package/lib/stores/QueryBuilderInternalizeState.d.ts.map +1 -0
  40. package/lib/stores/QueryBuilderInternalizeState.js +26 -0
  41. package/lib/stores/QueryBuilderInternalizeState.js.map +1 -0
  42. package/lib/stores/QueryBuilderResultState.js +5 -5
  43. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  44. package/lib/stores/QueryBuilderState.d.ts +7 -5
  45. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  46. package/lib/stores/QueryBuilderState.js +19 -17
  47. package/lib/stores/QueryBuilderState.js.map +1 -1
  48. package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
  49. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  50. package/lib/stores/QueryBuilderStateBuilder.js +27 -2
  51. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  52. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  53. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +28 -2
  54. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  55. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.d.ts.map +1 -1
  56. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +2 -2
  57. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  58. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.d.ts.map +1 -1
  59. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js +6 -4
  60. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js.map +1 -1
  61. package/lib/stores/explorer/QueryBuilderExplorerState.js +9 -9
  62. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  63. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +2 -1
  64. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  65. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +25 -2
  66. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  67. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +1 -1
  68. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  69. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  70. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +3 -1
  71. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  72. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  73. package/lib/stores/filter/QueryBuilderFilterState.js +2 -1
  74. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  75. package/lib/stores/workflows/ClassQueryBuilderState.d.ts.map +1 -1
  76. package/lib/stores/workflows/ClassQueryBuilderState.js +2 -1
  77. package/lib/stores/workflows/ClassQueryBuilderState.js.map +1 -1
  78. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts +23 -0
  79. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts.map +1 -0
  80. package/lib/stores/workflows/FunctionQueryBuilderState.js +27 -0
  81. package/lib/stores/workflows/FunctionQueryBuilderState.js.map +1 -0
  82. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  83. package/lib/stores/workflows/ServiceQueryBuilderState.js +7 -7
  84. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  85. package/package.json +4 -4
  86. package/src/components/QueryBuilder.tsx +5 -1
  87. package/src/components/QueryBuilderResultPanel.tsx +13 -3
  88. package/src/components/QueryBuilderSideBar.tsx +211 -7
  89. package/src/components/QueryChat.tsx +2 -1
  90. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +2 -2
  91. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +5 -1
  92. package/src/components/workflows/ClassQueryBuilder.tsx +17 -9
  93. package/src/components/workflows/MappingQueryBuilder.tsx +15 -11
  94. package/src/components/workflows/ServiceQueryBuilder.tsx +3 -2
  95. package/src/index.ts +1 -0
  96. package/src/stores/QueryBuilderExecutionContextState.ts +69 -0
  97. package/src/stores/QueryBuilderInternalizeState.ts +34 -0
  98. package/src/stores/QueryBuilderResultState.ts +6 -6
  99. package/src/stores/QueryBuilderState.ts +28 -21
  100. package/src/stores/QueryBuilderStateBuilder.ts +79 -1
  101. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +50 -1
  102. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +4 -2
  103. package/src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts +6 -4
  104. package/src/stores/explorer/QueryBuilderExplorerState.ts +9 -9
  105. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +64 -2
  106. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +1 -1
  107. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +4 -2
  108. package/src/stores/filter/QueryBuilderFilterState.ts +5 -2
  109. package/src/stores/workflows/ClassQueryBuilderState.ts +2 -1
  110. package/src/stores/workflows/FunctionQueryBuilderState.ts +38 -0
  111. package/src/stores/workflows/ServiceQueryBuilderState.ts +7 -11
  112. package/tsconfig.json +3 -0
@@ -53,16 +53,18 @@ export class QueryBuilderCheckEntitlementsState implements Hashable {
53
53
 
54
54
  this.dataAccessState = undefined;
55
55
  if (
56
- this.queryBuilderState.mapping &&
57
- this.queryBuilderState.runtimeValue instanceof RuntimePointer
56
+ this.queryBuilderState.executionContextState.mapping &&
57
+ this.queryBuilderState.executionContextState.runtimeValue instanceof
58
+ RuntimePointer
58
59
  ) {
59
60
  this.dataAccessState = new DataAccessState(
60
61
  this.queryBuilderState.applicationStore,
61
62
  this.queryBuilderState.graphManagerState,
62
63
  {
63
- mapping: this.queryBuilderState.mapping.path,
64
+ mapping: this.queryBuilderState.executionContextState.mapping.path,
64
65
  runtime:
65
- this.queryBuilderState.runtimeValue.packageableRuntime.value.path,
66
+ this.queryBuilderState.executionContextState.runtimeValue
67
+ .packageableRuntime.value.path,
66
68
  getQuery: async () =>
67
69
  this.createExecutableQuery(
68
70
  this.queryBuilderState.buildQuery(),
@@ -660,7 +660,7 @@ export class QueryBuilderExplorerState {
660
660
 
661
661
  refreshTreeData(): void {
662
662
  const _class = this.queryBuilderState.class;
663
- const _mapping = this.queryBuilderState.mapping;
663
+ const _mapping = this.queryBuilderState.executionContextState.mapping;
664
664
  this.setTreeData(
665
665
  _class && _mapping && this.mappingModelCoverageAnalysisResult
666
666
  ? getQueryBuilderTreeData(
@@ -675,9 +675,9 @@ export class QueryBuilderExplorerState {
675
675
  // We will only refetch if the analysis result's mapping has changed.
676
676
  // This makes the assumption that the mapping has not been edited, which is a valid assumption since query is not for editing mappings
677
677
  if (
678
- this.queryBuilderState.mapping &&
679
- this.queryBuilderState.mapping.path !==
680
- this.mappingModelCoverageAnalysisResult?.mapping.path
678
+ this.queryBuilderState.executionContextState.mapping &&
679
+ this.queryBuilderState.executionContextState.mapping !==
680
+ this.mappingModelCoverageAnalysisResult?.mapping
681
681
  ) {
682
682
  this.mappingModelCoverageAnalysisState.inProgress();
683
683
  QueryBuilderTelemetryHelper.logEvent_QueryMappingModelCoverageAnalysisLaunched(
@@ -692,7 +692,7 @@ export class QueryBuilderExplorerState {
692
692
  try {
693
693
  this.mappingModelCoverageAnalysisResult = (yield flowResult(
694
694
  this.queryBuilderState.graphManagerState.graphManager.analyzeMappingModelCoverage(
695
- this.queryBuilderState.mapping,
695
+ this.queryBuilderState.executionContextState.mapping,
696
696
  this.queryBuilderState.graphManagerState.graph,
697
697
  ),
698
698
  )) as MappingModelCoverageAnalysisResult;
@@ -720,7 +720,7 @@ export class QueryBuilderExplorerState {
720
720
  *previewData(
721
721
  node: QueryBuilderExplorerTreePropertyNodeData,
722
722
  ): GeneratorFn<void> {
723
- const runtime = this.queryBuilderState.runtimeValue;
723
+ const runtime = this.queryBuilderState.executionContextState.runtimeValue;
724
724
  if (!runtime) {
725
725
  this.queryBuilderState.applicationStore.notificationService.notifyWarning(
726
726
  `Can't preview data for property '${node.property.name}': runtime is not specified`,
@@ -730,7 +730,7 @@ export class QueryBuilderExplorerState {
730
730
  if (
731
731
  !node.mappingData.mapped ||
732
732
  !this.queryBuilderState.class ||
733
- !this.queryBuilderState.mapping
733
+ !this.queryBuilderState.executionContextState.mapping
734
734
  ) {
735
735
  return;
736
736
  }
@@ -759,7 +759,7 @@ export class QueryBuilderExplorerState {
759
759
  this.queryBuilderState,
760
760
  propertyExpression,
761
761
  ),
762
- this.queryBuilderState.mapping,
762
+ this.queryBuilderState.executionContextState.mapping,
763
763
  runtime,
764
764
  this.queryBuilderState.graphManagerState.graph,
765
765
  )) as ExecutionResult;
@@ -796,7 +796,7 @@ export class QueryBuilderExplorerState {
796
796
  this.queryBuilderState,
797
797
  propertyExpression,
798
798
  ),
799
- this.queryBuilderState.mapping,
799
+ this.queryBuilderState.executionContextState.mapping,
800
800
  runtime,
801
801
  this.queryBuilderState.graphManagerState.graph,
802
802
  )) as ExecutionResult;
@@ -32,11 +32,13 @@ import {
32
32
  CollectionInstanceValue,
33
33
  getClassProperty,
34
34
  PrimitiveType,
35
+ VariableExpression,
35
36
  } from '@finos/legend-graph';
36
37
  import {
37
38
  assertIsBoolean,
38
39
  assertIsString,
39
40
  assertTrue,
41
+ assertType,
40
42
  guaranteeIsString,
41
43
  guaranteeNonNullable,
42
44
  guaranteeType,
@@ -45,7 +47,7 @@ import {
45
47
  QUERY_BUILDER_PURE_PATH,
46
48
  QUERY_BUILDER_SUPPORTED_FUNCTIONS,
47
49
  } from '../../../graph/QueryBuilderMetaModelConst.js';
48
- import type { QueryBuilderState } from '../../QueryBuilderState.js';
50
+ import { type QueryBuilderState } from '../../QueryBuilderState.js';
49
51
  import { QueryBuilderValueSpecificationProcessor } from '../../QueryBuilderStateBuilder.js';
50
52
  import { FETCH_STRUCTURE_IMPLEMENTATION } from '../QueryBuilderFetchStructureImplementationState.js';
51
53
  import {
@@ -56,6 +58,7 @@ import {
56
58
  } from './QueryBuilderGraphFetchTreeState.js';
57
59
  import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
58
60
  import {} from 'mobx';
61
+ import { QueryBuilderInternalizeState } from '../../QueryBuilderInternalizeState.js';
59
62
 
60
63
  export const processGraphFetchExpression = (
61
64
  expression: SimpleFunctionExpression,
@@ -105,6 +108,65 @@ export const processGraphFetchExpression = (
105
108
  }
106
109
  };
107
110
 
111
+ export const processInternalizeExpression = (
112
+ expression: SimpleFunctionExpression,
113
+ queryBuilderState: QueryBuilderState,
114
+ parentLambda: LambdaFunction,
115
+ ): void => {
116
+ // update fetch-structure
117
+ queryBuilderState.fetchStructureState.changeImplementation(
118
+ FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH,
119
+ );
120
+ const functionName = expression.functionName;
121
+ // check parameters
122
+ assertTrue(
123
+ expression.parametersValues.length === 3,
124
+ `Can't process ${functionName}() expression: ${functionName}() expects 2 argument`,
125
+ );
126
+
127
+ // first param classs
128
+ const classVal = expression.parametersValues[0];
129
+ const _class = classVal?.genericType?.value.rawType;
130
+ assertType(
131
+ _class,
132
+ Class,
133
+ `Can't process internalize() expression: internalize() return type is missing`,
134
+ );
135
+
136
+ queryBuilderState.setClass(_class);
137
+ queryBuilderState.milestoningState.clearMilestoningDates();
138
+ queryBuilderState.explorerState.refreshTreeData();
139
+
140
+ // binding
141
+ const instanceExpression = guaranteeType(
142
+ expression.parametersValues[1],
143
+ InstanceValue,
144
+ `Can't process internalize() expression: only support internalize() with 1st parameter as instance value`,
145
+ );
146
+ const binding = guaranteeType(
147
+ guaranteeType(
148
+ instanceExpression.values[0],
149
+ PackageableElementReference,
150
+ `Can't process internalize() expression: only support internalize() with 1st parameter as packagableElement value`,
151
+ ).value,
152
+ Binding,
153
+ `Can't process internalize() expression: only support internalize() with 1st parameter as binding value`,
154
+ );
155
+
156
+ const variableExpression = guaranteeType(
157
+ expression.parametersValues[2],
158
+ VariableExpression,
159
+ );
160
+
161
+ const inernalize = new QueryBuilderInternalizeState(
162
+ binding,
163
+ variableExpression,
164
+ queryBuilderState,
165
+ );
166
+
167
+ queryBuilderState.setInternalize(inernalize);
168
+ };
169
+
108
170
  type PropertyValue = object | string | number | boolean;
109
171
 
110
172
  // Dynamically sets key values of config
@@ -327,6 +389,7 @@ export const processGraphFetchExternalizeExpression = (
327
389
  matchFunctionName(precedingExpression.functionName, [
328
390
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
329
391
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
392
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.INTERNALIZE,
330
393
  ]),
331
394
  `Can't process externalize() expression: only support externalize() in graph-fetch expression`,
332
395
  );
@@ -373,7 +436,6 @@ export const processGraphFetchExternalizeExpression = (
373
436
  Binding,
374
437
  `Can't process externalize() expression: only support externalize() with 1st parameter as binding value`,
375
438
  );
376
-
377
439
  const externalizeState = new GraphFetchExternalFormatSerializationState(
378
440
  graphFetchTreeState,
379
441
  binding,
@@ -452,7 +452,7 @@ export class QueryBuilderTDSState
452
452
  new QueryBuilderDerivationProjectionColumnState(
453
453
  this,
454
454
  guaranteeType(
455
- this.queryBuilderState.graphManagerState.graphManager.buildRawValueSpecification(
455
+ this.queryBuilderState.graphManagerState.graphManager.transformValueSpecToRawValueSpec(
456
456
  columnColumnLambda,
457
457
  this.queryBuilderState.graphManagerState.graph,
458
458
  ),
@@ -380,10 +380,12 @@ export class PostFilterConditionState implements Hashable {
380
380
  this.value,
381
381
  ),
382
382
  guaranteeNonNullable(
383
- this.postFilterState.tdsState.queryBuilderState.mapping,
383
+ this.postFilterState.tdsState.queryBuilderState
384
+ .executionContextState.mapping,
384
385
  ),
385
386
  guaranteeNonNullable(
386
- this.postFilterState.tdsState.queryBuilderState.runtimeValue,
387
+ this.postFilterState.tdsState.queryBuilderState
388
+ .executionContextState.runtimeValue,
387
389
  ),
388
390
  this.postFilterState.tdsState.queryBuilderState.graphManagerState
389
391
  .graph,
@@ -134,9 +134,12 @@ export class FilterConditionState implements Hashable {
134
134
  this.propertyExpressionState.propertyExpression,
135
135
  this.value,
136
136
  ),
137
- guaranteeNonNullable(this.filterState.queryBuilderState.mapping),
138
137
  guaranteeNonNullable(
139
- this.filterState.queryBuilderState.runtimeValue,
138
+ this.filterState.queryBuilderState.executionContextState.mapping,
139
+ ),
140
+ guaranteeNonNullable(
141
+ this.filterState.queryBuilderState.executionContextState
142
+ .runtimeValue,
140
143
  ),
141
144
  this.filterState.queryBuilderState.graphManagerState.graph,
142
145
  )) as ExecutionResult;
@@ -44,7 +44,8 @@ export class ClassQueryBuilderState extends QueryBuilderState {
44
44
  );
45
45
  // cascading
46
46
  const isCurrentMappingCompatible =
47
- this.mapping && compatibleMappings.includes(this.mapping);
47
+ this.executionContextState.mapping &&
48
+ compatibleMappings.includes(this.executionContextState.mapping);
48
49
  if (this.isMappingReadOnly || isCurrentMappingCompatible) {
49
50
  return;
50
51
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import type { GenericLegendApplicationStore } from '@finos/legend-application';
18
+ import type {
19
+ ConcreteFunctionDefinition,
20
+ GraphManagerState,
21
+ } from '@finos/legend-graph';
22
+ import { ClassQueryBuilderState } from './ClassQueryBuilderState.js';
23
+
24
+ // Note: We may want to move it to extend QueryBuilderState directly
25
+ // but for now we will use the same setup as class as class, mapping, runtime are editable
26
+ export class FunctionQueryBuilderState extends ClassQueryBuilderState {
27
+ readonly functionElement: ConcreteFunctionDefinition;
28
+
29
+ constructor(
30
+ applicationStore: GenericLegendApplicationStore,
31
+ graphManagerState: GraphManagerState,
32
+ functionElemenet: ConcreteFunctionDefinition,
33
+ ) {
34
+ super(applicationStore, graphManagerState);
35
+ this.functionElement = functionElemenet;
36
+ this.showParametersPanel = true;
37
+ }
38
+ }
@@ -78,12 +78,8 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
78
78
  this.onExecutionContextChange = onExecutionContextChange;
79
79
 
80
80
  if (service.execution instanceof PureSingleExecution) {
81
- assertTrue(
82
- Boolean(service.execution.mapping && service.execution.runtime),
83
- 'Service queries without runtime/mapping are not supported',
84
- );
85
- this.mapping = service.execution.mapping?.value;
86
- this.runtimeValue = service.execution.runtime;
81
+ this.executionContextState.mapping = service.execution.mapping?.value;
82
+ this.executionContextState.runtimeValue = service.execution.runtime;
87
83
  } else if (service.execution instanceof PureMultiExecution) {
88
84
  this.executionContexts = service.execution.executionParameters.map(
89
85
  (ep) => ({
@@ -92,7 +88,6 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
92
88
  runtimeValue: ep.runtime,
93
89
  }),
94
90
  );
95
-
96
91
  let selectedExecutionContext: ServiceExecutionContext;
97
92
  if (executionContextKey) {
98
93
  const matchingExecutionContext = this.executionContexts.find(
@@ -115,8 +110,9 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
115
110
  }
116
111
 
117
112
  this.setSelectedExecutionContext(selectedExecutionContext);
118
- this.mapping = selectedExecutionContext.mapping;
119
- this.runtimeValue = selectedExecutionContext.runtimeValue;
113
+ this.executionContextState.mapping = selectedExecutionContext.mapping;
114
+ this.executionContextState.runtimeValue =
115
+ selectedExecutionContext.runtimeValue;
120
116
  }
121
117
  }
122
118
 
@@ -131,11 +127,11 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
131
127
  }
132
128
 
133
129
  override get isMappingReadOnly(): boolean {
134
- return true;
130
+ return !this.executionContextState.specifiedInQuery;
135
131
  }
136
132
 
137
133
  override get isRuntimeReadOnly(): boolean {
138
- return true;
134
+ return !this.executionContextState.specifiedInQuery;
139
135
  }
140
136
 
141
137
  /**
package/tsconfig.json CHANGED
@@ -58,7 +58,9 @@
58
58
  "./src/stores/QueryBuilderCommand.ts",
59
59
  "./src/stores/QueryBuilderConfig.ts",
60
60
  "./src/stores/QueryBuilderConstantsState.ts",
61
+ "./src/stores/QueryBuilderExecutionContextState.ts",
61
62
  "./src/stores/QueryBuilderGroupOperationHelper.ts",
63
+ "./src/stores/QueryBuilderInternalizeState.ts",
62
64
  "./src/stores/QueryBuilderParametersState.ts",
63
65
  "./src/stores/QueryBuilderPreviewDataHelper.ts",
64
66
  "./src/stores/QueryBuilderPropertyEditorState.ts",
@@ -205,6 +207,7 @@
205
207
  "./src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts",
206
208
  "./src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts",
207
209
  "./src/stores/workflows/ClassQueryBuilderState.ts",
210
+ "./src/stores/workflows/FunctionQueryBuilderState.ts",
208
211
  "./src/stores/workflows/MappingQueryBuilderState.ts",
209
212
  "./src/stores/workflows/ServiceQueryBuilderState.ts",
210
213
  "./src/components/QueryBuilder.tsx",