@finos/legend-query-builder 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. package/lib/components/QueryBuilder.d.ts +0 -1
  2. package/lib/components/QueryBuilder.d.ts.map +1 -1
  3. package/lib/components/QueryBuilder.js +42 -9
  4. package/lib/components/QueryBuilder.js.map +1 -1
  5. package/lib/components/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  6. package/lib/components/QueryBuilderComponentTestUtils.js +2 -5
  7. package/lib/components/QueryBuilderComponentTestUtils.js.map +1 -1
  8. package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
  9. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  10. package/lib/components/QueryBuilderDiffPanel.js +2 -2
  11. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  12. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
  13. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  14. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
  15. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  16. package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
  17. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  18. package/lib/components/QueryBuilderResultPanel.js +3 -3
  19. package/lib/components/QueryBuilderSideBar.d.ts +0 -1
  20. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  21. package/lib/components/QueryBuilderSideBar.js +2 -1
  22. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  23. package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
  24. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
  26. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  27. package/lib/components/QueryBuilder_TestID.d.ts +1 -0
  28. package/lib/components/QueryBuilder_TestID.d.ts.map +1 -1
  29. package/lib/components/QueryBuilder_TestID.js +1 -0
  30. package/lib/components/QueryBuilder_TestID.js.map +1 -1
  31. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
  32. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  33. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
  34. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  35. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +2 -2
  36. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  37. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
  38. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  39. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
  40. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  41. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
  42. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.d.ts +22 -0
  44. package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.d.ts.map +1 -0
  45. package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.js +363 -0
  46. package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.js.map +1 -0
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +21 -53
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +22 -0
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -0
  53. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +32 -0
  54. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -0
  55. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
  56. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +2 -1
  58. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.d.ts +27 -0
  60. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.d.ts.map +1 -0
  61. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.js +61 -0
  62. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.js.map +1 -0
  63. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
  64. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  65. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -13
  66. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  67. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
  68. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  69. package/lib/components/shared/LambdaEditor.d.ts +0 -1
  70. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaEditor.js +23 -7
  72. package/lib/components/shared/LambdaEditor.js.map +1 -1
  73. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
  74. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  75. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  76. package/lib/components/workflows/ServiceQueryBuilder.js +5 -1
  77. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  78. package/lib/graphManager/QueryBuilderHashUtils.d.ts +14 -0
  79. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  80. package/lib/graphManager/QueryBuilderHashUtils.js +15 -0
  81. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  82. package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts +7 -1
  83. package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts.map +1 -1
  84. package/lib/graphManager/QueryBuilderSupportedFunctions.js +7 -0
  85. package/lib/graphManager/QueryBuilderSupportedFunctions.js.map +1 -1
  86. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  87. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +4 -1
  88. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  89. package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +1 -0
  90. package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  91. package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +50 -0
  92. package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  93. package/lib/index.css +2 -2
  94. package/lib/index.css.map +1 -1
  95. package/lib/package.json +6 -6
  96. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  97. package/lib/stores/QueryBuilderStateBuilder.js +7 -1
  98. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  99. package/lib/stores/QueryBuilderStateTestUtils.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderStateTestUtils.js +2 -4
  101. package/lib/stores/QueryBuilderStateTestUtils.js.map +1 -1
  102. package/lib/stores/QueryBuilderTypeaheadHelper.js +2 -2
  103. package/lib/stores/explorer/QueryBuilderExplorerState.js +3 -3
  104. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +1 -0
  105. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  106. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +3 -0
  107. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  108. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  109. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +2 -1
  110. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  111. package/lib/stores/fetch-structure/tds/QueryBuilderTDSColumnState_.d.ts +24 -0
  112. package/lib/stores/fetch-structure/tds/QueryBuilderTDSColumnState_.d.ts.map +1 -0
  113. package/lib/stores/fetch-structure/tds/QueryBuilderTDSColumnState_.js +20 -0
  114. package/lib/stores/fetch-structure/tds/QueryBuilderTDSColumnState_.js.map +1 -0
  115. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts +23 -0
  116. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts.map +1 -0
  117. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js +41 -0
  118. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js.map +1 -0
  119. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +11 -0
  120. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  121. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +44 -1
  122. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  123. package/lib/stores/fetch-structure/tds/QueryResultSetModifierState.d.ts +2 -2
  124. package/lib/stores/fetch-structure/tds/QueryResultSetModifierState.d.ts.map +1 -1
  125. package/lib/stores/fetch-structure/tds/QueryResultSetModifierState.js +2 -2
  126. package/lib/stores/fetch-structure/tds/QueryResultSetModifierState.js.map +1 -1
  127. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateOperator.js +1 -1
  128. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts +4 -4
  129. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts.map +1 -1
  130. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js +8 -7
  131. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js.map +1 -1
  132. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByOperatorLoader.d.ts +18 -0
  133. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByOperatorLoader.d.ts.map +1 -0
  134. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByOperatorLoader.js +36 -0
  135. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByOperatorLoader.js.map +1 -0
  136. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.d.ts +91 -0
  137. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.d.ts.map +1 -0
  138. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.js +272 -0
  139. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.js.map +1 -0
  140. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByStateBuilder.d.ts +19 -0
  141. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByStateBuilder.d.ts.map +1 -0
  142. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByStateBuilder.js +100 -0
  143. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByStateBuilder.js.map +1 -0
  144. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByValueSpecificationBuilder.d.ts +19 -0
  145. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByValueSpecificationBuilder.d.ts.map +1 -0
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByValueSpecificationBuilder.js +83 -0
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByValueSpecificationBuilder.js.map +1 -0
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_.d.ts +29 -0
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_.d.ts.map +1 -0
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_.js +30 -0
  151. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_.js.map +1 -0
  152. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Average.d.ts +25 -0
  153. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Average.d.ts.map +1 -0
  154. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Average.js +50 -0
  155. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Average.js.map +1 -0
  156. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Count.d.ts +25 -0
  157. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Count.d.ts.map +1 -0
  158. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Count.js +51 -0
  159. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Count.js.map +1 -0
  160. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Max.d.ts +25 -0
  161. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Max.d.ts.map +1 -0
  162. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Max.js +50 -0
  163. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Max.js.map +1 -0
  164. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Min.d.ts +25 -0
  165. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Min.d.ts.map +1 -0
  166. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Min.js +50 -0
  167. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Min.js.map +1 -0
  168. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Sum.d.ts +25 -0
  169. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Sum.d.ts.map +1 -0
  170. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Sum.js +51 -0
  171. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Sum.js.map +1 -0
  172. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_AverageRank_.d.ts +24 -0
  173. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_AverageRank_.d.ts.map +1 -0
  174. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_AverageRank_.js +48 -0
  175. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_AverageRank_.js.map +1 -0
  176. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_DenseRank_.d.ts +24 -0
  177. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_DenseRank_.d.ts.map +1 -0
  178. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_DenseRank_.js +48 -0
  179. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_DenseRank_.js.map +1 -0
  180. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_Rank_.d.ts +24 -0
  181. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_Rank_.d.ts.map +1 -0
  182. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_Rank_.js +48 -0
  183. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_Rank_.js.map +1 -0
  184. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_RowNumber_.d.ts +24 -0
  185. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_RowNumber_.d.ts.map +1 -0
  186. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_RowNumber_.js +48 -0
  187. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_RowNumber_.js.map +1 -0
  188. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.d.ts +1 -1
  189. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.js +2 -2
  190. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +6 -4
  191. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  192. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +14 -3
  193. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  194. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -1
  195. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js +8 -11
  196. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -1
  197. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.d.ts +2 -2
  198. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.d.ts.map +1 -1
  199. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +5 -1
  200. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  201. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js +4 -4
  202. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +1 -1
  203. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +1 -1
  204. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +3 -3
  205. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +3 -3
  206. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +1 -1
  207. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js +2 -2
  208. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.d.ts +2 -2
  209. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +3 -3
  210. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +3 -3
  211. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +1 -1
  212. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +1 -1
  213. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +4 -6
  214. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  215. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +6 -5
  216. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  217. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  218. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +1 -0
  219. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  220. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  221. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +6 -3
  222. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  223. package/lib/stores/filter/QueryBuilderFilterState.d.ts +2 -0
  224. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  225. package/lib/stores/filter/QueryBuilderFilterState.js +6 -0
  226. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  227. package/package.json +13 -13
  228. package/src/components/QueryBuilder.tsx +110 -35
  229. package/src/components/QueryBuilderComponentTestUtils.tsx +9 -11
  230. package/src/components/QueryBuilderDiffPanel.tsx +2 -2
  231. package/src/components/QueryBuilderResultPanel.tsx +4 -4
  232. package/src/components/QueryBuilderSideBar.tsx +4 -1
  233. package/src/components/QueryBuilder_TestID.ts +1 -0
  234. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +2 -3
  235. package/src/components/fetch-structure/QueryBuilderOlapGroupByPanel.tsx +1140 -0
  236. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +31 -106
  237. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +69 -0
  238. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +4 -1
  239. package/src/components/fetch-structure/QueryBuilderTDSComponentHelper.tsx +118 -0
  240. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +4 -23
  241. package/src/components/shared/LambdaEditor.tsx +25 -22
  242. package/src/components/workflows/ServiceQueryBuilder.tsx +10 -2
  243. package/src/graphManager/QueryBuilderHashUtils.ts +16 -0
  244. package/src/graphManager/QueryBuilderSupportedFunctions.ts +7 -0
  245. package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +14 -0
  246. package/src/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +129 -0
  247. package/src/stores/QueryBuilderStateBuilder.ts +14 -1
  248. package/src/stores/QueryBuilderStateTestUtils.ts +9 -13
  249. package/src/stores/QueryBuilderTypeaheadHelper.ts +2 -2
  250. package/src/stores/explorer/QueryBuilderExplorerState.ts +3 -3
  251. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +4 -0
  252. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +2 -1
  253. package/src/stores/fetch-structure/tds/QueryBuilderTDSColumnState_.ts +28 -0
  254. package/src/stores/fetch-structure/tds/QueryBuilderTDSHelper.ts +79 -0
  255. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +68 -1
  256. package/src/stores/fetch-structure/tds/QueryResultSetModifierState.ts +2 -2
  257. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateOperator.ts +1 -1
  258. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.ts +11 -9
  259. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByOperatorLoader.ts +39 -0
  260. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.ts +377 -0
  261. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByStateBuilder.ts +237 -0
  262. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByValueSpecificationBuilder.ts +148 -0
  263. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_.ts +43 -0
  264. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Average.ts +56 -0
  265. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Count.ts +57 -0
  266. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Max.ts +56 -0
  267. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Min.ts +56 -0
  268. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapOperator_Sum.ts +57 -0
  269. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_AverageRank_.ts +54 -0
  270. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_DenseRank_.ts +54 -0
  271. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_Rank_.ts +54 -0
  272. package/src/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDSOlapRankOperator_RowNumber_.ts +54 -0
  273. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.ts +2 -2
  274. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +22 -10
  275. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts +11 -19
  276. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +8 -7
  277. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.ts +4 -4
  278. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +1 -1
  279. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +1 -1
  280. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +3 -3
  281. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +3 -3
  282. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +1 -1
  283. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +2 -2
  284. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +3 -3
  285. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +3 -3
  286. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +1 -1
  287. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +1 -1
  288. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +9 -11
  289. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +1 -0
  290. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +8 -4
  291. package/src/stores/filter/QueryBuilderFilterState.ts +7 -0
  292. package/tsconfig.json +19 -0
