@finos/legend-query-builder 0.6.22 → 0.6.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +8 -5
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderConstantExpressionPanel.js +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  6. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  7. package/lib/components/QueryBuilderParametersPanel.js +3 -3
  8. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  9. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  10. package/lib/components/QueryBuilderResultPanel.js +8 -3
  11. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  12. package/lib/components/QueryBuilderSideBar.js +2 -2
  13. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  14. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderTextEditor.js +4 -3
  16. package/lib/components/QueryBuilderTextEditor.js.map +1 -1
  17. package/lib/components/QueryBuilder_TestID.d.ts +1 -1
  18. package/lib/components/QueryBuilder_TestID.d.ts.map +1 -1
  19. package/lib/components/QueryBuilder_TestID.js +1 -1
  20. package/lib/components/QueryBuilder_TestID.js.map +1 -1
  21. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  22. package/lib/components/explorer/QueryBuilderExplorerPanel.js +8 -7
  23. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +5 -5
  25. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  26. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +3 -3
  28. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.d.ts → QueryBuilderTDSWindowPanel.d.ts} +4 -4
  30. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -0
  31. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.js → QueryBuilderTDSWindowPanel.js} +94 -94
  32. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -0
  33. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  34. package/lib/components/shared/LambdaParameterValuesEditor.js +10 -4
  35. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  36. package/lib/components/shared/QueryBuilderVariableSelector.js +1 -1
  37. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  38. package/lib/components/workflows/ClassQueryBuilder.js +1 -1
  39. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  40. package/lib/components/workflows/MappingQueryBuilder.js +1 -1
  41. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  42. package/lib/graphManager/QueryBuilderHashUtils.d.ts +14 -14
  43. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  44. package/lib/graphManager/QueryBuilderHashUtils.js +14 -14
  45. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  46. package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts +1 -0
  47. package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts.map +1 -1
  48. package/lib/graphManager/QueryBuilderSupportedFunctions.js +1 -0
  49. package/lib/graphManager/QueryBuilderSupportedFunctions.js.map +1 -1
  50. package/lib/index.css +2 -2
  51. package/lib/index.css.map +1 -1
  52. package/lib/package.json +6 -6
  53. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
  54. package/lib/stores/QueryBuilderPreviewDataHelper.js +6 -2
  55. package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
  56. package/lib/stores/QueryBuilderResultState.d.ts +3 -1
  57. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  58. package/lib/stores/QueryBuilderResultState.js +4 -1
  59. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  60. package/lib/stores/QueryBuilderStateBuilder.js +1 -1
  61. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  62. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  63. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +26 -9
  64. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  65. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +7 -1
  66. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  67. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +50 -32
  68. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  69. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +6 -6
  70. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  71. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +13 -13
  72. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  73. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +2 -2
  74. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  75. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  76. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +4 -4
  77. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  78. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts → window/QueryBuilderWindowGroupByOperatorLoader.d.ts} +3 -3
  79. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.d.ts.map +1 -0
  80. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js +36 -0
  81. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js.map +1 -0
  82. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +91 -0
  83. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -0
  84. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.js → window/QueryBuilderWindowState.js} +55 -53
  85. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -0
  86. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts → window/QueryBuilderWindowStateBuilder.d.ts} +1 -1
  87. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -0
  88. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js → window/QueryBuilderWindowStateBuilder.js} +10 -10
  89. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -0
  90. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts → window/QueryBuilderWindowValueSpecificationBuilder.d.ts} +3 -3
  91. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -0
  92. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js → window/QueryBuilderWindowValueSpecificationBuilder.js} +5 -5
  93. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -0
  94. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts → window/operators/QueryBuilderTDS_WindowOperator.d.ts} +2 -2
  95. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -0
  96. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js → window/operators/QueryBuilderTDS_WindowOperator.js} +2 -2
  97. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -0
  98. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +25 -0
  99. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -0
  100. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js → window/operators/QueryBuilderTDS_WindowOperator_Average.js} +6 -4
  101. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -0
  102. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts} +3 -3
  103. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -0
  104. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js → window/operators/QueryBuilderTDS_WindowOperator_Count.js} +4 -4
  105. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -0
  106. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts} +3 -3
  107. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -0
  108. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js → window/operators/QueryBuilderTDS_WindowOperator_Max.js} +4 -4
  109. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -0
  110. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts} +3 -3
  111. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -0
  112. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js → window/operators/QueryBuilderTDS_WindowOperator_Min.js} +4 -4
  113. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -0
  114. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts} +3 -3
  115. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -0
  116. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js → window/operators/QueryBuilderTDS_WindowOperator_Sum.js} +4 -4
  117. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -0
  118. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts} +3 -3
  119. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -0
  120. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js} +4 -4
  121. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -0
  122. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts} +3 -3
  123. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -0
  124. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js} +4 -4
  125. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -0
  126. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts} +3 -3
  127. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -0
  128. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js} +4 -4
  129. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -0
  130. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts} +3 -3
  131. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -0
  132. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js} +4 -4
  133. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -0
  134. package/lib/stores/shared/LambdaParameterState.d.ts +1 -1
  135. package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -1
  136. package/lib/stores/shared/LambdaParameterState.js +1 -1
  137. package/lib/stores/shared/LambdaParameterState.js.map +1 -1
  138. package/package.json +13 -13
  139. package/src/components/QueryBuilder.tsx +16 -6
  140. package/src/components/QueryBuilderConstantExpressionPanel.tsx +1 -1
  141. package/src/components/QueryBuilderParametersPanel.tsx +3 -4
  142. package/src/components/QueryBuilderResultPanel.tsx +17 -3
  143. package/src/components/QueryBuilderSideBar.tsx +2 -2
  144. package/src/components/QueryBuilderTextEditor.tsx +10 -2
  145. package/src/components/QueryBuilder_TestID.ts +1 -1
  146. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +12 -1
  147. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +8 -8
  148. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +6 -8
  149. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.tsx → QueryBuilderTDSWindowPanel.tsx} +166 -166
  150. package/src/components/shared/LambdaParameterValuesEditor.tsx +24 -11
  151. package/src/components/shared/QueryBuilderVariableSelector.tsx +1 -1
  152. package/src/components/workflows/ClassQueryBuilder.tsx +1 -1
  153. package/src/components/workflows/MappingQueryBuilder.tsx +1 -1
  154. package/src/graphManager/QueryBuilderHashUtils.ts +14 -14
  155. package/src/graphManager/QueryBuilderSupportedFunctions.ts +1 -0
  156. package/src/stores/QueryBuilderPreviewDataHelper.ts +6 -2
  157. package/src/stores/QueryBuilderResultState.ts +7 -1
  158. package/src/stores/QueryBuilderStateBuilder.ts +1 -1
  159. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +42 -10
  160. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +79 -34
  161. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +16 -16
  162. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +2 -2
  163. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +4 -2
  164. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.ts +39 -0
  165. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.ts → window/QueryBuilderWindowState.ts} +83 -76
  166. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.ts → window/QueryBuilderWindowStateBuilder.ts} +19 -19
  167. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.ts → window/QueryBuilderWindowValueSpecificationBuilder.ts} +9 -9
  168. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.ts → window/operators/QueryBuilderTDS_WindowOperator.ts} +1 -1
  169. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.ts → window/operators/QueryBuilderTDS_WindowOperator_Average.ts} +5 -3
  170. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.ts} +3 -3
  171. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.ts} +3 -3
  172. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.ts} +3 -3
  173. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.ts} +3 -3
  174. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts} +3 -3
  175. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts} +3 -3
  176. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts} +3 -3
  177. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts} +3 -3
  178. package/src/stores/shared/LambdaParameterState.ts +2 -1
  179. package/tsconfig.json +15 -15
  180. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +0 -1
  181. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +0 -1
  182. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +0 -1
  183. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js +0 -36
  184. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +0 -1
  185. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts +0 -91
  186. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +0 -1
  187. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +0 -1
  188. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +0 -1
  189. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +0 -1
  190. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +0 -1
  191. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +0 -1
  192. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts.map +0 -1
  193. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js.map +0 -1
  194. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts.map +0 -1
  195. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js.map +0 -1
  196. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts.map +0 -1
  197. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js.map +0 -1
  198. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts.map +0 -1
  199. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js.map +0 -1
  200. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts.map +0 -1
  201. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js.map +0 -1
  202. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts +0 -25
  203. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts.map +0 -1
  204. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js.map +0 -1
  205. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts.map +0 -1
  206. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js.map +0 -1
  207. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts.map +0 -1
  208. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js.map +0 -1
  209. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts.map +0 -1
  210. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js.map +0 -1
  211. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts.map +0 -1
  212. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js.map +0 -1
  213. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.ts +0 -39
