@finos/legend-application-query 5.2.6 → 5.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +22 -11
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderResultPanel.js +12 -7
  6. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  7. package/lib/components/QueryBuilderSetupPanel.js +1 -1
  8. package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
  9. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +1 -2
  10. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  11. package/lib/components/explorer/QueryBuilderExplorerPanel.js +14 -16
  12. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  13. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +2 -2
  14. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
  15. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +22 -105
  17. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -2
  19. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  20. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +8 -10
  21. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +23 -17
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts +2 -2
  26. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js +15 -12
  28. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +2 -2
  30. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  31. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +23 -28
  32. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  33. package/lib/components/filter/QueryBuilderFilterPanel.js +7 -7
  34. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  35. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
  36. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +1 -1
  37. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
  38. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  39. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +5 -3
  40. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +7 -7
  44. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
  45. package/lib/stores/QueryBuilderPreviewDataHelper.js +17 -14
  46. package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
  47. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  48. package/lib/stores/QueryBuilderPropertyEditorState.js +34 -24
  49. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  50. package/lib/stores/QueryBuilderState.d.ts +1 -2
  51. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  52. package/lib/stores/QueryBuilderState.js +17 -26
  53. package/lib/stores/QueryBuilderState.js.map +1 -1
  54. package/lib/stores/QueryBuilderStateBuilder.d.ts +124 -0
  55. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -0
  56. package/lib/stores/QueryBuilderStateBuilder.js +310 -0
  57. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -0
  58. package/lib/stores/{QueryBuilderTestUtils.d.ts → QueryBuilderStateTestUtils.d.ts} +2 -2
  59. package/lib/stores/QueryBuilderStateTestUtils.d.ts.map +1 -0
  60. package/lib/stores/{QueryBuilderTestUtils.js → QueryBuilderStateTestUtils.js} +2 -2
  61. package/lib/stores/QueryBuilderStateTestUtils.js.map +1 -0
  62. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -1
  63. package/lib/stores/QueryBuilderTypeaheadHelper.js +14 -12
  64. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
  65. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +3 -11
  66. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  67. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +10 -319
  68. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  69. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +27 -0
  70. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -0
  71. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +153 -0
  72. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -0
  73. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +37 -1
  74. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  75. package/lib/stores/QueryBuilderValueSpecificationHelper.js +79 -2
  76. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  77. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +12 -11
  78. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  79. package/lib/stores/explorer/QueryBuilderExplorerState.js +53 -20
  80. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  81. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts +1 -1
  82. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts.map +1 -1
  83. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js +3 -1
  84. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js.map +1 -1
  85. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +17 -0
  86. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +10 -0
  88. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  89. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +3 -20
  90. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  91. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +31 -73
  92. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  93. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +17 -4
  94. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  95. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +110 -21
  96. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  97. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +20 -0
  98. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -0
  99. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +62 -0
  100. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -0
  101. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts +2 -1
  102. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
  103. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +3 -8
  104. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
  105. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts +9 -2
  106. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts.map +1 -1
  107. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js +28 -5
  108. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js.map +1 -1
  109. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js +2 -2
  110. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  111. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts +10 -2
  112. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts.map +1 -1
  113. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js +102 -39
  114. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js.map +1 -1
  115. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts +25 -0
  116. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -0
  117. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js +186 -0
  118. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js.map +1 -0
  119. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +9 -4
  120. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  121. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js +129 -13
  122. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  123. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts +20 -0
  124. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -0
  125. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js +96 -0
  126. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -0
  127. package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js +1 -1
  128. package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js.map +1 -1
  129. package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.d.ts → QueryBuilderPostFilterStateBuilder.d.ts} +4 -3
  130. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -0
  131. package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.js → QueryBuilderPostFilterStateBuilder.js} +30 -21
  132. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -0
  133. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.d.ts.map +1 -1
  134. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +1 -4
  135. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
  136. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +1 -1
  137. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  138. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +1 -1
  139. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  140. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +1 -1
  141. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  142. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +1 -1
  143. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  144. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +1 -1
  145. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
  146. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
  147. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
  148. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +1 -1
  149. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
  150. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +1 -1
  151. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  152. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +1 -1
  153. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
  154. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +1 -1
  155. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  156. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts +19 -0
  157. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -0
  158. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +74 -0
  159. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -0
  160. package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.d.ts → QueryBuilderFilterValueSpecificationBuilder.d.ts} +1 -1
  161. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -0
  162. package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.js → QueryBuilderFilterValueSpecificationBuilder.js} +1 -1
  163. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -0
  164. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.d.ts.map +1 -1
  165. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js +5 -5
  166. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js.map +1 -1
  167. package/package.json +14 -14
  168. package/src/components/QueryBuilder.tsx +47 -28
  169. package/src/components/QueryBuilderResultPanel.tsx +21 -14
  170. package/src/components/QueryBuilderSetupPanel.tsx +1 -1
  171. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +23 -38
  172. package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +2 -2
  173. package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +41 -175
  174. package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +9 -12
  175. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +62 -28
  176. package/src/components/fetch-structure/QueryBuilderProjectionPanel.tsx +74 -48
  177. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +33 -41
  178. package/src/components/filter/QueryBuilderFilterPanel.tsx +7 -7
  179. package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +3 -1
  180. package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +5 -8
  181. package/src/stores/QueryBuilderPreviewDataHelper.ts +27 -18
  182. package/src/stores/QueryBuilderPropertyEditorState.ts +40 -31
  183. package/src/stores/QueryBuilderState.ts +26 -32
  184. package/src/stores/QueryBuilderStateBuilder.ts +584 -0
  185. package/src/stores/{QueryBuilderTestUtils.ts → QueryBuilderStateTestUtils.ts} +1 -1
  186. package/src/stores/QueryBuilderTypeaheadHelper.ts +23 -16
  187. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +24 -584
  188. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +248 -0
  189. package/src/stores/QueryBuilderValueSpecificationHelper.ts +114 -0
  190. package/src/stores/explorer/QueryBuilderExplorerState.ts +73 -33
  191. package/src/stores/explorer/QueryBuilderPropertySearchPanelState.ts +3 -1
  192. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +33 -2
  193. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +53 -118
  194. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +166 -26
  195. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +131 -0
  196. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +10 -19
  197. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.ts +68 -4
  198. package/src/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.ts +2 -2
  199. package/src/stores/fetch-structure/projection/QueryBuilderProjectionState.ts +172 -67
  200. package/src/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.ts +426 -0
  201. package/src/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +266 -21
  202. package/src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.ts +228 -0
  203. package/src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.ts +1 -1
  204. package/src/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.ts → QueryBuilderPostFilterStateBuilder.ts} +68 -48
  205. package/src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +1 -11
  206. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +1 -1
  207. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +1 -1
  208. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +1 -1
  209. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +1 -1
  210. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +1 -1
  211. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
  212. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +1 -1
  213. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +1 -1
  214. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +1 -1
  215. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +1 -1
  216. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +155 -0
  217. package/src/stores/filter/{QueryBuilderValueSpecificationBuilder.ts → QueryBuilderFilterValueSpecificationBuilder.ts} +0 -0
  218. package/src/stores/filter/operators/QueryBuilderFilterOperatorHelper.ts +5 -5
  219. package/tsconfig.json +10 -5
  220. package/tsconfig.package.json +1 -1
  221. package/lib/stores/QueryBuilderTestUtils.d.ts.map +0 -1
  222. package/lib/stores/QueryBuilderTestUtils.js.map +0 -1
  223. package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts +0 -56
  224. package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts.map +0 -1
  225. package/lib/stores/QueryBuilderValueSpecificationProcessor.js +0 -548
  226. package/lib/stores/QueryBuilderValueSpecificationProcessor.js.map +0 -1
  227. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.d.ts.map +0 -1
  228. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.js.map +0 -1
  229. package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.d.ts.map +0 -1
  230. package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.js.map +0 -1
  231. package/src/stores/QueryBuilderValueSpecificationProcessor.ts +0 -1254
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFetchStructureImplementationState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F,8BAAsB,6CAA6C;IACjE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mBAAmB,EAAE,+BAA+B,CAAC;gBAGnD,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;CAQvD"}
1
+ {"version":3,"file":"QueryBuilderFetchStructureImplementationState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,0CAA0C,CAAC;AACzG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACrG,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F,oBAAY,8BAA8B;IACxC,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC5B;AAED,8BAAsB,6CAA6C;IACjE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mBAAmB,EAAE,+BAA+B,CAAC;gBAGnD,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;IAWtD,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC;IAC5B,QAAQ,KAAK,+BAA+B,IAAI,MAAM,EAAE,CAAC;IACzD,QAAQ,KAAK,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;IACvD,QAAQ,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;IAC5E,QAAQ,CAAC,qBAAqB,IAAI,IAAI;IACtC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,wCAAwC,GAAG,IAAI;IAC5E,QAAQ,CAAC,eAAe,CACtB,KAAK,EAAE,wCAAwC,EAAE,GAChD,IAAI;IACP,QAAQ,CAAC,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACtE,QAAQ,CAAC,oBAAoB,CAC3B,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,2BAA2B,GACpC,IAAI;CACR"}
@@ -13,10 +13,20 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { computed, makeObservable } from 'mobx';
17
+ export var FETCH_STRUCTURE_IMPLEMENTATION;
18
+ (function (FETCH_STRUCTURE_IMPLEMENTATION) {
19
+ FETCH_STRUCTURE_IMPLEMENTATION["PROJECTION"] = "PROJECTION";
20
+ FETCH_STRUCTURE_IMPLEMENTATION["GRAPH_FETCH"] = "GRAPH_FETCH";
21
+ })(FETCH_STRUCTURE_IMPLEMENTATION = FETCH_STRUCTURE_IMPLEMENTATION || (FETCH_STRUCTURE_IMPLEMENTATION = {}));
16
22
  export class QueryBuilderFetchStructureImplementationState {
17
23
  queryBuilderState;
18
24
  fetchStructureState;
19
25
  constructor(queryBuilderState, fetchStructureState) {
26
+ makeObservable(this, {
27
+ usedExplorerTreePropertyNodeIDs: computed,
28
+ validationIssues: computed,
29
+ });
20
30
  this.queryBuilderState = queryBuilderState;
21
31
  this.fetchStructureState = fetchStructureState;
22
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFetchStructureImplementationState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,OAAgB,6CAA6C;IACjE,iBAAiB,CAAoB;IACrC,mBAAmB,CAAkC;IAErD,YACE,iBAAoC,EACpC,mBAAoD;QAEpD,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;CAIF"}
1
+ {"version":3,"file":"QueryBuilderFetchStructureImplementationState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAMhD,MAAM,CAAN,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACxC,2DAAyB,CAAA;IACzB,6DAA2B,CAAA;AAC7B,CAAC,EAHW,8BAA8B,GAA9B,8BAA8B,KAA9B,8BAA8B,QAGzC;AAED,MAAM,OAAgB,6CAA6C;IACjE,iBAAiB,CAAoB;IACrC,mBAAmB,CAAkC;IAErD,YACE,iBAAoC,EACpC,mBAAoD;QAEpD,cAAc,CAAC,IAAI,EAAE;YACnB,+BAA+B,EAAE,QAAQ;YACzC,gBAAgB,EAAE,QAAQ;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;CAiBF"}
@@ -14,31 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { QueryBuilderState } from '../QueryBuilderState.js';
17
- import { QueryBuilderGraphFetchTreeState } from './graph-fetch/QueryBuilderGraphFetchTreeState.js';
18
- import { QueryBuilderProjectionState } from './projection/QueryBuilderProjectionState.js';
19
17
  import { type QueryBuilderExplorerTreeNodeData } from '../explorer/QueryBuilderExplorerState.js';
20
- export declare enum FETCH_STRUCTURE_MODE {
21
- PROJECTION = "PROJECTION",
22
- GRAPH_FETCH = "GRAPH_FETCH"
23
- }
18
+ import { type QueryBuilderFetchStructureImplementationState } from './QueryBuilderFetchStructureImplementationState.js';
24
19
  export declare class QueryBuilderFetchStructureState {
25
20
  queryBuilderState: QueryBuilderState;
26
- /**
27
- * TODO: refactor this so we could reduce this to
28
- * `implementationState: QueryBuilderFetchStructureImplementationState`
29
- * so we don't have graph fetch and projection at the same time
30
- *
31
- * TODO?: perhaps it would eventually make sense to default to
32
- * graph-fetch since `getAll()` naturally works for graph-fetch case
33
- * and graph-fetch allows somewhat an empty tree
34
- */
35
- fetchStructureMode: FETCH_STRUCTURE_MODE;
36
- projectionState: QueryBuilderProjectionState;
37
- graphFetchTreeState: QueryBuilderGraphFetchTreeState;
21
+ implementation: QueryBuilderFetchStructureImplementationState;
38
22
  constructor(queryBuilderState: QueryBuilderState);
39
- setFetchStructureMode(val: FETCH_STRUCTURE_MODE): void;
23
+ changeImplementation(type: string): void;
40
24
  fetchProperty(node: QueryBuilderExplorerTreeNodeData): void;
41
25
  fetchNodeChildrenProperties(node: QueryBuilderExplorerTreeNodeData): void;
42
- get validationIssues(): string[] | undefined;
43
26
  }
44
27
  //# sourceMappingURL=QueryBuilderFetchStructureState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFetchStructureState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAEL,KAAK,gCAAgC,EAEtC,MAAM,0CAA0C,CAAC;AAMlD,oBAAY,oBAAoB;IAC9B,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC5B;AAED,qBAAa,+BAA+B;IAC1C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;;;;;;OAQG;IACH,kBAAkB,uBAAmC;IACrD,eAAe,EAAE,2BAA2B,CAAC;IAC7C,mBAAmB,EAAE,+BAA+B,CAAC;gBAEzC,iBAAiB,EAAE,iBAAiB;IAmBhD,qBAAqB,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI;IAItD,aAAa,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;IAgC3D,2BAA2B,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;IA0DzE,IAAI,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAQ3C;CACF"}
1
+ {"version":3,"file":"QueryBuilderFetchStructureState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAEL,KAAK,6CAA6C,EACnD,MAAM,oDAAoD,CAAC;AAE5D,qBAAa,+BAA+B;IAC1C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,cAAc,EAAE,6CAA6C,CAAC;gBAElD,iBAAiB,EAAE,iBAAiB;IAoBhD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAuBxC,aAAa,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;IAS3D,2BAA2B,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;CAoB1E"}
@@ -16,100 +16,58 @@
16
16
  import { action, makeAutoObservable } from 'mobx';
17
17
  import { QueryBuilderGraphFetchTreeState } from './graph-fetch/QueryBuilderGraphFetchTreeState.js';
18
18
  import { QueryBuilderProjectionState } from './projection/QueryBuilderProjectionState.js';
19
- import { buildPropertyExpressionFromExplorerTreeNodeData, QueryBuilderExplorerTreePropertyNodeData, } from '../explorer/QueryBuilderExplorerState.js';
19
+ import { QueryBuilderExplorerTreePropertyNodeData, } from '../explorer/QueryBuilderExplorerState.js';
20
20
  import { Class } from '@finos/legend-graph';
21
- import { filterByType } from '@finos/legend-shared';
22
- import { addQueryBuilderPropertyNode } from './graph-fetch/QueryBuilderGraphFetchTreeUtil.js';
23
- import { QueryBuilderSimpleProjectionColumnState } from './projection/QueryBuilderProjectionColumnState.js';
24
- export var FETCH_STRUCTURE_MODE;
25
- (function (FETCH_STRUCTURE_MODE) {
26
- FETCH_STRUCTURE_MODE["PROJECTION"] = "PROJECTION";
27
- FETCH_STRUCTURE_MODE["GRAPH_FETCH"] = "GRAPH_FETCH";
28
- })(FETCH_STRUCTURE_MODE = FETCH_STRUCTURE_MODE || (FETCH_STRUCTURE_MODE = {}));
21
+ import { filterByType, UnsupportedOperationError } from '@finos/legend-shared';
22
+ import { FETCH_STRUCTURE_IMPLEMENTATION, } from './QueryBuilderFetchStructureImplementationState.js';
29
23
  export class QueryBuilderFetchStructureState {
30
24
  queryBuilderState;
31
- /**
32
- * TODO: refactor this so we could reduce this to
33
- * `implementationState: QueryBuilderFetchStructureImplementationState`
34
- * so we don't have graph fetch and projection at the same time
35
- *
36
- * TODO?: perhaps it would eventually make sense to default to
37
- * graph-fetch since `getAll()` naturally works for graph-fetch case
38
- * and graph-fetch allows somewhat an empty tree
39
- */
40
- fetchStructureMode = FETCH_STRUCTURE_MODE.PROJECTION;
41
- projectionState;
42
- graphFetchTreeState;
25
+ implementation;
43
26
  constructor(queryBuilderState) {
44
27
  makeAutoObservable(this, {
45
28
  queryBuilderState: false,
46
- setFetchStructureMode: action,
29
+ changeImplementation: action,
47
30
  });
48
31
  this.queryBuilderState = queryBuilderState;
49
- // TODO: we probably should modularize this a bit better
50
- // See https://github.com/finos/legend-studio/issues/731
51
- this.projectionState = new QueryBuilderProjectionState(queryBuilderState, this);
52
- this.graphFetchTreeState = new QueryBuilderGraphFetchTreeState(queryBuilderState, this);
32
+ /**
33
+ * TODO?: perhaps it would eventually make sense to default to
34
+ * graph-fetch since `getAll()` naturally works for graph-fetch case
35
+ * and graph-fetch allows somewhat an empty tree
36
+ *
37
+ * TODO?: we could consider making this configurable
38
+ */
39
+ this.implementation = new QueryBuilderProjectionState(this.queryBuilderState, this);
53
40
  }
54
- setFetchStructureMode(val) {
55
- this.fetchStructureMode = val;
41
+ changeImplementation(type) {
42
+ switch (type) {
43
+ case FETCH_STRUCTURE_IMPLEMENTATION.PROJECTION: {
44
+ this.implementation = new QueryBuilderProjectionState(this.queryBuilderState, this);
45
+ return;
46
+ }
47
+ case FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH: {
48
+ this.implementation = new QueryBuilderGraphFetchTreeState(this.queryBuilderState, this);
49
+ return;
50
+ }
51
+ default:
52
+ throw new UnsupportedOperationError(`Can't change fetch-structure implementation to unsupported type: '${type}'`);
53
+ }
56
54
  }
57
55
  fetchProperty(node) {
58
56
  if (node instanceof QueryBuilderExplorerTreePropertyNodeData &&
59
57
  !(node.type instanceof Class)) {
60
- switch (this.fetchStructureMode) {
61
- case FETCH_STRUCTURE_MODE.GRAPH_FETCH: {
62
- this.graphFetchTreeState.addProperty(node);
63
- return;
64
- }
65
- case FETCH_STRUCTURE_MODE.PROJECTION: {
66
- this.projectionState.addColumn(new QueryBuilderSimpleProjectionColumnState(this.projectionState, buildPropertyExpressionFromExplorerTreeNodeData(this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState.graphManagerState.graph, this.queryBuilderState.explorerState.propertySearchPanelState
67
- .allMappedPropertyNodes), this.queryBuilderState.explorerState.humanizePropertyName));
68
- return;
69
- }
70
- default:
71
- return;
72
- }
58
+ this.implementation.fetchProperty(node);
73
59
  }
74
60
  }
75
61
  fetchNodeChildrenProperties(node) {
76
62
  if (node.type instanceof Class) {
63
+ this.implementation.fetchProperties(
77
64
  // NOTE: here we require the node to already been expanded so the child nodes are generated
78
65
  // we don't allow adding unopened node. Maybe if it helps, we can show a warning.
79
- const nodesToAdd = node.childrenIds
66
+ node.childrenIds
80
67
  .map((childId) => this.queryBuilderState.explorerState.nonNullableTreeData.nodes.get(childId))
81
68
  .filter(filterByType(QueryBuilderExplorerTreePropertyNodeData))
82
- .filter((childNode) => !(childNode.type instanceof Class) && childNode.mappingData.mapped);
83
- switch (this.fetchStructureMode) {
84
- case FETCH_STRUCTURE_MODE.GRAPH_FETCH: {
85
- const graphFetchTreeData = this.graphFetchTreeState.treeData;
86
- if (graphFetchTreeData) {
87
- nodesToAdd.forEach((nodeToAdd) => addQueryBuilderPropertyNode(graphFetchTreeData, this.queryBuilderState.explorerState.nonNullableTreeData, nodeToAdd, this.queryBuilderState));
88
- this.graphFetchTreeState.setGraphFetchTree({
89
- ...graphFetchTreeData,
90
- });
91
- }
92
- return;
93
- }
94
- case FETCH_STRUCTURE_MODE.PROJECTION: {
95
- nodesToAdd.forEach((nodeToAdd) => {
96
- this.projectionState.addColumn(new QueryBuilderSimpleProjectionColumnState(this.projectionState, buildPropertyExpressionFromExplorerTreeNodeData(this.queryBuilderState.explorerState.nonNullableTreeData, nodeToAdd, this.queryBuilderState.graphManagerState.graph, this.queryBuilderState.explorerState.propertySearchPanelState
97
- .allMappedPropertyNodes), this.queryBuilderState.explorerState.humanizePropertyName));
98
- });
99
- return;
100
- }
101
- default:
102
- return;
103
- }
104
- }
105
- }
106
- get validationIssues() {
107
- switch (this.fetchStructureMode) {
108
- case FETCH_STRUCTURE_MODE.PROJECTION:
109
- return this.projectionState.validationIssues;
110
- case FETCH_STRUCTURE_MODE.GRAPH_FETCH:
111
- default:
112
- return undefined;
69
+ .filter((childNode) => !(childNode.type instanceof Class) &&
70
+ childNode.mappingData.mapped));
113
71
  }
114
72
  }
115
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFetchStructureState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EACL,+CAA+C,EAE/C,wCAAwC,GACzC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,uCAAuC,EAAE,MAAM,mDAAmD,CAAC;AAE5G,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,iDAAyB,CAAA;IACzB,mDAA2B,CAAA;AAC7B,CAAC,EAHW,oBAAoB,GAApB,oBAAoB,KAApB,oBAAoB,QAG/B;AAED,MAAM,OAAO,+BAA+B;IAC1C,iBAAiB,CAAoB;IACrC;;;;;;;;OAQG;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EACpB,+CAA+C,CAC7C,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,mBAAmB,EACxD,SAAS,EACT,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,EAC9C,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,wBAAwB;6BAC1D,sBAAsB,CAC1B,EACD,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,oBAAoB,CAC1D,CACF,CAAC;oBACJ,CAAC,CAAC,CAAC;oBACH,OAAO;iBACR;gBACD;oBACE,OAAO;aACV;SACF;IACH,CAAC;IAED,IAAI,gBAAgB;QAClB,QAAQ,IAAI,CAAC,kBAAkB,EAAE;YAC/B,KAAK,oBAAoB,CAAC,UAAU;gBAClC,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC;YAC/C,KAAK,oBAAoB,CAAC,WAAW,CAAC;YACtC;gBACE,OAAO,SAAS,CAAC;SACpB;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"QueryBuilderFetchStructureState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAEL,wCAAwC,GACzC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,8BAA8B,GAE/B,MAAM,oDAAoD,CAAC;AAE5D,MAAM,OAAO,+BAA+B;IAC1C,iBAAiB,CAAoB;IACrC,cAAc,CAAgD;IAE9D,YAAY,iBAAoC;QAC9C,kBAA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,YAAY,CAAC,wCAAwC,CAAC,CAAC;iBAC9D,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CACZ,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,KAAK,CAAC;gBAClC,SAAS,CAAC,WAAW,CAAC,MAAM,CAC/B,CACJ,CAAC;SACH;IACH,CAAC;CACF"}
@@ -14,11 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { QueryBuilderState } from '../../QueryBuilderState.js';
17
- import { RootGraphFetchTree } from '@finos/legend-graph';
17
+ import { type CompilationError, type Class, type LambdaFunction } from '@finos/legend-graph';
18
18
  import { type QueryBuilderGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
19
- import type { QueryBuilderExplorerTreePropertyNodeData } from '../../explorer/QueryBuilderExplorerState.js';
19
+ import { type QueryBuilderExplorerTreePropertyNodeData } from '../../explorer/QueryBuilderExplorerState.js';
20
20
  import { QueryBuilderFetchStructureImplementationState } from '../QueryBuilderFetchStructureImplementationState.js';
21
21
  import type { QueryBuilderFetchStructureState } from '../QueryBuilderFetchStructureState.js';
22
+ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecificationBuilderHelper.js';
22
23
  export declare class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureImplementationState {
23
24
  treeData?: QueryBuilderGraphFetchTreeData | undefined;
24
25
  /**
@@ -28,9 +29,21 @@ export declare class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchSt
28
29
  */
29
30
  isChecked: boolean;
30
31
  constructor(queryBuilderState: QueryBuilderState, fetchStructureState: QueryBuilderFetchStructureState);
32
+ get type(): string;
33
+ get usedExplorerTreePropertyNodeIDs(): string[];
34
+ get validationIssues(): string[] | undefined;
31
35
  setGraphFetchTree(val: QueryBuilderGraphFetchTreeData | undefined): void;
32
36
  setChecked(val: boolean): void;
33
- initialize(tree?: RootGraphFetchTree): void;
34
- addProperty(node: QueryBuilderExplorerTreePropertyNodeData): void;
37
+ private updateTreeData;
38
+ onClassChange(_class: Class | undefined): void;
39
+ appendFetchStructure(lambdaFunction: LambdaFunction, options?: LambdaFunctionBuilderOption): void;
40
+ addProperty(node: QueryBuilderExplorerTreePropertyNodeData, options?: {
41
+ refreshTreeData?: boolean;
42
+ }): void;
43
+ revealCompilationError(compilationError: CompilationError): boolean;
44
+ clearCompilationError(): void;
45
+ fetchProperty(node: QueryBuilderExplorerTreePropertyNodeData): void;
46
+ fetchProperties(nodes: QueryBuilderExplorerTreePropertyNodeData[]): void;
47
+ checkBeforeChangingImplementation(onChange: () => void): void;
35
48
  }
36
49
  //# sourceMappingURL=QueryBuilderGraphFetchTreeState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderGraphFetchTreeState.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAEL,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,6CAA6C,CAAC;AAE5G,OAAO,EAAE,6CAA6C,EAAE,MAAM,qDAAqD,CAAC;AACpH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAE7F,qBAAa,+BAAgC,SAAQ,6CAA6C;IAChG,QAAQ,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IACtD;;;;OAIG;IACH,SAAS,UAAS;gBAGhB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;IAYtD,iBAAiB,CAAC,GAAG,EAAE,8BAA8B,GAAG,SAAS,GAAG,IAAI;IAIxE,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAK9B,UAAU,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAmB3C,WAAW,CAAC,IAAI,EAAE,wCAAwC,GAAG,IAAI;CAgBlE"}
1
+ {"version":3,"file":"QueryBuilderGraphFetchTreeState.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EACL,KAAK,gBAAgB,EAGrB,KAAK,KAAK,EACV,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAGL,KAAK,wCAAwC,EAC9C,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAEL,6CAA6C,EAC9C,MAAM,qDAAqD,CAAC;AAC7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAK7F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAIxG,qBAAa,+BAAgC,SAAQ,6CAA6C;IAChG,QAAQ,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IACtD;;;;OAIG;IACH,SAAS,UAAS;gBAGhB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;IAetD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,+BAA+B,IAAI,MAAM,EAAE,CAiD9C;IAED,IAAI,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAE3C;IAED,iBAAiB,CAAC,GAAG,EAAE,8BAA8B,GAAG,SAAS,GAAG,IAAI;IAIxE,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAI9B,OAAO,CAAC,cAAc;IAYtB,aAAa,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;IAI9C,oBAAoB,CAClB,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,2BAA2B,GACpC,IAAI;IAIP,WAAW,CACT,IAAI,EAAE,wCAAwC,EAC9C,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GACA,IAAI;IAkBP,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;IAInE,qBAAqB,IAAI,IAAI;IAI7B,aAAa,CAAC,IAAI,EAAE,wCAAwC,GAAG,IAAI;IAInE,eAAe,CAAC,KAAK,EAAE,wCAAwC,EAAE,GAAG,IAAI;IAaxE,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CA0B9D"}
@@ -14,10 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { action, makeObservable, observable } from 'mobx';
17
- import { PackageableElementExplicitReference, RootGraphFetchTree, } from '@finos/legend-graph';
17
+ import { PackageableElementExplicitReference, RootGraphFetchTree, getAllSuperclasses, } from '@finos/legend-graph';
18
18
  import { addQueryBuilderPropertyNode, buildGraphFetchTreeData, } from './QueryBuilderGraphFetchTreeUtil.js';
19
- import { assertNonNullable } from '@finos/legend-shared';
20
- import { QueryBuilderFetchStructureImplementationState } from '../QueryBuilderFetchStructureImplementationState.js';
19
+ import { generateExplorerTreePropertyNodeID, generateExplorerTreeSubtypeNodeID, } from '../../explorer/QueryBuilderExplorerState.js';
20
+ import { FETCH_STRUCTURE_IMPLEMENTATION, QueryBuilderFetchStructureImplementationState, } from '../QueryBuilderFetchStructureImplementationState.js';
21
+ import { ActionAlertActionType, ActionAlertType, } from '@finos/legend-application';
22
+ import { appendGraphFetch } from './QueryBuilderGraphFetchValueSpecificationBuilder.js';
23
+ import { guaranteeNonNullable } from '@finos/legend-shared';
21
24
  export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureImplementationState {
22
25
  treeData;
23
26
  /**
@@ -29,11 +32,57 @@ export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureI
29
32
  constructor(queryBuilderState, fetchStructureState) {
30
33
  super(queryBuilderState, fetchStructureState);
31
34
  makeObservable(this, {
32
- treeData: observable,
35
+ treeData: observable.ref,
33
36
  isChecked: observable,
34
37
  setGraphFetchTree: action,
35
38
  setChecked: action,
36
39
  });
40
+ // try to initialize the graph-fetch tree data using the setup class
41
+ this.updateTreeData(this.queryBuilderState.querySetupState._class);
42
+ }
43
+ get type() {
44
+ return FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH;
45
+ }
46
+ get usedExplorerTreePropertyNodeIDs() {
47
+ if (!this.treeData) {
48
+ return [];
49
+ }
50
+ const explorerTreeNodeIDIndex = new Map();
51
+ const ids = [];
52
+ // traverse in breadth-first fashion
53
+ const nodesToProcess = this.treeData.rootIds.slice();
54
+ while (nodesToProcess.length) {
55
+ const currentNodeID = guaranteeNonNullable(nodesToProcess[0]);
56
+ const node = this.treeData.nodes.get(currentNodeID);
57
+ if (!node) {
58
+ continue;
59
+ }
60
+ let nodeID;
61
+ const parentNodeID = node.parentId
62
+ ? // since we traverse the nodes in order, parent node ID should already been computed
63
+ guaranteeNonNullable(explorerTreeNodeIDIndex.get(node.parentId))
64
+ : '';
65
+ const propertyNodeID = generateExplorerTreePropertyNodeID(parentNodeID, node.tree.property.value.name);
66
+ ids.push(propertyNodeID);
67
+ if (node.tree.subType) {
68
+ nodeID = generateExplorerTreeSubtypeNodeID(propertyNodeID, node.tree.subType.value.path);
69
+ getAllSuperclasses(node.tree.subType.value)
70
+ .concat(node.tree.subType.value)
71
+ .forEach((_class) => ids.push(generateExplorerTreeSubtypeNodeID(propertyNodeID, _class.path)));
72
+ }
73
+ else {
74
+ nodeID = propertyNodeID;
75
+ }
76
+ explorerTreeNodeIDIndex.set(node.id, nodeID);
77
+ // update list of nodes to process
78
+ nodesToProcess.shift();
79
+ node.childrenIds.forEach((childId) => nodesToProcess.push(childId));
80
+ }
81
+ // de-duplicate
82
+ return Array.from(new Set(ids).values());
83
+ }
84
+ get validationIssues() {
85
+ return undefined;
37
86
  }
38
87
  setGraphFetchTree(val) {
39
88
  this.treeData = val;
@@ -41,28 +90,68 @@ export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureI
41
90
  setChecked(val) {
42
91
  this.isChecked = val;
43
92
  }
44
- // TODO-BEFORE-PR: consider removing this
45
- initialize(tree) {
46
- if (tree) {
47
- this.setGraphFetchTree(buildGraphFetchTreeData(tree));
93
+ updateTreeData(_class) {
94
+ this.setGraphFetchTree(_class
95
+ ? buildGraphFetchTreeData(new RootGraphFetchTree(PackageableElementExplicitReference.create(_class)))
96
+ : undefined);
97
+ }
98
+ onClassChange(_class) {
99
+ this.updateTreeData(_class);
100
+ }
101
+ appendFetchStructure(lambdaFunction, options) {
102
+ appendGraphFetch(this, lambdaFunction, options);
103
+ }
104
+ addProperty(node, options) {
105
+ if (!this.treeData) {
106
+ this.queryBuilderState.applicationStore.notifyWarning(`Can't add property: graph-fetch tree has not been properly initialized`);
107
+ return;
48
108
  }
49
- else {
50
- const _class = this.queryBuilderState.querySetupState._class;
51
- if (_class) {
52
- this.setGraphFetchTree(buildGraphFetchTreeData(new RootGraphFetchTree(PackageableElementExplicitReference.create(_class))));
53
- }
54
- else {
55
- this.setGraphFetchTree(undefined);
56
- }
109
+ addQueryBuilderPropertyNode(this.treeData, this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState);
110
+ if (options?.refreshTreeData) {
111
+ this.setGraphFetchTree({ ...this.treeData });
57
112
  }
58
113
  }
59
- addProperty(node) {
114
+ revealCompilationError(compilationError) {
115
+ return false;
116
+ }
117
+ clearCompilationError() {
118
+ return;
119
+ }
120
+ fetchProperty(node) {
121
+ this.addProperty(node, { refreshTreeData: true });
122
+ }
123
+ fetchProperties(nodes) {
60
124
  if (!this.treeData) {
61
- this.initialize();
125
+ this.queryBuilderState.applicationStore.notifyWarning(`Can't add property: graph-fetch tree has not been properly initialized`);
126
+ return;
127
+ }
128
+ nodes.forEach((nodeToAdd) => this.addProperty(nodeToAdd));
129
+ this.setGraphFetchTree({
130
+ ...this.treeData,
131
+ });
132
+ }
133
+ checkBeforeChangingImplementation(onChange) {
134
+ if (this.treeData?.rootIds.length) {
135
+ this.queryBuilderState.applicationStore.setActionAlertInfo({
136
+ message: 'Current graph-fetch will be lost when switching to projection mode. Do you still want to proceed?',
137
+ type: ActionAlertType.CAUTION,
138
+ actions: [
139
+ {
140
+ label: 'Proceed',
141
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
142
+ handler: this.queryBuilderState.applicationStore.guardUnhandledError(async () => onChange()),
143
+ },
144
+ {
145
+ label: 'Cancel',
146
+ type: ActionAlertActionType.PROCEED,
147
+ default: true,
148
+ },
149
+ ],
150
+ });
151
+ }
152
+ else {
153
+ onChange();
62
154
  }
63
- assertNonNullable(this.treeData, `Graph-fetch tree has not been properly initialized`);
64
- addQueryBuilderPropertyNode(this.treeData, this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState);
65
- this.setGraphFetchTree({ ...this.treeData });
66
155
  }
67
156
  }
68
157
  //# sourceMappingURL=QueryBuilderGraphFetchTreeState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderGraphFetchTreeState.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EACL,mCAAmC,EACnC,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,6CAA6C,EAAE,MAAM,qDAAqD,CAAC;AAGpH,MAAM,O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ACJ,IAAI,CAAC,iBAAiB,CACvB,CAAC;QACF,IAAI,CAAC,iBAAiB,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF"}
1
+ {"version":3,"file":"QueryBuilderGraphFetchTreeState.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAEL,mCAAmC,EACnC,kBAAkB,EAGlB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,8BAA8B,EAC9B,6CAA6C,GAC9C,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,OAAO,+BAAgC,SAAQ,6CAA6C;IAChG,QAAQ,CAA8C;IACtD;;;;OAIG;IACH,SAAS,GAAG,KAAK,CAAC;IAElB,YACE,iBAAoC,EACpC,mBAAoD;QAEpD,KAAK,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QAE9C,cAAc,CAAC,IAAI,EAAE;YACnB,QAAQ,EAAE,UAAU,CAAC,GAAG;YACxB,SAAS,EAAE,UAAU;YACrB,iBAAiB,EAAE,MAAM;YACzB,UAAU,EAAE,MAAM;SACnB,CAAC,CAAC;QAEH,oEAAoE;QACpE,IAAI,CAAC,cAAc,CAAC,IAAI,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BACzD,OAAO,EACL,mGAAmG;gBACrG,IAAI,EAAE,eAAe,CAAC,OAAO;gBAC7B,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,SAAS;wBAChB,IAAI,EAAE,qBAAqB,CAAC,oBAAoB;wBAChD,OAAO,EACL,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,mBAAmB,CACzD,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,CACvB;qBACJ;oBACD;wBACE,KAAK,EAAE,QAAQ;wBACf,IAAI,EAAE,qBAAqB,CAAC,OAAO;wBACnC,OAAO,EAAE,IAAI;qBACd;iBACF;aACF,CAAC,CAAC;SACJ;aAAM;YACL,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC;CACF"}
@@ -0,0 +1,20 @@
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
+ import { SimpleFunctionExpression } from '@finos/legend-graph';
17
+ import type { QueryBuilderState } from '../../QueryBuilderState.js';
18
+ export declare const processGraphFetchExpression: (expression: SimpleFunctionExpression, queryBuilderState: QueryBuilderState) => void;
19
+ export declare const processGraphFetchSerializeExpression: (expression: SimpleFunctionExpression, queryBuilderState: QueryBuilderState) => void;
20
+ //# sourceMappingURL=QueryBuilderGraphFetchTreeStateBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderGraphFetchTreeStateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,eAAO,MAAM,2BAA2B,eAC1B,wBAAwB,qBACjB,iBAAiB,KACnC,IAyCF,CAAC;AAEF,eAAO,MAAM,oCAAoC,eACnC,wBAAwB,qBACjB,iBAAiB,KACnC,IAmDF,CAAC"}
@@ -0,0 +1,62 @@
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
+ import { GraphFetchTreeInstanceValue, matchFunctionName, RootGraphFetchTree, SimpleFunctionExpression, } from '@finos/legend-graph';
17
+ import { assertTrue, guaranteeType } from '@finos/legend-shared';
18
+ import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../QueryBuilder_Const.js';
19
+ import { QueryBuilderValueSpecificationProcessor } from '../../QueryBuilderStateBuilder.js';
20
+ import { FETCH_STRUCTURE_IMPLEMENTATION } from '../QueryBuilderFetchStructureImplementationState.js';
21
+ import { QueryBuilderGraphFetchTreeState } from './QueryBuilderGraphFetchTreeState.js';
22
+ import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
23
+ export const processGraphFetchExpression = (expression, queryBuilderState) => {
24
+ const functionName = expression.functionName;
25
+ // check parameters
26
+ assertTrue(expression.parametersValues.length === 2, `Can't process ${functionName}() expression: ${functionName}() expects 1 argument`);
27
+ // check preceding expression
28
+ const precedingExpression = guaranteeType(expression.parametersValues[0], SimpleFunctionExpression, `Can't process ${functionName}() expression: only support ${functionName}() immediately following an expression`);
29
+ assertTrue(matchFunctionName(precedingExpression.functionName, [
30
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER,
31
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GET_ALL,
32
+ ]), `Can't process ${functionName}(): only support ${functionName}() immediately following either getAll() or filter()`);
33
+ QueryBuilderValueSpecificationProcessor.process(precedingExpression, queryBuilderState);
34
+ // build state
35
+ if (queryBuilderState.fetchStructureState.implementation instanceof
36
+ QueryBuilderGraphFetchTreeState) {
37
+ const graphFetchTreeState = queryBuilderState.fetchStructureState.implementation;
38
+ graphFetchTreeState.setChecked(matchFunctionName(expression.functionName, QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED));
39
+ }
40
+ };
41
+ export const processGraphFetchSerializeExpression = (expression, queryBuilderState) => {
42
+ // update fetch-structure
43
+ queryBuilderState.fetchStructureState.changeImplementation(FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH);
44
+ // check parameters
45
+ assertTrue(expression.parametersValues.length === 2, `Can't process serialize() expression: serialize() expects 1 argument`);
46
+ // check preceding expression
47
+ const precedingExpression = guaranteeType(expression.parametersValues[0], SimpleFunctionExpression, `Can't process serialize() expression: only support serialize() immediately following an expression`);
48
+ assertTrue(matchFunctionName(precedingExpression.functionName, [
49
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
50
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
51
+ ]), `Can't process serialize() expression: only support serialize() in graph-fetch expression`);
52
+ QueryBuilderValueSpecificationProcessor.process(precedingExpression, queryBuilderState);
53
+ // build state
54
+ if (queryBuilderState.fetchStructureState.implementation instanceof
55
+ QueryBuilderGraphFetchTreeState) {
56
+ const graphFetchTreeState = queryBuilderState.fetchStructureState.implementation;
57
+ const graphFetchTree = guaranteeType(expression.parametersValues[1], GraphFetchTreeInstanceValue, `Can't process serialize() expression: serialize() graph-fetch is missing`);
58
+ const graphFetchTreeRoot = guaranteeType(graphFetchTree.values[0], RootGraphFetchTree, `Can't process serialize() expression: serialize() graph-fetch tree root is missing`);
59
+ graphFetchTreeState.setGraphFetchTree(buildGraphFetchTreeData(graphFetchTreeRoot));
60
+ }
61
+ };
62
+ //# sourceMappingURL=QueryBuilderGraphFetchTreeStateBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderGraphFetchTreeStateBuilder.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,uCAAuC,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,UAAoC,EACpC,iBAAoC,EAC9B,EAAE;IACR,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAE7C,mBAAmB;IACnB,UAAU,CACR,UAAU,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,EACxC,iBAAiB,YAAY,kBAAkB,YAAY,uBAAuB,CACnF,CAAC;IAEF,6BAA6B;IAC7B,MAAM,mBAAmB,GAAG,aAAa,CACvC,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mB,EACnB,iBAAiB,CAClB,CAAC;IAEF,cAAc;IACd,IACE,iBAAiB,CAAC,mBAAmB,CAAC,cAAc;QACpD,+BAA+B,EAC/B;QACA,MAAM,mBAAmB,GACvB,iBAAiB,CAAC,mBAAmB,CAAC,cAAc,CAAC;QACvD,MAAM,cAAc,GAAG,aAAa,CAClC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAC9B,2BAA2B,EAC3B,0EAA0E,CAC3E,CAAC;QACF,MAAM,kBAAkB,GAAG,aAAa,CACtC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EACxB,kBAAkB,EAClB,oFAAoF,CACrF,CAAC;QACF,mBAAmB,CAAC,iBAAiB,CACnC,uBAAuB,CAAC,kBAAkB,CAAC,CAC5C,CAAC;KACH;AACH,CAAC,CAAC"}
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { TreeNodeData, TreeData } from '@finos/legend-art';
17
- import { type Type, type RootGraphFetchTree, PropertyGraphFetchTree } from '@finos/legend-graph';
17
+ import { type AbstractProperty, type Type, type RootGraphFetchTree, PropertyGraphFetchTree } from '@finos/legend-graph';
18
18
  import { type QueryBuilderExplorerTreeNodeData, QueryBuilderExplorerTreePropertyNodeData } from '../../explorer/QueryBuilderExplorerState.js';
19
19
  import type { QueryBuilderState } from '../../QueryBuilderState.js';
20
20
  export declare class QueryBuilderGraphFetchTreeNodeData implements TreeNodeData {
@@ -31,6 +31,7 @@ export declare class QueryBuilderGraphFetchTreeNodeData implements TreeNodeData
31
31
  export interface QueryBuilderGraphFetchTreeData extends TreeData<QueryBuilderGraphFetchTreeNodeData> {
32
32
  tree: RootGraphFetchTree;
33
33
  }
34
+ export declare const generateGraphFetchTreeNodeID: (property: AbstractProperty, parentNodeId: string | undefined, subType: Type | undefined) => string;
34
35
  /**
35
36
  * Build graph fetch tree data from an existing graph fetch tree root
36
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderGraphFetchTreeUtil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B,oBACtB,SAAS,gCAAgC,CAAC,QACtD,wCAAwC,qBAC3B,iBAAiB,KACnC,IAkGF,CAAC"}
1
+ {"version":3,"file":"QueryBuilderGraphFetchTreeUtil.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,IAAI,EACT,KAAK,kBAAkB,EAGvB,sBAAsB,EAGvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,gCAAgC,EACrC,wCAAwC,EAEzC,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,qBAAa,kCAAmC,YAAW,YAAY;IACrE,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAM;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,sBAAsB,CAAC;gBAG3B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,sBAAsB;IAU5C,IAAI,IAAI,IAAI,IAAI,CAEf;CACF;AAED,MAAM,WAAW,8BACf,SAAQ,QAAQ,CAAC,kCAAkC,CAAC;IACpD,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,eAAO,MAAM,4BAA4B,aAC7B,gBAAgB,gBACZ,MAAM,GAAG,SAAS,WACvB,IAAI,GAAG,SAAS,KACxB,MAGC,CAAC;AA6BL;;GAEG;AACH,eAAO,MAAM,uBAAuB,SAC5B,kBAAkB,KACvB,8BASF,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAC1B,8BAA8B,KACvC,OAA8C,CAAC;AA6ClD,eAAO,MAAM,qBAAqB,aACtB,8BAA8B,QAClC,kCAAkC,KACvC,IAGF,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAC5B,8BAA8B,oBACtB,SAAS,gCAAgC,CAAC,QACtD,wCAAwC,qBAC3B,iBAAiB,KACnC,IAgGF,CAAC"}
@@ -37,16 +37,13 @@ export class QueryBuilderGraphFetchTreeNodeData {
37
37
  return this.tree.property.value.genericType.value.rawType;
38
38
  }
39
39
  }
40
- const generateNodeId = (property, parentNodeId) => `${parentNodeId ? `${parentNodeId}.` : ''}${property.name}`;
41
- const generateNodeIdForSubType = (property, subType, parentNodeId) => `${parentNodeId ? `${parentNodeId}.` : ''}${property.name}${TYPE_CAST_TOKEN}${subType.path}`;
40
+ export const generateGraphFetchTreeNodeID = (property, parentNodeId, subType) => `${parentNodeId ? `${parentNodeId}.` : ''}${property.name}${subType ? `${TYPE_CAST_TOKEN}${subType.path}` : ''}`;
42
41
  const buildGraphFetchSubTree = (tree, parentNode, nodes) => {
43
42
  assertType(tree, PropertyGraphFetchTree, 'Graph fetch sub-tree must be a property graph fetch tree');
44
43
  const property = tree.property.value;
45
44
  const subType = tree.subType?.value;
46
45
  const parentNodeId = parentNode?.id;
47
- const node = new QueryBuilderGraphFetchTreeNodeData(subType
48
- ? generateNodeIdForSubType(property, subType, parentNodeId)
49
- : generateNodeId(property, parentNodeId), property.name, parentNodeId, tree);
46
+ const node = new QueryBuilderGraphFetchTreeNodeData(generateGraphFetchTreeNodeID(property, parentNodeId, subType), property.name, parentNodeId, tree);
50
47
  tree.subTrees.forEach((subTree) => {
51
48
  const subTreeNode = buildGraphFetchSubTree(subTree, node, nodes);
52
49
  addUniqueEntry(node.childrenIds, subTreeNode.id);
@@ -149,9 +146,7 @@ export const addQueryBuilderPropertyNode = (treeData, explorerTreeData, node, qu
149
146
  let parentNode = undefined;
150
147
  let newSubTree;
151
148
  for (const propertyGraphFetchTree of propertyGraphFetchTrees) {
152
- currentNodeId = propertyGraphFetchTree.subType?.value
153
- ? generateNodeIdForSubType(propertyGraphFetchTree.property.value, propertyGraphFetchTree.subType.value, currentNodeId)
154
- : generateNodeId(propertyGraphFetchTree.property.value, currentNodeId);
149
+ currentNodeId = generateGraphFetchTreeNodeID(propertyGraphFetchTree.property.value, currentNodeId, propertyGraphFetchTree.subType?.value);
155
150
  const existingGraphFetchNode = treeData.nodes.get(currentNodeId);
156
151
  if (existingGraphFetchNode) {
157
152
  parentNode = existingGraphFetchNode;