@finos/legend-query-builder 0.4.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) 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 +105 -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 +10 -27
  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/CustomDatePicker.d.ts.map +1 -1
  70. package/lib/components/shared/CustomDatePicker.js +3 -3
  71. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  72. package/lib/components/shared/LambdaEditor.d.ts +1 -0
  73. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  74. package/lib/components/shared/LambdaEditor.js +1 -15
  75. package/lib/components/shared/LambdaEditor.js.map +1 -1
  76. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
  77. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  78. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +37 -0
  79. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  80. package/lib/components/shared/QueryBuilderVariableSelector.js +53 -0
  81. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  82. package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
  83. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  84. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  85. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  86. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  87. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  88. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  89. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  90. package/lib/index.css +1 -17
  91. package/lib/index.css.map +1 -1
  92. package/lib/package.json +6 -6
  93. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  94. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  95. package/lib/stores/QueryBuilderConfig.js +1 -0
  96. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  97. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  98. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  99. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  100. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  101. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  102. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  103. package/lib/stores/QueryBuilderParametersState.js +0 -1
  104. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  105. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  106. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  107. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  108. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  109. package/lib/stores/QueryBuilderState.d.ts +10 -3
  110. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  111. package/lib/stores/QueryBuilderState.js +27 -4
  112. package/lib/stores/QueryBuilderState.js.map +1 -1
  113. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  114. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  115. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  116. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  117. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  118. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
  119. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  120. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  121. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  122. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  123. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  124. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  125. package/lib/stores/QueryBuilderValueSpecificationHelper.js +13 -20
  126. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  127. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -1
  128. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  130. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -1
  131. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  132. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -0
  133. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  134. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  135. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  136. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  137. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  138. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +3 -2
  139. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  140. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -2
  141. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  142. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  143. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  144. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  145. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  151. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  152. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  153. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  154. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  155. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  156. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  157. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  158. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  159. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  160. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  161. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  162. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +2 -1
  163. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  164. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +9 -1
  165. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  166. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  167. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  168. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +2 -1
  169. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  170. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +4 -0
  171. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  172. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  173. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  174. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  175. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  176. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  177. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  178. package/lib/stores/filter/QueryBuilderFilterState.d.ts +2 -1
  179. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  180. package/lib/stores/filter/QueryBuilderFilterState.js +9 -1
  181. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  182. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  183. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  184. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  185. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  186. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  187. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  188. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  189. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  190. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  191. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  192. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  193. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  194. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  195. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  196. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  197. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  198. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  199. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  200. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  201. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  202. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +7 -2
  203. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  204. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +30 -20
  205. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  206. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  207. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  208. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  209. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  210. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  211. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  212. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  213. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  214. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +2 -1
  215. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  216. package/lib/stores/watermark/QueryBuilderWatermarkState.js +6 -0
  217. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  218. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  219. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  220. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  221. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  222. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  223. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  224. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  225. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  226. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  227. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  228. package/package.json +13 -13
  229. package/src/components/QueryBuilder.tsx +38 -0
  230. package/src/components/QueryBuilderConstantExpressionPanel.tsx +291 -0
  231. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  232. package/src/components/QueryBuilderParametersPanel.tsx +29 -103
  233. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  234. package/src/components/QueryBuilderSideBar.tsx +5 -22
  235. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  236. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  237. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  238. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  239. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  240. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  241. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  242. package/src/components/shared/CustomDatePicker.tsx +3 -2
  243. package/src/components/shared/LambdaEditor.tsx +0 -15
  244. package/src/components/shared/QueryBuilderVariableSelector.tsx +193 -0
  245. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  246. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  247. package/src/stores/QueryBuilderConfig.ts +1 -0
  248. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  249. package/src/stores/QueryBuilderParametersState.ts +0 -6
  250. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  251. package/src/stores/QueryBuilderState.ts +36 -4
  252. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  253. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
  254. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  255. package/src/stores/QueryBuilderValueSpecificationHelper.ts +23 -29
  256. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +2 -0
  257. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +14 -2
  258. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  259. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +21 -4
  260. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  261. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  262. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  263. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  264. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  265. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +13 -0
  266. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  267. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +12 -0
  268. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  269. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  270. package/src/stores/filter/QueryBuilderFilterState.ts +13 -0
  271. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  272. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  273. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  274. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  275. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  276. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +66 -39
  277. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  278. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  279. package/src/stores/watermark/QueryBuilderWatermarkState.ts +8 -0
  280. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  281. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  282. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  283. package/tsconfig.json +14 -6
  284. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  285. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  286. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  287. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  288. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  289. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  290. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  291. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  292. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  293. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  294. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  295. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ type Type,
