@finos/legend-application-query 5.0.1 → 5.2.1

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 (210) hide show
  1. package/lib/application/LegendQueryApplicationConfig.d.ts +17 -1
  2. package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
  3. package/lib/application/LegendQueryApplicationConfig.js +23 -1
  4. package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +3 -1
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryBuilderExplorerPanel.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderExplorerPanel.js +10 -35
  10. package/lib/components/QueryBuilderExplorerPanel.js.map +1 -1
  11. package/lib/components/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  12. package/lib/components/QueryBuilderFetchStructurePanel.js +78 -35
  13. package/lib/components/QueryBuilderFetchStructurePanel.js.map +1 -1
  14. package/lib/components/QueryBuilderFilterPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderFilterPanel.js +80 -66
  16. package/lib/components/QueryBuilderFilterPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  18. package/lib/components/QueryBuilderFunctionsExplorerPanel.js +9 -39
  19. package/lib/components/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
  20. package/lib/components/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  21. package/lib/components/QueryBuilderGraphFetchTreePanel.js +5 -5
  22. package/lib/components/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  23. package/lib/components/QueryBuilderLambdaEditor.d.ts +1 -0
  24. package/lib/components/QueryBuilderLambdaEditor.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderLambdaEditor.js +2 -2
  26. package/lib/components/QueryBuilderLambdaEditor.js.map +1 -1
  27. package/lib/components/QueryBuilderMilestoneEditor.js +5 -5
  28. package/lib/components/QueryBuilderMilestoneEditor.js.map +1 -1
  29. package/lib/components/QueryBuilderPanelIssueCountBadge.d.ts +20 -0
  30. package/lib/components/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -0
  31. package/lib/components/QueryBuilderPanelIssueCountBadge.js +28 -0
  32. package/lib/components/QueryBuilderPanelIssueCountBadge.js.map +1 -0
  33. package/lib/components/QueryBuilderParameterPanel.d.ts.map +1 -1
  34. package/lib/components/QueryBuilderParameterPanel.js +13 -33
  35. package/lib/components/QueryBuilderParameterPanel.js.map +1 -1
  36. package/lib/components/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  37. package/lib/components/QueryBuilderPostFilterPanel.js +59 -62
  38. package/lib/components/QueryBuilderPostFilterPanel.js.map +1 -1
  39. package/lib/components/QueryBuilderProjectionPanel.d.ts.map +1 -1
  40. package/lib/components/QueryBuilderProjectionPanel.js +47 -63
  41. package/lib/components/QueryBuilderProjectionPanel.js.map +1 -1
  42. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  43. package/lib/components/QueryBuilderPropertyExpressionEditor.js +11 -11
  44. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  45. package/lib/components/QueryBuilderPropertySearchPanel.js +5 -7
  46. package/lib/components/QueryBuilderPropertySearchPanel.js.map +1 -1
  47. package/lib/components/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  48. package/lib/components/QueryBuilderResultModifierPanel.js +3 -1
  49. package/lib/components/QueryBuilderResultModifierPanel.js.map +1 -1
  50. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  51. package/lib/components/QueryBuilderResultPanel.js +37 -23
  52. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  53. package/lib/components/QueryBuilderSetupPanel.d.ts.map +1 -1
  54. package/lib/components/QueryBuilderSetupPanel.js +10 -9
  55. package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
  56. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  57. package/lib/components/QueryBuilderUnsupportedQueryEditor.js +4 -2
  58. package/lib/components/QueryBuilderUnsupportedQueryEditor.js.map +1 -1
  59. package/lib/components/QueryEditor.d.ts.map +1 -1
  60. package/lib/components/QueryEditor.js +16 -4
  61. package/lib/components/QueryEditor.js.map +1 -1
  62. package/lib/index.css +2 -2
  63. package/lib/index.css.map +1 -1
  64. package/lib/package.json +10 -9
  65. package/lib/stores/QueryBuilderExplorerState.d.ts +1 -1
  66. package/lib/stores/QueryBuilderExplorerState.d.ts.map +1 -1
  67. package/lib/stores/QueryBuilderExplorerState.js +18 -3
  68. package/lib/stores/QueryBuilderExplorerState.js.map +1 -1
  69. package/lib/stores/QueryBuilderFetchStructureState.d.ts +8 -1
  70. package/lib/stores/QueryBuilderFetchStructureState.d.ts.map +1 -1
  71. package/lib/stores/QueryBuilderFetchStructureState.js +10 -2
  72. package/lib/stores/QueryBuilderFetchStructureState.js.map +1 -1
  73. package/lib/stores/QueryBuilderFilterState.d.ts +10 -5
  74. package/lib/stores/QueryBuilderFilterState.d.ts.map +1 -1
  75. package/lib/stores/QueryBuilderFilterState.js +34 -8
  76. package/lib/stores/QueryBuilderFilterState.js.map +1 -1
  77. package/lib/stores/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  78. package/lib/stores/QueryBuilderGraphFetchTreeState.js +6 -3
  79. package/lib/stores/QueryBuilderGraphFetchTreeState.js.map +1 -1
  80. package/lib/stores/QueryBuilderLambdaProcessor.d.ts.map +1 -1
  81. package/lib/stores/QueryBuilderLambdaProcessor.js +2 -0
  82. package/lib/stores/QueryBuilderLambdaProcessor.js.map +1 -1
  83. package/lib/stores/QueryBuilderOperatorLoader.d.ts +47 -0
  84. package/lib/stores/QueryBuilderOperatorLoader.d.ts.map +1 -0
  85. package/lib/stores/QueryBuilderOperatorLoader.js +94 -0
  86. package/lib/stores/QueryBuilderOperatorLoader.js.map +1 -0
  87. package/lib/stores/QueryBuilderOperatorsHelper.d.ts +1 -0
  88. package/lib/stores/QueryBuilderOperatorsHelper.d.ts.map +1 -1
  89. package/lib/stores/QueryBuilderOperatorsHelper.js +28 -1
  90. package/lib/stores/QueryBuilderOperatorsHelper.js.map +1 -1
  91. package/lib/stores/QueryBuilderPostFilterState.d.ts +9 -6
  92. package/lib/stores/QueryBuilderPostFilterState.d.ts.map +1 -1
  93. package/lib/stores/QueryBuilderPostFilterState.js +31 -7
  94. package/lib/stores/QueryBuilderPostFilterState.js.map +1 -1
  95. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts +4 -3
  96. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
  97. package/lib/stores/QueryBuilderPreviewDataHelper.js +77 -97
  98. package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
  99. package/lib/stores/QueryBuilderProjectionState.d.ts +4 -7
  100. package/lib/stores/QueryBuilderProjectionState.d.ts.map +1 -1
  101. package/lib/stores/QueryBuilderProjectionState.js +23 -39
  102. package/lib/stores/QueryBuilderProjectionState.js.map +1 -1
  103. package/lib/stores/QueryBuilderPropertySearchPanelState.js +1 -1
  104. package/lib/stores/QueryBuilderPropertySearchPanelState.js.map +1 -1
  105. package/lib/stores/QueryBuilderResultState.d.ts +5 -2
  106. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  107. package/lib/stores/QueryBuilderResultState.js +19 -7
  108. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  109. package/lib/stores/QueryBuilderSetupState.js +1 -1
  110. package/lib/stores/QueryBuilderSetupState.js.map +1 -1
  111. package/lib/stores/QueryBuilderState.d.ts +7 -0
  112. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  113. package/lib/stores/QueryBuilderState.js +18 -58
  114. package/lib/stores/QueryBuilderState.js.map +1 -1
  115. package/lib/stores/QueryBuilderTestUtils.d.ts +24 -0
  116. package/lib/stores/QueryBuilderTestUtils.d.ts.map +1 -0
  117. package/lib/stores/QueryBuilderTestUtils.js +49 -0
  118. package/lib/stores/QueryBuilderTestUtils.js.map +1 -0
  119. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts +24 -0
  120. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -0
  121. package/lib/stores/QueryBuilderTypeaheadHelper.js +89 -0
  122. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -0
  123. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  124. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +7 -7
  125. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  126. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  127. package/lib/stores/QueryEditorStore.js +14 -3
  128. package/lib/stores/QueryEditorStore.js.map +1 -1
  129. package/lib/stores/QueryFunctionsExplorerState.d.ts +2 -6
  130. package/lib/stores/QueryFunctionsExplorerState.d.ts.map +1 -1
  131. package/lib/stores/QueryFunctionsExplorerState.js +2 -11
  132. package/lib/stores/QueryFunctionsExplorerState.js.map +1 -1
  133. package/lib/stores/QueryParametersState.d.ts +1 -3
  134. package/lib/stores/QueryParametersState.d.ts.map +1 -1
  135. package/lib/stores/QueryParametersState.js +1 -4
  136. package/lib/stores/QueryParametersState.js.map +1 -1
  137. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  138. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js +9 -32
  139. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  140. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  141. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js +9 -32
  142. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  143. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  144. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js +9 -32
  145. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  146. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  147. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js +9 -33
  148. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  149. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  150. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js +9 -32
  151. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  152. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  153. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js +7 -30
  154. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  155. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  156. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js +8 -31
  157. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  158. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  159. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js +8 -31
  160. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  161. package/package.json +17 -16
  162. package/src/application/LegendQueryApplicationConfig.ts +35 -1
  163. package/src/components/QueryBuilder.tsx +13 -2
  164. package/src/components/QueryBuilderExplorerPanel.tsx +20 -57
  165. package/src/components/QueryBuilderFetchStructurePanel.tsx +94 -41
  166. package/src/components/QueryBuilderFilterPanel.tsx +271 -232
  167. package/src/components/QueryBuilderFunctionsExplorerPanel.tsx +24 -68
  168. package/src/components/QueryBuilderGraphFetchTreePanel.tsx +34 -25
  169. package/src/components/QueryBuilderLambdaEditor.tsx +3 -0
  170. package/src/components/QueryBuilderMilestoneEditor.tsx +34 -34
  171. package/src/components/QueryBuilderPanelIssueCountBadge.tsx +38 -0
  172. package/src/components/QueryBuilderParameterPanel.tsx +23 -55
  173. package/src/components/QueryBuilderPostFilterPanel.tsx +245 -233
  174. package/src/components/QueryBuilderProjectionPanel.tsx +127 -154
  175. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +61 -57
  176. package/src/components/QueryBuilderPropertySearchPanel.tsx +9 -9
  177. package/src/components/QueryBuilderResultModifierPanel.tsx +4 -2
  178. package/src/components/QueryBuilderResultPanel.tsx +139 -91
  179. package/src/components/QueryBuilderSetupPanel.tsx +13 -12
  180. package/src/components/QueryBuilderUnsupportedQueryEditor.tsx +4 -2
  181. package/src/components/QueryEditor.tsx +39 -1
  182. package/src/stores/QueryBuilderExplorerState.ts +22 -3
  183. package/src/stores/QueryBuilderFetchStructureState.ts +18 -2
  184. package/src/stores/QueryBuilderFilterState.ts +52 -7
  185. package/src/stores/QueryBuilderGraphFetchTreeState.ts +14 -8
  186. package/src/stores/QueryBuilderLambdaProcessor.ts +8 -0
  187. package/src/stores/QueryBuilderOperatorLoader.ts +133 -0
  188. package/src/stores/QueryBuilderOperatorsHelper.ts +35 -0
  189. package/src/stores/QueryBuilderPostFilterState.ts +47 -8
  190. package/src/stores/QueryBuilderPreviewDataHelper.ts +122 -217
  191. package/src/stores/QueryBuilderProjectionState.ts +40 -53
  192. package/src/stores/QueryBuilderPropertySearchPanelState.ts +1 -1
  193. package/src/stores/QueryBuilderResultState.ts +27 -9
  194. package/src/stores/QueryBuilderSetupState.ts +1 -1
  195. package/src/stores/QueryBuilderState.ts +35 -94
  196. package/src/stores/QueryBuilderTestUtils.ts +93 -0
  197. package/src/stores/QueryBuilderTypeaheadHelper.ts +149 -0
  198. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +9 -7
  199. package/src/stores/QueryEditorStore.ts +19 -3
  200. package/src/stores/QueryFunctionsExplorerState.ts +1 -11
  201. package/src/stores/QueryParametersState.ts +1 -3
  202. package/src/stores/filterOperators/QueryBuilderFilterOperator_Equal.ts +14 -36
  203. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.ts +17 -36
  204. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.ts +17 -36
  205. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThan.ts +17 -37
  206. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.ts +17 -36
  207. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.ts +14 -34
  208. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.ts +19 -37
  209. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.ts +19 -37
  210. package/tsconfig.json +4 -0