@@ -18,7 +18,6 @@ import { useApplicationStore } from '@finos/legend-application';
18
18
  import {
19
19
  type TreeNodeContainerProps,
20
20
  type TreeNodeViewProps,
21
- type TooltipPlacement,
22
21
  BlankPanelPlaceholder,
23
22
  CaretDownIcon,
24
23
  ChevronDownIcon,
@@ -39,11 +38,6 @@ import {
39
38
  NewFolderIcon,
40
39
  PlusCircleIcon,
41
40
  InfoCircleIcon,
42
- Tooltip,
43
- StringTypeIcon,
44
- ToggleIcon,
45
- HashtagIcon,
46
- ClockIcon,
47
41
  PanelDropZone,
48
42
  DragPreviewLayer,
49
43
  PanelEntryDropZonePlaceholder,
@@ -52,25 +46,20 @@ import {
52
46
  PanelContent,
53
47
  } from '@finos/legend-art';
54
48
  import {
55
- type Type,
56
49
  type ValueSpecification,
57
50
  Class,
58
51
  Enumeration,
59
52
  PrimitiveType,
60
- PRIMITIVE_TYPE,
61
- getMultiplicityDescription,
62
53
  } from '@finos/legend-graph';
63
54
  import {
64
55
  assertErrorThrown,
65
56
  guaranteeNonNullable,
66
- returnUndefOnError,
67
57
  debounce,
68
58
  } from '@finos/legend-shared';
69
59
  import { flowResult } from 'mobx';
70
60
  import { observer } from 'mobx-react-lite';
71
61
  import { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
72
62
  import { useDrop, useDrag } from 'react-dnd';
73
- import { getColumnMultiplicity } from '../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js';
74
63
  import { QueryBuilderAggregateColumnState } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js';
75
64
  import type { QueryBuilderPostFilterOperator } from '../../stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.js';
76
65
  import {
@@ -99,6 +88,15 @@ import { isTypeCompatibleForAssignment } from '../../stores/QueryBuilderValueSpe
99
88
  import { QUERY_BUILDER_GROUP_OPERATION } from '../../stores/QueryBuilderGroupOperationHelper.js';
100
89
  import { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
101
90
  import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
91
+ import {
92
+ QueryBuilderColumnInfoTooltip,
93
+ renderPropertyTypeIcon,
94
+ } from './QueryBuilderTDSComponentHelper.js';
95
+ import {
96
+ type QueryBuilderOlapColumnDragSource,
97
+ QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
98
+ } from '../../stores/fetch-structure/tds/olapGroupBy/QueryBuilderOlapGroupByState.js';
99
+ import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState_.js';
102
100
 
103
101
  const QueryBuilderPostFilterConditionContextMenu = observer(
104
102
  forwardRef<
@@ -197,91 +195,6 @@ const QueryBuilderPostFilterGroupConditionEditor = observer(
197
195
  },
198
196
  );
199
197
 
200
- const renderPropertyTypeIcon = (type: Type): React.ReactNode => {
201
- if (type instanceof PrimitiveType) {
202
- if (type.name === PRIMITIVE_TYPE.STRING) {
203
- return <StringTypeIcon className="query-builder-column-badge__icon" />;
204
- } else if (type.name === PRIMITIVE_TYPE.BOOLEAN) {
205
- return <ToggleIcon className="query-builder-column-badge__icon" />;
206
- } else if (
207
- type.name === PRIMITIVE_TYPE.NUMBER ||
208
- type.name === PRIMITIVE_TYPE.INTEGER ||
209
- type.name === PRIMITIVE_TYPE.FLOAT ||
210
- type.name === PRIMITIVE_TYPE.DECIMAL
211
- ) {
212
- return <HashtagIcon className="query-builder-column-badge__icon" />;
213
- } else if (
214
- type.name === PRIMITIVE_TYPE.DATE ||
215
- type.name === PRIMITIVE_TYPE.DATETIME ||
216
- type.name === PRIMITIVE_TYPE.STRICTDATE
217
- ) {
218
- return <ClockIcon className="query-builder-column-badge__icon" />;
219
- }
220
- } else if (type instanceof Enumeration) {
221
- return <div className="icon query-builder-column-badge__icon">E</div>;
222
- }
223
- return null;
224
- };
225
-
226
- const QueryBuilderColumnInfoTooltip: React.FC<{
227
- columnState:
228
- | QueryBuilderProjectionColumnState
229
- | QueryBuilderAggregateColumnState;
230
- children: React.ReactElement;
231
- placement?: TooltipPlacement | undefined;
232
- }> = (props) => {
233
- const { columnState, placement, children } = props;
234
- const type = columnState.getReturnType();
235
- const multiplicity = returnUndefOnError(() =>
236
- getColumnMultiplicity(columnState),
237
- );
238
- return (
239
- <Tooltip
240
- arrow={true}
241
- {...(placement !== undefined ? { placement } : {})}
242
- classes={{
243
- tooltip: 'query-builder__tooltip',
244
- arrow: 'query-builder__tooltip__arrow',
245
- tooltipPlacementRight: 'query-builder__tooltip--right',
246
- }}
247
- TransitionProps={{
248
- // disable transition
249
- // NOTE: somehow, this is the only workaround we have, if for example
250
- // we set `appear = true`, the tooltip will jump out of position
251
- timeout: 0,
252
- }}
253
- title={
254
- <div className="query-builder__tooltip__content">
255
- <div className="query-builder__tooltip__item">
256
- <div className="query-builder__tooltip__item__label">Name</div>
257
- <div className="query-builder__tooltip__item__value">
258
- {columnState.columnName}
259
- </div>
260
- </div>
261
- <div className="query-builder__tooltip__item">
262
- <div className="query-builder__tooltip__item__label">Type</div>
263
- <div className="query-builder__tooltip__item__value">
264
- {type?.path}
265
- </div>
266
- </div>
267
- {multiplicity && (
268
- <div className="query-builder__tooltip__item">
269
- <div className="query-builder__tooltip__item__label">
270
- Multiplicity
271
- </div>
272
- <div className="query-builder__tooltip__item__value">
273
- {getMultiplicityDescription(multiplicity)}
274
- </div>
275
- </div>
276
- )}
277
- </div>
278
- }
279
- >
280
- {children}
281
- </Tooltip>
282
- );
283
- };
284
-
285
198
  export const QueryBuilderColumnBadge = observer(
286
199
  (props: {
287
200
  postFilterConditionState: PostFilterConditionState;
@@ -291,7 +204,7 @@ export const QueryBuilderColumnBadge = observer(
291
204
  }) => {
292
205
  const { postFilterConditionState, onColumnChange } = props;
293
206
  const applicationStore = useApplicationStore();
294
- const type = postFilterConditionState.columnState.getReturnType();
207
+ const type = postFilterConditionState.columnState.getColumnType();
295
208
  const handleDrop = useCallback(
296
209
  (item: QueryBuilderProjectionColumnDragSource): Promise<void> =>
297
210
  onColumnChange(item.columnState),
@@ -303,7 +216,10 @@ export const QueryBuilderColumnBadge = observer(
303
216
  { isDragOver: boolean }
304
217
  >(
305
218
  () => ({
306
- accept: [QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE],
219
+ accept: [
220
+ QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
221
+ QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
222
+ ],
307
223
  drop: (item, monitor): void => {
308
224
  if (!monitor.didDrop()) {
309
225
  handleDrop(item).catch(applicationStore.alertUnhandledError);
@@ -386,7 +302,7 @@ const QueryBuilderPostFilterConditionEditor = observer(
386
302
  (item: QueryBuilderParameterDragSource): void => {
387
303
  const parameterType =
388
304
  item.variable.parameter.genericType?.value.rawType;
389
- const conditionValueType = node.condition.columnState.getReturnType();
305
+ const conditionValueType = node.condition.columnState.getColumnType();
390
306
  if (
391
307
  conditionValueType &&
392
308
  isTypeCompatibleForAssignment(parameterType, conditionValueType)
@@ -507,7 +423,7 @@ const QueryBuilderPostFilterConditionEditor = observer(
507
423
  }
508
424
  typeCheckOption={{
509
425
  expectedType: guaranteeNonNullable(
510
- node.condition.columnState.getReturnType(),
426
+ node.condition.columnState.getColumnType(),
511
427
  ),
512
428
  }}
513
429
  resetValue={resetNode}
@@ -569,9 +485,15 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
569
485
  postFilterState.removeNodeAndPruneBranch(node);
570
486
  const handleDrop = useCallback(
571
487
  (item: QueryBuilderPostFilterDropTarget, type: string): void => {
572
- if (type === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE) {
573
- const columnState = (item as QueryBuilderProjectionColumnDragSource)
574
- .columnState;
488
+ if (
489
+ type === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE ||
490
+ type === QUERY_BUILDER_OLAP_COLUMN_DND_TYPE
491
+ ) {
492
+ const columnState = (
493
+ item as
494
+ | QueryBuilderProjectionColumnDragSource
495
+ | QueryBuilderOlapColumnDragSource
496
+ ).columnState as QueryBuilderTDSColumnState;
575
497
  let conditionState: PostFilterConditionState;
576
498
  try {
577
499
  conditionState = new PostFilterConditionState(
@@ -590,7 +512,6 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
590
512
  applicationStore.notifyWarning(error.message);
591
513
  return;
592
514
  }
593
-
594
515
  if (node instanceof QueryBuilderPostFilterTreeGroupNodeData) {
595
516
  postFilterState.addNodeFromNode(
596
517
  new QueryBuilderPostFilterTreeConditionNodeData(
@@ -633,6 +554,7 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
633
554
  accept: [
634
555
  ...Object.values(QUERY_BUILDER_POST_FILTER_DND_TYPE),
635
556
  QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
557
+ QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
636
558
  ],
637
559
  drop: (item, monitor): void => {
638
560
  if (!monitor.didDrop()) {
@@ -942,11 +864,14 @@ const QueryBuilderPostFilterPanelContent = observer(
942
864
  { isDragOver: boolean }
943
865
  >(
944
866
  () => ({
945
- accept: [QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE],
867
+ accept: [
868
+ QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
869
+ QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
870
+ ],
946
871
  drop: (item, monitor): void => {
947
872
  if (!monitor.didDrop()) {
948
873
  handleDrop(item).catch(applicationStore.alertUnhandledError);
949
- } // prevent drop event propagation to accomondate for nested DnD
874
+ }
950
875
  },
951
876
  collect: (monitor) => ({
952
877
  isDragOver: monitor.isOver({ shallow: true }),
@@ -0,0 +1,69 @@
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 { observer } from 'mobx-react-lite';
18
+ import {
19
+ ResizablePanelGroup,
20
+ ResizablePanel,
21
+ ResizablePanelSplitter,
22
+ } from '@finos/legend-art';
23
+ import { QueryBuilderFilterPanel } from '../filter/QueryBuilderFilterPanel.js';
24
+ import { QueryBuilderOlapGroupByPanel } from './QueryBuilderOlapGroupByPanel.js';
25
+ import { QueryBuilderPostFilterPanel } from './QueryBuilderPostFilterPanel.js';
26
+ import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
27
+
28
+ export const QueryBuilderPostTDSPanel = observer(
29
+ (props: { tdsState: QueryBuilderTDSState }) => {
30
+ const { tdsState } = props;
31
+ const showFilterPanel = tdsState.queryBuilderState.filterState.showPanel;
32
+ const showOlapGroupByPanel = tdsState.showOlapGroupByPanel;
33
+ const showPostFilterPanel = tdsState.showPostFilterPanel;
34
+ if (!tdsState.TEMPORARY__showPostFetchStructurePanel) {
35
+ return null;
36
+ }
37
+ return (
38
+ <ResizablePanelGroup orientation="horizontal">
39
+ {showFilterPanel && (
40
+ <ResizablePanel minSize={40} direction={1}>
41
+ <QueryBuilderFilterPanel
42
+ queryBuilderState={tdsState.queryBuilderState}
43
+ />
44
+ </ResizablePanel>
45
+ )}
46
+ {showFilterPanel && (showOlapGroupByPanel || showPostFilterPanel) && (
47
+ <ResizablePanelSplitter />
48
+ )}
49
+ {showOlapGroupByPanel && (
50
+ <ResizablePanel minSize={40}>
51
+ <QueryBuilderOlapGroupByPanel
52
+ olapGroupByState={tdsState.olapGroupByState}
53
+ />
54
+ </ResizablePanel>
55
+ )}
56
+ {showOlapGroupByPanel && showPostFilterPanel && (
57
+ <ResizablePanelSplitter />
58
+ )}
59
+ {showPostFilterPanel && (
60
+ <ResizablePanel minSize={40}>
61
+ <QueryBuilderPostFilterPanel
62
+ queryBuilderState={tdsState.queryBuilderState}
63
+ />
64
+ </ResizablePanel>
65
+ )}
66
+ </ResizablePanelGroup>
67
+ );
68
+ },
69
+ );
@@ -76,7 +76,10 @@ const ColumnSortEditor = observer(
76
76
  <CustomSelectorInput
77
77
  className="query-builder__projection__options__sort__dropdown"
78
78
  options={projectionOptions}
79
- disabled={projectionOptions.length <= 1}
79
+ disabled={
80
+ projectionOptions.length < 1 ||
81
+ (projectionOptions.length === 1 && Boolean(value))
82
+ }
80
83
  onChange={onChange}
81
84
  value={value}
82
85
  darkMode={!applicationStore.TEMPORARY__isLightThemeEnabled}
@@ -0,0 +1,118 @@
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 {
18
+ StringTypeIcon,
19
+ ToggleIcon,
20
+ HashtagIcon,
21
+ ClockIcon,
22
+ type TooltipPlacement,
23
+ Tooltip,
24
+ } from '@finos/legend-art';
25
+ import {
26
+ type Type,
27
+ Enumeration,
28
+ PrimitiveType,
29
+ PRIMITIVE_TYPE,
30
+ getMultiplicityDescription,
31
+ } from '@finos/legend-graph';
32
+ import { returnUndefOnError } from '@finos/legend-shared';
33
+ import type { QueryBuilderAggregateColumnState } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js';
34
+ import { getColumnMultiplicity } from '../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js';
35
+ import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState_.js';
36
+
37
+ export const renderPropertyTypeIcon = (type: Type): React.ReactNode => {
38
+ if (type instanceof PrimitiveType) {
39
+ if (type.name === PRIMITIVE_TYPE.STRING) {
40
+ return <StringTypeIcon className="query-builder-column-badge__icon" />;
41
+ } else if (type.name === PRIMITIVE_TYPE.BOOLEAN) {
42
+ return <ToggleIcon className="query-builder-column-badge__icon" />;
43
+ } else if (
44
+ type.name === PRIMITIVE_TYPE.NUMBER ||
45
+ type.name === PRIMITIVE_TYPE.INTEGER ||
46
+ type.name === PRIMITIVE_TYPE.FLOAT ||
47
+ type.name === PRIMITIVE_TYPE.DECIMAL
48
+ ) {
49
+ return <HashtagIcon className="query-builder-column-badge__icon" />;
50
+ } else if (
51
+ type.name === PRIMITIVE_TYPE.DATE ||
52
+ type.name === PRIMITIVE_TYPE.DATETIME ||
53
+ type.name === PRIMITIVE_TYPE.STRICTDATE
54
+ ) {
55
+ return <ClockIcon className="query-builder-column-badge__icon" />;
56
+ }
57
+ } else if (type instanceof Enumeration) {
58
+ return <div className="icon query-builder-column-badge__icon">E</div>;
59
+ }
60
+ return null;
61
+ };
62
+
63
+ export const QueryBuilderColumnInfoTooltip: React.FC<{
64
+ columnState: QueryBuilderTDSColumnState | QueryBuilderAggregateColumnState;
65
+ children: React.ReactElement;
66
+ placement?: TooltipPlacement | undefined;
67
+ }> = (props) => {
68
+ const { columnState, placement, children } = props;
69
+ const type = columnState.getColumnType();
70
+ const multiplicity = returnUndefOnError(() =>
71
+ getColumnMultiplicity(columnState),
72
+ );
73
+ return (
74
+ <Tooltip
75
+ arrow={true}
76
+ {...(placement !== undefined ? { placement } : {})}
77
+ classes={{
78
+ tooltip: 'query-builder__tooltip',
79
+ arrow: 'query-builder__tooltip__arrow',
80
+ tooltipPlacementRight: 'query-builder__tooltip--right',
81
+ }}
82
+ TransitionProps={{
83
+ // disable transition
84
+ // NOTE: somehow, this is the only workaround we have, if for example
85
+ // we set `appear = true`, the tooltip will jump out of position
86
+ timeout: 0,
87
+ }}
88
+ title={
89
+ <div className="query-builder__tooltip__content">
90
+ <div className="query-builder__tooltip__item">
91
+ <div className="query-builder__tooltip__item__label">Name</div>
92
+ <div className="query-builder__tooltip__item__value">
93
+ {columnState.columnName}
94
+ </div>
95
+ </div>
96
+ <div className="query-builder__tooltip__item">
97
+ <div className="query-builder__tooltip__item__label">Type</div>
98
+ <div className="query-builder__tooltip__item__value">
99
+ {type?.path}
100
+ </div>
101
+ </div>
102
+ {multiplicity && (
103
+ <div className="query-builder__tooltip__item">
104
+ <div className="query-builder__tooltip__item__label">
105
+ Multiplicity
106
+ </div>
107
+ <div className="query-builder__tooltip__item__value">
108
+ {getMultiplicityDescription(multiplicity)}
109
+ </div>
110
+ </div>
111
+ )}
112
+ </div>
113
+ }
114
+ >
115
+ {children}
116
+ </Tooltip>
117
+ );
118
+ };
@@ -53,7 +53,6 @@ import {
53
53
  import { QueryBuilderPropertyExpressionBadge } from '../QueryBuilderPropertyExpressionEditor.js';
54
54
  import { QueryResultModifierModal } from './QueryBuilderResultModifierPanel.js';
55
55
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
56
- import { QueryBuilderAggregateColumnState } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js';
57
56
  import { flowResult } from 'mobx';
58
57
  import { useApplicationStore } from '@finos/legend-application';
59
58
  import {
@@ -71,8 +70,6 @@ import {
71
70
  QUERY_BUILDER_FUNCTION_DND_TYPE,
72
71
  } from '../../stores/explorer/QueryFunctionsExplorerState.js';
73
72
  import { DEFAULT_LAMBDA_VARIABLE_NAME } from '../../stores/QueryBuilderConfig.js';
74
- import { QueryBuilderPostFilterTreeConditionNodeData } from '../../stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js';
75
- import { filterByType } from '@finos/legend-shared';
76
73
  import type { QueryBuilderAggregateOperator } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregateOperator.js';
77
74
  import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
78
75
  import { LambdaEditor } from '../shared/LambdaEditor.js';
@@ -234,21 +231,7 @@ const QueryBuilderProjectionColumnEditor = observer(
234
231
 
235
232
  const { projectionColumnState } = props;
236
233
  const tdsState = projectionColumnState.tdsState;
237
- const postFilterColumnStates = Array.from(
238
- tdsState.postFilterState.nodes.values(),
239
- )
240
- .filter(filterByType(QueryBuilderPostFilterTreeConditionNodeData))
241
- .map((n) => n.condition.columnState);
242
-
243
- const isRemovalDisabled =
244
- postFilterColumnStates
245
- .filter((co) => co instanceof QueryBuilderAggregateColumnState)
246
- .map(
247
- (co) =>
248
- (co as QueryBuilderAggregateColumnState).projectionColumnState,
249
- )
250
- .includes(projectionColumnState) ||
251
- postFilterColumnStates.includes(projectionColumnState);
234
+ const isRemovalDisabled = tdsState.isColumnInUse(projectionColumnState);
252
235
 
253
236
  const removeColumn = (): void =>
254
237
  tdsState.removeColumn(projectionColumnState);
@@ -258,9 +241,7 @@ const QueryBuilderProjectionColumnEditor = observer(
258
241
  event,
259
242
  ) => projectionColumnState.setColumnName(event.target.value);
260
243
  const isDuplicatedColumnName =
261
- projectionColumnState.tdsState.projectionColumns.filter(
262
- (column) => column.columnName === projectionColumnState.columnName,
263
- ).length > 1;
244
+ projectionColumnState.tdsState.isDuplicateColumn(projectionColumnState);
264
245
 
265
246
  // aggregation
266
247
  const aggregateColumnState = tdsState.aggregationState.columns.find(
@@ -415,7 +396,6 @@ const QueryBuilderProjectionColumnEditor = observer(
415
396
  )}
416
397
  </div>
417
398
  )}
418
-
419
399
  <DropdownMenu
420
400
  className="query-builder__projection__column__aggregate__operator__dropdown"
421
401
  title="Choose Aggregate Operator..."
@@ -472,7 +452,8 @@ const QueryBuilderProjectionColumnEditor = observer(
472
452
  disabled={isRemovalDisabled}
473
453
  title={
474
454
  isRemovalDisabled
475
- ? "This column is used in the post filter and can't be removed"
455
+ ? // TODO: We may want to provide a list of all places where column is in use
456
+ "This column is used and can't be removed"
476
457
  : 'Remove'
477
458
  }
478
459
  >
@@ -19,9 +19,8 @@ import { editor as monacoEditorAPI, type IDisposable } from 'monaco-editor';
19
19
  import { observer } from 'mobx-react-lite';
20
20
  import {
21
21
  clsx,
22
- setErrorMarkers,
23
22
  disposeEditor,
24
- baseTextEditorSettings,
23
+ getBaseTextEditorOptions,
25
24
  getEditorValue,
26
25
  normalizeLineEnding,
27
26
  FilledWindowMaximizeIcon,
@@ -29,6 +28,8 @@ import {
29
28
  LongArrowAltUpIcon,
30
29
  Dialog,
31
30
  useResizeDetector,
31
+ clearMarkers,
32
+ setErrorMarkers,
32
33
  } from '@finos/legend-art';
33
34
  import type { LambdaEditorState } from '../../stores/shared/LambdaEditorState.js';
34
35
  import {
@@ -178,7 +179,7 @@ const LambdaEditorInline = observer(
178
179
  scrollbar: { vertical: 'hidden' },
179
180
  };
180
181
  const _editor = monacoEditorAPI.create(element, {
181
- ...baseTextEditorSettings,
182
+ ...getBaseTextEditorOptions(),
182
183
  language: EDITOR_LANGUAGE.PURE,
183
184
  theme: applicationStore.TEMPORARY__isLightThemeEnabled
184
185
  ? EDITOR_THEME.TEMPORARY__VSCODE_LIGHT
@@ -309,16 +310,17 @@ const LambdaEditorInline = observer(
309
310
  editorModel.updateOptions({ tabSize: TAB_SIZE });
310
311
  const error = parserError ?? compilationError;
311
312
  if (error?.sourceInformation) {
312
- setErrorMarkers(
313
- editorModel,
314
- error.message,
315
- error.sourceInformation.startLine,
316
- error.sourceInformation.startColumn,
317
- error.sourceInformation.endLine,
318
- error.sourceInformation.endColumn,
319
- );
313
+ setErrorMarkers(editorModel, [
314
+ {
315
+ message: error.message,
316
+ startLineNumber: error.sourceInformation.startLine,
317
+ startColumn: error.sourceInformation.startColumn,
318
+ endLineNumber: error.sourceInformation.endLine,
319
+ endColumn: error.sourceInformation.endColumn,
320
+ },
321
+ ]);
320
322
  } else {
321
- monacoEditorAPI.setModelMarkers(editorModel, 'Error', []);
323
+ clearMarkers();
322
324
  }
323
325
  }
324
326
  }
@@ -461,7 +463,7 @@ const LambdaEditorPopUp = observer(
461
463
  if (!editor && textInputRef.current) {
462
464
  const element = textInputRef.current;
463
465
  const _editor = monacoEditorAPI.create(element, {
464
- ...baseTextEditorSettings,
466
+ ...getBaseTextEditorOptions(),
465
467
  language: EDITOR_LANGUAGE.PURE,
466
468
  theme: EDITOR_THEME.LEGEND,
467
469
  });
@@ -544,16 +546,17 @@ const LambdaEditorPopUp = observer(
544
546
  editorModel.updateOptions({ tabSize: TAB_SIZE });
545
547
  const error = parserError ?? compilationError;
546
548
  if (error?.sourceInformation) {
547
- setErrorMarkers(
548
- editorModel,
549
- error.message,
550
- error.sourceInformation.startLine,
551
- error.sourceInformation.startColumn,
552
- error.sourceInformation.endLine,
553
- error.sourceInformation.endColumn,
554
- );
549
+ setErrorMarkers(editorModel, [
550
+ {
551
+ message: error.message,
552
+ startLineNumber: error.sourceInformation.startLine,
553
+ startColumn: error.sourceInformation.startColumn,
554
+ endLineNumber: error.sourceInformation.endLine,
555
+ endColumn: error.sourceInformation.endColumn,
556
+ },
557
+ ]);
555
558
  } else {
556
- monacoEditorAPI.setModelMarkers(editorModel, 'Error', []);
559
+ clearMarkers();
557
560
  }
558
561
  }
559
562
  }
@@ -114,7 +114,11 @@ const ServiceQueryBuilderSetupPanelContent = observer(
114
114
  className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
115
115
  placeholder="Choose a service..."
116
116
  options={serviceOptions}
117
- disabled={serviceOptions.length <= 1}
117
+ disabled={
118
+ serviceOptions.length < 1 ||
119
+ (serviceOptions.length === 1 &&
120
+ Boolean(selectedServiceOption))
121
+ }
118
122
  onChange={onServiceOptionChange}
119
123
  value={selectedServiceOption}
120
124
  darkMode={!applicationStore.TEMPORARY__isLightThemeEnabled}
@@ -134,7 +138,11 @@ const ServiceQueryBuilderSetupPanelContent = observer(
134
138
  className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
135
139
  placeholder="Choose an execution context..."
136
140
  options={executionContextOptions}
137
- disabled={executionContextOptions.length <= 1}
141
+ disabled={
142
+ executionContextOptions.length < 1 ||
143
+ (executionContextOptions.length === 1 &&
144
+ Boolean(selectedExecutionContextOption))
145
+ }
138
146
  onChange={onExecutionContextOptionChange}
139
147
  value={selectedExecutionContextOption}
140
148
  darkMode={!applicationStore.TEMPORARY__isLightThemeEnabled}
@@ -61,6 +61,22 @@ export enum QUERY_BUILDER_HASH_STRUCTURE {
61
61
  POST_FILTER_OPERATOR_NOT_START_WITH = 'POST_FILTER_OPERATOR_NOT_START_WITH',
62
62
  POST_FILTER_STATE = 'POST_FILTER_STATE',
63
63
 
64
+ // OLAPGroup state
65
+ OLAP_GROUPBY_STATE = 'OLAP_GROUPBY_STATE',
66
+ OLAP_GROUPBY_OPERATION_STATE = 'OLAP_GROUPBY_OPERATION_STATE',
67
+ OLAP_GROUPBY_AGG_OPERATION_STATE = 'OLAP_GROUPBY_AGG_OPERATION_STATE',
68
+ OLAP_GROUPBY_COLUMN_STATE = 'OLAP_GROUPBY_COLUMN_STATE',
69
+ OLAP_GROUPBY_COLUMN_SORTBY_STATE = 'OLAP_GROUPBY_COLUMN_SORTBY_STATE',
70
+ OLAP_OPERATOR_RANK = 'OLAP_OPERATOR_RANK',
71
+ OLAP_OPERATOR_AVERAGE_RANK = 'OLAP_OPERATOR_AVERAGE_RANK',
72
+ OLAP_OPERATOR_DENSE_RANK = 'OLAP_OPERATOR_DENSE_RANK',
73
+ OLAP_OPERATOR_ROW_NUMBER = 'OLAP_OPERATOR_ROW_NUMBER',
74
+ OLAP_OPERATOR_SUM = 'OLAP_OPERATOR_SUM',
75
+ OLAP_OPERATOR_MAX = 'OLAP_OPERATOR_MAX',
76
+ OLAP_OPERATOR_MIN = 'OLAP_OPERATOR_MIN',
77
+ OLAP_OPERATOR_COUNT = 'OLAP_OPERATOR_COUNT',
78
+ OLAP_OPERATOR_AVERAGE = 'OLAP_OPERATOR_AVERAGE',
79
+
64
80
  // filter state
65
81
  FILTER_TREE_GROUP_NODE_DATA = 'FILTER_TREE_GROUP_NODE_DATA',
66
82
  FILTER_TREE_CONDIITION_NODE_DATA = 'FILTER_TREE_CONDITION_NODE_DATA',
@@ -39,6 +39,7 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
39
39
  TDS_GROUP_BY = 'meta::pure::tds::groupBy',
40
40
  TDS_SORT = 'meta::pure::tds::sort',
41
41
  TDS_TAKE = 'meta::pure::tds::take',
42
+ TDS_FUNC = 'meta::pure::tds::func',
42
43
 
43
44
  // filter
44
45
  CONTAINS = 'meta::pure::functions::string::contains',
@@ -64,4 +65,10 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
64
65
  STD_DEV_SAMPLE = 'meta::pure::functions::math::stdDevSample',
65
66
  SUM = 'meta::pure::functions::math::sum',
66
67
  UNIQUE_VALUE_ONLY = 'meta::pure::functions::collection::uniqueValueOnly',
68
+ // OLAP
69
+ OLAP_GROUPBY = 'meta::pure::tds::olapGroupBy',
70
+ OLAP_RANK = 'meta::pure::functions::math::olap::rank',
71
+ OLAP_AVERAGE_RANK = 'meta::pure::functions::math::olap::averageRank',
72
+ OLAP_DENSE_RANK = 'meta::pure::functions::math::olap::denseRank',
73
+ OLAP_ROW_NUMBER = 'meta::pure::functions::math::olap::rowNumber',
67
74
  }