19
+ type ValueSpecification,
20
+ GenericType,
21
+ GenericTypeExplicitReference,
22
+ observe_ValueSpecification,
23
+ VariableExpression,
24
+ } from '@finos/legend-graph';
25
+ import {
26
+ type Hashable,
27
+ hashArray,
28
+ deleteEntry,
29
+ addUniqueEntry,
30
+ IllegalStateError,
31
+ uuid,
32
+ assertErrorThrown,
33
+ } from '@finos/legend-shared';
34
+ import { action, makeObservable, observable } from 'mobx';
35
+ import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
36
+ import type { QueryBuilderState } from './QueryBuilderState.js';
37
+ import { buildDefaultInstanceValue } from './shared/ValueSpecificationEditorHelper.js';
38
+ import { valueSpecification_setGenericType } from './shared/ValueSpecificationModifierHelper.js';
39
+
40
+ export class QueryBuilderConstantExpressionState implements Hashable {
41
+ readonly queryBuilderState: QueryBuilderState;
42
+ readonly uuid = uuid();
43
+ variable: VariableExpression;
44
+ value: ValueSpecification;
45
+
46
+ constructor(
47
+ queryBuilderState: QueryBuilderState,
48
+ variable: VariableExpression,
49
+ value: ValueSpecification,
50
+ ) {
51
+ makeObservable(this, {
52
+ variable: observable,
53
+ value: observable,
54
+ setValueSpec: action,
55
+ changeValSpecType: action,
56
+ });
57
+ this.queryBuilderState = queryBuilderState;
58
+ this.value = observe_ValueSpecification(
59
+ value,
60
+ this.queryBuilderState.observableContext,
61
+ );
62
+ observe_ValueSpecification(
63
+ variable,
64
+ this.queryBuilderState.observableContext,
65
+ );
66
+ this.variable = variable;
67
+ }
68
+
69
+ changeValSpecType(type: Type): void {
70
+ const variableType = this.value.genericType?.value.rawType;
71
+ if (variableType !== type) {
72
+ try {
73
+ const valSpec = buildDefaultInstanceValue(
74
+ this.queryBuilderState.graphManagerState.graph,
75
+ type,
76
+ );
77
+ this.setValueSpec(valSpec);
78
+ } catch (error) {
79
+ assertErrorThrown(error);
80
+ this.queryBuilderState.applicationStore.notifyError(error.message);
81
+ }
82
+ }
83
+ }
84
+
85
+ setValueSpec(value: ValueSpecification): void {
86
+ if (value instanceof VariableExpression) {
87
+ throw new IllegalStateError(
88
+ 'Can not assign a parameter to another parameter',
89
+ );
90
+ }
91
+ this.value = observe_ValueSpecification(
92
+ value,
93
+ this.queryBuilderState.observableContext,
94
+ );
95
+ const valueSpecType = value.genericType?.value.rawType;
96
+ if (
97
+ valueSpecType &&
98
+ valueSpecType !== this.variable.genericType?.value.rawType
99
+ ) {
100
+ valueSpecification_setGenericType(
101
+ this.variable,
102
+ GenericTypeExplicitReference.create(new GenericType(valueSpecType)),
103
+ );
104
+ }
105
+ }
106
+
107
+ get hashCode(): string {
108
+ return hashArray([
109
+ QUERY_BUILDER_HASH_STRUCTURE.CONSTANT_EXPRESSION_STATE,
110
+ this.variable.name,
111
+ this.value,
112
+ ]);
113
+ }
114
+ }
115
+
116
+ export class QueryBuilderConstantsState implements Hashable {
117
+ readonly queryBuilderState: QueryBuilderState;
118
+ showConstantPanel = false;
119
+ constants: QueryBuilderConstantExpressionState[] = [];
120
+ selectedConstant: QueryBuilderConstantExpressionState | undefined;
121
+
122
+ constructor(queryBuilderState: QueryBuilderState) {
123
+ this.queryBuilderState = queryBuilderState;
124
+
125
+ makeObservable(this, {
126
+ constants: observable,
127
+ showConstantPanel: observable,
128
+ selectedConstant: observable,
129
+ addConstant: action,
130
+ removeConstant: action,
131
+ setShowConstantPanel: action,
132
+ setSelectedConstant: action,
133
+ });
134
+ }
135
+
136
+ get isEmpty(): boolean {
137
+ return !this.constants.length;
138
+ }
139
+
140
+ setShowConstantPanel(val: boolean): void {
141
+ this.showConstantPanel = val;
142
+ }
143
+
144
+ addConstant(val: QueryBuilderConstantExpressionState): void {
145
+ addUniqueEntry(this.constants, val);
146
+ }
147
+
148
+ removeConstant(val: QueryBuilderConstantExpressionState): void {
149
+ deleteEntry(this.constants, val);
150
+ }
151
+
152
+ setSelectedConstant(
153
+ val: QueryBuilderConstantExpressionState | undefined,
154
+ ): void {
155
+ this.selectedConstant = val;
156
+ }
157
+
158
+ isValueSpecConstant(value: ValueSpecification): boolean {
159
+ if (value instanceof VariableExpression) {
160
+ return Boolean(
161
+ this.constants.find((v) => v.variable.name === value.name),
162
+ );
163
+ }
164
+ return false;
165
+ }
166
+
167
+ get hashCode(): string {
168
+ return hashArray([
169
+ QUERY_BUILDER_HASH_STRUCTURE.CONSTANT_STATE,
170
+ hashArray(this.constants),
171
+ ]);
172
+ }
173
+ }
@@ -23,12 +23,6 @@ import {
23
23
  LambdaParametersState,
24
24
  } from './shared/LambdaParameterState.js';