@@ -14,27 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {
18
- type AbstractPropertyExpression,
19
- type Class,
20
- type PureModel,
21
- GenericType,
22
- GenericTypeExplicitReference,
23
- PrimitiveInstanceValue,
24
- PRIMITIVE_TYPE,
25
- CollectionInstanceValue,
26
- CORE_PURE_PATH,
27
- extractElementNameFromPath,
28
- FunctionType,
29
- LambdaFunction,
30
- Multiplicity,
31
- SimpleFunctionExpression,
32
- TYPICAL_MULTIPLICITY_TYPE,
17
+ import type {
18
+ RawLambda,
19
+ AbstractPropertyExpression,
33
20
  } from '@finos/legend-graph';
34
- import {
35
- DEFAULT_LAMBDA_VARIABLE_NAME,
36
- QUERY_BUILDER_SUPPORTED_FUNCTIONS,
37
- } from '../QueryBuilder_Const.js';
21
+ import { guaranteeNonNullable } from '@finos/legend-shared';
22
+ import type { QueryBuilderAggregateOperator } from './QueryBuilderAggregationState.js';
38
23
  import { QueryBuilderAggregateOperator_Average } from './aggregateOperators/QueryBuilderAggregateOperator_Average.js';
39
24
  import { QueryBuilderAggregateOperator_Count } from './aggregateOperators/QueryBuilderAggregateOperator_Count.js';
40
25
  import { QueryBuilderAggregateOperator_DistinctCount } from './aggregateOperators/QueryBuilderAggregateOperator_DistinctCount.js';
@@ -43,109 +28,82 @@ import { QueryBuilderAggregateOperator_Min } from './aggregateOperators/QueryBui
43
28
  import { QueryBuilderAggregateOperator_StdDev_Population } from './aggregateOperators/QueryBuilderAggregateOperator_StdDev_Population.js';
44
29
  import { QueryBuilderAggregateOperator_StdDev_Sample } from './aggregateOperators/QueryBuilderAggregateOperator_StdDev_Sample.js';
45
30
  import { QueryBuilderAggregateOperator_Sum } from './aggregateOperators/QueryBuilderAggregateOperator_Sum.js';
46
- import type { QueryBuilderAggregateOperator } from './QueryBuilderAggregationState.js';
47
- import { buildGetAllFunction } from './QueryBuilderLambdaBuilder.js';
48
- import { buildGenericLambdaFunctionInstanceValue } from './QueryBuilderValueSpecificationBuilderHelper.js';
31
+ import { QueryBuilderSimpleProjectionColumnState } from './QueryBuilderProjectionState.js';
32
+ import type { QueryBuilderState } from './QueryBuilderState.js';
33
+ import {
34
+ COLUMN_SORT_TYPE,
35
+ SortColumnState,
36
+ } from './QueryResultSetModifierState.js';
49
37
 
50
- const buildGroupByFunction = (
51
- getAllFunction: SimpleFunctionExpression,
52
- propertyExpression: AbstractPropertyExpression,
53
- aggregates: [QueryBuilderAggregateOperator, string][],
54
- includePropertyValue: boolean,
55
- graph: PureModel,
56
- ): SimpleFunctionExpression => {
57
- const multiplicityOne = graph.getTypicalMultiplicity(
58
- TYPICAL_MULTIPLICITY_TYPE.ONE,
59
- );
60
- const typeAny = graph.getType(CORE_PURE_PATH.ANY);
61
- const typeString = graph.getPrimitiveType(PRIMITIVE_TYPE.STRING);
62
- const lambdaFunction = new LambdaFunction(
63
- new FunctionType(typeAny, multiplicityOne),
64
- );
38
+ const PREVIEW_DATA_TAKE_LIMIT = 10;
39
+ const PREVIEW_DATA_NON_NUMERIC_VALUE_COLUMN_NAME = 'Value';
40
+ const PREVIEW_DATA_NON_NUMERIC_COUNT_COLUMN_NAME = 'Count';
65
41
 
66
- const groupByFunction = new SimpleFunctionExpression(
67
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_GROUP_BY),
68
- multiplicityOne,
69
- );
42
+ enum NUMERIC_AGG_FUNC {
43
+ COUNT = 'Count',
44
+ DISTINCT_COUNT = 'Distinct Count',
45
+ SUM = 'Sum',
46
+ MIN = 'Min',
47
+ MAX = 'Max',
48
+ AVERAGE = 'Average',
49
+ STD_DEV_POPULATION = 'Std Dev (Population)',
50
+ STD_DEV_SAMPLE = 'Std Dev (Sample)',
51
+ }
70
52
 
71
- const colLambdas = new CollectionInstanceValue(
72
- graph.getTypicalMultiplicity(
73
- includePropertyValue
74
- ? TYPICAL_MULTIPLICITY_TYPE.ONE
75
- : TYPICAL_MULTIPLICITY_TYPE.ZERO,
76
- ),
77
- );
78
- const aggregateLambdas = new CollectionInstanceValue(
79
- new Multiplicity(aggregates.length, aggregates.length),
80
- );
81
- const noOfCols = aggregates.length + (includePropertyValue ? 1 : 0);
82
- const colAliases = new CollectionInstanceValue(
83
- new Multiplicity(noOfCols, noOfCols),
84
- );
53
+ const NUMERIC_AGG_FUNC_TO_AGG_OP: [
54
+ NUMERIC_AGG_FUNC,
55
+ typeof QueryBuilderAggregateOperator,
56
+ ][] = [
57
+ [NUMERIC_AGG_FUNC.COUNT, QueryBuilderAggregateOperator_Count],
58
+ [
59
+ NUMERIC_AGG_FUNC.DISTINCT_COUNT,
60
+ QueryBuilderAggregateOperator_DistinctCount,
61
+ ],
62
+ [NUMERIC_AGG_FUNC.SUM, QueryBuilderAggregateOperator_Sum],
63
+ [NUMERIC_AGG_FUNC.MIN, QueryBuilderAggregateOperator_Min],
64
+ [NUMERIC_AGG_FUNC.MAX, QueryBuilderAggregateOperator_Max],
65
+ [NUMERIC_AGG_FUNC.AVERAGE, QueryBuilderAggregateOperator_Average],
66
+ [
67
+ NUMERIC_AGG_FUNC.STD_DEV_POPULATION,
68
+ QueryBuilderAggregateOperator_StdDev_Population,
69
+ ],
70
+ [
71
+ NUMERIC_AGG_FUNC.STD_DEV_SAMPLE,
72
+ QueryBuilderAggregateOperator_StdDev_Sample,
73
+ ],
74
+ ];
85
75
 
86
- if (includePropertyValue) {
87
- colLambdas.values.push(
88
- buildGenericLambdaFunctionInstanceValue(
89
- DEFAULT_LAMBDA_VARIABLE_NAME,
90
- [propertyExpression],
91
- graph,
92
- ),
93
- );
94
- const valueColAlias = new PrimitiveInstanceValue(
95
- GenericTypeExplicitReference.create(new GenericType(typeString)),
96
- multiplicityOne,
97
- );
98
- valueColAlias.values.push('Value');
99
- colAliases.values.push(valueColAlias);
100
- }
76
+ const createProjectionColumn = (
77
+ queryBuilderState: QueryBuilderState,
78
+ propertyExpression: AbstractPropertyExpression,
79
+ columnName: string,
80
+ ): QueryBuilderSimpleProjectionColumnState => {
81
+ const col = new QueryBuilderSimpleProjectionColumnState(
82
+ queryBuilderState.fetchStructureState.projectionState,
83
+ propertyExpression,
84
+ false,
85
+ );
86
+ col.setColumnName(columnName);
87
+ return col;
88
+ };
101
89
 
102
- aggregates.forEach((pair) => {
103
- const aggregateFunctionExpression = new SimpleFunctionExpression(
104
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG),
105
- multiplicityOne,
106
- );
107
- aggregateFunctionExpression.parametersValues = [
108
- buildGenericLambdaFunctionInstanceValue(
109
- DEFAULT_LAMBDA_VARIABLE_NAME,
110
- [propertyExpression],
111
- graph,
112
- ),
113
- buildGenericLambdaFunctionInstanceValue(
114
- DEFAULT_LAMBDA_VARIABLE_NAME,
115
- [
116
- pair[0].buildAggregateExpression(
117
- propertyExpression,
118
- DEFAULT_LAMBDA_VARIABLE_NAME,
119
- graph,
120
- ),
121
- ],
122
- graph,
123
- ),
124
- ];
125
- aggregateLambdas.values.push(aggregateFunctionExpression);
90
+ const createQueryBuilderState = (
91
+ queryBuilderState: QueryBuilderState,
92
+ ): QueryBuilderState => {
93
+ const builderState = queryBuilderState.createBareBuilderState();
94
+ builderState.querySetupState = queryBuilderState.querySetupState;
95
+ return builderState;
96
+ };
126
97
 
127
- const colAlias = new PrimitiveInstanceValue(
128
- GenericTypeExplicitReference.create(new GenericType(typeString)),
129
- multiplicityOne,
130
- );
131
- colAlias.values.push(pair[1]);
132
- colAliases.values.push(colAlias);
133
- });
134
- groupByFunction.parametersValues = [
135
- getAllFunction,
136
- colLambdas,
137
- aggregateLambdas,
138
- colAliases,
139
- ];
140
- lambdaFunction.expressionSequence[0] = groupByFunction;
141
- return groupByFunction;
98
+ export type QueryBuilderPreviewData = {
99
+ columns: string[];
100
+ rows: { values: (string | number)[] }[];
142
101
  };
