@finos/legend-query-builder 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. package/lib/components/QueryBuilder.d.ts +1 -0
  2. package/lib/components/QueryBuilder.d.ts.map +1 -1
  3. package/lib/components/QueryBuilder.js +11 -2
  4. package/lib/components/QueryBuilder.js.map +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
  6. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
  7. package/lib/components/QueryBuilderConstantExpressionPanel.js +104 -0
  8. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
  9. package/lib/components/QueryBuilderDiffPanel.d.ts +1 -0
  10. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderDiffPanel.js +1 -2
  12. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderParametersPanel.d.ts +1 -9
  14. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderParametersPanel.js +8 -26
  16. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +1 -0
  18. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
  20. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  21. package/lib/components/QueryBuilderResultPanel.d.ts +1 -0
  22. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderSideBar.d.ts +3 -1
  24. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderSideBar.js +6 -14
  26. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  27. package/lib/components/QueryBuilderTextEditor.d.ts +1 -0
  28. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -0
  30. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  31. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -0
  32. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  33. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +1 -0
  34. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  35. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
  36. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  37. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -0
  38. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  39. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -0
  40. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  41. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -0
  42. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +3 -2
  44. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
  45. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
  46. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -0
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -0
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
  54. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -0
  56. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -0
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
  60. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  61. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -0
  62. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
  64. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  65. package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
  66. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  67. package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
  68. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  69. package/lib/components/shared/LambdaEditor.d.ts +1 -0
  70. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaEditor.js +1 -15
  72. package/lib/components/shared/LambdaEditor.js.map +1 -1
  73. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
  74. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  75. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +36 -0
  76. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  77. package/lib/components/shared/QueryBuilderVariableSelector.js +50 -0
  78. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  79. package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
  80. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  81. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  82. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  83. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  84. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  85. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  86. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  87. package/lib/index.css +2 -2
  88. package/lib/index.css.map +1 -1
  89. package/lib/package.json +6 -6
  90. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  91. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  92. package/lib/stores/QueryBuilderConfig.js +1 -0
  93. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  94. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  95. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  96. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  97. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  98. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  99. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderParametersState.js +0 -1
  101. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  102. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  103. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  104. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  105. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  106. package/lib/stores/QueryBuilderState.d.ts +9 -3
  107. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  108. package/lib/stores/QueryBuilderState.js +19 -4
  109. package/lib/stores/QueryBuilderState.js.map +1 -1
  110. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  111. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  112. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  113. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  114. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  115. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
  116. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  117. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  118. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  119. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  120. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  121. package/lib/stores/QueryBuilderValueSpecificationHelper.js +4 -20
  122. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  123. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  124. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  125. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  126. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  127. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -1
  128. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +2 -2
  130. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  131. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  132. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  133. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  134. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  135. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  136. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  137. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  138. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  139. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  140. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  141. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  142. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  143. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  144. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  145. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  151. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  152. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  153. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  154. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  155. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  156. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  157. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  158. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  159. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  160. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  161. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  162. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  163. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  164. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  165. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  166. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  167. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  168. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  169. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  170. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  171. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  172. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  173. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  174. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  175. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  176. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  177. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  178. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  179. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +6 -2
  180. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  181. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +20 -20
  182. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  183. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  184. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  185. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  186. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  187. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  188. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  189. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  190. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  191. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  192. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  193. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  194. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  195. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  196. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  197. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  198. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  199. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  200. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  201. package/package.json +13 -13
  202. package/src/components/QueryBuilder.tsx +38 -0
  203. package/src/components/QueryBuilderConstantExpressionPanel.tsx +284 -0
  204. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  205. package/src/components/QueryBuilderParametersPanel.tsx +22 -103
  206. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  207. package/src/components/QueryBuilderSideBar.tsx +5 -22
  208. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  209. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  210. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  211. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  212. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  213. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  214. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  215. package/src/components/shared/LambdaEditor.tsx +0 -15
  216. package/src/components/shared/QueryBuilderVariableSelector.tsx +186 -0
  217. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  218. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  219. package/src/stores/QueryBuilderConfig.ts +1 -0
  220. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  221. package/src/stores/QueryBuilderParametersState.ts +0 -6
  222. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  223. package/src/stores/QueryBuilderState.ts +25 -4
  224. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  225. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
  226. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  227. package/src/stores/QueryBuilderValueSpecificationHelper.ts +10 -29
  228. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  229. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +2 -2
  230. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  231. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  232. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  233. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  234. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  235. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  236. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  237. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  238. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  239. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  240. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  241. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  242. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  243. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +55 -39
  244. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  245. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  246. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  247. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  248. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  249. package/tsconfig.json +14 -6
  250. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  251. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  252. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  253. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  254. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  255. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  256. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  257. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  258. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  259. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  260. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  261. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -18,6 +18,8 @@ import {
18
18
  assertNonNullable,
19
19
  assertTrue,
20
20
  assertType,
21
+ guaranteeIsString,
22
+ guaranteeNonNullable,
21
23
  guaranteeType,
22
24
  UnsupportedOperationError,
23
25
  } from '@finos/legend-shared';