25
25
 
26
- export const QUERY_BUILDER_PARAMETER_DND_TYPE = 'PARAMETER';
27
-
28
- export interface QueryBuilderParameterDragSource {
29
- variable: LambdaParameterState;
30
- }
31
-
32
26
  export class QueryBuilderParametersState
33
27
  extends LambdaParametersState
34
28
  implements Hashable
@@ -38,21 +38,14 @@ import {
38
38
  EnumValueInstanceValue,
39
39
  InstanceValue,
40
40
  PrimitiveInstanceValue,
41
- PRIMITIVE_TYPE,
41
+ type PRIMITIVE_TYPE,
42
42
  VariableExpression,
43
- getMilestoneTemporalStereotype,
44
- MILESTONING_STEREOTYPE,
45
43
  SimpleFunctionExpression,
46
44
  matchFunctionName,
47
45
  TYPE_CAST_TOKEN,
48
46
  observe_AbstractPropertyExpression,
49
47
  GenericTypeExplicitReference,
50
48
  GenericType,
51
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
52
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
53
- INTERNAL__PropagatedValue,
54
- Association,
55
- getGeneratedMilestonedPropertiesForAssociation,
56
49
  PropertyExplicitReference,
57
50
  PrimitiveType,
58
51
  } from '@finos/legend-graph';
@@ -61,7 +54,6 @@ import {
61
54
  generateDefaultValueForPrimitiveType,
62
55
  } from './QueryBuilderValueSpecificationHelper.js';