143
102
 
144
103
  export const buildNumericPreviewDataQuery = (
104
+ queryBuilderState: QueryBuilderState,
145
105
  propertyExpression: AbstractPropertyExpression,
146
- _class: Class,
147
- graph: PureModel,
148
- ): LambdaFunction => {
106
+ ): RawLambda => {
149
107
  // Build the following query
150
108
  //
151
109
  // ClassX.all()->groupBy(
@@ -171,44 +129,29 @@ export const buildNumericPreviewDataQuery = (
171
129
  // 'Std Dev (Sample)'
172
130
  // ]
173
131
  // )
174
- const multiplicityOne = graph.getTypicalMultiplicity(
175
- TYPICAL_MULTIPLICITY_TYPE.ONE,
176
- );
177
- const typeAny = graph.getType(CORE_PURE_PATH.ANY);
178
- const lambdaFunction = new LambdaFunction(
179
- new FunctionType(typeAny, multiplicityOne),
180
- );
181
- const groupByFunction = buildGroupByFunction(
182
- buildGetAllFunction(_class, multiplicityOne),
183
- propertyExpression,
184
- [
185
- [new QueryBuilderAggregateOperator_Count(), 'Count'],
186
- [new QueryBuilderAggregateOperator_DistinctCount(), 'Distinct Count'],
187
- [new QueryBuilderAggregateOperator_Sum(), 'Sum'],
188
- [new QueryBuilderAggregateOperator_Min(), 'Min'],
189
- [new QueryBuilderAggregateOperator_Max(), 'Max'],
190
- [new QueryBuilderAggregateOperator_Average(), 'Average'],
191
- [
192
- new QueryBuilderAggregateOperator_StdDev_Population(),
193
- 'Standard Deviation (Population)',
194
- ],
195
- [
196
- new QueryBuilderAggregateOperator_StdDev_Sample(),
197
- 'Standard Deviation (Sample)',
198
- ],
199
- ] as [QueryBuilderAggregateOperator, string][],
200
- false,
201
- graph,
202
- );
203
- lambdaFunction.expressionSequence[0] = groupByFunction;
204
- return lambdaFunction;
132
+ const builderState = createQueryBuilderState(queryBuilderState);
133
+ const projectionState = builderState.fetchStructureState.projectionState;
134
+ const aggregationState = projectionState.aggregationState;
135
+ NUMERIC_AGG_FUNC_TO_AGG_OP.forEach((val) => {
136
+ const colState = createProjectionColumn(
137
+ builderState,
138
+ propertyExpression,
139
+ val[0],
140
+ );
141
+ projectionState.columns.push(colState);
142
+ const valAggOp = guaranteeNonNullable(
143
+ aggregationState.operators.find((t) => t instanceof val[1]),
144
+ );
145
+ aggregationState.changeColumnAggregateOperator(valAggOp, colState);
146
+ });
147
+
148
+ return builderState.resultState.buildExecutionRawLambda();
205
149
  };
206
150
 
207
151
  export const buildNonNumericPreviewDataQuery = (
152
+ queryBuilderState: QueryBuilderState,
208
153
  propertyExpression: AbstractPropertyExpression,
209
- _class: Class,
210
- graph: PureModel,
211
- ): LambdaFunction => {
154
+ ): RawLambda => {
212
155
  // Build the following query
213
156
  //
214
157
  // ClassX.all()->groupBy(
@@ -216,85 +159,47 @@ export const buildNonNumericPreviewDataQuery = (
216
159
  // x|$x.prop
217
160
  // ],
218
161
  // [
219
- // agg(x|$x.prop, x|$x->distinct()->count())
162
+ // agg(x|$x.prop, x|$x->count())
220
163
  // ],
221
164
  // [
222
165
  // 'Value',
223
166
  // 'Count'
224
167
  // ]
225
- // )->take(10)->sort([desc('Count'), asc('Value')])
226
- const multiplicityOne = graph.getTypicalMultiplicity(
227
- TYPICAL_MULTIPLICITY_TYPE.ONE,
228
- );
229
- const typeAny = graph.getType(CORE_PURE_PATH.ANY);
230
- const lambdaFunction = new LambdaFunction(
231
- new FunctionType(typeAny, multiplicityOne),
232
- );
233
-
234
- // build groupBy()
235
- const groupByFunction = buildGroupByFunction(
236
- buildGetAllFunction(_class, multiplicityOne),
168
+ // )->sort([desc('Count'), asc('Value')])->take(10)
169
+ const builderState = createQueryBuilderState(queryBuilderState);
170
+ const valueProjectionColState = createProjectionColumn(
171
+ builderState,
237
172
  propertyExpression,
238
- [[new QueryBuilderAggregateOperator_Count(), 'Count']] as [
239
- QueryBuilderAggregateOperator,
240
- string,
241
- ][],
242
- true,
243
- graph,
173
+ PREVIEW_DATA_NON_NUMERIC_VALUE_COLUMN_NAME,
244
174
  );
245
- lambdaFunction.expressionSequence[0] = groupByFunction;
246
-
247
- // build sort()
248
- const sortFunction = new SimpleFunctionExpression(
249
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_SORT),
250
- multiplicityOne,
251
- );
252
- const sortColumnFunctions = new CollectionInstanceValue(
253
- new Multiplicity(2, 2),
254
- undefined,
175
+ const valueCountProjectionState = createProjectionColumn(
176
+ builderState,
177
+ propertyExpression,
178
+ PREVIEW_DATA_NON_NUMERIC_COUNT_COLUMN_NAME,
255
179
  );
256
- sortColumnFunctions.values = [
257
- [QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_DESC, 'Count'],
258
- [QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_ASC, 'Value'],
259
- ].map((pair) => {
260
- const sortColumnFunction = new SimpleFunctionExpression(
261
- extractElementNameFromPath(pair[0] as string),
262
- multiplicityOne,
263
- );
264
- const sortColumnName = new PrimitiveInstanceValue(
265
- GenericTypeExplicitReference.create(
266
- new GenericType(graph.getPrimitiveType(PRIMITIVE_TYPE.STRING)),
267
- ),
268
- multiplicityOne,
269
- );
270
- sortColumnName.values = [pair[1]];
271
- sortColumnFunction.parametersValues[0] = sortColumnName;
272
- return sortColumnFunction;
273
- });
274
- sortFunction.parametersValues[0] = groupByFunction;
275
- sortFunction.parametersValues[1] = sortColumnFunctions;
276
-
277
- // build take()
278
- const limit = new PrimitiveInstanceValue(
279
- GenericTypeExplicitReference.create(
280
- new GenericType(graph.getPrimitiveType(PRIMITIVE_TYPE.INTEGER)),
180
+ builderState.fetchStructureState.projectionState.columns = [
181
+ valueProjectionColState,
182
+ valueCountProjectionState,
183
+ ];
184
+ const distinctCountOp = guaranteeNonNullable(
185
+ builderState.fetchStructureState.projectionState.aggregationState.operators.find(
186
+ (t) => t instanceof QueryBuilderAggregateOperator_Count,
281
187
  ),
282
- multiplicityOne,
283
188
  );
284
- limit.values = [10];
285
- const takeFunction = new SimpleFunctionExpression(
286
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_TAKE),
287
- multiplicityOne,
189
+ builderState.fetchStructureState.projectionState.aggregationState.changeColumnAggregateOperator(
190
+ distinctCountOp,
191
+ valueCountProjectionState,
288
192
  );
289
- takeFunction.parametersValues[0] = sortFunction;
290
- takeFunction.parametersValues[1] = limit;
291
-
292
- lambdaFunction.expressionSequence[0] = takeFunction;
293
-
294
- return lambdaFunction;
295
- };
296
-
297
- export type QueryBuilderPreviewData = {
298
- columns: string[];
299
- rows: { values: (string | number)[] }[];
193
+ // result set
194
+ builderState.resultSetModifierState.limit = PREVIEW_DATA_TAKE_LIMIT;
195
+ const sortValueCount = new SortColumnState(
196
+ builderState,
197
+ valueCountProjectionState,
198
+ );
199
+ sortValueCount.sortType = COLUMN_SORT_TYPE.DESC;
200
+ builderState.resultSetModifierState.sortColumns = [
201
+ sortValueCount,
202
+ new SortColumnState(builderState, valueProjectionColState),
203
+ ];
204
+ return builderState.resultState.buildExecutionRawLambda();
300
205
  };
@@ -68,34 +68,24 @@ import {
68
68
  RawLambda,
69
69
  stub_RawLambda,
70
70
  isStubbed_RawLambda,
71
- buildRawLambdaFromLambdaFunction,
72
71
  } from '@finos/legend-graph';
73
72
  import {
74
73
  DEFAULT_LAMBDA_VARIABLE_NAME,
75
74
  QUERY_BUILDER_SOURCE_ID_LABEL,
76
75
  } from '../QueryBuilder_Const.js';
77
- import { QueryBuilderAggregationState } from './QueryBuilderAggregationState.js';
78
- import { QueryBuilderAggregateOperator_Count } from './aggregateOperators/QueryBuilderAggregateOperator_Count.js';
79
- import { QueryBuilderAggregateOperator_Distinct } from './aggregateOperators/QueryBuilderAggregateOperator_Distinct.js';
80
- import { QueryBuilderAggregateOperator_Sum } from './aggregateOperators/QueryBuilderAggregateOperator_Sum.js';
81
- import { QueryBuilderAggregateOperator_Average } from './aggregateOperators/QueryBuilderAggregateOperator_Average.js';
82
- import { QueryBuilderAggregateOperator_StdDev_Population } from './aggregateOperators/QueryBuilderAggregateOperator_StdDev_Population.js';
83
- import { QueryBuilderAggregateOperator_StdDev_Sample } from './aggregateOperators/QueryBuilderAggregateOperator_StdDev_Sample.js';
84
- import { QueryBuilderAggregateOperator_DistinctCount } from './aggregateOperators/QueryBuilderAggregateOperator_DistinctCount.js';
85
- import { QueryBuilderAggregateOperator_Min } from './aggregateOperators/QueryBuilderAggregateOperator_Min.js';
86
- import { QueryBuilderAggregateOperator_Max } from './aggregateOperators/QueryBuilderAggregateOperator_Max.js';
87
- import { QueryBuilderAggregateOperator_JoinString } from './aggregateOperators/QueryBuilderAggregateOperator_JoinString.js';
76
+ import {
77
+ type QueryBuilderAggregateOperator,
78
+ QueryBuilderAggregationState,
79
+ } from './QueryBuilderAggregationState.js';
80
+ import { buildGenericLambdaFunctionInstanceValue } from './QueryBuilderValueSpecificationBuilderHelper.js';
81
+ import { LambdaEditorState } from '@finos/legend-application';
88
82
  import {
89
83
  type QueryBuilderPreviewData,
90
- buildNonNumericPreviewDataQuery,
91
84
  buildNumericPreviewDataQuery,
85
+ buildNonNumericPreviewDataQuery,
92
86
  } from './QueryBuilderPreviewDataHelper.js';
93
- import { buildGenericLambdaFunctionInstanceValue } from './QueryBuilderValueSpecificationBuilderHelper.js';
94
- import { LambdaEditorState } from '@finos/legend-application';
95
87
 
96
- export enum QUERY_BUILDER_PROJECTION_DND_TYPE {
97
- PROJECTION_COLUMN = 'PROJECTION_COLUMN',
98
- }
88
+ export const QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE = 'PROJECTION_COLUMN';
99
89
 
100
90
  export interface QueryBuilderProjectionColumnDragSource {
101
91
  columnState: QueryBuilderProjectionColumnState;
@@ -104,7 +94,6 @@ export interface QueryBuilderProjectionColumnDragSource {
104
94
  export abstract class QueryBuilderProjectionColumnState {
105
95
  readonly uuid = uuid();
106
96
  projectionState: QueryBuilderProjectionState;
107
- isBeingDragged = false;
108
97
  columnName: string;
109
98
 
110
99
  constructor(
@@ -114,9 +103,7 @@ export abstract class QueryBuilderProjectionColumnState {
114
103
  makeObservable(this, {
115
104
  uuid: false,
116
105
  projectionState: false,
117
- isBeingDragged: observable,
118
106
  columnName: observable,
119
- setIsBeingDragged: action,
120
107
  setColumnName: action,
121
108
  });
122
109
 
@@ -124,10 +111,6 @@ export abstract class QueryBuilderProjectionColumnState {
124
111
  this.columnName = columnName;
125
112
  }
126
113
 
127
- setIsBeingDragged(val: boolean): void {
128
- this.isBeingDragged = val;
129
- }
130
-
131
114
  setColumnName(val: string): void {
132
115
  this.columnName = val;
133
116
  }
@@ -380,7 +363,10 @@ export class QueryBuilderProjectionState {
380
363
  aggregationState: QueryBuilderAggregationState;
381
364
  isConvertDerivationProjectionObjects = false;
382
365
 
383
- constructor(queryBuilderState: QueryBuilderState) {
366
+ constructor(
367
+ queryBuilderState: QueryBuilderState,
368
+ operators: QueryBuilderAggregateOperator[],
369
+ ) {
384
370
  makeAutoObservable(this, {
385
371
  queryBuilderState: false,
386
372
  removeColumn: action,
@@ -390,18 +376,7 @@ export class QueryBuilderProjectionState {
390
376
  });
391
377
 
392
378
  this.queryBuilderState = queryBuilderState;
393
- this.aggregationState = new QueryBuilderAggregationState(this, [
394
- new QueryBuilderAggregateOperator_Count(),
395
- new QueryBuilderAggregateOperator_DistinctCount(),
396
- new QueryBuilderAggregateOperator_Distinct(),
397
- new QueryBuilderAggregateOperator_Sum(),
398
- new QueryBuilderAggregateOperator_Average(),
399
- new QueryBuilderAggregateOperator_Min(),
400
- new QueryBuilderAggregateOperator_Max(),
401
- new QueryBuilderAggregateOperator_StdDev_Population(),
402
- new QueryBuilderAggregateOperator_StdDev_Sample(),
403
- new QueryBuilderAggregateOperator_JoinString(),
404
- ]);
379
+ this.aggregationState = new QueryBuilderAggregationState(this, operators);
405
380
  }
406
381
 
407
382
  *convertDerivationProjectionObjects(): GeneratorFn<void> {
@@ -606,7 +581,9 @@ export class QueryBuilderProjectionState {
606
581
  addNewBlankDerivation(): void {
607
582
  const derivation = new QueryBuilderDerivationProjectionColumnState(
608
583
  this,
609
- this.queryBuilderState.graphManagerState.graphManager.HACKY__createDefaultBlankLambda(),
584
+ this.queryBuilderState.graphManagerState.graphManager.createDefaultBasicRawLambda(
585
+ { addDummyParameter: true },
586
+ ),
610
587
  );
611
588
  this.addColumn(derivation);
612
589
  derivation.derivationLambdaEditorState.setLambdaString(
@@ -709,13 +686,9 @@ export class QueryBuilderProjectionState {
709
686
  case PRIMITIVE_TYPE.FLOAT: {
710
687
  const previewResult =
711
688
  (yield this.queryBuilderState.graphManagerState.graphManager.executeMapping(
712
- buildRawLambdaFromLambdaFunction(
713
- buildNumericPreviewDataQuery(
714
- propertyExpression,
715
- this.queryBuilderState.querySetupState._class,
716
- this.queryBuilderState.graphManagerState.graph,
717
- ),
718
- this.queryBuilderState.graphManagerState,
689
+ buildNumericPreviewDataQuery(
690
+ this.queryBuilderState,
691
+ propertyExpression,
719
692
  ),
720
693
  this.queryBuilderState.querySetupState.mapping,
721
694
  runtime,
@@ -752,13 +725,9 @@ export class QueryBuilderProjectionState {
752
725
  case PRIMITIVE_TYPE.DATETIME: {
753
726
  const previewResult =
754
727
  (yield this.queryBuilderState.graphManagerState.graphManager.executeMapping(
755
- buildRawLambdaFromLambdaFunction(
756
- buildNonNumericPreviewDataQuery(
757
- propertyExpression,
758
- this.queryBuilderState.querySetupState._class,
759
- this.queryBuilderState.graphManagerState.graph,
760
- ),
761
- this.queryBuilderState.graphManagerState,
728
+ buildNonNumericPreviewDataQuery(
729
+ this.queryBuilderState,
730
+ propertyExpression,
762
731
  ),
763
732
  this.queryBuilderState.querySetupState.mapping,
764
733
  runtime,
@@ -793,4 +762,22 @@ export class QueryBuilderProjectionState {
793
762
  );
794
763
  }
795
764
  }
765
+
766
+ get validationIssues(): string[] | undefined {
767
+ if (this.queryBuilderState.fetchStructureState.isProjectionMode()) {
768
+ const hasDuplicatedProjectionColumns = this.columns.some(
769
+ (column) =>
770
+ this.columns.filter((c) => c.columnName === column.columnName)
771
+ .length > 1,
772
+ );
773
+ if (hasDuplicatedProjectionColumns) {
774
+ return ['Query has duplicated projection columns'];
775
+ }
776
+ const hasNoProjectionColumns = this.columns.length === 0;
777
+ if (hasNoProjectionColumns) {
778
+ return ['Query has no projection columns'];
779
+ }
780
+ }
781
+ return undefined;
782
+ }
796
783
  }
@@ -262,7 +262,7 @@ export class QueryBuilderPropertySearchPanelState {
262
262
  ),
263
263
  );
264
264
  if (
265
- propertyTreeNodeData.mappingData.mapped &&
265
+ propertyTreeNodeData?.mappingData.mapped &&
266
266
  !propertyTreeNodeData.isPartOfDerivedPropertyBranch
267
267
  ) {
268
268
  nextLevelPropertyNodes.push(propertyTreeNodeData);
@@ -48,16 +48,18 @@ export class QueryBuilderResultState {
48
48
  queryBuilderState: QueryBuilderState;
49
49
  exportDataState = ActionState.create();
50
50
  previewLimit = DEFAULT_LIMIT;
51
- isExecutingQuery = false;
51
+ isRunningQuery = false;
52
52
  isGeneratingPlan = false;
53
53
  executionResult?: ExecutionResult | undefined;
54
54
  executionPlanState: ExecutionPlanState;
55
55
  executionDuration?: number | undefined;
56
+ queryRunPromise: Promise<ExecutionResult> | undefined = undefined;
56
57
 
57
58
  constructor(queryBuilderState: QueryBuilderState) {
58
59
  makeAutoObservable(this, {
59
60
  queryBuilderState: false,
60
61
  executionPlanState: false,
62
+ setIsRunningQuery: action,
61
63
  setExecutionResult: action,
62
64
  });
63
65
 
@@ -68,16 +70,28 @@ export class QueryBuilderResultState {
68
70
  );
69
71
  }
70
72
 
73
+ setIsRunningQuery = (val: boolean): void => {
74
+ this.isRunningQuery = val;
75
+ };
76
+
71
77
  setExecutionResult = (val: ExecutionResult | undefined): void => {
72
78
  this.executionResult = val;
73
79
  };
80
+
74
81
  setExecutionDuration = (val: number | undefined): void => {
75
82
  this.executionDuration = val;
76
83
  };
84
+
77
85
  setPreviewLimit = (val: number): void => {
78
86
  this.previewLimit = Math.max(1, val);
79
87
  };
80
88
 
89
+ setQueryRunPromise = (
90
+ promise: Promise<ExecutionResult> | undefined,
91
+ ): void => {
92
+ this.queryRunPromise = promise;
93
+ };
94
+
81
95
  buildExecutionRawLambda(): RawLambda {
82
96
  let query: RawLambda;
83
97
  if (this.queryBuilderState.isQuerySupported()) {
@@ -172,9 +186,9 @@ export class QueryBuilderResultState {
172
186
  }
173
187
  }
174
188
 
175
- *execute(): GeneratorFn<void> {
189
+ *runQuery(): GeneratorFn<void> {
176
190
  try {
177
- this.isExecutingQuery = true;
191
+ this.isRunningQuery = true;
178
192
  const mapping = guaranteeNonNullable(
179
193
  this.queryBuilderState.querySetupState.mapping,
180
194
  'Mapping is required to execute query',
@@ -185,15 +199,19 @@ export class QueryBuilderResultState {
185
199
  );
186
200
  const query = this.buildExecutionRawLambda();
187
201
  const startTime = Date.now();
188
- const result =
189
- (yield this.queryBuilderState.graphManagerState.graphManager.executeMapping(
202
+ const promise =
203
+ this.queryBuilderState.graphManagerState.graphManager.executeMapping(
190
204
  query,
191
205
  mapping,
192
206
  runtime,
193
207
  this.queryBuilderState.graphManagerState.graph,
194
- )) as ExecutionResult;
195
- this.setExecutionResult(result);
196
- this.setExecutionDuration(Date.now() - startTime);
208
+ );
209
+ this.setQueryRunPromise(promise);
210
+ const result = (yield promise) as ExecutionResult;
211
+ if (this.queryRunPromise === promise) {
212
+ this.setExecutionResult(result);
213
+ this.setExecutionDuration(Date.now() - startTime);
214
+ }
197
215
  } catch (error) {
198
216
  assertErrorThrown(error);
199
217
  this.queryBuilderState.applicationStore.log.error(
@@ -202,7 +220,7 @@ export class QueryBuilderResultState {
202
220
  );
203
221
  this.queryBuilderState.applicationStore.notifyError(error);
204
222
  } finally {
205
- this.isExecutingQuery = false;
223
+ this.setIsRunningQuery(false);
206
224
  }
207
225
  }
208
226
 
@@ -106,7 +106,7 @@ export class QueryBuilderSetupState {
106
106
  get classes(): Class[] {
107
107
  return this.queryBuilderState.graphManagerState.graph.ownClasses
108
108
  .concat(
109
- this.queryBuilderState.graphManagerState.filterSystemElementOptions(
109
+ this.queryBuilderState.graphManagerState.collectExposedSystemElements(
110
110
  this.queryBuilderState.graphManagerState.graph.systemModel.ownClasses,
111
111
  ),
112
112
  )