@finos/legend-query-builder 4.14.47 → 4.14.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +3 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +2 -0
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts +1 -1
  6. package/lib/components/QueryBuilder.d.ts.map +1 -1
  7. package/lib/components/QueryBuilder.js +59 -46
  8. package/lib/components/QueryBuilder.js.map +1 -1
  9. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +1 -1
  10. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderConstantExpressionPanel.js +22 -22
  12. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderDiffPanel.d.ts +2 -2
  14. package/lib/components/QueryBuilderDiffPanel.js +7 -6
  15. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  16. package/lib/components/QueryBuilderParametersPanel.d.ts +1 -1
  17. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  18. package/lib/components/QueryBuilderParametersPanel.js +29 -10
  19. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  20. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +3 -3
  21. package/lib/components/QueryBuilderPropertyExpressionEditor.js +14 -13
  22. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  23. package/lib/components/QueryBuilderSideBar.d.ts +2 -2
  24. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderSideBar.js +14 -24
  26. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  27. package/lib/components/QueryBuilderTextEditor.d.ts +1 -1
  28. package/lib/components/QueryBuilderTextEditor.js +8 -7
  29. package/lib/components/QueryBuilderTextEditor.js.map +1 -1
  30. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -1
  31. package/lib/components/QueryBuilderUnsupportedQueryEditor.js +4 -3
  32. package/lib/components/QueryBuilderUnsupportedQueryEditor.js.map +1 -1
  33. package/lib/components/QueryChat.d.ts +1 -1
  34. package/lib/components/QueryChat.js +3 -2
  35. package/lib/components/QueryChat.js.map +1 -1
  36. package/lib/components/QueryLoader.d.ts +2 -2
  37. package/lib/components/QueryLoader.js +25 -24
  38. package/lib/components/QueryLoader.js.map +1 -1
  39. package/lib/components/QueryUsageViewer.d.ts +1 -1
  40. package/lib/components/QueryUsageViewer.js +4 -3
  41. package/lib/components/QueryUsageViewer.js.map +1 -1
  42. package/lib/components/ServiceQuerySetupUtils.js +4 -3
  43. package/lib/components/ServiceQuerySetupUtils.js.map +1 -1
  44. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +3 -2
  45. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  46. package/lib/components/data-access/DataAccessOverview.d.ts +1 -1
  47. package/lib/components/data-access/DataAccessOverview.js +17 -16
  48. package/lib/components/data-access/DataAccessOverview.js.map +1 -1
  49. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js +4 -3
  50. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js.map +1 -1
  51. package/lib/components/execution-plan/ConstantExecutionNodeViewer.js +3 -2
  52. package/lib/components/execution-plan/ConstantExecutionNodeViewer.js.map +1 -1
  53. package/lib/components/execution-plan/DataTypeResultTypeViewer.js +4 -3
  54. package/lib/components/execution-plan/DataTypeResultTypeViewer.js.map +1 -1
  55. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts +3 -3
  56. package/lib/components/execution-plan/ExecutionPlanViewer.js +34 -33
  57. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  58. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js +3 -2
  59. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js.map +1 -1
  60. package/lib/components/execution-plan/ImplementationViewer.js +4 -3
  61. package/lib/components/execution-plan/ImplementationViewer.js.map +1 -1
  62. package/lib/components/execution-plan/PartialClassResultViewer.js +3 -2
  63. package/lib/components/execution-plan/PartialClassResultViewer.js.map +1 -1
  64. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.js +6 -5
  65. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -1
  66. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.js +7 -6
  67. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -1
  68. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.js +6 -5
  69. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -1
  70. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js +4 -3
  71. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js.map +1 -1
  72. package/lib/components/execution-plan/ResultTypeViewer.js +5 -4
  73. package/lib/components/execution-plan/ResultTypeViewer.js.map +1 -1
  74. package/lib/components/execution-plan/SQLExecutionNodeViewer.js +7 -6
  75. package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
  76. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js +6 -5
  77. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js.map +1 -1
  78. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.js +6 -5
  79. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.js.map +1 -1
  80. package/lib/components/execution-plan/TDSResultTypeViewer.js +4 -3
  81. package/lib/components/execution-plan/TDSResultTypeViewer.js.map +1 -1
  82. package/lib/components/execution-plan/TempTableStrategyViewer.js +3 -2
  83. package/lib/components/execution-plan/TempTableStrategyViewer.js.map +1 -1
  84. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +1 -1
  85. package/lib/components/explorer/QueryBuilderExplorerPanel.js +31 -30
  86. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  87. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -1
  88. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js +20 -19
  89. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
  90. package/lib/components/explorer/{QueryBuilderMilestoningEditor.d.ts → QueryBuilderMilestoningParameterEditor.d.ts} +6 -3
  91. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.d.ts.map +1 -0
  92. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js +53 -0
  93. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js.map +1 -0
  94. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -1
  95. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +18 -17
  96. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
  97. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -1
  98. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +9 -8
  99. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
  100. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +3 -3
  101. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +24 -23
  102. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  103. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +4 -3
  104. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  105. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +76 -54
  106. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  107. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -1
  108. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +3 -2
  109. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  110. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -1
  111. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  112. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +201 -29
  113. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  114. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.js +9 -8
  115. package/lib/components/fetch-structure/QueryBuilderTDSComponentHelper.js.map +1 -1
  116. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -1
  117. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  118. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +55 -36
  119. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  120. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +1 -1
  121. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +29 -28
  122. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  123. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -1
  124. package/lib/components/filter/QueryBuilderFilterPanel.js +20 -19
  125. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  126. package/lib/components/result/QueryBuilderResultPanel.d.ts +2 -2
  127. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
  128. package/lib/components/result/QueryBuilderResultPanel.js +19 -17
  129. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  130. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts +1 -1
  131. package/lib/components/result/tds/QueryBuilderTDSGridResult.js +11 -10
  132. package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
  133. package/lib/components/result/tds/QueryBuilderTDSResultShared.js +5 -4
  134. package/lib/components/result/tds/QueryBuilderTDSResultShared.js.map +1 -1
  135. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts +1 -1
  136. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +9 -8
  137. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -1
  138. package/lib/components/shared/BasicValueSpecificationEditor.js +38 -37
  139. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  140. package/lib/components/shared/CustomDatePicker.js +21 -20
  141. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  142. package/lib/components/shared/LambdaEditor.d.ts +2 -2
  143. package/lib/components/shared/LambdaEditor.js +14 -13
  144. package/lib/components/shared/LambdaEditor.js.map +1 -1
  145. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -1
  146. package/lib/components/shared/LambdaParameterValuesEditor.js +7 -6
  147. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  148. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +4 -3
  149. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
  150. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js +10 -9
  151. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js.map +1 -1
  152. package/lib/components/shared/QueryBuilderRootClassInfoTooltip.js +4 -3
  153. package/lib/components/shared/QueryBuilderRootClassInfoTooltip.js.map +1 -1
  154. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +2 -2
  155. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  156. package/lib/components/shared/QueryBuilderVariableSelector.js +15 -7
  157. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  158. package/lib/components/workflows/ClassQueryBuilder.js +6 -5
  159. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  160. package/lib/components/workflows/MappingQueryBuilder.js +6 -5
  161. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  162. package/lib/components/workflows/ServiceQueryBuilder.js +6 -5
  163. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  164. package/lib/graph-manager/QueryBuilderConfig.d.ts +4 -0
  165. package/lib/graph-manager/QueryBuilderConfig.d.ts.map +1 -1
  166. package/lib/graph-manager/QueryBuilderConfig.js +5 -0
  167. package/lib/graph-manager/QueryBuilderConfig.js.map +1 -1
  168. package/lib/index.css +2 -2
  169. package/lib/index.css.map +1 -1
  170. package/lib/package.json +1 -1
  171. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  172. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  173. package/lib/stores/QueryBuilderValueSpecificationHelper.js +3 -3
  174. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  175. package/lib/stores/QueryLoaderState.d.ts +1 -0
  176. package/lib/stores/QueryLoaderState.d.ts.map +1 -1
  177. package/lib/stores/QueryLoaderState.js +1 -0
  178. package/lib/stores/QueryLoaderState.js.map +1 -1
  179. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -0
  180. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  181. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +8 -0
  182. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  183. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.d.ts.map +1 -1
  184. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.js +4 -2
  185. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.js.map +1 -1
  186. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  187. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +1 -1
  188. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  189. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
  190. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +1 -1
  191. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
  192. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +2 -0
  193. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -1
  194. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +13 -2
  195. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -1
  196. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +2 -0
  197. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -1
  198. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +8 -1
  199. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -1
  200. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +1 -1
  201. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -1
  202. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +25 -1
  203. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -1
  204. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +2 -0
  205. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -1
  206. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -1
  207. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts +5 -0
  208. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
  209. package/lib/stores/milestoning/QueryBuilderMilestoningState.js +62 -3
  210. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
  211. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +2 -0
  212. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -1
  213. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +8 -1
  214. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -1
  215. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +1 -0
  216. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  217. package/lib/stores/shared/ValueSpecificationEditorHelper.js +7 -1
  218. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  219. package/package.json +4 -4
  220. package/src/__lib__/QueryBuilderDocumentation.ts +2 -0
  221. package/src/components/QueryBuilder.tsx +44 -0
  222. package/src/components/QueryBuilderConstantExpressionPanel.tsx +13 -4
  223. package/src/components/QueryBuilderParametersPanel.tsx +55 -0
  224. package/src/components/QueryBuilderSideBar.tsx +0 -42
  225. package/src/components/explorer/QueryBuilderMilestoningParameterEditor.tsx +114 -0
  226. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +143 -78
  227. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +445 -19
  228. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +134 -21
  229. package/src/components/result/QueryBuilderResultPanel.tsx +9 -1
  230. package/src/components/shared/QueryBuilderVariableSelector.tsx +22 -0
  231. package/src/graph-manager/QueryBuilderConfig.ts +6 -0
  232. package/src/stores/QueryBuilderValueSpecificationHelper.ts +4 -1
  233. package/src/stores/QueryLoaderState.ts +1 -0
  234. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +11 -0
  235. package/src/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.ts +6 -2
  236. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +1 -0
  237. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +1 -0
  238. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +23 -0
  239. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +13 -0
  240. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +45 -0
  241. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +3 -0
  242. package/src/stores/milestoning/QueryBuilderMilestoningState.ts +95 -7
  243. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +13 -0
  244. package/src/stores/shared/ValueSpecificationEditorHelper.ts +11 -0
  245. package/tsconfig.json +1 -1
  246. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +0 -1
  247. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +0 -102
  248. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +0 -1
  249. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +0 -364
