@finos/legend-query-builder 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +11 -2
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
  5. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
  6. package/lib/components/QueryBuilderConstantExpressionPanel.js +104 -0
  7. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
  8. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderDiffPanel.js +1 -2
  10. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  11. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -9
  12. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  13. package/lib/components/QueryBuilderParametersPanel.js +10 -30
  14. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  15. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  16. package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  18. package/lib/components/QueryBuilderSideBar.d.ts +2 -1
  19. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  20. package/lib/components/QueryBuilderSideBar.js +6 -14
  21. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  22. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  23. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
  24. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  25. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +2 -2
  26. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
  27. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
  28. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
  29. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  30. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
  31. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  32. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
  33. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  34. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  35. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
  36. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  37. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  38. package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
  39. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  40. package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
  41. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  42. package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
  43. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  44. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  45. package/lib/components/shared/LambdaEditor.js +1 -15
  46. package/lib/components/shared/LambdaEditor.js.map +1 -1
  47. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +36 -0
  48. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  49. package/lib/components/shared/QueryBuilderVariableSelector.js +50 -0
  50. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  51. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  52. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  53. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  54. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  55. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  56. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  57. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  58. package/lib/index.css +17 -1
  59. package/lib/index.css.map +1 -1
  60. package/lib/package.json +8 -8
  61. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  62. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  63. package/lib/stores/QueryBuilderConfig.js +1 -0
  64. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  65. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  66. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  67. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  68. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  69. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  70. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  71. package/lib/stores/QueryBuilderParametersState.js +0 -1
  72. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  73. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  74. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  75. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  76. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  77. package/lib/stores/QueryBuilderResultState.d.ts +1 -2
  78. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  79. package/lib/stores/QueryBuilderResultState.js +7 -12
  80. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  81. package/lib/stores/QueryBuilderState.d.ts +9 -3
  82. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  83. package/lib/stores/QueryBuilderState.js +19 -4
  84. package/lib/stores/QueryBuilderState.js.map +1 -1
  85. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  86. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  87. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  88. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  89. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +32 -29
  91. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  92. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  93. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  94. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  95. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  96. package/lib/stores/QueryBuilderValueSpecificationHelper.js +4 -20
  97. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  98. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  99. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  100. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  101. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  102. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -1
  103. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  104. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +2 -2
  105. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  106. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  107. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  108. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  109. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  110. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  111. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  112. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  113. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  114. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  115. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  116. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  117. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  118. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  119. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  120. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  121. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  122. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  123. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  124. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  125. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  126. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  127. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  128. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  129. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  130. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  131. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  132. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  133. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  134. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  135. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  136. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  137. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  138. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  139. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  140. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  141. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  142. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  143. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  144. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  145. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  146. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  147. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  148. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  149. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  150. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  151. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  152. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  153. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  154. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +6 -2
  155. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  156. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +20 -20
  157. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  158. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  159. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  160. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  161. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  162. package/lib/stores/shared/LambdaParameterState.d.ts +14 -2
  163. package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -1
  164. package/lib/stores/shared/LambdaParameterState.js +79 -6
  165. package/lib/stores/shared/LambdaParameterState.js.map +1 -1
  166. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  167. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  168. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  169. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  170. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  171. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  172. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  173. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  174. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  175. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  176. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  177. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  178. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  179. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  180. package/package.json +15 -15
  181. package/src/components/QueryBuilder.tsx +38 -0
  182. package/src/components/QueryBuilderConstantExpressionPanel.tsx +284 -0
  183. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  184. package/src/components/QueryBuilderParametersPanel.tsx +24 -110
  185. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  186. package/src/components/QueryBuilderSideBar.tsx +5 -22
  187. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  188. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  189. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  190. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  191. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  192. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  193. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  194. package/src/components/shared/LambdaEditor.tsx +0 -15
  195. package/src/components/shared/QueryBuilderVariableSelector.tsx +186 -0
  196. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  197. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  198. package/src/stores/QueryBuilderConfig.ts +1 -0
  199. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  200. package/src/stores/QueryBuilderParametersState.ts +0 -6
  201. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  202. package/src/stores/QueryBuilderResultState.ts +19 -17
  203. package/src/stores/QueryBuilderState.ts +25 -4
  204. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  205. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +48 -58
  206. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  207. package/src/stores/QueryBuilderValueSpecificationHelper.ts +10 -29
  208. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  209. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +2 -2
  210. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  211. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  212. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  213. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  214. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  215. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  216. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  217. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  218. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  219. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  220. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  221. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  222. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  223. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +55 -39
  224. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  225. package/src/stores/shared/LambdaParameterState.ts +151 -10
  226. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  227. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  228. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  229. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  230. package/tsconfig.json +14 -6
  231. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  232. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  233. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  234. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  235. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  236. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  237. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  238. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  239. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  240. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  241. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  242. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -38,7 +38,6 @@ import {
38
38
  Class,
39
39
  getMilestoneTemporalStereotype,
40
40
  DerivedProperty,
41
- MILESTONING_STEREOTYPE,
42
41
  PackageableElementExplicitReference,
43
42
  Multiplicity,
44
43
  CollectionInstanceValue,
@@ -55,7 +54,10 @@ import {
55
54
  UnsupportedOperationError,
56
55
  } from '@finos/legend-shared';
57
56
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
58
- import { getDerivedPropertyMilestoningSteoreotype } from './QueryBuilderPropertyEditorState.js';
57
+ import {
58
+ getDerivedPropertyMilestoningSteoreotype,
59
+ validateMilestoningPropertyExpressionChain,
60
+ } from './milestoning/QueryBuilderMilestoningHelper.js';
59
61
 
60
62
  export const getNonCollectionValueSpecificationType = (
61
63
  valueSpecification: ValueSpecification,
@@ -209,6 +211,7 @@ export const generateDefaultValueForPrimitiveType = (
209
211
  case PRIMITIVE_TYPE.DECIMAL:
210
212
  case PRIMITIVE_TYPE.FLOAT:
211
213
  case PRIMITIVE_TYPE.INTEGER:
214
+ case PRIMITIVE_TYPE.BINARY:
212
215
  return 0;
213
216
  case PRIMITIVE_TYPE.DATE:
214
217
  case PRIMITIVE_TYPE.STRICTDATE:
@@ -301,33 +304,11 @@ export const validatePropertyExpressionChain = (
301
304
  guaranteeType(func, DerivedProperty),
302
305
  graph,
303
306
  );
304
- if (
305
- sourceStereotype !== MILESTONING_STEREOTYPE.BITEMPORAL &&
306
- targetStereotype !== sourceStereotype
307
- ) {
308
- if (targetStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
309
- if (
310
- propertyExpression.parametersValues.length !== 3 &&
311
- !sourceStereotype
312
- ) {
313
- throw new UnsupportedOperationError(
314
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have exactly two parameters`,
315
- );
316
- } else if (propertyExpression.parametersValues.length < 2) {
317
- throw new UnsupportedOperationError(
318
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have at least one parameter`,
319
- );
320
- } else if (propertyExpression.parametersValues.length > 3) {
321
- throw new UnsupportedOperationError(
322
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should not have more than two parameters`,
323
- );
324
- }
325
- } else if (propertyExpression.parametersValues.length !== 2) {
326
- throw new UnsupportedOperationError(
327
- `Property of milestoning sterotype '${targetStereotype}' should have exactly one parameter`,
328
- );
329
- }
330
- }
307
+ validateMilestoningPropertyExpressionChain(
308
+ sourceStereotype,
309
+ targetStereotype,
310
+ propertyExpression,
311
+ );
331
312
  }
332
313
  }
333
314
  }
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  GraphFetchTreeInstanceValue,
19
20
  matchFunctionName,
20
21
  RootGraphFetchTree,
@@ -31,6 +32,7 @@ import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
31
32
  export const processGraphFetchExpression = (
32
33
  expression: SimpleFunctionExpression,
33
34
  queryBuilderState: QueryBuilderState,
35
+ parentLambda: LambdaFunction,
34
36
  ): void => {
35
37
  const functionName = expression.functionName;
36
38
 
@@ -55,6 +57,7 @@ export const processGraphFetchExpression = (
55
57
  );
56
58
  QueryBuilderValueSpecificationProcessor.process(
57
59
  precedingExpression,
60
+ parentLambda,
58
61
  queryBuilderState,
59
62
  );
60
63
 
@@ -77,6 +80,7 @@ export const processGraphFetchExpression = (
77
80
  export const processGraphFetchSerializeExpression = (
78
81
  expression: SimpleFunctionExpression,
79
82
  queryBuilderState: QueryBuilderState,
83
+ parentLambda: LambdaFunction,
80
84
  ): void => {
81
85
  // update fetch-structure
82
86
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -104,6 +108,7 @@ export const processGraphFetchSerializeExpression = (
104
108
  );
105
109
  QueryBuilderValueSpecificationProcessor.process(
106
110
  precedingExpression,
111
+ parentLambda,
107
112
  queryBuilderState,
108
113
  );
109
114
 
@@ -91,9 +91,9 @@ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecifi
91
91
  import { appendProjection } from './projection/QueryBuilderProjectionValueSpecificationBuilder.js';
92
92
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graphManager/QueryBuilderSupportedFunctions.js';
93
93
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
94
- import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState_.js';
94
+ import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState.js';
95
95
  import type { QueryBuilderTDS_OLAPOperator } from './olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js';
96
- import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js';
96
+ import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js';
97
97
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
98
98
 
99
99
  export class QueryBuilderTDSState
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  CollectionInstanceValue,
19
20
  LambdaFunctionInstanceValue,
20
21
  matchFunctionName,
@@ -41,6 +42,7 @@ export const processTDSAggregateExpression = (
41
42
  expression: SimpleFunctionExpression,
42
43
  parentExpression: SimpleFunctionExpression | undefined,
43
44
  queryBuilderState: QueryBuilderState,
45
+ parentLambda: LambdaFunction,
44
46
  ): void => {
45
47
  // check parent expression
46
48
  assertTrue(
@@ -65,6 +67,7 @@ export const processTDSAggregateExpression = (
65
67
  // TODO?: do we want to do more validation here for the shape of the column lambda?
66
68
  guaranteeNonNullable(expression.parametersValues[0]),
67
69
  expression,
70
+ parentLambda,
68
71
  queryBuilderState,
69
72
  );
70
73
 
@@ -137,6 +140,7 @@ export const processTDSAggregateExpression = (
137
140
  export const processTDSGroupByExpression = (
138
141
  expression: SimpleFunctionExpression,
139
142
  queryBuilderState: QueryBuilderState,
143
+ parentLambda: LambdaFunction,
140
144
  ): void => {
141
145
  // update fetch-structureTABULAR_DATA_STRUCTURE
142
146
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -164,6 +168,7 @@ export const processTDSGroupByExpression = (
164
168
  );
165
169
  QueryBuilderValueSpecificationProcessor.process(
166
170
  precedingExpression,
171
+ parentLambda,
167
172
  queryBuilderState,
168
173
  );
169
174
 
@@ -178,6 +183,7 @@ export const processTDSGroupByExpression = (
178
183
  QueryBuilderValueSpecificationProcessor.processChild(
179
184
  value,
180
185
  expression,
186
+ parentLambda,
181
187
  queryBuilderState,
182
188
  ),
183
189
  );
@@ -193,6 +199,7 @@ export const processTDSGroupByExpression = (
193
199
  QueryBuilderValueSpecificationProcessor.processChild(
194
200
  value,
195
201
  expression,
202
+ parentLambda,
196
203
  queryBuilderState,
197
204
  ),
198
205
  );
@@ -44,11 +44,12 @@ import {
44
44
  QueryBuilderOLAPGroupByColumnState,
45
45
  QueryBuilderTDS_OLAPAggreationOperatorState,
46
46
  QueryBuilderTDS_OLAPRankOperatorState,
47
- } from './QueryBuilderOLAPGroupByState_.js';
47
+ } from './QueryBuilderOLAPGroupByState.js';
48
48
 
49
49
  export const processTDS_OLAPGroupByExpression = (
50
50
  expression: SimpleFunctionExpression,
51
51
  queryBuilderState: QueryBuilderState,
52
+ parentLambda: LambdaFunction,
52
53
  ): void => {
53
54
  // check parameters
54
55
  const parametersLength = expression.parametersValues.length;
@@ -90,6 +91,7 @@ export const processTDS_OLAPGroupByExpression = (
90
91
  );
91
92
  QueryBuilderValueSpecificationProcessor.process(
92
93
  precedingExpression,
94
+ parentLambda,
93
95
  queryBuilderState,
94
96
  );
95
97
 
@@ -34,7 +34,7 @@ import {
34
34
  type QueryBuilderOLAPGroupByColumnState,
35
35
  type QueryBuilderOLAPGroupByState,
36
36
  QueryBuilderTDS_OLAPAggreationOperatorState,
37
- } from './QueryBuilderOLAPGroupByState_.js';
37
+ } from './QueryBuilderOLAPGroupByState.js';
38
38
 
39
39
  const appendOLAPGroupByColumnState = (
40
40
  olapGroupByColumnState: QueryBuilderOLAPGroupByColumnState,
@@ -17,7 +17,7 @@
17
17
  import { Multiplicity } from '@finos/legend-graph';
18
18
  import { UnsupportedOperationError } from '@finos/legend-shared';
19
19
  import { QueryBuilderAggregateColumnState } from '../../aggregation/QueryBuilderAggregationState.js';
20
- import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState_.js';
20
+ import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState.js';
21
21
  import { QueryBuilderSimpleProjectionColumnState } from '../../projection/QueryBuilderProjectionColumnState.js';
22
22
  import type { QueryBuilderTDSColumnState } from '../../QueryBuilderTDSColumnState.js';
23
23
 
@@ -17,6 +17,7 @@
17
17
  import {
18
18
  type INTERNAL__UnknownValueSpecification,
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  AbstractPropertyExpression,
21
22
  CollectionInstanceValue,
22
23
  DerivedProperty,
@@ -59,6 +60,7 @@ import {
59
60
  export const processTDSProjectExpression = (
60
61
  expression: SimpleFunctionExpression,
61
62
  queryBuilderState: QueryBuilderState,
63
+ parentLambda: LambdaFunction,
62
64
  ): void => {
63
65
  // update fetch-structure
64
66
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -87,6 +89,7 @@ export const processTDSProjectExpression = (
87
89
  );
88
90
  QueryBuilderValueSpecificationProcessor.process(
89
91
  precedingExpression,
92
+ parentLambda,
90
93
  queryBuilderState,
91
94
  );
92
95
 
@@ -101,6 +104,7 @@ export const processTDSProjectExpression = (
101
104
  QueryBuilderValueSpecificationProcessor.processChild(
102
105
  value,
103
106
  expression,
107
+ parentLambda,
104
108
  queryBuilderState,
105
109
  ),
106
110
  );
@@ -236,6 +240,7 @@ export const processTDSProjectionDerivationExpression = (
236
240
  export const processTDSTakeExpression = (
237
241
  expression: SimpleFunctionExpression,
238
242
  queryBuilderState: QueryBuilderState,
243
+ parentLambda: LambdaFunction,
239
244
  ): void => {
240
245
  // check parameters
241
246
  assertTrue(
@@ -263,6 +268,7 @@ export const processTDSTakeExpression = (
263
268
  );
264
269
  QueryBuilderValueSpecificationProcessor.process(
265
270
  precedingExpression,
271
+ parentLambda,
266
272
  queryBuilderState,
267
273
  );
268
274
 
@@ -283,6 +289,7 @@ export const processTDSTakeExpression = (
283
289
  export const processTDSDistinctExpression = (
284
290
  expression: SimpleFunctionExpression,
285
291
  queryBuilderState: QueryBuilderState,
292
+ parentLambda: LambdaFunction,
286
293
  ): void => {
287
294
  // check parameters
288
295
  assertTrue(
@@ -309,6 +316,7 @@ export const processTDSDistinctExpression = (
309
316
  );
310
317
  QueryBuilderValueSpecificationProcessor.process(
311
318
  precedingExpression,
319
+ parentLambda,
312
320
  queryBuilderState,
313
321
  );
314
322
 
@@ -326,6 +334,7 @@ export const processTDSDistinctExpression = (
326
334
  export const processTDSSortExpression = (
327
335
  expression: SimpleFunctionExpression,
328
336
  queryBuilderState: QueryBuilderState,
337
+ parentLambda: LambdaFunction,
329
338
  ): void => {
330
339
  // check parameters
331
340
  assertTrue(
@@ -353,6 +362,7 @@ export const processTDSSortExpression = (
353
362
  );
354
363
  QueryBuilderValueSpecificationProcessor.process(
355
364
  precedingExpression,
365
+ parentLambda,
356
366
  queryBuilderState,
357
367
  );
358
368
 
@@ -367,6 +377,7 @@ export const processTDSSortExpression = (
367
377
  QueryBuilderValueSpecificationProcessor.processChild(
368
378
  value,
369
379
  expression,
380
+ parentLambda,
370
381
  queryBuilderState,
371
382
  ),
372
383
  );
@@ -47,7 +47,7 @@ import {
47
47
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graphManager/QueryBuilderSupportedFunctions.js';
48
48
  import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
49
49
  import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
50
- import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js';
50
+ import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js';
51
51
  import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
52
52
 
53
53
  const buildSortExpression = (
@@ -17,6 +17,7 @@
17
17
  import { isNonNullable, guaranteeNonNullable } from '@finos/legend-shared';
18
18
  import {
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  extractElementNameFromPath,
21
22
  SimpleFunctionExpression,
22
23
  } from '@finos/legend-graph';
@@ -80,22 +81,25 @@ const buildFilterConditionExpression = (
80
81
 
81
82
  export const buildFilterExpression = (
82
83
  filterState: QueryBuilderFilterState,
83
- getAllFunc: SimpleFunctionExpression,
84
- ): SimpleFunctionExpression | undefined => {
84
+ lambdaFunction: LambdaFunction,
85
+ ): void => {
85
86
  const filterConditionExpressions = filterState.rootIds
86
87
  .map((e) => guaranteeNonNullable(filterState.nodes.get(e)))
87
88
  .map((e) => buildFilterConditionExpression(filterState, e))
88
89
  .filter(isNonNullable);
89
90
 
90
91
  if (!filterConditionExpressions.length) {
91
- return undefined;
92
+ return;
92
93
  }
93
94
  // main filter expression
94
95
  const filterExpression = new SimpleFunctionExpression(
95
96
  extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER),
96
97
  );
98
+ const currentExpression = guaranteeNonNullable(
99
+ lambdaFunction.expressionSequence[0],
100
+ );
97
101
  // param [0]
98
- filterExpression.parametersValues.push(getAllFunc);
102
+ filterExpression.parametersValues.push(currentExpression);
99
103
  // param [1]
100
104
  filterExpression.parametersValues.push(
101
105
  buildGenericLambdaFunctionInstanceValue(
@@ -104,5 +108,6 @@ export const buildFilterExpression = (
104
108
  filterState.queryBuilderState.graphManagerState.graph,
105
109
  ),
106
110
  );
107
- return filterExpression;
111
+ // reprocess filter as main expression
112
+ lambdaFunction.expressionSequence[0] = filterExpression;
108
113
  };
@@ -0,0 +1,165 @@
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 ValueSpecification,
19
+ PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
20
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
21
+ type SimpleFunctionExpression,
22
+ AbstractPropertyExpression,
23
+ MILESTONING_STEREOTYPE,
24
+ INTERNAL__PropagatedValue,
25
+ } from '@finos/legend-graph';
26
+ import {
27
+ assertTrue,
28
+ guaranteeNonNullable,
29
+ guaranteeType,
30
+ } from '@finos/legend-shared';
31
+ import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
32
+ import type { QueryBuilderDerivedPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
33
+ import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
34
+
35
+ export class QueryBuilderBitemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
36
+ getMilestoningDate(index?: number): ValueSpecification | undefined {
37
+ if (index === 0) {
38
+ return this.milestoningState.processingDate;
39
+ } else {
40
+ return this.milestoningState.businessDate;
41
+ }
42
+ }
43
+
44
+ getMilestoningToolTipText(): string {
45
+ return `Processing Date: ${getParameterValue(
46
+ this.getMilestoningDate(0),
47
+ )}, Business Date: ${getParameterValue(this.getMilestoningDate(1))}`;
48
+ }
49
+
50
+ initializeMilestoningParameters(force?: boolean): void {
51
+ if (!this.milestoningState.processingDate || force) {
52
+ this.milestoningState.setProcessingDate(
53
+ this.milestoningState.buildMilestoningParameter(
54
+ PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
55
+ ),
56
+ );
57
+ }
58
+ if (!this.milestoningState.businessDate || force) {
59
+ this.milestoningState.setBusinessDate(
60
+ this.milestoningState.buildMilestoningParameter(
61
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
62
+ ),
63
+ );
64
+ }
65
+ }
66
+
67
+ processGetAllParamaters(parameterValues: ValueSpecification[]): void {
68
+ assertTrue(
69
+ parameterValues.length === 3,
70
+ `Can't process getAll() expression: when used with a bitemporal milestoned class getAll() expects two parameters`,
71
+ );
72
+ this.milestoningState.setProcessingDate(parameterValues[1]);
73
+ this.milestoningState.setBusinessDate(parameterValues[2]);
74
+ }
75
+
76
+ buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
77
+ getAllFunction.parametersValues.push(
78
+ guaranteeNonNullable(
79
+ this.getMilestoningDate(0),
80
+ `Milestoning class should have a parameter of type 'Date'`,
81
+ ),
82
+ );
83
+ getAllFunction.parametersValues.push(
84
+ guaranteeNonNullable(
85
+ this.getMilestoningDate(1),
86
+ `Milestoning class should have a parameter of type 'Date'`,
87
+ ),
88
+ );
89
+ }
90
+
91
+ generateMilestoningDate(
92
+ isDatePropagationSupported: boolean,
93
+ hasDefaultMilestoningDate: boolean,
94
+ prevPropertyExpression: AbstractPropertyExpression | undefined,
95
+ temporalSource: MILESTONING_STEREOTYPE | undefined,
96
+ idx?: number,
97
+ derivedPropertyExpressionState?: QueryBuilderDerivedPropertyExpressionState,
98
+ ): ValueSpecification {
99
+ this.initializeMilestoningParameters();
100
+ if (idx === 0) {
101
+ if (
102
+ temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
103
+ derivedPropertyExpressionState?.parameterValues.length === 1
104
+ ) {
105
+ return new INTERNAL__PropagatedValue(() =>
106
+ guaranteeNonNullable(
107
+ guaranteeType(prevPropertyExpression, AbstractPropertyExpression)
108
+ .parametersValues[1],
109
+ ),
110
+ );
111
+ }
112
+ let parameter;
113
+ if (
114
+ isDatePropagationSupported &&
115
+ prevPropertyExpression &&
116
+ !hasDefaultMilestoningDate
117
+ ) {
118
+ parameter = new INTERNAL__PropagatedValue(() =>
119
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
120
+ );
121
+ } else {
122
+ parameter = new INTERNAL__PropagatedValue(() =>
123
+ guaranteeNonNullable(this.getMilestoningDate(idx)),
124
+ );
125
+ parameter.isPropagatedValue = hasDefaultMilestoningDate
126
+ ? false
127
+ : isDatePropagationSupported;
128
+ }
129
+ return parameter;
130
+ } else {
131
+ if (
132
+ temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL &&
133
+ derivedPropertyExpressionState?.parameterValues.length === 1
134
+ ) {
135
+ return new INTERNAL__PropagatedValue(() =>
136
+ guaranteeNonNullable(
137
+ guaranteeType(
138
+ derivedPropertyExpressionState.propertyExpression
139
+ .parametersValues[0],
140
+ AbstractPropertyExpression,
141
+ ).parametersValues[1],
142
+ ),
143
+ );
144
+ }
145
+ let parameter;
146
+ if (
147
+ isDatePropagationSupported &&
148
+ prevPropertyExpression &&
149
+ !hasDefaultMilestoningDate
150
+ ) {
151
+ parameter = new INTERNAL__PropagatedValue(() =>
152
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
153
+ );
154
+ } else {
155
+ parameter = new INTERNAL__PropagatedValue(() =>
156
+ guaranteeNonNullable(this.getMilestoningDate(idx)),
157
+ );
158
+ parameter.isPropagatedValue = hasDefaultMilestoningDate
159
+ ? false
160
+ : isDatePropagationSupported;
161
+ }
162
+ return parameter;
163
+ }
164
+ }
165
+ }
@@ -0,0 +1,96 @@
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 ValueSpecification,
19
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
20
+ type SimpleFunctionExpression,
21
+ type AbstractPropertyExpression,
22
+ MILESTONING_STEREOTYPE,
23
+ INTERNAL__PropagatedValue,
24
+ } from '@finos/legend-graph';
25
+ import { assertTrue, guaranteeNonNullable } from '@finos/legend-shared';
26
+ import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
27
+ import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
28
+
29
+ export class QueryBuilderBusinessTemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
30
+ getMilestoningDate(): ValueSpecification | undefined {
31
+ return this.milestoningState.businessDate;
32
+ }
33
+
34
+ getMilestoningToolTipText(): string {
35
+ return `Business Date: ${getParameterValue(this.getMilestoningDate())}`;
36
+ }
37
+
38
+ initializeMilestoningParameters(force?: boolean): void {
39
+ if (!this.milestoningState.businessDate || force) {
40
+ this.milestoningState.setBusinessDate(
41
+ this.milestoningState.buildMilestoningParameter(
42
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
43
+ ),
44
+ );
45
+ }
46
+ }
47
+
48
+ processGetAllParamaters(parameterValues: ValueSpecification[]): void {
49
+ assertTrue(
50
+ parameterValues.length === 2,
51
+ `Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
52
+ );
53
+ this.milestoningState.setBusinessDate(parameterValues[1]);
54
+ }
55
+
56
+ buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
57
+ getAllFunction.parametersValues.push(
58
+ guaranteeNonNullable(
59
+ this.getMilestoningDate(),
60
+ `Milestoning class should have a parameter of type 'Date'`,
61
+ ),
62
+ );
63
+ }
64
+
65
+ generateMilestoningDate(
66
+ isDatePropagationSupported: boolean,
67
+ hasDefaultMilestoningDate: boolean,
68
+ prevPropertyExpression: AbstractPropertyExpression | undefined,
69
+ temporalSource: MILESTONING_STEREOTYPE | undefined,
70
+ ): ValueSpecification {
71
+ this.initializeMilestoningParameters();
72
+ if (
73
+ isDatePropagationSupported &&
74
+ prevPropertyExpression &&
75
+ !hasDefaultMilestoningDate
76
+ ) {
77
+ if (temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL) {
78
+ return new INTERNAL__PropagatedValue(() =>
79
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
80
+ );
81
+ } else {
82
+ return new INTERNAL__PropagatedValue(() =>
83
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
84
+ );
85
+ }
86
+ } else {
87
+ const milestoningDate = new INTERNAL__PropagatedValue(() =>
88
+ guaranteeNonNullable(this.getMilestoningDate()),
89
+ );
90
+ milestoningDate.isPropagatedValue = hasDefaultMilestoningDate
91
+ ? false
92
+ : isDatePropagationSupported;
93
+ return milestoningDate;
94
+ }
95
+ }
96
+ }