@@ -19,8 +19,10 @@ import {
19
19
  Dialog,
20
20
  Modal,
21
21
  ModalBody,
22
+ ModalFooterButton,
22
23
  ModalFooter,
23
24
  ModalHeader,
25
+ ModalFooterStatus,
24
26
  } from '@finos/legend-art';
25
27
  import {
26
28
  type PureModel,
@@ -28,8 +30,8 @@ import {
28
30
  type ObserverContext,
29
31
  PrimitiveType,
30
32
  } from '@finos/legend-graph';
31
- import { prettyCONSTName } from '@finos/legend-shared';
32
33
  import { observer } from 'mobx-react-lite';
34
+ import { useState } from 'react';
33
35
  import type { LambdaParametersState } from '../../stores/shared/LambdaParameterState.js';
34
36
  import { BasicValueSpecificationEditor } from './BasicValueSpecificationEditor.js';
35
37
 
@@ -41,12 +43,18 @@ export const LambdaParameterValuesEditor = observer(
41
43
  lambdaParametersState: LambdaParametersState;
42
44
  }) => {
43
45
  const { lambdaParametersState, graph, observerContext } = props;
46
+ const [isSubmitAction, setIsSubmitAction] = useState(false);
47
+ const [isClosingAction, setIsClosingAction] = useState(false);
44
48
  const valuesEdtiorState = lambdaParametersState.parameterValuesEditorState;
45
- const close = (): void => valuesEdtiorState.close();
49
+ const close = (): void => {
50
+ setIsClosingAction(true);
51
+ valuesEdtiorState.close();
52
+ };
46
53
  const applicationStore = useApplicationStore();
47
54
  const submitAction = valuesEdtiorState.submitAction;
48
55
  const submit = applicationStore.guardUnhandledError(async () => {
49
56
  if (submitAction) {
57
+ setIsSubmitAction(true);
50
58
  close();
51
59
  await submitAction.handler();
52
60
  }
@@ -106,18 +114,23 @@ export const LambdaParameterValuesEditor = observer(
106
114
  })}
107
115
  </ModalBody>
108
116
  <ModalFooter>
117
+ {isClosingAction && (
118
+ <ModalFooterStatus> Closing...</ModalFooterStatus>
119
+ )}
109
120
  {submitAction && (
110
- <button
111
- className="btn modal__footer__close-btn"
112
- title={submitAction.label}
121
+ <ModalFooterButton
122
+ inProgress={isSubmitAction}
123
+ inProgressText={`${submitAction.label}...`}
113
124
  onClick={submit}
114
- >
115
- {prettyCONSTName(submitAction.label)}
116
- </button>
125
+ text={submitAction.label}
126
+ />
117
127
  )}
118
- <button className="btn modal__footer__close-btn" onClick={close}>
119
- Close
120
- </button>
128
+ <ModalFooterButton
129
+ inProgress={isClosingAction}
130
+ inProgressText={'Closing...'}
131
+ onClick={close}
132
+ text="Close"
133
+ />
121
134
  </ModalFooter>
122
135
  </Modal>
123
136
  </Dialog>
@@ -133,7 +133,7 @@ export const VariableViewer = observer(
133
133
  <TimesIcon />
134
134
  </button>
135
135
  <VariableInfoTooltip variable={variable}>
136
- <div className="value-spec-editor__variable__info">
136
+ <div className="query-builder__variables__variable__action value-spec-editor__variable__info">
137
137
  <InfoCircleIcon />
138
138
  </div>
139
139
  </VariableInfoTooltip>
@@ -157,7 +157,7 @@ const ClassQueryBuilderSetupPanelContent = observer(
157
157
  filterOption={mappingFilterOption}
158
158
  formatOptionLabel={getPackageableElementOptionFormatter({
159
159
  darkMode: !applicationStore.TEMPORARY__isLightThemeEnabled,
160
- pureModel: queryBuilderState.graphManagerState.graph,
160
+ graph: queryBuilderState.graphManagerState.graph,
161
161
  })}
162
162
  />
163
163
  </div>
@@ -151,7 +151,7 @@ const MappingQueryBuilderSetupPanelContent = observer(
151
151
  filterOption={mappingFilterOption}
152
152
  formatOptionLabel={getPackageableElementOptionFormatter({
153
153
  darkMode: !applicationStore.TEMPORARY__isLightThemeEnabled,
154
- pureModel: queryBuilderState.graphManagerState.graph,
154
+ graph: queryBuilderState.graphManagerState.graph,
155
155
  })}
156
156
  />
157
157
  </div>
@@ -67,20 +67,20 @@ export enum QUERY_BUILDER_HASH_STRUCTURE {
67
67
  WATERMARK_STATE = 'WATERMARK_STATE',
68
68
 
69
69
  // OLAPGroup state
70
- TDS_OLAP_GROUPBY_STATE = 'TDS_OLAP_GROUPBY_STATE',
71
- TDS_OLAP_GROUPBY_OPERATION_STATE = 'TDS_OLAP_GROUPBY_OPERATION_STATE',
72
- TDS_OLAP_GROUPBY_AGG_OPERATION_STATE = 'TDS_OLAP_GROUPBY_AGG_OPERATION_STATE',
73
- TDS_OLAP_GROUPBY_COLUMN_STATE = 'TDS_OLAP_GROUPBY_COLUMN_STATE',
74
- TDS_OLAP_GROUPBY_COLUMN_SORTBY_STATE = 'TDS_OLAP_GROUPBY_COLUMN_SORTBY_STATE',
75
- TDS_OLAP_OPERATOR_RANK = 'TDS_OLAP_OPERATOR_RANK',
76
- TDS_OLAP_OPERATOR_AVERAGE_RANK = 'TDS_OLAP_OPERATOR_AVERAGE_RANK',
77
- TDS_OLAP_OPERATOR_DENSE_RANK = 'TDS_OLAP_OPERATOR_DENSE_RANK',
78
- TDS_OLAP_OPERATOR_ROW_NUMBER = 'TDS_OLAP_OPERATOR_ROW_NUMBER',
79
- TDS_OLAP_OPERATOR_SUM = 'TDS_OLAP_OPERATOR_SUM',
80
- TDS_OLAP_OPERATOR_MAX = 'TDS_OLAP_OPERATOR_MAX',
81
- TDS_OLAP_OPERATOR_MIN = 'TDS_OLAP_OPERATOR_MIN',
82
- TDS_OLAP_OPERATOR_COUNT = 'TDS_OLAP_OPERATOR_COUNT',
83
- TDS_OLAP_OPERATOR_AVERAGE = 'TDS_OLAP_OPERATOR_AVERAGE',
70
+ TDS_WINDOW_GROUPBY_STATE = 'TDS_WINDOW_STATE',
71
+ TDS_WINDOW_GROUPBY_OPERATION_STATE = 'TDS_WINDOW_OPERATION_STATE',
72
+ TDS_WINDOW_GROUPBY_AGG_OPERATION_STATE = 'TDS_WINDOW_AGG_OPERATION_STATE',
73
+ TDS_WINDOW_COLUMN_STATE = 'TDS_WINDOW_COLUMN_STATE',
74
+ TDS_WINDOW_COLUMN_SORTBY_STATE = 'TDS_WINDOW_COLUMN_SORTBY_STATE',
75
+ TDS_WINDOW_OPERATOR_RANK = 'TDS_WINDOW_OPERATOR_RANK',
76
+ TDS_WINDOW_OPERATOR_AVERAGE_RANK = 'TDS_WINDOW_OPERATOR_AVERAGE_RANK',
77
+ TDS_WINDOW_OPERATOR_DENSE_RANK = 'TDS_WINDOW_OPERATOR_DENSE_RANK',
78
+ TDS_WINDOW_OPERATOR_ROW_NUMBER = 'TDS_WINDOW_OPERATOR_ROW_NUMBER',
79
+ TDS_WINDOW_OPERATOR_SUM = 'TDS_WINDOW_OPERATOR_SUM',
80
+ TDS_WINDOW_OPERATOR_MAX = 'TDS_WINDOW_OPERATOR_MAX',
81
+ TDS_WINDOW_OPERATOR_MIN = 'TDS_WINDOW_OPERATOR_MIN',
82
+ TDS_WINDOW_OPERATOR_COUNT = 'TDS_WINDOW_OPERATOR_COUNT',
83
+ TDS_WINDOW_OPERATOR_AVERAGE = 'TDS_WINDOW_OPERATOR_AVERAGE',
84
84
 
85
85
  // filter state
86
86
  FILTER_TREE_GROUP_NODE_DATA = 'FILTER_TREE_GROUP_NODE_DATA',
@@ -19,6 +19,7 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
19
19
  EXISTS = 'meta::pure::functions::collection::exists',
20
20
  FILTER = 'meta::pure::functions::collection::filter',
21
21
  GET_ALL = 'meta::pure::functions::collection::getAll',
22
+ GET_ALL_VERSIONS = 'meta::pure::functions::collection::getAllVersions',
22
23
  NOT = 'meta::pure::functions::boolean::not',
23
24
  OR = 'meta::pure::functions::boolean::or',
24
25
  TAKE = 'meta::pure::functions::collection::take',
@@ -141,7 +141,9 @@ export const buildNumericPreviewDataQuery = (
141
141
  aggregationState.changeColumnAggregateOperator(valAggOp, colState);
142
142
  });
143
143
 
144
- return builderState.resultState.buildExecutionRawLambda();
144
+ return builderState.resultState.buildExecutionRawLambda({
145
+ useAllVersionsForMilestoning: true,
146
+ });
145
147
  };
146
148
 
147
149
  export const buildNonNumericPreviewDataQuery = (
@@ -198,5 +200,7 @@ export const buildNonNumericPreviewDataQuery = (
198
200
  sortValueCount,
199
201
  new SortColumnState(valueProjectionColState),
200
202
  ];
201
- return builderState.resultState.buildExecutionRawLambda();
203
+ return builderState.resultState.buildExecutionRawLambda({
204
+ useAllVersionsForMilestoning: true,
205
+ });
202
206
  };
@@ -42,6 +42,7 @@ import {
42
42
  buildExecutionParameterValues,
43
43
  getExecutionQueryFromRawLambda,
44
44
  } from './shared/LambdaParameterState.js';
45
+ import type { LambdaFunctionBuilderOption } from './QueryBuilderValueSpecificationBuilderHelper.js';
45
46
 
46
47
  const DEFAULT_LIMIT = 1000;
47
48
 
@@ -51,6 +52,7 @@ export class QueryBuilderResultState {
51
52
  readonly executionPlanState: ExecutionPlanState;
52
53
 
53
54
  previewLimit = DEFAULT_LIMIT;
55
+ pressedRunQuery = ActionState.create();
54
56
  isRunningQuery = false;
55
57
  isGeneratingPlan = false;
56
58
  executionResult?: ExecutionResult | undefined;
@@ -113,11 +115,14 @@ export class QueryBuilderResultState {
113
115
  return false;
114
116
  }
115
117
 
116
- buildExecutionRawLambda(): RawLambda {
118
+ buildExecutionRawLambda(
119
+ executionOptions?: LambdaFunctionBuilderOption,
120
+ ): RawLambda {
117
121
  let query: RawLambda;
118
122
  if (this.queryBuilderState.isQuerySupported) {
119
123
  const lambdaFunction = buildLambdaFunction(this.queryBuilderState, {
120
124
  isBuildingExecutionQuery: true,
125
+ ...executionOptions,
121
126
  });
122
127
  query = buildRawLambdaFromLambdaFunction(
123
128
  lambdaFunction,
@@ -241,6 +246,7 @@ export class QueryBuilderResultState {
241
246
  this.queryBuilderState.applicationStore.notifyError(error);
242
247
  } finally {
243
248
  this.setIsRunningQuery(false);
249
+ this.pressedRunQuery.complete();
244
250
  }
245
251
  }
246
252
 
@@ -66,7 +66,7 @@ import {
66
66
  } from './fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js';
67
67
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
68
68
  import { LambdaParameterState } from './shared/LambdaParameterState.js';
69
- import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js';
69
+ import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js';
70
70
  import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
71
71
  import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
72
72
 
@@ -57,6 +57,24 @@ const buildGetAllFunction = (
57
57
  return _func;
58
58
  };
59
59
 
60
+ const buildGetAllVersionsFunction = (
61
+ _class: Class,
62
+ multiplicity: Multiplicity,
63
+ ): SimpleFunctionExpression => {
64
+ const _func = new SimpleFunctionExpression(
65
+ extractElementNameFromPath(
66
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GET_ALL_VERSIONS,
67
+ ),
68
+ );
69
+ const classInstance = new InstanceValue(
70
+ multiplicity,
71
+ GenericTypeExplicitReference.create(new GenericType(_class)),
72
+ );
73
+ classInstance.values[0] = PackageableElementExplicitReference.create(_class);
74
+ _func.parametersValues.push(classInstance);
75
+ return _func;
76
+ };
77
+
60
78
  const buildLetExpression = (
61
79
  constantExpressionState: QueryBuilderConstantExpressionState,
62
80
  ): SimpleFunctionExpression => {
@@ -101,20 +119,31 @@ export const buildLambdaFunction = (
101
119
  ),
102
120
  );
103
121
 
104
- // build getAll()
105
- const getAllFunction = buildGetAllFunction(_class, Multiplicity.ONE);
106
-
107
- // build milestoning parameter(s) for getAll()
108
122
  const milestoningStereotype = getMilestoneTemporalStereotype(
109
123
  _class,
110
124
  queryBuilderState.graphManagerState.graph,
111
125
  );
112
- if (milestoningStereotype) {
113
- queryBuilderState.milestoningState
114
- .getMilestoningImplementation(milestoningStereotype)
115
- .buildGetAllParameters(getAllFunction);
126
+
127
+ if (milestoningStereotype && options?.useAllVersionsForMilestoning) {
128
+ // build getAllVersions() when we preview data for milestoned classes
129
+ // because if we use getAll() we need to pass in data to execute the query
130
+ // but we don't give user that option in this flow.
131
+ const getAllVersionsFunction = buildGetAllVersionsFunction(
132
+ _class,
133
+ Multiplicity.ONE,
134
+ );
135
+ lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
136
+ } else {
137
+ // build getAll()
138
+ const getAllFunction = buildGetAllFunction(_class, Multiplicity.ONE);
139
+ if (milestoningStereotype) {
140
+ // build milestoning parameter(s) for getAll()
141
+ queryBuilderState.milestoningState
142
+ .getMilestoningImplementation(milestoningStereotype)
143
+ .buildGetAllParameters(getAllFunction);
144
+ }
145
+ lambdaFunction.expressionSequence[0] = getAllFunction;
116
146
  }
117
- lambdaFunction.expressionSequence[0] = getAllFunction;
118
147
 
119
148
  // build watermark
120
149
  buildWatermarkExpression(queryBuilderState.watermarkState, lambdaFunction);
@@ -139,7 +168,10 @@ export const buildLambdaFunction = (
139
168
  ];
140
169
  }
141
170
  // build parameters
142
- if (queryBuilderState.parametersState.parameterStates.length) {
171
+ if (
172
+ queryBuilderState.parametersState.parameterStates.length &&
173
+ !options?.useAllVersionsForMilestoning
174
+ ) {
143
175
  if (options?.isBuildingExecutionQuery) {
144
176
  buildExecutionQueryFromLambdaFunction(
145
177
  lambdaFunction,
@@ -16,9 +16,12 @@
16
16
 
17
17
  import {
18
18
  AbstractPropertyExpression,
19
+ Class,
19
20
  DerivedProperty,
20
21
  INTERNAL__PropagatedValue,
21
22
  matchFunctionName,
23
+ MILESTONING_VERSION_PROPERTY_SUFFIX,
24
+ PropertyExplicitReference,
22
25
  SimpleFunctionExpression,
23
26
  VariableExpression,
24
27
  type ValueSpecification,
@@ -30,7 +33,11 @@ import {
30
33
  } from '@finos/legend-shared';
31
34
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
32
35
  import type { QueryBuilderState } from './QueryBuilderState.js';
33
- import { variableExpression_setName } from './shared/ValueSpecificationModifierHelper.js';
36
+ import {
37
+ functionExpression_setParametersValues,
38
+ propertyExpression_setFunc,
39
+ variableExpression_setName,
40
+ } from './shared/ValueSpecificationModifierHelper.js';
34
41
 
35
42
  /**
36
43
  * Gets the value of ValueSpecification given INTERNAL__PropagatedValue is pointing to.
@@ -50,6 +57,7 @@ export const buildPropertyExpressionChain = (
50
57
  propertyExpression: AbstractPropertyExpression,
51
58
  queryBuilderState: QueryBuilderState,
52
59
  lambdaParameterName: string,
60
+ options?: LambdaFunctionBuilderOption,
53
61
  /**
54
62
  * As of now, we don't support date propagation for aggregation-class functions
55
63
  * so we have this temporary flag to disable date propagation, there could be other
@@ -81,45 +89,75 @@ export const buildPropertyExpressionChain = (
81
89
  currentExpression instanceof AbstractPropertyExpression &&
82
90
  currentExpression.func.value instanceof DerivedProperty
83
91
  ) {
84
- const currentPropertyExpression = currentExpression;
85
- const parameterValues = currentExpression.parametersValues.slice(1);
86
- parameterValues.forEach((parameterValue, index) => {
87
- if (parameterValue instanceof INTERNAL__PropagatedValue) {
88
- // Replace with argumentless derived property expression only when default date propagation is supported
89
- if (
90
- !TEMPORARY__disableDatePropagation &&
91
- parameterValue.isPropagatedValue
92
- ) {
93
- // NOTE: For `bitemporal` property check if the property expression has parameters which are not instance of
94
- // `INTERNAL_PropagatedValue` then pass the parameters as user explicitly changed values of either of the parameters.
92
+ // check if we are building the expression chain to view preview data and if the
93
+ // the property is milestoned. If that is the case we need to replace the
94
+ // `property` with `propertyAllVersions`
95
+ if (
96
+ options?.useAllVersionsForMilestoning &&
97
+ currentExpression.func.value.genericType.value.rawType instanceof
98
+ Class &&
99
+ currentExpression.func.value._OWNER._generatedMilestonedProperties
100
+ .length !== 0
101
+ ) {
102
+ const name = currentExpression.func.value.name;
103
+ const property =
104
+ currentExpression.func.value._OWNER._generatedMilestonedProperties.find(
105
+ (e) =>
106
+ e.name ===
107
+ `${name}${MILESTONING_VERSION_PROPERTY_SUFFIX.ALL_VERSIONS}`,
108
+ );
109
+ if (property) {
110
+ propertyExpression_setFunc(
111
+ currentExpression,
112
+ PropertyExplicitReference.create(property),
113
+ );
114
+ functionExpression_setParametersValues(
115
+ currentExpression,
116
+ [guaranteeNonNullable(currentExpression.parametersValues[0])],
117
+ queryBuilderState.observableContext,
118
+ );
119
+ }
120
+ } else {
121
+ const currentPropertyExpression = currentExpression;
122
+ const parameterValues = currentExpression.parametersValues.slice(1);
123
+ parameterValues.forEach((parameterValue, index) => {
124
+ if (parameterValue instanceof INTERNAL__PropagatedValue) {
125
+ // Replace with argumentless derived property expression only when default date propagation is supported
95
126
  if (
96
- (index === 1 &&
97
- currentPropertyExpression.parametersValues.length === 3) ||
98
- (index === 0 &&
99
- currentPropertyExpression.parametersValues.length === 3 &&
100
- !(
101
- currentPropertyExpression.parametersValues[2] instanceof
102
- INTERNAL__PropagatedValue &&
103
- currentPropertyExpression.parametersValues[2]
104
- .isPropagatedValue === true
105
- ))
127
+ !TEMPORARY__disableDatePropagation &&
128
+ parameterValue.isPropagatedValue
106
129
  ) {
130
+ // NOTE: For `bitemporal` property check if the property expression has parameters which are not instance of
131
+ // `INTERNAL_PropagatedValue` then pass the parameters as user explicitly changed values of either of the parameters.
132
+ if (
133
+ (index === 1 &&
134
+ currentPropertyExpression.parametersValues.length === 3) ||
135
+ (index === 0 &&
136
+ currentPropertyExpression.parametersValues.length === 3 &&
137
+ !(
138
+ currentPropertyExpression.parametersValues[2] instanceof
139
+ INTERNAL__PropagatedValue &&
140
+ currentPropertyExpression.parametersValues[2]
141
+ .isPropagatedValue === true
142
+ ))
143
+ ) {
144
+ currentPropertyExpression.parametersValues[index + 1] =
145
+ getValueOfInternalPropagatedValue(parameterValue);
146
+ } else {
147
+ currentPropertyExpression.parametersValues = [
148
+ guaranteeNonNullable(
149
+ guaranteeType(currentExpression, AbstractPropertyExpression)
150
+ .parametersValues[0],
151
+ ),
152
+ ];
153
+ }
154
+ } else {
107
155
  currentPropertyExpression.parametersValues[index + 1] =
108
156
  getValueOfInternalPropagatedValue(parameterValue);
109
- } else {
110
- currentPropertyExpression.parametersValues = [
111
- guaranteeNonNullable(
112
- guaranteeType(currentExpression, AbstractPropertyExpression)
113
- .parametersValues[0],
114
- ),
115
- ];
116
157
  }
117
- } else {
118
- currentPropertyExpression.parametersValues[index + 1] =
119
- getValueOfInternalPropagatedValue(parameterValue);
120
158
  }
121
- }
122
- });
159
+ });
160
+ }
123
161
  }
124
162
  currentExpression = nextExpression;
125
163
  // Take care of chains of subtype (a pattern that is not useful, but we want to support and rectify)
@@ -150,5 +188,12 @@ export type LambdaFunctionBuilderOption = {
150
188
  * queryBuilderState will make the lambda function building process overrides several query values, such as the row limit.
151
189
  */
152
190
  isBuildingExecutionQuery?: boolean | undefined;
191
+
192
+ /**
193
+ * Set this to `true` when we construct query for execution within the app to view preview data.
194
+ * queryBuilderState will make the lambda function building process overrides `.all()` to `.allVersions()` if the Class
195
+ * is milestoned and `property` to `propertyAllVersions` if a property is milestoned.
196
+ */
197
+ useAllVersionsForMilestoning?: boolean | undefined;
153
198
  keepSourceInformation?: boolean | undefined;
154
199
  };
@@ -92,9 +92,9 @@ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecifi
92
92
  import { appendProjection } from './projection/QueryBuilderProjectionValueSpecificationBuilder.js';
93
93
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graphManager/QueryBuilderSupportedFunctions.js';
94
94
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
95
- import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState.js';
96
- import type { QueryBuilderTDS_OLAPOperator } from './olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js';
97
- import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js';
95
+ import { QueryBuilderWindowState } from './window/QueryBuilderWindowState.js';
96
+ import type { QueryBuilderTDS_WindowOperator } from './window/operators/QueryBuilderTDS_WindowOperator.js';
97
+ import { getQueryBuilderCoreWindowOperators } from './window/QueryBuilderWindowGroupByOperatorLoader.js';
98
98
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
99
99
 
100
100
  export class QueryBuilderTDSState
@@ -103,19 +103,19 @@ export class QueryBuilderTDSState
103
103
  {
104
104
  readonly aggregationState: QueryBuilderAggregationState;
105
105
  readonly postFilterState: QueryBuilderPostFilterState;
106
- readonly olapGroupByState: QueryBuilderOLAPGroupByState;
106
+ readonly windowState: QueryBuilderWindowState;
107
107
  readonly resultSetModifierState: QueryResultSetModifierState;
108
108
  projectionColumns: QueryBuilderProjectionColumnState[] = [];
109
109
  isConvertDerivationProjectionObjects = false;
110
110
  showPostFilterPanel = false;
111
- showOlapGroupByPanel = false;
111
+ showWindowFuncPanel = false;
112
112
 
113
113
  postFilterOperators: QueryBuilderPostFilterOperator[] =
114
114
  getQueryBuilderCorePostFilterOperators();
115
115
  aggregationOperators: QueryBuilderAggregateOperator[] =
116
116
  getQueryBuilderCoreAggregrationOperators();
117
- olapGroupByOperators: QueryBuilderTDS_OLAPOperator[] =
118
- getQueryBuilderCoreOLAPGroupByOperators();
117
+ windowFuncOperators: QueryBuilderTDS_WindowOperator[] =
118
+ getQueryBuilderCoreWindowOperators();
119
119
 
120
120
  constructor(
121
121
  queryBuilderState: QueryBuilderState,
@@ -127,7 +127,7 @@ export class QueryBuilderTDSState
127
127
  projectionColumns: observable,
128
128
  isConvertDerivationProjectionObjects: observable,
129
129
  showPostFilterPanel: observable,
130
- showOlapGroupByPanel: observable,
130
+ showWindowFuncPanel: observable,
131
131
  TEMPORARY__showPostFetchStructurePanel: computed,
132
132
  derivations: computed,
133
133
  hasParserError: computed,
@@ -135,7 +135,7 @@ export class QueryBuilderTDSState
135
135
  moveColumn: action,
136
136
  replaceColumn: action,
137
137
  setShowPostFilterPanel: action,
138
- setShowOlapGroupByPanel: action,
138
+ setShowWindowFuncPanel: action,
139
139
  convertDerivationProjectionObjects: flow,
140
140
  });
141
141
 
@@ -148,9 +148,9 @@ export class QueryBuilderTDSState
148
148
  this,
149
149
  this.aggregationOperators,
150
150
  );
151
- this.olapGroupByState = new QueryBuilderOLAPGroupByState(
151
+ this.windowState = new QueryBuilderWindowState(
152
152
  this,
153
- this.olapGroupByOperators,
153
+ this.windowFuncOperators,
154
154
  );
155
155
  }
156
156
 
@@ -173,7 +173,7 @@ export class QueryBuilderTDSState
173
173
  override get TEMPORARY__showPostFetchStructurePanel(): boolean {
174
174
  return (
175
175
  this.queryBuilderState.filterState.showPanel ||
176
- this.showOlapGroupByPanel ||
176
+ this.showWindowFuncPanel ||
177
177
  this.showPostFilterPanel
178
178
  );
179
179
  }
@@ -279,7 +279,7 @@ export class QueryBuilderTDSState
279
279
  return [
280
280
  ...this.aggregationState.columns,
281
281
  ...projectionColumns,
282
- ...this.olapGroupByState.olapColumns,
282
+ ...this.windowState.windowColumns,
283
283
  ];
284
284
  }
285
285
 
@@ -293,7 +293,7 @@ export class QueryBuilderTDSState
293
293
  return Boolean(
294
294
  [
295
295
  ...this.postFilterState.referencedTDSColumns,
296
- ...this.olapGroupByState.referencedTDSColumns,
296
+ ...this.windowState.referencedTDSColumns,
297
297
  ].find((col) => {
298
298
  if (col instanceof QueryBuilderAggregateColumnState) {
299
299
  return tdsCol instanceof QueryBuilderAggregateColumnState
@@ -320,8 +320,8 @@ export class QueryBuilderTDSState
320
320
  this.showPostFilterPanel = val;
321
321
  }
322
322
 
323
- setShowOlapGroupByPanel(val: boolean): void {
324
- this.showOlapGroupByPanel = val;
323
+ setShowWindowFuncPanel(val: boolean): void {
324
+ this.showWindowFuncPanel = val;
325
325
  }
326
326
 
327
327
  *convertDerivationProjectionObjects(): GeneratorFn<void> {
@@ -17,7 +17,7 @@
17
17
  import { Multiplicity } from '@finos/legend-graph';
18
18
  import { UnsupportedOperationError } from '@finos/legend-shared';
19
19
  import { QueryBuilderAggregateColumnState } from '../../aggregation/QueryBuilderAggregationState.js';
20
- import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState.js';
20
+ import { QueryBuilderWindowColumnState } from '../../window/QueryBuilderWindowState.js';
21
21
  import { QueryBuilderSimpleProjectionColumnState } from '../../projection/QueryBuilderProjectionColumnState.js';
22
22
  import type { QueryBuilderTDSColumnState } from '../../QueryBuilderTDSColumnState.js';
23
23
 
@@ -26,7 +26,7 @@ export const getColumnMultiplicity = (
26
26
  ): Multiplicity => {
27
27
  if (
28
28
  columnState instanceof QueryBuilderAggregateColumnState ||
29
- columnState instanceof QueryBuilderOLAPGroupByColumnState
29
+ columnState instanceof QueryBuilderWindowColumnState
30
30
  ) {
31
31
  return Multiplicity.ONE;
32
32
  } else if (columnState instanceof QueryBuilderSimpleProjectionColumnState) {
@@ -47,7 +47,7 @@ import {
47
47
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graphManager/QueryBuilderSupportedFunctions.js';
48
48
  import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
49
49
  import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
50
- import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js';
50
+ import { appendOLAPGroupByState } from '../window/QueryBuilderWindowValueSpecificationBuilder.js';
51
51
  import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
52
52
 
53
53
  const buildSortExpression = (
@@ -227,6 +227,7 @@ export const appendProjection = (
227
227
  projectionColumnState.propertyExpressionState.propertyExpression,
228
228
  projectionColumnState.propertyExpressionState.queryBuilderState,
229
229
  projectionColumnState.lambdaParameterName,
230
+ options,
230
231
  true,
231
232
  ),
232
233
  ],
@@ -328,6 +329,7 @@ export const appendProjection = (
328
329
  projectionColumnState.propertyExpressionState.propertyExpression,
329
330
  projectionColumnState.propertyExpressionState.queryBuilderState,
330
331
  projectionColumnState.lambdaParameterName,
332
+ options,
331
333
  ),
332
334
  ],
333
335
  queryBuilderState.graphManagerState.graph,
@@ -368,7 +370,7 @@ export const appendProjection = (
368
370
  }
369
371
 
370
372
  // build olapGroupBy
371
- appendOLAPGroupByState(tdsState.olapGroupByState, lambdaFunction);
373
+ appendOLAPGroupByState(tdsState.windowState, lambdaFunction);
372
374
 
373
375
  // build post-filter
374
376
  appendPostFilter(tdsState.postFilterState, lambdaFunction);
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import type { QueryBuilderTDS_WindowOperator } from './operators/QueryBuilderTDS_WindowOperator.js';
18
+ import { QueryBuilderTDS_WindowRankOperator_AverageRank } from './operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js';
19
+ import { QueryBuilderTDS_WindowRankOperator_DenseRank } from './operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js';
20
+ import { QueryBuilderTDS_WindowRankOperator_Rank } from './operators/QueryBuilderTDS_WindowRankOperator_Rank.js';
21
+ import { QueryBuilderTDS_WindowRankOperator_RowNumber } from './operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js';
22
+ import { QueryBuilderTDS_WindowOperator_Sum } from './operators/QueryBuilderTDS_WindowOperator_Sum.js';
23
+ import { QueryBuilderTDS_WindowOperator_Count } from './operators/QueryBuilderTDS_WindowOperator_Count.js';
24
+ import { QueryBuilderTDS_WindowOperator_Max } from './operators/QueryBuilderTDS_WindowOperator_Max.js';
25
+ import { QueryBuilderTDS_WindowOperator_Min } from './operators/QueryBuilderTDS_WindowOperator_Min.js';
26
+ import { QueryBuilderTDS_WindowOperator_Average } from './operators/QueryBuilderTDS_WindowOperator_Average.js';
27
+
28
+ export const getQueryBuilderCoreWindowOperators =
29
+ (): QueryBuilderTDS_WindowOperator[] => [
30
+ new QueryBuilderTDS_WindowOperator_Sum(),
31
+ new QueryBuilderTDS_WindowOperator_Count(),
32
+ new QueryBuilderTDS_WindowOperator_Max(),
33
+ new QueryBuilderTDS_WindowOperator_Min(),
34
+ new QueryBuilderTDS_WindowOperator_Average(),
35
+ new QueryBuilderTDS_WindowRankOperator_AverageRank(),
36
+ new QueryBuilderTDS_WindowRankOperator_DenseRank(),
37
+ new QueryBuilderTDS_WindowRankOperator_Rank(),
38
+ new QueryBuilderTDS_WindowRankOperator_RowNumber(),
39
+ ];