@@ -1,364 +0,0 @@
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 { observer } from 'mobx-react-lite';
18
- import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
19
- import { useCallback } from 'react';
20
- import {
21
- type ValueSpecification,
22
- type VariableExpression,
23
- GenericType,
24
- GenericTypeExplicitReference,
25
- observe_PrimitiveInstanceValue,
26
- PrimitiveInstanceValue,
27
- PRIMITIVE_TYPE,
28
- PrimitiveType,
29
- } from '@finos/legend-graph';
30
- import { guaranteeNonNullable } from '@finos/legend-shared';
31
- import { useDrop } from 'react-dnd';
32
- import {
33
- Dialog,
34
- Modal,
35
- ModalBody,
36
- ModalFooter,
37
- ModalFooterButton,
38
- ModalHeader,
39
- PanelEntryDropZonePlaceholder,
40
- PanelFormBooleanField,
41
- PanelFormSection,
42
- } from '@finos/legend-art';
43
- import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
44
- import {
45
- BasicValueSpecificationEditor,
46
- type QueryBuilderVariableDragSource,
47
- QUERY_BUILDER_VARIABLE_DND_TYPE,
48
- } from '../shared/BasicValueSpecificationEditor.js';
49
- import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
50
- import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
51
-
52
- const MilestoningParameterEditor = observer(
53
- (props: {
54
- queryBuilderState: QueryBuilderState;
55
- parameter: ValueSpecification;
56
- setParameter: (val: ValueSpecification) => void;
57
- }) => {
58
- const { queryBuilderState, parameter, setParameter } = props;
59
- const handleDrop = useCallback(
60
- (item: QueryBuilderVariableDragSource): void => {
61
- setParameter(item.variable);
62
- },
63
- [setParameter],
64
- );
65
- const [{ isDragOver }, dropConnector] = useDrop<
66
- QueryBuilderVariableDragSource,
67
- void,
68
- { isDragOver: boolean }
69
- >(
70
- () => ({
71
- accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
72
- drop: (item, monitor): void => {
73
- if (!monitor.didDrop()) {
74
- handleDrop(item);
75
- }
76
- },
77
- collect: (monitor): { isDragOver: boolean } => ({
78
- isDragOver: monitor.isOver({
79
- shallow: true,
80
- }),
81
- }),
82
- }),
83
- [handleDrop],
84
- );
85
- const resetMilestoningParameter = (): void => {
86
- const param = observe_PrimitiveInstanceValue(
87
- new PrimitiveInstanceValue(
88
- GenericTypeExplicitReference.create(
89
- new GenericType(PrimitiveType.STRICTDATE),
90
- ),
91
- ),
92
- queryBuilderState.observerContext,
93
- );
94
- instanceValue_setValues(
95
- param,
96
- [generateDefaultValueForPrimitiveType(PRIMITIVE_TYPE.STRICTDATE)],
97
- queryBuilderState.observerContext,
98
- );
99
- setParameter(param);
100
- };
101
-
102
- return (
103
- <div ref={dropConnector} className="query-builder__variable-editor">
104
- <PanelEntryDropZonePlaceholder
105
- isDragOver={isDragOver}
106
- label="Change Milestoning Parameter Value"
107
- >
108
- <BasicValueSpecificationEditor
109
- valueSpecification={parameter}
110
- graph={queryBuilderState.graphManagerState.graph}
111
- obseverContext={queryBuilderState.observerContext}
112
- setValueSpecification={(val: ValueSpecification): void =>
113
- setParameter(val)
114
- }
115
- typeCheckOption={{
116
- expectedType: PrimitiveType.DATE,
117
- }}
118
- resetValue={resetMilestoningParameter}
119
- isConstant={queryBuilderState.constantState.isValueSpecConstant(
120
- parameter,
121
- )}
122
- />
123
- </PanelEntryDropZonePlaceholder>
124
- </div>
125
- );
126
- },
127
- );
128
-
129
- const BiTemporalMilestoningEditor = observer(
130
- (props: { queryBuilderState: QueryBuilderState }) => {
131
- const { queryBuilderState } = props;
132
- return (
133
- <>
134
- <PanelFormSection>
135
- <div className="panel__content__form__section__header__label">
136
- Processing Date
137
- </div>
138
- <MilestoningParameterEditor
139
- queryBuilderState={queryBuilderState}
140
- parameter={guaranteeNonNullable(
141
- queryBuilderState.milestoningState.processingDate,
142
- )}
143
- setParameter={(val: ValueSpecification): void =>
144
- queryBuilderState.milestoningState.setProcessingDate(val)
145
- }
146
- />
147
- </PanelFormSection>
148
- <PanelFormSection>
149
- <div className="panel__content__form__section__header__label">
150
- Business Date
151
- </div>
152
- <MilestoningParameterEditor
153
- queryBuilderState={queryBuilderState}
154
- parameter={guaranteeNonNullable(
155
- queryBuilderState.milestoningState.businessDate,
156
- )}
157
- setParameter={(val: ValueSpecification): void =>
158
- queryBuilderState.milestoningState.setBusinessDate(val)
159
- }
160
- />
161
- </PanelFormSection>
162
- </>
163
- );
164
- },
165
- );
166
-
167
- const BusinessTemporalMilestoningEditor = observer(
168
- (props: { queryBuilderState: QueryBuilderState }) => {
169
- const { queryBuilderState } = props;
170
- return (
171
- <PanelFormSection>
172
- <div className="panel__content__form__section__header__label">
173
- Business Date
174
- </div>
175
- <MilestoningParameterEditor
176
- key="BusinessDate"
177
- queryBuilderState={queryBuilderState}
178
- parameter={guaranteeNonNullable(
179
- queryBuilderState.milestoningState.businessDate,
180
- )}
181
- setParameter={(val: ValueSpecification): void =>
182
- queryBuilderState.milestoningState.setBusinessDate(val)
183
- }
184
- />
185
- </PanelFormSection>
186
- );
187
- },
188
- );
189
-
190
- const ProcessingTemporalMilestoningEditor = observer(
191
- (props: { queryBuilderState: QueryBuilderState }) => {
192
- const { queryBuilderState } = props;
193
- return (
194
- <PanelFormSection>
195
- <div className="panel__content__form__section__header__label">
196
- Processing Date
197
- </div>
198
- <MilestoningParameterEditor
199
- key="BusinessDate"
200
- queryBuilderState={queryBuilderState}
201
- parameter={guaranteeNonNullable(
202
- queryBuilderState.milestoningState.processingDate,
203
- )}
204
- setParameter={(val: ValueSpecification): void =>
205
- queryBuilderState.milestoningState.setProcessingDate(val)
206
- }
207
- />
208
- </PanelFormSection>
209
- );
210
- },
211
- );
212
-
213
- const TemporalMilestoningEditor: React.FC<{
214
- queryBuilderState: QueryBuilderState;
215
- }> = (props) => {
216
- const { queryBuilderState } = props;
217
-
218
- if (
219
- queryBuilderState.milestoningState.processingDate &&
220
- queryBuilderState.milestoningState.businessDate
221
- ) {
222
- return (
223
- <BiTemporalMilestoningEditor queryBuilderState={queryBuilderState} />
224
- );
225
- } else if (queryBuilderState.milestoningState.businessDate) {
226
- return (
227
- <BusinessTemporalMilestoningEditor
228
- queryBuilderState={queryBuilderState}
229
- />
230
- );
231
- } else if (queryBuilderState.milestoningState.processingDate) {
232
- return (
233
- <ProcessingTemporalMilestoningEditor
234
- queryBuilderState={queryBuilderState}
235
- />
236
- );
237
- } else {
238
- return null;
239
- }
240
- };
241
-
242
- const AllVersionsInRangelMilestoningParametersEditor = observer(
243
- (props: { queryBuilderState: QueryBuilderState }) => {
244
- const { queryBuilderState } = props;
245
-
246
- return (
247
- <div className="query-builder__milestoning-panel__all-versions-in-range-editor">
248
- <PanelFormSection>
249
- <div className="panel__content__form__section__header__label">
250
- Start Date
251
- </div>
252
- <MilestoningParameterEditor
253
- queryBuilderState={queryBuilderState}
254
- parameter={guaranteeNonNullable(
255
- queryBuilderState.milestoningState.startDate,
256
- )}
257
- setParameter={(val: ValueSpecification): void =>
258
- queryBuilderState.milestoningState.setStartDate(val)
259
- }
260
- />
261
- </PanelFormSection>
262
- <PanelFormSection>
263
- <div className="panel__content__form__section__header__label">
264
- End Date
265
- </div>
266
- <MilestoningParameterEditor
267
- queryBuilderState={queryBuilderState}
268
- parameter={guaranteeNonNullable(
269
- queryBuilderState.milestoningState.endDate,
270
- )}
271
- setParameter={(val: ValueSpecification): void =>
272
- queryBuilderState.milestoningState.setEndDate(val)
273
- }
274
- />
275
- </PanelFormSection>
276
- </div>
277
- );
278
- },
279
- );
280
-
281
- export const MilestoningParametersEditor = observer(
282
- (props: { queryBuilderState: QueryBuilderState }) => {
283
- const { queryBuilderState } = props;
284
- const applicationStore = queryBuilderState.applicationStore;
285
- const milestoningState = queryBuilderState.milestoningState;
286
- const close = (): void => milestoningState.setShowMilestoningEditor(false);
287
- const isCompatibleMilestoningParameter = (
288
- variable: VariableExpression,
289
- ): boolean =>
290
- variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.STRICTDATE ||
291
- variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE ||
292
- variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATE ||
293
- variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATETIME;
294
-
295
- return (
296
- <Dialog
297
- open={milestoningState.showMilestoningEditor}
298
- onClose={close}
299
- classes={{
300
- root: 'editor-modal__root-container',
301
- container: 'editor-modal__container',
302
- paper: 'editor-modal__content',
303
- }}
304
- >
305
- <Modal
306
- darkMode={
307
- !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
308
- }
309
- className="editor-modal query-builder__variables__modal"
310
- >
311
- <ModalHeader title="Milestoning Parameters" />
312
- <ModalBody className="query-builder__variables__modal__body">
313
- {milestoningState.isCurrentClassMilestoned && (
314
- <PanelFormBooleanField
315
- isReadOnly={false}
316
- value={milestoningState.isAllVersionsEnabled}
317
- name="all Versions"
318
- prompt="Query All Milestoned Versions of the Root Class"
319
- update={(value: boolean | undefined): void =>
320
- milestoningState.setAllVersions(value)
321
- }
322
- />
323
- )}
324
- {milestoningState.isAllVersionsEnabled &&
325
- milestoningState.isCurrentClassSupportsVersionsInRange && (
326
- <>
327
- <PanelFormBooleanField
328
- isReadOnly={false}
329
- value={milestoningState.isAllVersionsInRangeEnabled}
330
- name=" All Versions In Range"
331
- prompt="Optionally apply a date range to get All Versions for"
332
- update={(value: boolean | undefined): void =>
333
- milestoningState.setAllVersionsInRange(value)
334
- }
335
- />
336
-
337
- {milestoningState.isAllVersionsInRangeEnabled && (
338
- <AllVersionsInRangelMilestoningParametersEditor
339
- queryBuilderState={queryBuilderState}
340
- />
341
- )}
342
- </>
343
- )}
344
- <TemporalMilestoningEditor queryBuilderState={queryBuilderState} />
345
- <PanelFormSection>
346
- <div className="panel__content__form__section__header__label">
347
- List of compatible milestoning parameters
348
- </div>
349
- </PanelFormSection>
350
- <div className="panel__content__form__section__list__items">
351
- <VariableSelector
352
- queryBuilderState={queryBuilderState}
353
- filterBy={isCompatibleMilestoningParameter}
354
- />
355
- </div>
356
- </ModalBody>
357
- <ModalFooter>
358
- <ModalFooterButton text="Close" onClick={close} type="secondary" />
359
- </ModalFooter>
360
- </Modal>
361
- </Dialog>
362
- );
363
- },
364
- );