63
56
  import type { QueryBuilderState } from './QueryBuilderState.js';
64
- import type { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
65
57
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
66
58
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
67
59
  import {
@@ -69,236 +61,11 @@ import {
69
61
  functionExpression_setParametersValues,
70
62
  instanceValue_setValues,
71
63
  } from './shared/ValueSpecificationModifierHelper.js';
72
-
73
- export const getDerivedPropertyMilestoningSteoreotype = (
74
- property: DerivedProperty,
75
- graph: PureModel,
76
- ): MILESTONING_STEREOTYPE | undefined => {
77
- const owner = property._OWNER;
78
- if (owner instanceof Class) {
79
- return getMilestoneTemporalStereotype(owner, graph);
80
- } else if (owner instanceof Association) {
81
- const generatedMilestonedProperties =
82
- getGeneratedMilestonedPropertiesForAssociation(owner, property);
83
- if (generatedMilestonedProperties.length) {
84
- const ownerClass =
85
- generatedMilestonedProperties[0]?.genericType.value.rawType;
86
- return getMilestoneTemporalStereotype(
87
- guaranteeType(ownerClass, Class),
88
- graph,
89
- );
90
- }
91
- }
92
- return undefined;
93
- };
94
-
95
- /**
96
- * Check if the parameter value of the milestoned property is
97
- * the same as those specified in global scope, so that we can
98
- * potentially replace them with propgated value.
99
- */
100
- const matchMilestoningParameterValue = (
101
- stereotype: MILESTONING_STEREOTYPE,
102
- idx: number,
103
- parameterValue: ValueSpecification,
104
- milestoningDate: QueryBuilderMilestoningState,
105
- ): boolean => {
106
- const checkIfEquivalent = (
107
- param1: ValueSpecification | undefined,
108
- param2: ValueSpecification | undefined,
109
- ): boolean => {
110
- if (
111
- param1 instanceof VariableExpression &&
112
- param2 instanceof VariableExpression
113
- ) {
114
- return param1.name === param2.name;
115
- } else if (
116
- param1 instanceof PrimitiveInstanceValue &&
117
- param2 instanceof PrimitiveInstanceValue
118
- ) {
119
- if (
120
- param1.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE &&
121
- param2.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE
122
- ) {
123
- return true;
124
- }
125
- return (
126
- param1.genericType.value.rawType.name ===
127
- param2.genericType.value.rawType.name &&
128
- param1.values[0] === param2.values[0]
129
- );
130
- }
131
- return false;
132
- };
133
- switch (stereotype) {
134
- case MILESTONING_STEREOTYPE.BITEMPORAL:
135
- return (
136
- (idx === 0 &&
137
- checkIfEquivalent(parameterValue, milestoningDate.processingDate)) ||
138
- (idx === 1 &&
139
- checkIfEquivalent(parameterValue, milestoningDate.businessDate))
140
- );
141
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL:
142
- return checkIfEquivalent(parameterValue, milestoningDate.processingDate);
143
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL:
144
- return checkIfEquivalent(parameterValue, milestoningDate.businessDate);
145
- default:
146
- }
147
- return false;
148
- };
64
+ import { generateMilestonedPropertyParameterValue } from './milestoning/QueryBuilderMilestoningHelper.js';
149
65
 
150
66
  export const prettyPropertyName = (value: string): string =>
151
67
  isCamelCase(value) ? prettyCamelCase(value) : prettyCONSTName(value);
152
68
 
153
- /**
154
- * Generate a parameter value for the derived property given the index if the property is milestoned.
155
- *
156
- * This method considers different scenarios for milestoning and take into account date propagation
157
- * See https://github.com/finos/legend-studio/pull/891
158
- */
159
- export const generateMilestonedPropertyParameterValue = (
160
- derivedPropertyExpressionState: QueryBuilderDerivedPropertyExpressionState,
161
- idx: number,
162
- ): ValueSpecification | undefined => {
163
- // Milestoning transformations should not be done on actual derived properties.
164
- if (
165
- derivedPropertyExpressionState.derivedProperty._OWNER.derivedProperties.includes(
166
- derivedPropertyExpressionState.derivedProperty,
167
- )
168
- ) {
169
- return undefined;
170
- }
171
- const milestoningState =
172
- derivedPropertyExpressionState.queryBuilderState.milestoningState;
173
- const temporalSource = getDerivedPropertyMilestoningSteoreotype(
174
- derivedPropertyExpressionState.derivedProperty,
175
- derivedPropertyExpressionState.queryBuilderState.graphManagerState.graph,
176
- );
177
- const temporalTarget =
178
- derivedPropertyExpressionState.propertyExpression.func.value.genericType
179
- .value.rawType instanceof Class &&
180
- derivedPropertyExpressionState.propertyExpression.func.value._OWNER
181
- ._generatedMilestonedProperties.length !== 0
182
- ? getMilestoneTemporalStereotype(
183
- derivedPropertyExpressionState.propertyExpression.func.value
184
- .genericType.value.rawType,
185
- derivedPropertyExpressionState.queryBuilderState.graphManagerState
186
- .graph,
187
- )
188
- : undefined;
189
- const shouldReturnMilestoningParameter =
190
- temporalTarget &&
191
- ((idx < derivedPropertyExpressionState.parameterValues.length &&
192
- (matchMilestoningParameterValue(
193
- temporalTarget,
194
- idx,
195
- guaranteeNonNullable(
196
- derivedPropertyExpressionState.parameterValues[idx],
197
- ),
198
- milestoningState,
199
- ) ||
200
- /**
201
- * Checks if the given milestoning needs to be overwritten or not.
202
- * Specially, we would need to rewrite the query if the user passes a single parameter
203
- * to the `bitemporal` property expression with `processing temporal` source.
204
- */
205
- (getDerivedPropertyMilestoningSteoreotype(
206
- derivedPropertyExpressionState.derivedProperty,
207
- derivedPropertyExpressionState.queryBuilderState.graphManagerState
208
- .graph,
209
- ) === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
210
- temporalTarget === MILESTONING_STEREOTYPE.BITEMPORAL &&
211
- derivedPropertyExpressionState.parameterValues.length === 1))) ||
212
- idx >= derivedPropertyExpressionState.parameterValues.length);
213
-
214
- if (!shouldReturnMilestoningParameter) {
215
- return undefined;
216
- }
217
-
218
- switch (temporalTarget) {
219
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL: {
220
- if (!milestoningState.businessDate) {
221
- milestoningState.setBusinessDate(
222
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
223
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
224
- ),
225
- );
226
- }
227
- const parameter = new INTERNAL__PropagatedValue(() =>
228
- guaranteeNonNullable(milestoningState.businessDate),
229
- );
230
- return parameter;
231
- }
232
- case MILESTONING_STEREOTYPE.BITEMPORAL: {
233
- if (!milestoningState.processingDate) {
234
- milestoningState.setProcessingDate(
235
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
236
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
237
- ),
238
- );
239
- }
240
- if (!milestoningState.businessDate) {
241
- milestoningState.setBusinessDate(
242
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
243
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
244
- ),
245
- );
246
- }
247
- if (idx === 0) {
248
- if (
249
- temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
250
- derivedPropertyExpressionState.parameterValues.length === 1
251
- ) {
252
- return guaranteeType(
253
- derivedPropertyExpressionState.propertyExpression
254
- .parametersValues[0],
255
- AbstractPropertyExpression,
256
- ).parametersValues[1];
257
- }
258
- const parameter = new INTERNAL__PropagatedValue(() =>
259
- guaranteeNonNullable(milestoningState.processingDate),
260
- );
261
- return parameter;
262
- } else {
263
- if (
264
- temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
265
- derivedPropertyExpressionState.parameterValues.length === 1
266
- ) {
267
- return derivedPropertyExpressionState.parameterValues[0];
268
- } else if (
269
- temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL &&
270
- derivedPropertyExpressionState.parameterValues.length === 1
271
- ) {
272
- return guaranteeType(
273
- derivedPropertyExpressionState.propertyExpression
274
- .parametersValues[0],
275
- AbstractPropertyExpression,
276
- ).parametersValues[1];
277
- }
278
- const parameter = new INTERNAL__PropagatedValue(() =>
279
- guaranteeNonNullable(milestoningState.businessDate),
280
- );
281
- return parameter;
282
- }
283
- }
284
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL: {
285
- if (!milestoningState.processingDate) {
286
- milestoningState.setProcessingDate(
287
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
288
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
289
- ),
290
- );
291
- }
292
- const parameter = new INTERNAL__PropagatedValue(() =>
293
- guaranteeNonNullable(milestoningState.processingDate),
294
- );
295
- return parameter;
296
- }
297
- default:
298
- return undefined;
299
- }
300
- };
301
-
302
69
  export const getPropertyChainName = (
303
70
  propertyExpression: AbstractPropertyExpression,
304
71
  humanizePropertyName: boolean,
@@ -468,10 +235,12 @@ export class QueryBuilderDerivedPropertyExpressionState {
468
235
  readonly propertyExpression: AbstractPropertyExpression;
469
236
  readonly derivedProperty: DerivedProperty;
470
237
  readonly parameters: VariableExpression[] = [];
238
+ readonly propertyExpressionState: QueryBuilderPropertyExpressionState;
471
239
 
472
240
  constructor(
473
241
  queryBuilderState: QueryBuilderState,
474
242
  propertyExpression: AbstractPropertyExpression,
243
+ propertyExpressionState: QueryBuilderPropertyExpressionState,
475
244
  ) {
476
245
  this.path = getPropertyPath(propertyExpression);
477
246
  this.title = getPropertyChainName(propertyExpression, true);
@@ -484,6 +253,7 @@ export class QueryBuilderDerivedPropertyExpressionState {
484
253
  propertyExpression.func.value,
485
254
  DerivedProperty,
486
255
  );
256
+ this.propertyExpressionState = propertyExpressionState;
487
257
  // build the parameters of the derived properties
488
258
  if (Array.isArray(this.derivedProperty.parameters)) {
489
259
  this.parameters = this.derivedProperty.parameters.map((parameter) =>
@@ -625,6 +395,7 @@ export class QueryBuilderPropertyExpressionState implements Hashable {
625
395
  new QueryBuilderDerivedPropertyExpressionState(
626
396
  this.queryBuilderState,
627
397
  currentExpression,
398
+ this,
628
399
  );
629
400
  result.push(derivedPropertyExpressionState);
630
401
  }
@@ -72,10 +72,11 @@ import { QueryBuilderParametersState } from './QueryBuilderParametersState.js';
72
72
  import type { QueryBuilderFilterOperator } from './filter/QueryBuilderFilterOperator.js';
73
73
  import { getQueryBuilderCoreFilterOperators } from './filter/QueryBuilderFilterOperatorLoader.js';
74
74
  import { QueryBuilderChangeDetectionState } from './QueryBuilderChangeDetectionState.js';
75
- import { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
75
+ import { QueryBuilderMilestoningState } from './milestoning/QueryBuilderMilestoningState.js';
76
76
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
77
77
  import { QUERY_BUILDER_COMMAND_KEY } from './QueryBuilderCommand.js';
78
78
  import { QueryBuilderWatermarkState } from './watermark/QueryBuilderWatermarkState.js';
79
+ import { QueryBuilderConstantsState } from './QueryBuilderConstantsState.js';
79
80
 
80
81
  export abstract class QueryBuilderState implements CommandRegistrar {
81
82
  applicationStore: GenericLegendApplicationStore;
@@ -85,6 +86,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
85
86
  explorerState: QueryBuilderExplorerState;
86
87
  functionsExplorerState: QueryFunctionsExplorerState;
87
88
  parametersState: QueryBuilderParametersState;
89
+ constantState: QueryBuilderConstantsState;
88
90
  milestoningState: QueryBuilderMilestoningState;
89
91
  fetchStructureState: QueryBuilderFetchStructureState;
90
92
  filterState: QueryBuilderFilterState;
@@ -116,6 +118,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
116
118
  makeObservable(this, {
117
119
  explorerState: observable,
118
120
  parametersState: observable,
121
+ constantState: observable,
119
122
  functionsExplorerState: observable,
120
123
  fetchStructureState: observable,
121
124
  filterState: observable,
@@ -159,6 +162,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
159
162
  this.milestoningState = new QueryBuilderMilestoningState(this);
160
163
  this.explorerState = new QueryBuilderExplorerState(this);
161
164
  this.parametersState = new QueryBuilderParametersState(this);
165
+ this.constantState = new QueryBuilderConstantsState(this);
162
166
  this.functionsExplorerState = new QueryFunctionsExplorerState(this);
163
167
  this.fetchStructureState = new QueryBuilderFetchStructureState(this);
164
168
  this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
@@ -200,6 +204,20 @@ export abstract class QueryBuilderState implements CommandRegistrar {
200
204
  return true;
201
205
  }
202
206
 
207
+ get allVariables(): VariableExpression[] {
208
+ const parameterVars = this.parametersState.parameterStates.map(
209
+ (paramState) => paramState.parameter,
210
+ );
211
+ const letVars = this.constantState.constants.map(
212
+ (letVar) => letVar.variable,
213
+ );
214
+ return [...parameterVars, ...letVars];
215
+ }
216
+
217
+ get allVariableNames(): string[] {
218
+ return this.allVariables.map((e) => e.name);
219
+ }
220
+
203
221
  setShowFunctionsExplorerPanel(val: boolean): void {
204
222
  this.showFunctionsExplorerPanel = val;
205
223
  }
@@ -239,6 +257,17 @@ export abstract class QueryBuilderState implements CommandRegistrar {
239
257
  });
240
258
  }
241
259
 
260
+ // Used to determine if variable is used within query
261
+ // For places where we don't know, we will assume the variable is not used (i.e projection derivation column)
262
+ isVariableUsed(variable: VariableExpression): boolean {
263
+ return (
264
+ this.milestoningState.isVariableUsed(variable) ||
265
+ this.filterState.isVariableUsed(variable) ||
266
+ this.watermarkState.isVariableUsed(variable) ||
267
+ this.fetchStructureState.implementation.isVariableUsed(variable)
268
+ );
269
+ }
270
+
242
271
  deregisterCommands(): void {
243
272
  [QUERY_BUILDER_COMMAND_KEY.COMPILE].forEach((key) =>
244
273
  this.applicationStore.commandCenter.deregisterCommand(key),
@@ -258,6 +287,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
258
287
  this.explorerState = new QueryBuilderExplorerState(this);
259
288
  this.explorerState.refreshTreeData();
260
289
  this.parametersState = new QueryBuilderParametersState(this);
290
+ this.constantState = new QueryBuilderConstantsState(this);
261
291
  this.functionsExplorerState = new QueryFunctionsExplorerState(this);
262
292
  this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
263
293
  this.watermarkState = new QueryBuilderWatermarkState(this);
@@ -284,10 +314,12 @@ export abstract class QueryBuilderState implements CommandRegistrar {
284
314
  this.milestoningState.updateMilestoningConfiguration();
285
315
  }
286
316
 
287
- changeMapping(val: Mapping): void {
317
+ changeMapping(val: Mapping, options?: { keepQueryContent?: boolean }): void {
288
318
  this.resetQueryResult();
289
- this.resetQueryContent();
290
- this.milestoningState.updateMilestoningConfiguration();
319
+ if (!options?.keepQueryContent) {
320
+ this.resetQueryContent();
321
+ this.milestoningState.updateMilestoningConfiguration();
322
+ }
291
323
  this.setMapping(val);
292
324
  }
293
325