@@ -30,18 +32,18 @@ import {
30
32
  type InstanceValue,
31
33
  type INTERNAL__UnknownValueSpecification,
32
34
  type LambdaFunction,
33
- MILESTONING_STEREOTYPE,
34
35
  matchFunctionName,
35
36
  Class,
36
37
  type CollectionInstanceValue,
37
38
  type LambdaFunctionInstanceValue,
38
- type PrimitiveInstanceValue,
39
+ PrimitiveInstanceValue,
39
40
  SimpleFunctionExpression,
40
41
  type VariableExpression,
41
42
  type AbstractPropertyExpression,
42
43
  getMilestoneTemporalStereotype,
43
44
  type INTERNAL__PropagatedValue,
44
45
  type ValueSpecification,
46
+ SUPPORTED_FUNCTIONS,
45
47
  } from '@finos/legend-graph';
46
48
  import { processTDSPostFilterExpression } from './fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js';
47
49
  import { processFilterExpression } from './filter/QueryBuilderFilterStateBuilder.js';
@@ -64,8 +66,9 @@ import {
64
66
  } from './fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js';
65
67
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
66
68
  import { LambdaParameterState } from './shared/LambdaParameterState.js';
67
- import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js';
69
+ import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js';
68
70
  import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
71
+ import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
69
72
 
