@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
@@ -70,10 +70,6 @@ import {
70
70
  } from '@finos/legend-shared';
71
71
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
72
72
  import { useApplicationStore } from '@finos/legend-application';
73
- import {
74
- type QueryBuilderParameterDragSource,
75
- QUERY_BUILDER_PARAMETER_DND_TYPE,
76
- } from '../../stores/QueryBuilderParametersState.js';
77
73
  import type { ValueSpecification } from '@finos/legend-graph';
78
74
  import {
79
75
  type QueryBuilderProjectionColumnDragSource,
@@ -83,7 +79,11 @@ import {
83
79
  import type { QueryBuilderFilterOperator } from '../../stores/filter/QueryBuilderFilterOperator.js';
84
80
  import { isTypeCompatibleForAssignment } from '../../stores/QueryBuilderValueSpecificationHelper.js';
85
81
  import { QUERY_BUILDER_GROUP_OPERATION } from '../../stores/QueryBuilderGroupOperationHelper.js';
86
- import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
82
+ import {
83
+ BasicValueSpecificationEditor,
84
+ type QueryBuilderVariableDragSource,
85
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
86
+ } from '../shared/BasicValueSpecificationEditor.js';
87
87
 
88
88
  const QueryBuilderFilterGroupConditionEditor = observer(
89
89
  (props: {
@@ -139,6 +139,7 @@ const QueryBuilderFilterConditionEditor = observer(
139
139
  const { node, isDragOver } = props;
140
140
  const graph =
141
141
  node.condition.filterState.queryBuilderState.graphManagerState.graph;
142
+ const queryBuilderState = node.condition.filterState.queryBuilderState;
142
143
  const applicationStore = useApplicationStore();
143
144
  const changeOperator = (val: QueryBuilderFilterOperator) => (): void =>
144
145
  node.condition.changeOperator(val);
@@ -148,19 +149,18 @@ const QueryBuilderFilterConditionEditor = observer(
148
149
  node.condition.changeProperty(
149
150
  buildPropertyExpressionFromExplorerTreeNodeData(
150
151
  propertyNode,
151
- node.condition.filterState.queryBuilderState.explorerState,
152
+ queryBuilderState.explorerState,
152
153
  ),
153
154
  );
154
155
  // Drag and Drop on filter condition value
155
156
  const handleDrop = useCallback(
156
- (item: QueryBuilderParameterDragSource): void => {
157
- const parameterType =
158
- item.variable.parameter.genericType?.value.rawType;
157
+ (item: QueryBuilderVariableDragSource): void => {
158
+ const parameterType = item.variable.genericType?.value.rawType;
159
159
  const conditionValueType =
160
160
  node.condition.propertyExpressionState.propertyExpression.func.value
161
161
  .genericType.value.rawType;
162
162
  if (isTypeCompatibleForAssignment(parameterType, conditionValueType)) {
163
- node.condition.setValue(item.variable.parameter);
163
+ node.condition.setValue(item.variable);
164
164
  } else {
165
165
  applicationStore.notifyWarning(
166
166
  `Incompatible parameter type ${parameterType?.name}. ${parameterType?.name} is not compatible with type ${conditionValueType.name}.`,
@@ -170,12 +170,12 @@ const QueryBuilderFilterConditionEditor = observer(
170
170
  [applicationStore, node.condition],
171
171
  );
172
172
  const [{ isFilterValueDragOver }, dropConnector] = useDrop<
173
- QueryBuilderParameterDragSource,
173
+ QueryBuilderVariableDragSource,
174
174
  void,
175
175
  { isFilterValueDragOver: boolean }
176
176
  >(
177
177
  () => ({
178
- accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
178
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
179
179
  drop: (item, monitor): void => {
180
180
  if (!monitor.didDrop()) {
181
181
  handleDrop(item);
@@ -212,7 +212,6 @@ const QueryBuilderFilterConditionEditor = observer(
212
212
  reloadValues: debouncedTypeaheadSearch,
213
213
  cleanUpReloadValues,
214
214
  };
215
-
216
215
  return (
217
216
  <div className="query-builder-filter-tree__node__label__content">
218
217
  <PanelEntryDropZonePlaceholder
@@ -270,10 +269,7 @@ const QueryBuilderFilterConditionEditor = observer(
270
269
  valueSpecification={node.condition.value}
271
270
  setValueSpecification={changeValueSpecification}
272
271
  graph={graph}
273
- obseverContext={
274
- node.condition.filterState.queryBuilderState
275
- .observableContext
276
- }
272
+ obseverContext={queryBuilderState.observableContext}
277
273
  typeCheckOption={{
278
274
  expectedType:
279
275
  node.condition.propertyExpressionState
@@ -282,6 +278,9 @@ const QueryBuilderFilterConditionEditor = observer(
282
278
  }}
283
279
  resetValue={resetNode}
284
280
  selectorConfig={selectorConfig}
281
+ isConstant={queryBuilderState.constantState.isValueSpecConstant(
282
+ node.condition.value,
283
+ )}
285
284
  />
286
285
  </PanelEntryDropZonePlaceholder>
287
286
  </div>
@@ -28,6 +28,7 @@ import {
28
28
  CustomSelectorInput,
29
29
  SaveIcon,
30
30
  PencilIcon,
31
+ DragPreviewLayer,
31
32
  } from '@finos/legend-art';
32
33
  import {
33
34
  type Enum,
@@ -80,7 +81,7 @@ type TypeCheckOption = {
80
81
  match?: boolean;
81
82
  };
82
83
 
83
- const ParameterInfoTooltip: React.FC<{
84
+ export const VariableInfoTooltip: React.FC<{
84
85
  variable: VariableExpression;
85
86
  children: React.ReactElement;
86
87
  placement?: TooltipPlacement | undefined;
@@ -136,35 +137,55 @@ const ParameterInfoTooltip: React.FC<{
136
137
  );
137
138
  };
138
139
 
140
+ export const QUERY_BUILDER_VARIABLE_DND_TYPE = 'VARIABLE';
141
+
142
+ export interface QueryBuilderVariableDragSource {
143
+ variable: VariableExpression;
144
+ }
145
+
139
146
  const VariableExpressionParameterEditor = observer(
140
147
  (props: {
141
148
  valueSpecification: VariableExpression;
142
- className?: string | undefined;
143
149
  resetValue: () => void;
150
+ className?: string | undefined;
151
+ isConstant?: boolean;
144
152
  }) => {
145
- const { valueSpecification, className, resetValue } = props;
153
+ const { valueSpecification, resetValue, isConstant, className } = props;
146
154
  const varName = valueSpecification.name;
147
155
  return (
148
- <div className={clsx('value-spec-editor__parameter', className)}>
149
- <div className="value-spec-editor__parameter__icon">
150
- <DollarIcon />
151
- </div>
152
- <div className="value-spec-editor__parameter__label">
153
- <div className="value-spec-editor__parameter__text">{varName}</div>
154
- <ParameterInfoTooltip variable={valueSpecification}>
155
- <div className="value-spec-editor__parameter__info">
156
- <InfoCircleIcon />
157
- </div>
158
- </ParameterInfoTooltip>
159
- <button
160
- className="value-spec-editor__parameter__reset-btn"
161
- title="Reset"
162
- onClick={resetValue}
163
- >
164
- <RefreshIcon />
165
- </button>
156
+ <>
157
+ <DragPreviewLayer
158
+ labelGetter={(item: QueryBuilderVariableDragSource): string =>
159
+ item.variable.name
160
+ }
161
+ types={[QUERY_BUILDER_VARIABLE_DND_TYPE]}
162
+ />
163
+ <div
164
+ className={clsx('value-spec-editor__variable', className, {
165
+ 'value-spec-editor__variable__constant': isConstant,
166
+ })}
167
+ >
168
+ <div className="value-spec-editor__variable__icon">
169
+ {isConstant ? <div className="icon">C</div> : <DollarIcon />}
170
+ </div>
171
+ <div className="value-spec-editor__variable__label">
172
+ <div className="value-spec-editor__variable__text">{varName}</div>
173
+ <VariableInfoTooltip variable={valueSpecification}>
174
+ <div className="value-spec-editor__variable__info">
175
+ <InfoCircleIcon />
176
+ </div>
177
+ </VariableInfoTooltip>
178
+
179
+ <button
180
+ className="value-spec-editor__variable__reset-btn"
181
+ title="Reset"
182
+ onClick={resetValue}
183
+ >
184
+ <RefreshIcon />
185
+ </button>
186
+ </div>
166
187
  </div>
167
- </div>
188
+ </>
168
189
  );
169
190
  },
170
191
  );
@@ -682,6 +703,7 @@ export const BasicValueSpecificationEditor: React.FC<{
682
703
  className?: string | undefined;
683
704
  setValueSpecification: (val: ValueSpecification) => void;
684
705
  resetValue: () => void;
706
+ isConstant?: boolean;
685
707
  selectorConfig?:
686
708
  | {
687
709
  values: string[] | undefined;
@@ -702,6 +724,7 @@ export const BasicValueSpecificationEditor: React.FC<{
702
724
  setValueSpecification,
703
725
  resetValue,
704
726
  selectorConfig,
727
+ isConstant,
705
728
  } = props;
706
729
  if (valueSpecification instanceof PrimitiveInstanceValue) {
707
730
  const _type = valueSpecification.genericType.value.rawType;
@@ -728,6 +751,7 @@ export const BasicValueSpecificationEditor: React.FC<{
728
751
  case PRIMITIVE_TYPE.NUMBER:
729
752
  case PRIMITIVE_TYPE.FLOAT:
730
753
  case PRIMITIVE_TYPE.DECIMAL:
754
+ case PRIMITIVE_TYPE.BINARY:
731
755
  case PRIMITIVE_TYPE.INTEGER:
732
756
  return (
733
757
  <NumberPrimitiveInstanceValueEditor
@@ -790,6 +814,7 @@ export const BasicValueSpecificationEditor: React.FC<{
790
814
  valueSpecification={valueSpecification}
791
815
  className={className}
792
816
  resetValue={resetValue}
817
+ isConstant={Boolean(isConstant)}
793
818
  />
794
819
  );
795
820
  } else if (valueSpecification instanceof INTERNAL__PropagatedValue) {
@@ -39,6 +39,7 @@ import {
39
39
  DURATION_UNIT,
40
40
  type ObserverContext,
41
41
  PrimitiveType,
42
+ getSupportFunctionFullPath,
42
43
  } from '@finos/legend-graph';
43
44
  import {
44
45
  guaranteeNonNullable,
@@ -569,7 +570,7 @@ const buildCustomDateOptionReferenceMomentValue = (
569
570
  const funcName = (
570
571
  pureDateAjustFunction.parametersValues[0] as SimpleFunctionExpression
571
572
  ).functionName;
572
- switch (funcName) {
573
+ switch (getSupportFunctionFullPath(funcName)) {
573
574
  case SUPPORTED_FUNCTIONS.TODAY:
574
575
  return CUSTOM_DATE_OPTION_REFERENCE_MOMENT.TODAY;
575
576
  case SUPPORTED_FUNCTIONS.NOW:
@@ -637,7 +638,7 @@ const buildDatePickerOption = (
637
638
  valueSpecification: SimpleFunctionExpression | PrimitiveInstanceValue,
638
639
  ): DatePickerOption => {
639
640
  if (valueSpecification instanceof SimpleFunctionExpression) {
640
- switch (valueSpecification.functionName) {
641
+ switch (getSupportFunctionFullPath(valueSpecification.functionName)) {
641
642
  case SUPPORTED_FUNCTIONS.TODAY:
642
643
  return new DatePickerOption(
643
644
  CUSTOM_DATE_PICKER_OPTION.TODAY,
@@ -46,7 +46,6 @@ import {
46
46
  import { flowResult } from 'mobx';
47
47
  import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
48
48
  import {
49
- createPassThroughOnKeyHandler,
50
49
  EDITOR_LANGUAGE,
51
50
  EDITOR_THEME,
52
51
  TAB_SIZE,
@@ -191,13 +190,6 @@ const LambdaEditorInline = observer(
191
190
  : EDITOR_THEME.LEGEND,
192
191
  ...lambdaEditorOptions,
193
192
  });
194
- // NOTE: if we ever set any hotkey explicitly, we would like to use the disposer partern instead
195
- // else, we could risk triggering these hotkeys command multiple times
196
- // e.g.
197
- // const onKeyDownEventDisposer = useRef<IDisposable | undefined>(undefined);
198
- // onKeyDownEventDisposer.current?.dispose();
199
- // onKeyDownEventDisposer.current = editor.onKeyDown(() => ...)
200
- _editor.onKeyDown(() => createPassThroughOnKeyHandler());
201
193
  setEditor(_editor);
202
194
  }
203
195
  }, [editor, applicationStore, useBaseTextEditorSettings]);
@@ -472,13 +464,6 @@ const LambdaEditorPopUp = observer(
472
464
  language: EDITOR_LANGUAGE.PURE,
473
465
  theme: EDITOR_THEME.LEGEND,
474
466
  });
475
- // NOTE: if we ever set any hotkey explicitly, we would like to use the disposer partern instead
476
- // else, we could risk triggering these hotkeys command multiple times
477
- // e.g.
478
- // const onKeyDownEventDisposer = useRef<IDisposable | undefined>(undefined);
479
- // onKeyDownEventDisposer.current?.dispose();
480
- // onKeyDownEventDisposer.current = editor.onKeyDown(() => ...)
481
- _editor.onKeyDown(() => createPassThroughOnKeyHandler());
482
467
  setEditor(_editor);
483
468
  }
484
469
  };
@@ -0,0 +1,193 @@
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
+ DollarIcon,
19
+ DragPreviewLayer,
20
+ InfoCircleIcon,
21
+ PanelFormListItems,
22
+ PencilIcon,
23
+ TimesIcon,
24
+ useDragPreviewLayer,
25
+ } from '@finos/legend-art';
26
+ import type {
27
+ ValueSpecification,
28
+ VariableExpression,
29
+ } from '@finos/legend-graph';
30
+ import { observer } from 'mobx-react-lite';
31
+ import { useDrag } from 'react-dnd';
32
+ import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
33
+ import { getValueSpecificationStringValue } from '../../stores/shared/ValueSpecificationEditorHelper.js';
34
+ import {
35
+ type QueryBuilderVariableDragSource,
36
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
37
+ VariableInfoTooltip,
38
+ } from './BasicValueSpecificationEditor.js';
39
+
40
+ export const VariableViewer = observer(
41
+ (props: {
42
+ variable: VariableExpression;
43
+ queryBuilderState: QueryBuilderState;
44
+ isReadOnly: boolean;
45
+ constantValue?: ValueSpecification | undefined;
46
+ actions?: {
47
+ editVariable: () => void;
48
+ deleteVariable: () => void;
49
+ };
50
+ }) => {
51
+ const { variable, constantValue, actions, isReadOnly, queryBuilderState } =
52
+ props;
53
+ const valueString = constantValue
54
+ ? getValueSpecificationStringValue(constantValue)
55
+ : undefined;
56
+ const name = variable.name;
57
+ const variableType = variable.genericType?.value.rawType;
58
+ const typeName = variableType?.name;
59
+ const isVariableUsed = queryBuilderState.isVariableUsed(variable);
60
+ const deleteDisabled = isReadOnly || isVariableUsed;
61
+ const deleteTitle = isVariableUsed ? 'Used in query' : 'Remove';
62
+ const editVariable = (): void => {
63
+ actions?.editVariable();
64
+ };
65
+ const deleteVariable = (): void => {
66
+ actions?.deleteVariable();
67
+ };
68
+ const [, dragConnector, dragPreviewConnector] = useDrag(
69
+ () => ({
70
+ type: QUERY_BUILDER_VARIABLE_DND_TYPE,
71
+ item: { variable: variable },
72
+ }),
73
+ [variable],
74
+ );
75
+ useDragPreviewLayer(dragPreviewConnector);
76
+
77
+ return (
78
+ <div className="query-builder__variables__variable" ref={dragConnector}>
79
+ <DragPreviewLayer
80
+ labelGetter={(item: QueryBuilderVariableDragSource): string =>
81
+ item.variable.name === '' ? '(unknown)' : item.variable.name
82
+ }
83
+ types={[QUERY_BUILDER_VARIABLE_DND_TYPE]}
84
+ />
85
+ <div
86
+ onClick={editVariable}
87
+ className="query-builder__variables__variable__content"
88
+ >
89
+ <div className="query-builder__variables__variable__icon">
90
+ <div className="query-builder__variables__variable-icon">
91
+ {constantValue ? (
92
+ <div className="icon query-builder__variables__variable-icon">
93
+ C
94
+ </div>
95
+ ) : (
96
+ <DollarIcon />
97
+ )}
98
+ </div>
99
+ </div>
100
+ <div className="query-builder__variables__variable__label">
101
+ {name}
102
+ {valueString ? (
103
+ <div className="query-builder__constants__value">
104
+ {valueString}
105
+ </div>
106
+ ) : (
107
+ <div className="query-builder__variables__variable__type">
108
+ <div className="query-builder__variables__variable__type__label">
109
+ {typeName}
110
+ </div>
111
+ </div>
112
+ )}
113
+ </div>
114
+ </div>
115
+ {actions && (
116
+ <div className="query-builder__variables__variable__actions">
117
+ <button
118
+ className="query-builder__variables__variable__action"
119
+ tabIndex={-1}
120
+ disabled={isReadOnly}
121
+ onClick={editVariable}
122
+ title="Edit"
123
+ >
124
+ <PencilIcon />
125
+ </button>
126
+ <button
127
+ className="query-builder__variables__variable__action"
128
+ tabIndex={-1}
129
+ onClick={deleteVariable}
130
+ disabled={deleteDisabled}
131
+ title={deleteTitle}
132
+ >
133
+ <TimesIcon />
134
+ </button>
135
+ <VariableInfoTooltip variable={variable}>
136
+ <div className="value-spec-editor__variable__info">
137
+ <InfoCircleIcon />
138
+ </div>
139
+ </VariableInfoTooltip>
140
+ </div>
141
+ )}
142
+ </div>
143
+ );
144
+ },
145
+ );
146
+
147
+ export const VariableSelector = observer(
148
+ (props: {
149
+ queryBuilderState: QueryBuilderState;
150
+ filterBy?: (variableExpression: VariableExpression) => boolean;
151
+ }) => {
152
+ const { queryBuilderState, filterBy } = props;
153
+ const isReadOnly = !queryBuilderState.isQuerySupported;
154
+ const filteredParameterStates =
155
+ queryBuilderState.parametersState.parameterStates.filter((p) =>
156
+ filterBy ? filterBy(p.parameter) : true,
157
+ );
158
+ const filteredConstantState =
159
+ queryBuilderState.constantState.constants.filter((c) =>
160
+ filterBy ? filterBy(c.variable) : true,
161
+ );
162
+ return (
163
+ <>
164
+ <PanelFormListItems title="Available parameters">
165
+ {filteredParameterStates.length === 0 && (
166
+ <> No available parameters </>
167
+ )}
168
+ {filteredParameterStates.map((pState) => (
169
+ <VariableViewer
170
+ key={pState.uuid}
171
+ variable={pState.parameter}
172
+ isReadOnly={isReadOnly}
173
+ queryBuilderState={queryBuilderState}
174
+ />
175
+ ))}
176
+ </PanelFormListItems>
177
+ {Boolean(filteredConstantState.length) && (
178
+ <PanelFormListItems title="Available constants">
179
+ {filteredConstantState.map((constantState) => (
180
+ <VariableViewer
181
+ key={constantState.uuid}
182
+ variable={constantState.variable}
183
+ constantValue={constantState.value}
184
+ queryBuilderState={queryBuilderState}
185
+ isReadOnly={isReadOnly}
186
+ />
187
+ ))}
188
+ </PanelFormListItems>
189
+ )}
190
+ </>
191
+ );
192
+ },
193
+ );
@@ -24,7 +24,6 @@ import {
24
24
  ModalBody,
25
25
  ModalFooter,
26
26
  ModalHeader,
27
- PanelFormListItems,
28
27
  PanelFormSection,
29
28
  } from '@finos/legend-art';
30
29
  import {
@@ -37,14 +36,14 @@ import {
37
36
  import { observer } from 'mobx-react-lite';
38
37
  import { useCallback } from 'react';
39
38
  import { useDrop } from 'react-dnd';
40
- import {
41
- type QueryBuilderParameterDragSource,
42
- QUERY_BUILDER_PARAMETER_DND_TYPE,
43
- } from '../../stores/QueryBuilderParametersState.js';
44
39
  import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
45
40
  import type { QueryBuilderWatermarkState } from '../../stores/watermark/QueryBuilderWatermarkState.js';
46
- import { VariableExpressionViewer } from '../QueryBuilderParametersPanel.js';
47
- import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
41
+ import {
42
+ BasicValueSpecificationEditor,
43
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
44
+ type QueryBuilderVariableDragSource,
45
+ } from '../shared/BasicValueSpecificationEditor.js';
46
+ import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
48
47
 
49
48
  const isParamaterCompatibleWithWaterMark = (
50
49
  parameter: VariableExpression,
@@ -62,24 +61,24 @@ const WatermarkValueEditor = observer(
62
61
  const graph = watermarkState.queryBuilderState.graphManagerState.graph;
63
62
 
64
63
  const handleDrop = useCallback(
65
- (item: QueryBuilderParameterDragSource): void => {
66
- watermarkState.setValue(item.variable.parameter);
64
+ (item: QueryBuilderVariableDragSource): void => {
65
+ watermarkState.setValue(item.variable);
67
66
  },
68
67
  [watermarkState],
69
68
  );
70
69
 
71
70
  const [{ isParameterValueDragOver }, dropTargetConnector] = useDrop<
72
- QueryBuilderParameterDragSource,
71
+ QueryBuilderVariableDragSource,
73
72
  void,
74
73
  { isParameterValueDragOver: boolean }
75
74
  >(
76
75
  () => ({
77
- accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
76
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
78
77
  drop: (item, monitor): void => {
79
78
  if (
80
79
  !monitor.didDrop() &&
81
80
  // Only allows parameters with muliplicity 1 and type string
82
- isParamaterCompatibleWithWaterMark(item.variable.parameter)
81
+ isParamaterCompatibleWithWaterMark(item.variable)
83
82
  ) {
84
83
  handleDrop(item);
85
84
  } // prevent drop event propagation to accomondate for nested DnD
@@ -95,7 +94,7 @@ const WatermarkValueEditor = observer(
95
94
 
96
95
  return (
97
96
  <PanelFormSection>
98
- <div className="query-builder__parameter-editor">
97
+ <div className="query-builder__variable-editor">
99
98
  <PanelDropZone
100
99
  isDragOver={isParameterValueDragOver}
101
100
  dropTargetConnector={dropTargetConnector}
@@ -115,6 +114,9 @@ const WatermarkValueEditor = observer(
115
114
  resetValue={(): void => {
116
115
  watermarkState.resetValue();
117
116
  }}
117
+ isConstant={watermarkState.queryBuilderState.constantState.isValueSpecConstant(
118
+ watermarkValue,
119
+ )}
118
120
  />
119
121
  </PanelDropZone>
120
122
  </div>
@@ -130,10 +132,6 @@ export const QueryBuilderWatermarkEditor = observer(
130
132
  const handleClose = (): void => {
131
133
  watermarkState.setIsEditingWatermark(false);
132
134
  };
133
- const compatibleParameters =
134
- queryBuilderState.parametersState.parameterStates.filter((p) =>
135
- isParamaterCompatibleWithWaterMark(p.parameter),
136
- );
137
135
 
138
136
  return (
139
137
  <Dialog
@@ -162,20 +160,10 @@ export const QueryBuilderWatermarkEditor = observer(
162
160
  watermarkValue={watermarkState.value}
163
161
  />
164
162
  <PanelDivider />
165
- <PanelFormListItems title="List of available parameters">
166
- {compatibleParameters.length === 0 && (
167
- <> No available parameters </>
168
- )}
169
- {compatibleParameters.map((parameter) => (
170
- <VariableExpressionViewer
171
- key={parameter.uuid}
172
- queryBuilderState={queryBuilderState}
173
- variableExpressionState={parameter}
174
- isReadOnly={true}
175
- hideActions={true}
176
- />
177
- ))}
178
- </PanelFormListItems>
163
+ <VariableSelector
164
+ filterBy={isParamaterCompatibleWithWaterMark}
165
+ queryBuilderState={queryBuilderState}
166
+ />
179
167
  </>
180
168
  )}
181
169
  </PanelForm>
@@ -17,6 +17,8 @@
17
17
  export enum QUERY_BUILDER_HASH_STRUCTURE {
18
18
  // parameters state
19
19
  PARAMETERS_STATE = 'PARAMETERS_STATE',
20
+ CONSTANT_STATE = 'CONSTANT_STATE',
21
+ CONSTANT_EXPRESSION_STATE = 'CONSTANT_EXPRESSION_STATE',
20
22
 
21
23
  // projection state
22
24
  AGGREGATE_OPERATOR_AVERAGE = 'AGGREGATE_OPERATOR_AVERAGE',
@@ -21,6 +21,7 @@ export enum QUERY_BUILDER_SOURCE_ID_LABEL {
21
21
 
22
22
  export const DEFAULT_LAMBDA_VARIABLE_NAME = 'x';
23
23
  export const DEFAULT_VARIABLE_NAME = 'var';
24
+ export const DEFAULT_CONSTANT_VARIABLE_NAME = 'c_var';
24
25
  export const DEFAULT_POST_FILTER_LAMBDA_VARIABLE_NAME = 'row';
25
26
 
26
27
  export const QUERY_BUILDER_PROPERTY_SEARCH_MAX_DEPTH = 5;