70
73
  const processGetAllExpression = (
71
74
  expression: SimpleFunctionExpression,
@@ -78,57 +81,62 @@ const processGetAllExpression = (
78
81
  `Can't process getAll() expression: getAll() return type is missing`,
79
82
  );
80
83
  queryBuilderState.setClass(_class);
81
- queryBuilderState.milestoningState.updateMilestoningConfiguration();
84
+ queryBuilderState.milestoningState.clearMilestoningDates();
82
85
  queryBuilderState.explorerState.refreshTreeData();
83
86
 
84
87
  // check parameters (milestoning) and build state
85
- let acceptedNoOfParameters = 1;
88
+ const acceptedNoOfParameters = 1;
86
89
  const stereotype = getMilestoneTemporalStereotype(
87
90
  _class,
88
91
  queryBuilderState.graphManagerState.graph,
89
92
  );
90
- switch (stereotype) {
91
- case MILESTONING_STEREOTYPE.BITEMPORAL:
92
- acceptedNoOfParameters = 3;
93
- assertTrue(
94
- expression.parametersValues.length === acceptedNoOfParameters,
95
- `Can't process getAll() expression: when used with a bitemporal milestoned class getAll() expects two parameters`,
96
- );
97
- queryBuilderState.milestoningState.setProcessingDate(
98
- expression.parametersValues[1],
99
- );
100
- queryBuilderState.milestoningState.setBusinessDate(
101
- expression.parametersValues[2],
102
- );
103
- break;
104
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL:
105
- acceptedNoOfParameters = 2;
106
- assertTrue(
107
- expression.parametersValues.length === acceptedNoOfParameters,
108
- `Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
109
- );
110
- queryBuilderState.milestoningState.setBusinessDate(
111
- expression.parametersValues[1],
112
- );
113
- break;
114
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL:
115
- acceptedNoOfParameters = 2;
116
- assertTrue(
117
- expression.parametersValues.length === acceptedNoOfParameters,
118
- `Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
119
- );
120
- queryBuilderState.milestoningState.setProcessingDate(
121
- expression.parametersValues[1],
122
- );
123
- break;
124
- default:
125
- assertTrue(
126
- expression.parametersValues.length === acceptedNoOfParameters,
127
- `Can't process getAll() expression: getAll() expects no arguments`,
128
- );
93
+ if (stereotype) {
94
+ queryBuilderState.milestoningState
95
+ .getMilestoningImplementation(stereotype)
96
+ .processGetAllParamaters(expression.parametersValues);
97
+ } else {
98
+ assertTrue(
99
+ expression.parametersValues.length === acceptedNoOfParameters,
100
+ `Can't process getAll() expression: getAll() expects no arguments`,
101
+ );
129
102
  }
130
103
  };
131
104
 
105
+ const processLetExpression = (
106
+ expression: SimpleFunctionExpression,
107
+ queryBuilderState: QueryBuilderState,
108
+ parentLambda: LambdaFunction,
109
+ ): void => {
110
+ const parameters = expression.parametersValues;
111
+ assertTrue(
112
+ expression.parametersValues.length === 2,
113
+ 'Let function expected to have two parameters (left and right side value)',
114
+ );
115
+ // process left side (var)
116
+ const letVariable = guaranteeIsString(
117
+ guaranteeType(
118
+ parameters[0],
119
+ PrimitiveInstanceValue,
120
+ 'Can`t process let function: left side should be a primitive instance value',
121
+ ).values[0],
122
+ 'Can`t process let function: left side should be a string primitive instance value',
123
+ );
124
+ const varExp = guaranteeNonNullable(
125
+ parentLambda.openVariables.get(letVariable),
126
+ `Unable to find variable ${letVariable} in lambda function`,
127
+ );
128
+ // process right side (value)
129
+ const rightSide = guaranteeNonNullable(parameters[1]);
130
+ // final
131
+ const constantExpression = new QueryBuilderConstantExpressionState(
132
+ queryBuilderState,
133
+ varExp,
134
+ rightSide,
135
+ );
136
+ queryBuilderState.constantState.setShowConstantPanel(true);
137
+ queryBuilderState.constantState.addConstant(constantExpression);
138
+ };
139
+
132
140
  /**
133
141
  * This is the value specification processor (a.k.a state builder) for query builder.
134
142
  *
@@ -209,21 +217,29 @@ export class QueryBuilderValueSpecificationProcessor
209
217
  * value specification.
210
218
  */
211
219
  readonly parentExpression?: SimpleFunctionExpression | undefined;
220
+ readonly parentLambda: LambdaFunction;
212
221
 
213
222
  private constructor(
214
223
  queryBuilderState: QueryBuilderState,
224
+ parentLambda: LambdaFunction,
215
225
  parentExpression: SimpleFunctionExpression | undefined,
216
226
  ) {
217
227
  this.queryBuilderState = queryBuilderState;
218
228
  this.parentExpression = parentExpression;
229
+ this.parentLambda = parentLambda;
219
230
  }
220
231
 
221
232
  static process(
222
233
  valueSpecification: ValueSpecification,
234
+ parentLambda: LambdaFunction,
223
235
  queryBuilderState: QueryBuilderState,
224
236
  ): void {
225
237
  valueSpecification.accept_ValueSpecificationVisitor(
226
- new QueryBuilderValueSpecificationProcessor(queryBuilderState, undefined),
238
+ new QueryBuilderValueSpecificationProcessor(
239
+ queryBuilderState,
240
+ parentLambda,
241
+ undefined,
242
+ ),
227
243
  );
228
244
  }
229
245
 
@@ -234,11 +250,13 @@ export class QueryBuilderValueSpecificationProcessor
234
250
  static processChild(
235
251
  valueSpecification: ValueSpecification,
236
252
  parentExpression: SimpleFunctionExpression,
253
+ parentLambda: LambdaFunction,
237
254
  queryBuilderState: QueryBuilderState,
238
255
  ): void {
239
256
  valueSpecification.accept_ValueSpecificationVisitor(
240
257
  new QueryBuilderValueSpecificationProcessor(
241
258
  queryBuilderState,
259
+ parentLambda,
242
260
  parentExpression,
243
261
  ),
244
262
  );
@@ -316,6 +334,7 @@ export class QueryBuilderValueSpecificationProcessor
316
334
  );
317
335
  QueryBuilderValueSpecificationProcessor.process(
318
336
  precedingExpression,
337
+ this.parentLambda,
319
338
  this.queryBuilderState,
320
339
  );
321
340
 
@@ -371,7 +390,11 @@ export class QueryBuilderValueSpecificationProcessor
371
390
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.WATERMARK,
372
391
  )
373
392
  ) {
374
- processWatermarkExpression(valueSpecification, this.queryBuilderState);
393
+ processWatermarkExpression(
394
+ valueSpecification,
395
+ this.queryBuilderState,
396
+ this.parentLambda,
397
+ );
375
398
  return;
376
399
  } else if (
377
400
  matchFunctionName(
@@ -379,7 +402,11 @@ export class QueryBuilderValueSpecificationProcessor
379
402
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
380
403
  )
381
404
  ) {
382
- processTDSProjectExpression(valueSpecification, this.queryBuilderState);
405
+ processTDSProjectExpression(
406
+ valueSpecification,
407
+ this.queryBuilderState,
408
+ this.parentLambda,
409
+ );
383
410
  return;
384
411
  } else if (
385
412
  matchFunctionName(
@@ -387,7 +414,11 @@ export class QueryBuilderValueSpecificationProcessor
387
414
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_TAKE,
388
415
  )
389
416
  ) {
390
- processTDSTakeExpression(valueSpecification, this.queryBuilderState);
417
+ processTDSTakeExpression(
418
+ valueSpecification,
419
+ this.queryBuilderState,
420
+ this.parentLambda,
421
+ );
391
422
  return;
392
423
  } else if (
393
424
  matchFunctionName(
@@ -395,7 +426,11 @@ export class QueryBuilderValueSpecificationProcessor
395
426
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_DISTINCT,
396
427
  )
397
428
  ) {
398
- processTDSDistinctExpression(valueSpecification, this.queryBuilderState);
429
+ processTDSDistinctExpression(
430
+ valueSpecification,
431
+ this.queryBuilderState,
432
+ this.parentLambda,
433
+ );
399
434
  return;
400
435
  } else if (
401
436
  matchFunctionName(
@@ -403,7 +438,11 @@ export class QueryBuilderValueSpecificationProcessor
403
438
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_SORT,
404
439
  )
405
440
  ) {
406
- processTDSSortExpression(valueSpecification, this.queryBuilderState);
441
+ processTDSSortExpression(
442
+ valueSpecification,
443
+ this.queryBuilderState,
444
+ this.parentLambda,
445
+ );
407
446
  return;
408
447
  } else if (
409
448
  matchFunctionName(functionName, [
@@ -423,7 +462,11 @@ export class QueryBuilderValueSpecificationProcessor
423
462
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_GROUP_BY,
424
463
  )
425
464
  ) {
426
- processTDSGroupByExpression(valueSpecification, this.queryBuilderState);
465
+ processTDSGroupByExpression(
466
+ valueSpecification,
467
+ this.queryBuilderState,
468
+ this.parentLambda,
469
+ );
427
470
  return;
428
471
  } else if (
429
472
  matchFunctionName(functionName, QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG)
@@ -432,6 +475,7 @@ export class QueryBuilderValueSpecificationProcessor
432
475
  valueSpecification,
433
476
  this.parentExpression,
434
477
  this.queryBuilderState,
478
+ this.parentLambda,
435
479
  );
436
480
  return;
437
481
  } else if (
@@ -443,6 +487,7 @@ export class QueryBuilderValueSpecificationProcessor
443
487
  processTDS_OLAPGroupByExpression(
444
488
  valueSpecification,
445
489
  this.queryBuilderState,
490
+ this.parentLambda,
446
491
  );
447
492
  return;
448
493
  } else if (
@@ -454,6 +499,7 @@ export class QueryBuilderValueSpecificationProcessor
454
499
  processGraphFetchSerializeExpression(
455
500
  valueSpecification,
456
501
  this.queryBuilderState,
502
+ this.parentLambda,
457
503
  );
458
504
  return;
459
505
  } else if (
@@ -462,7 +508,18 @@ export class QueryBuilderValueSpecificationProcessor
462
508
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
463
509
  ])
464
510
  ) {
465
- processGraphFetchExpression(valueSpecification, this.queryBuilderState);
511
+ processGraphFetchExpression(
512
+ valueSpecification,
513
+ this.queryBuilderState,
514
+ this.parentLambda,
515
+ );
516
+ return;
517
+ } else if (matchFunctionName(functionName, [SUPPORTED_FUNCTIONS.LET])) {
518
+ processLetExpression(
519
+ valueSpecification,
520
+ this.queryBuilderState,
521
+ this.parentLambda,
522
+ );
466
523
  return;
467
524
  }
468
525
  throw new UnsupportedOperationError(
@@ -531,6 +588,7 @@ export class QueryBuilderValueSpecificationProcessor
531
588
  expression.accept_ValueSpecificationVisitor(
532
589
  new QueryBuilderValueSpecificationProcessor(
533
590
  this.queryBuilderState,
591
+ this.parentLambda,
534
592
  this.parentExpression,
535
593
  ),
536
594
  ),
@@ -574,6 +632,7 @@ export const processQueryLambdaFunction = (
574
632
  lambdaFunction.expressionSequence.map((expression) =>
575
633
  QueryBuilderValueSpecificationProcessor.process(
576
634
  expression,
635
+ lambdaFunction,
577
636
  queryBuilderState,
578
637
  ),
579
638
  );
@@ -28,7 +28,9 @@ import {
28
28
  GenericTypeExplicitReference,
29
29
  LambdaFunction,
30
30
  SimpleFunctionExpression,
31
- MILESTONING_STEREOTYPE,
31
+ PrimitiveInstanceValue,
32
+ PrimitiveType,
33
+ SUPPORTED_FUNCTIONS,
32
34
  } from '@finos/legend-graph';
33
35
  import type { QueryBuilderState } from './QueryBuilderState.js';
34
36
  import { buildFilterExpression } from './filter/QueryBuilderFilterValueSpecificationBuilder.js';
@@ -37,6 +39,7 @@ import type { QueryBuilderFetchStructureState } from './fetch-structure/QueryBui
37
39
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
38
40
  import { buildWatermarkExpression } from './watermark/QueryBuilderWatermarkValueSpecificationBuilder.js';
39
41
  import { buildExecutionQueryFromLambdaFunction } from './shared/LambdaParameterState.js';
42
+ import type { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
40
43
 
41
44
  const buildGetAllFunction = (
42
45
  _class: Class,
@@ -54,6 +57,22 @@ const buildGetAllFunction = (
54
57
  return _func;
55
58
  };
56
59
 
60
+ const buildLetExpression = (
61
+ constantExpressionState: QueryBuilderConstantExpressionState,
62
+ ): SimpleFunctionExpression => {
63
+ const varName = constantExpressionState.variable.name;
64
+ const value = constantExpressionState.value;
65
+ const leftSide = new PrimitiveInstanceValue(
66
+ GenericTypeExplicitReference.create(new GenericType(PrimitiveType.STRING)),
67
+ );
68
+ leftSide.values = [varName];
69
+ const letFunc = new SimpleFunctionExpression(
70
+ extractElementNameFromPath(SUPPORTED_FUNCTIONS.LET),
71
+ );
72
+ letFunc.parametersValues = [leftSide, value];
73
+ return letFunc;
74
+ };
75
+
57
76
  const buildFetchStructure = (
58
77
  fetchStructureState: QueryBuilderFetchStructureState,
59
78
  lambdaFunction: LambdaFunction,
@@ -91,62 +110,17 @@ export const buildLambdaFunction = (
91
110
  queryBuilderState.graphManagerState.graph,
92
111
  );
93
112
  if (milestoningStereotype) {
94
- switch (milestoningStereotype) {
95
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL: {
96
- getAllFunction.parametersValues.push(
97
- guaranteeNonNullable(
98
- queryBuilderState.milestoningState.businessDate,
99
- `Milestoning class should have a parameter of type 'Date'`,
100
- ),
101
- );
102
- break;
103
- }
104
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL: {
105
- getAllFunction.parametersValues.push(
106
- guaranteeNonNullable(
107
- queryBuilderState.milestoningState.processingDate,
108
- `Milestoning class should have a parameter of type 'Date'`,
109
- ),
110
- );
111
- break;
112
- }
113
- case MILESTONING_STEREOTYPE.BITEMPORAL: {
114
- getAllFunction.parametersValues.push(
115
- guaranteeNonNullable(
116
- queryBuilderState.milestoningState.processingDate,
117
- `Milestoning class should have a parameter of type 'Date'`,
118
- ),
119
- );
120
- getAllFunction.parametersValues.push(
121
- guaranteeNonNullable(
122
- queryBuilderState.milestoningState.businessDate,
123
- `Milestoning class should have a parameter of type 'Date'`,
124
- ),
125
- );
126
- break;
127
- }
128
- default:
129
- }
113
+ queryBuilderState.milestoningState
114
+ .getMilestoningImplementation(milestoningStereotype)
115
+ .buildGetAllParameters(getAllFunction);
130
116
  }
131
117
  lambdaFunction.expressionSequence[0] = getAllFunction;
132
118
 
133
119
  // build watermark
134
- const watermarkFunction = buildWatermarkExpression(
135
- queryBuilderState.watermarkState,
136
- getAllFunction,
137
- );
138
- if (watermarkFunction) {
139
- lambdaFunction.expressionSequence[0] = watermarkFunction;
140
- }
120
+ buildWatermarkExpression(queryBuilderState.watermarkState, lambdaFunction);
141
121
 
142
122
  // build filter
143
- const filterFunction = buildFilterExpression(
144
- queryBuilderState.filterState,
145
- watermarkFunction ?? getAllFunction,
146
- );
147
- if (filterFunction) {
148
- lambdaFunction.expressionSequence[0] = filterFunction;
149
- }
123
+ buildFilterExpression(queryBuilderState.filterState, lambdaFunction);
150
124
 
151
125
  // build fetch-structure
152
126
  buildFetchStructure(
@@ -155,6 +129,15 @@ export const buildLambdaFunction = (
155
129
  options,
156
130
  );
157
131
 
132
+ // build variable expressions
133
+ if (queryBuilderState.constantState.constants.length) {
134
+ const letExpressions =
135
+ queryBuilderState.constantState.constants.map(buildLetExpression);
136
+ lambdaFunction.expressionSequence = [
137
+ ...letExpressions,
138
+ ...lambdaFunction.expressionSequence,
139
+ ];
140
+ }
158
141
  // build parameters
159
142
  if (queryBuilderState.parametersState.parameterStates.length) {
160
143
  if (options?.isBuildingExecutionQuery) {
@@ -16,12 +16,9 @@
16
16
 
17
17
  import {
18
18
  AbstractPropertyExpression,
19
- Class,
20
19
  DerivedProperty,
21
- getMilestoneTemporalStereotype,
22
20
  INTERNAL__PropagatedValue,
23
21
  matchFunctionName,
24
- MILESTONING_STEREOTYPE,
25
22
  SimpleFunctionExpression,
26
23
  VariableExpression,
27
24
  type ValueSpecification,
@@ -32,103 +29,21 @@ import {
32
29
  guaranteeType,
33
30
  } from '@finos/legend-shared';
34
31
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
35
- import { getDerivedPropertyMilestoningSteoreotype } from './QueryBuilderPropertyEditorState.js';
36
32
  import type { QueryBuilderState } from './QueryBuilderState.js';
33
+ import { variableExpression_setName } from './shared/ValueSpecificationModifierHelper.js';
37
34
 
38
35
  /**
39
- * Checks if the provided property expression match the criteria for default
40
- * date propagation so we know whether we need to fill in values for the parameter
41
- * or just propgate values from the parent's expression
42
- *
43
- * NOTE: this takes date propgation into account. See the table below for all
44
- * the combination:
45
- *
46
- * | [source] | | | | |
47
- * ----------------------------------------------------------------------
48
- * [target] | | NONE | PR_TMP | BI_TMP | BU_TMP |
49
- * ----------------------------------------------------------------------
50
- * | NONE | N.A. | PRD | PRD,BUD | BUD |
51
- * ----------------------------------------------------------------------
52
- * | PR_TMP | N.A. | X | PRD,BUD | BUD |
53
- * ----------------------------------------------------------------------
54
- * | BI_TMP | N.A. | X | X | X |
55
- * ----------------------------------------------------------------------
56
- * | BU_TMP | N.A. | PRD | PRD,BUD | X |
57
- * ----------------------------------------------------------------------
58
- *
59
- * Annotations:
60
- *
61
- * [source]: source temporal type
62
- * [target]: target temporal type
63
- *
64
- * PR_TMP : processing temporal
65
- * BI_TMP : bitemporal
66
- * BU_TMP : business temporal
67
- *
68
- * X : no default date propagated
69
- * PRD : default processing date is propagated
70
- * BUD : default business date is propgated
36
+ * Gets the value of ValueSpecification given INTERNAL__PropagatedValue is pointing to.
71
37
  */
72
- const isDefaultDatePropagationSupported = (
73
- currentPropertyExpression: AbstractPropertyExpression,
74
- queryBuilderState: QueryBuilderState,
75
- prevPropertyExpression?: AbstractPropertyExpression | undefined,
76
- ): boolean => {
77
- const property = currentPropertyExpression.func.value;
78
- const graph = queryBuilderState.graphManagerState.graph;
79
- // Default date propagation is not supported for current expression when the previous property expression is a derived property.
80
- if (
81
- prevPropertyExpression &&
82
- prevPropertyExpression.func.value instanceof DerivedProperty &&
83
- prevPropertyExpression.func.value._OWNER.derivedProperties.includes(
84
- prevPropertyExpression.func.value,
85
- )
86
- ) {
87
- return false;
88
- }
89
- // Default date propagation is not supported for current expression when the milestonedParameterValues of
90
- // the previous property expression doesn't match with the global milestonedParameterValues
91
- if (
92
- prevPropertyExpression &&
93
- prevPropertyExpression.func.value.genericType.value.rawType instanceof Class
94
- ) {
95
- const milestoningStereotype = getMilestoneTemporalStereotype(
96
- prevPropertyExpression.func.value.genericType.value.rawType,
97
- graph,
98
- );
99
- if (
100
- milestoningStereotype &&
101
- !prevPropertyExpression.parametersValues
102
- .slice(1)
103
- .every(
104
- (parameterValue) =>
105
- parameterValue instanceof INTERNAL__PropagatedValue,
106
- )
107
- ) {
108
- return false;
109
- }
110
- }
111
- if (property.genericType.value.rawType instanceof Class) {
112
- // the stereotype of source class of current property expression.
113
- const sourceStereotype =
114
- property instanceof DerivedProperty
115
- ? getDerivedPropertyMilestoningSteoreotype(property, graph)
116
- : undefined;
117
- // Default date propagation is always supported if the source is `bitemporal`
118
- if (sourceStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
119
- return true;
120
- }
121
- // the stereotype (if exists) of the generic type of current property expression.
122
- const targetStereotype = getMilestoneTemporalStereotype(
123
- property.genericType.value.rawType,
124
- graph,
38
+ const getValueOfInternalPropagatedValue = (
39
+ valueSpec: INTERNAL__PropagatedValue,
40
+ ): ValueSpecification => {
41
+ if (valueSpec.getValue() instanceof INTERNAL__PropagatedValue) {
42
+ return getValueOfInternalPropagatedValue(
43
+ guaranteeType(valueSpec.getValue(), INTERNAL__PropagatedValue),
125
44
  );
126
- // Default date propagation is supported when stereotype of both source and target matches
127
- if (sourceStereotype && targetStereotype) {
128
- return sourceStereotype === targetStereotype;
129
- }
130
45
  }
131
- return false;
46
+ return valueSpec.getValue();
132
47
  };
133
48
 
134
49
  export const buildPropertyExpressionChain = (
@@ -173,13 +88,7 @@ export const buildPropertyExpressionChain = (
173
88
  // Replace with argumentless derived property expression only when default date propagation is supported
174
89
  if (
175
90
  !TEMPORARY__disableDatePropagation &&
176
- isDefaultDatePropagationSupported(
177
- currentPropertyExpression,
178
- queryBuilderState,
179
- nextExpression instanceof AbstractPropertyExpression
180
- ? nextExpression
181
- : undefined,
182
- )
91
+ parameterValue.isPropagatedValue
183
92
  ) {
184
93
  // NOTE: For `bitemporal` property check if the property expression has parameters which are not instance of
185
94
  // `INTERNAL_PropagatedValue` then pass the parameters as user explicitly changed values of either of the parameters.
@@ -190,11 +99,13 @@ export const buildPropertyExpressionChain = (
190
99
  currentPropertyExpression.parametersValues.length === 3 &&
191
100
  !(
192
101
  currentPropertyExpression.parametersValues[2] instanceof
193
- INTERNAL__PropagatedValue
102
+ INTERNAL__PropagatedValue &&
103
+ currentPropertyExpression.parametersValues[2]
104
+ .isPropagatedValue === true
194
105
  ))
195
106
  ) {
196
107
  currentPropertyExpression.parametersValues[index + 1] =
197
- parameterValue.getValue();
108
+ getValueOfInternalPropagatedValue(parameterValue);
198
109
  } else {
199
110
  currentPropertyExpression.parametersValues = [
200
111
  guaranteeNonNullable(
@@ -205,7 +116,7 @@ export const buildPropertyExpressionChain = (
205
116
  }
206
117
  } else {
207
118
  currentPropertyExpression.parametersValues[index + 1] =
208
- parameterValue.getValue();
119
+ getValueOfInternalPropagatedValue(parameterValue);
209
120
  }
210
121
  }
211
122
  });
@@ -228,7 +139,7 @@ export const buildPropertyExpressionChain = (
228
139
 
229
140
  // Update the root lambda name based on the parent's lambda parameter name.
230
141
  if (currentExpression instanceof VariableExpression) {
231
- currentExpression.name = lambdaParameterName;
142
+ variableExpression_setName(currentExpression, lambdaParameterName);
232
143
  }
233
144
  return newPropertyExpression;
234
145
  };
@@ -38,7 +38,6 @@ import {
38
38
  Class,
39
39
  getMilestoneTemporalStereotype,
40
40
  DerivedProperty,
41
- MILESTONING_STEREOTYPE,
42
41
  PackageableElementExplicitReference,
43
42
  Multiplicity,
44
43
  CollectionInstanceValue,
@@ -55,7 +54,10 @@ import {
55
54
  UnsupportedOperationError,
56
55
  } from '@finos/legend-shared';
57
56
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
58
- import { getDerivedPropertyMilestoningSteoreotype } from './QueryBuilderPropertyEditorState.js';
57
+ import {
58
+ getDerivedPropertyMilestoningSteoreotype,
59
+ validateMilestoningPropertyExpressionChain,
60
+ } from './milestoning/QueryBuilderMilestoningHelper.js';
59
61
 
60
62
  export const getNonCollectionValueSpecificationType = (
61
63
  valueSpecification: ValueSpecification,
@@ -209,6 +211,7 @@ export const generateDefaultValueForPrimitiveType = (
209
211
  case PRIMITIVE_TYPE.DECIMAL:
210
212
  case PRIMITIVE_TYPE.FLOAT:
211
213
  case PRIMITIVE_TYPE.INTEGER:
214
+ case PRIMITIVE_TYPE.BINARY:
212
215
  return 0;
213
216
  case PRIMITIVE_TYPE.DATE:
214
217
  case PRIMITIVE_TYPE.STRICTDATE:
@@ -301,33 +304,11 @@ export const validatePropertyExpressionChain = (
301
304
  guaranteeType(func, DerivedProperty),
302
305
  graph,
303
306
  );
304
- if (
305
- sourceStereotype !== MILESTONING_STEREOTYPE.BITEMPORAL &&
306
- targetStereotype !== sourceStereotype
307
- ) {
308
- if (targetStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
309
- if (
310
- propertyExpression.parametersValues.length !== 3 &&
311
- !sourceStereotype
312
- ) {
313
- throw new UnsupportedOperationError(
314
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have exactly two parameters`,
315
- );
316
- } else if (propertyExpression.parametersValues.length < 2) {
317
- throw new UnsupportedOperationError(
318
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have at least one parameter`,
319
- );
320
- } else if (propertyExpression.parametersValues.length > 3) {
321
- throw new UnsupportedOperationError(
322
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should not have more than two parameters`,
323
- );
324
- }
325
- } else if (propertyExpression.parametersValues.length !== 2) {
326
- throw new UnsupportedOperationError(
327
- `Property of milestoning sterotype '${targetStereotype}' should have exactly one parameter`,
328
- );
329
- }
330
- }
307
+ validateMilestoningPropertyExpressionChain(
308
+ sourceStereotype,
309
+ targetStereotype,
310
+ propertyExpression,
311
+ );
331
312
  }
332
313
  }
333
314
  }