@finos/legend-query-builder 0.6.23 → 0.6.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +8 -5
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderConstantExpressionPanel.js +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  6. package/lib/components/QueryBuilderParametersPanel.js +1 -1
  7. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  8. package/lib/components/QueryBuilderSideBar.js +2 -2
  9. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  10. package/lib/components/QueryBuilder_TestID.d.ts +1 -1
  11. package/lib/components/QueryBuilder_TestID.d.ts.map +1 -1
  12. package/lib/components/QueryBuilder_TestID.js +1 -1
  13. package/lib/components/QueryBuilder_TestID.js.map +1 -1
  14. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +5 -5
  15. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  17. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +3 -3
  18. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  19. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.d.ts → QueryBuilderTDSWindowPanel.d.ts} +4 -4
  20. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -0
  21. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.js → QueryBuilderTDSWindowPanel.js} +94 -94
  22. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -0
  23. package/lib/components/workflows/ClassQueryBuilder.js +1 -1
  24. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  25. package/lib/components/workflows/MappingQueryBuilder.js +1 -1
  26. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  27. package/lib/graphManager/QueryBuilderHashUtils.d.ts +14 -14
  28. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  29. package/lib/graphManager/QueryBuilderHashUtils.js +14 -14
  30. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  31. package/lib/index.css +1 -1
  32. package/lib/package.json +6 -6
  33. package/lib/stores/QueryBuilderStateBuilder.js +1 -1
  34. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  35. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  36. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +2 -1
  37. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  38. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  39. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +2 -1
  40. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  41. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +6 -6
  42. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  43. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +13 -13
  44. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  45. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +2 -2
  46. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  47. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +2 -2
  48. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  49. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts → window/QueryBuilderWindowGroupByOperatorLoader.d.ts} +3 -3
  50. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.d.ts.map +1 -0
  51. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js +36 -0
  52. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js.map +1 -0
  53. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +91 -0
  54. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -0
  55. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.js → window/QueryBuilderWindowState.js} +55 -53
  56. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -0
  57. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts → window/QueryBuilderWindowStateBuilder.d.ts} +1 -1
  58. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -0
  59. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js → window/QueryBuilderWindowStateBuilder.js} +10 -10
  60. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -0
  61. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts → window/QueryBuilderWindowValueSpecificationBuilder.d.ts} +3 -3
  62. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -0
  63. package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js → window/QueryBuilderWindowValueSpecificationBuilder.js} +5 -5
  64. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -0
  65. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts → window/operators/QueryBuilderTDS_WindowOperator.d.ts} +2 -2
  66. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -0
  67. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js → window/operators/QueryBuilderTDS_WindowOperator.js} +2 -2
  68. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -0
  69. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +25 -0
  70. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -0
  71. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js → window/operators/QueryBuilderTDS_WindowOperator_Average.js} +6 -4
  72. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -0
  73. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts} +3 -3
  74. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -0
  75. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js → window/operators/QueryBuilderTDS_WindowOperator_Count.js} +4 -4
  76. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -0
  77. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts} +3 -3
  78. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -0
  79. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js → window/operators/QueryBuilderTDS_WindowOperator_Max.js} +4 -4
  80. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -0
  81. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts} +3 -3
  82. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -0
  83. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js → window/operators/QueryBuilderTDS_WindowOperator_Min.js} +4 -4
  84. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -0
  85. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts} +3 -3
  86. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -0
  87. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js → window/operators/QueryBuilderTDS_WindowOperator_Sum.js} +4 -4
  88. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -0
  89. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts} +3 -3
  90. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -0
  91. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js} +4 -4
  92. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -0
  93. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts} +3 -3
  94. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -0
  95. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js} +4 -4
  96. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -0
  97. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts} +3 -3
  98. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -0
  99. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js} +4 -4
  100. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -0
  101. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts} +3 -3
  102. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -0
  103. package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js} +4 -4
  104. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -0
  105. package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -1
  106. package/lib/stores/shared/LambdaParameterState.js.map +1 -1
  107. package/package.json +13 -13
  108. package/src/components/QueryBuilder.tsx +16 -6
  109. package/src/components/QueryBuilderConstantExpressionPanel.tsx +1 -1
  110. package/src/components/QueryBuilderParametersPanel.tsx +1 -1
  111. package/src/components/QueryBuilderSideBar.tsx +2 -2
  112. package/src/components/QueryBuilder_TestID.ts +1 -1
  113. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +8 -8
  114. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +6 -8
  115. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.tsx → QueryBuilderTDSWindowPanel.tsx} +166 -166
  116. package/src/components/workflows/ClassQueryBuilder.tsx +1 -1
  117. package/src/components/workflows/MappingQueryBuilder.tsx +1 -1
  118. package/src/graphManager/QueryBuilderHashUtils.ts +14 -14
  119. package/src/stores/QueryBuilderStateBuilder.ts +1 -1
  120. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +4 -2
  121. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +3 -1
  122. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +16 -16
  123. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +2 -2
  124. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +2 -2
  125. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.ts +39 -0
  126. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.ts → window/QueryBuilderWindowState.ts} +83 -76
  127. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.ts → window/QueryBuilderWindowStateBuilder.ts} +19 -19
  128. package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.ts → window/QueryBuilderWindowValueSpecificationBuilder.ts} +9 -9
  129. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.ts → window/operators/QueryBuilderTDS_WindowOperator.ts} +1 -1
  130. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.ts → window/operators/QueryBuilderTDS_WindowOperator_Average.ts} +5 -3
  131. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.ts} +3 -3
  132. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.ts} +3 -3
  133. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.ts} +3 -3
  134. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.ts} +3 -3
  135. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts} +3 -3
  136. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts} +3 -3
  137. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts} +3 -3
  138. package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts} +3 -3
  139. package/src/stores/shared/LambdaParameterState.ts +1 -0
  140. package/tsconfig.json +15 -15
  141. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +0 -1
  142. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +0 -1
  143. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +0 -1
  144. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js +0 -36
  145. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +0 -1
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts +0 -91
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +0 -1
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +0 -1
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +0 -1
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +0 -1
  151. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +0 -1
  152. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +0 -1
  153. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts.map +0 -1
  154. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js.map +0 -1
  155. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts.map +0 -1
  156. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js.map +0 -1
  157. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts.map +0 -1
  158. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js.map +0 -1
  159. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts.map +0 -1
  160. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js.map +0 -1
  161. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts.map +0 -1
  162. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js.map +0 -1
  163. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts +0 -25
  164. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts.map +0 -1
  165. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js.map +0 -1
  166. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts.map +0 -1
  167. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js.map +0 -1
  168. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts.map +0 -1
  169. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js.map +0 -1
  170. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts.map +0 -1
  171. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js.map +0 -1
  172. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts.map +0 -1
  173. package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js.map +0 -1
  174. package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.ts +0 -39
@@ -47,16 +47,16 @@ import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
47
47
  import { observer } from 'mobx-react-lite';
48
48
  import { forwardRef, useCallback, useRef, useState } from 'react';
49
49
  import { type DropTargetMonitor, useDrag, useDrop } from 'react-dnd';
50
- import type { QueryBuilderTDS_OLAPOperator } from '../../stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js';
50
+ import type { QueryBuilderTDS_WindowOperator } from '../../stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js';
51
51
  import {
52
- type QueryBuilderOLAPGroupByState,
53
- type QueryBuilderOLAPDropTarget,
54
- type QueryBuilderOLAPColumnDragSource,
55
- QueryBuilderOLAPGroupByColumnState,
56
- QueryBuilderTDS_OLAPRankOperatorState,
57
- QueryBuilderTDS_OLAPAggreationOperatorState,
58
- QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
59
- } from '../../stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js';
52
+ type QueryBuilderWindowState,
53
+ type QueryBuilderWindowDropTarget,
54
+ type QueryBuilderWindowColumnDragSource,
55
+ QueryBuilderWindowColumnState,
56
+ QueryBuilderTDS_WindowRankOperatorState,
57
+ QueryBuilderTDS_WindowAggreationOperatorState,
58
+ QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
59
+ } from '../../stores/fetch-structure/tds/window/QueryBuilderWindowState.js';
60
60
  import { QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE } from '../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
61
61
  import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState.js';
62
62
  import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
@@ -64,40 +64,38 @@ import { COLUMN_SORT_TYPE } from '../../stores/fetch-structure/tds/QueryResultSe
64
64
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
65
65
 
66
66
  // helpers
67
- const createOlapColumnState = (
67
+ const createWindowColumnState = (
68
68
  columnState: QueryBuilderTDSColumnState,
69
69
  tdsState: QueryBuilderTDSState,
70
- ): QueryBuilderOLAPGroupByColumnState => {
71
- const operator = tdsState.olapGroupByState.operators.filter(
70
+ ): QueryBuilderWindowColumnState => {
71
+ const operator = tdsState.windowState.operators.filter(
72
72
  (o) =>
73
73
  o.isColumnAggregator() &&
74
74
  o.isCompatibleWithType(columnState.getColumnType()),
75
75
  )[0];
76
76
  const nonColoperator = guaranteeNonNullable(
77
- tdsState.olapGroupByState.operators.filter(
78
- (o) => !o.isColumnAggregator(),
79
- )[0],
77
+ tdsState.windowState.operators.filter((o) => !o.isColumnAggregator())[0],
80
78
  );
81
79
  if (operator) {
82
- const opState = new QueryBuilderTDS_OLAPAggreationOperatorState(
83
- tdsState.olapGroupByState,
80
+ const opState = new QueryBuilderTDS_WindowAggreationOperatorState(
81
+ tdsState.windowState,
84
82
  operator,
85
83
  columnState,
86
84
  );
87
- return new QueryBuilderOLAPGroupByColumnState(
88
- tdsState.olapGroupByState,
85
+ return new QueryBuilderWindowColumnState(
86
+ tdsState.windowState,
89
87
  [],
90
88
  undefined,
91
89
  opState,
92
90
  `${operator.getLabel()} ${columnState.columnName}`,
93
91
  );
94
92
  } else {
95
- return new QueryBuilderOLAPGroupByColumnState(
96
- tdsState.olapGroupByState,
93
+ return new QueryBuilderWindowColumnState(
94
+ tdsState.windowState,
97
95
  [columnState],
98
96
  undefined,
99
- new QueryBuilderTDS_OLAPRankOperatorState(
100
- tdsState.olapGroupByState,
97
+ new QueryBuilderTDS_WindowRankOperatorState(
98
+ tdsState.windowState,
101
99
  nonColoperator,
102
100
  ),
103
101
  `${nonColoperator.getLabel()} ${columnState.columnName}`,
@@ -105,18 +103,18 @@ const createOlapColumnState = (
105
103
  }
106
104
  };
107
105
 
108
- const QueryBuilderOlapGroupByColumnContextMenu = observer(
106
+ const QueryBuilderWindowColumnContextMenu = observer(
109
107
  forwardRef<
110
108
  HTMLDivElement,
111
109
  {
112
- columnState: QueryBuilderOLAPGroupByColumnState;
110
+ columnState: QueryBuilderWindowColumnState;
113
111
  }
114
- >(function QueryBuilderOlapGroupByColumnContextMenu(props, ref) {
112
+ >(function QueryBuilderWindowGroupByColumnContextMenu(props, ref) {
115
113
  const { columnState } = props;
116
114
  const editColumn = (): void =>
117
- columnState.olapState.setEditColumn(columnState);
115
+ columnState.windowState.setEditColumn(columnState);
118
116
  const removeColumn = (): void =>
119
- columnState.olapState.removeColumn(columnState);
117
+ columnState.windowState.removeColumn(columnState);
120
118
 
121
119
  return (
122
120
  <MenuContent ref={ref}>
@@ -176,27 +174,27 @@ const TDSColumnSelectorEditor = observer(
176
174
  },
177
175
  );
178
176
 
179
- const QueryBuilderOlapColumnModalEditor = observer(
177
+ const QueryBuilderWindowColumnModalEditor = observer(
180
178
  (props: {
181
- olapGroupByState: QueryBuilderOLAPGroupByState;
182
- olapColumnState: QueryBuilderOLAPGroupByColumnState;
179
+ windowState: QueryBuilderWindowState;
180
+ windowColumnState: QueryBuilderWindowColumnState;
183
181
  }) => {
184
- const { olapGroupByState, olapColumnState } = props;
185
- const createNewOlap =
186
- !olapGroupByState.olapColumns.includes(olapColumnState);
187
- const tdsState = olapGroupByState.tdsState;
182
+ const { windowState, windowColumnState } = props;
183
+ const createNewWindow =
184
+ !windowState.windowColumns.includes(windowColumnState);
185
+ const tdsState = windowState.tdsState;
188
186
  const applicationStore = useApplicationStore();
189
187
  const close = (): void => {
190
- olapGroupByState.setEditColumn(undefined);
188
+ windowState.setEditColumn(undefined);
191
189
  };
192
- const isDuplicatedColumnName = createNewOlap
193
- ? olapGroupByState.tdsState.tdsColumns
190
+ const isDuplicatedColumnName = createNewWindow
191
+ ? windowState.tdsState.tdsColumns
194
192
  .map((c) => c.columnName)
195
- .includes(olapColumnState.columnName)
196
- : olapGroupByState.tdsState.isDuplicateColumn(olapColumnState);
197
- const windowOptions = createNewOlap
193
+ .includes(windowColumnState.columnName)
194
+ : windowState.tdsState.isDuplicateColumn(windowColumnState);
195
+ const windowOptions = createNewWindow
198
196
  ? tdsState.tdsColumns
199
- : olapColumnState.possibleReferencedColumns;
197
+ : windowColumnState.possibleReferencedColumns;
200
198
  const windowOptionsLabels = windowOptions.map((w) => ({
201
199
  label: w.columnName,
202
200
  value: w,
@@ -204,19 +202,19 @@ const QueryBuilderOlapColumnModalEditor = observer(
204
202
  // column Name
205
203
  const changeColumnName: React.ChangeEventHandler<HTMLInputElement> = (
206
204
  event,
207
- ) => olapColumnState.setColumnName(event.target.value);
205
+ ) => windowColumnState.setColumnName(event.target.value);
208
206
  // operator
209
- const operators = olapGroupByState.operators;
210
- const operationState = olapColumnState.operationState;
211
- const olapOpColumn =
212
- operationState instanceof QueryBuilderTDS_OLAPAggreationOperatorState
207
+ const operators = windowState.operators;
208
+ const operationState = windowColumnState.operationState;
209
+ const windowOpColumn =
210
+ operationState instanceof QueryBuilderTDS_WindowAggreationOperatorState
213
211
  ? operationState.columnState
214
212
  : undefined;
215
213
  const changeOperatorCol = (
216
214
  val: { label: string; value: QueryBuilderTDSColumnState } | null,
217
215
  ): void => {
218
216
  if (
219
- operationState instanceof QueryBuilderTDS_OLAPAggreationOperatorState
217
+ operationState instanceof QueryBuilderTDS_WindowAggreationOperatorState
220
218
  ) {
221
219
  if (val !== null) {
222
220
  operationState.setColumnState(val.value);
@@ -224,26 +222,26 @@ const QueryBuilderOlapColumnModalEditor = observer(
224
222
  }
225
223
  };
226
224
  const changeOperator =
227
- (olapOp: QueryBuilderTDS_OLAPOperator) => (): void => {
228
- olapColumnState.changeOperator(olapOp);
225
+ (olapOp: QueryBuilderTDS_WindowOperator) => (): void => {
226
+ windowColumnState.changeOperator(olapOp);
229
227
  };
230
228
  // window
231
229
  const addOptions = windowOptions.filter(
232
- (e) => !olapColumnState.windowColumns.includes(e),
230
+ (e) => !windowColumnState.windowColumns.includes(e),
233
231
  );
234
232
  const create = (): void => {
235
- olapGroupByState.addOLAPColumn(olapColumnState);
233
+ windowState.addWindowColumn(windowColumnState);
236
234
  close();
237
235
  };
238
236
  const addWindowValue = (): void => {
239
237
  if (addOptions.length > 0) {
240
- olapColumnState.addWindow(guaranteeNonNullable(addOptions[0]));
238
+ windowColumnState.addWindow(guaranteeNonNullable(addOptions[0]));
241
239
  }
242
240
  };
243
241
  // sortby
244
- const sortByState = olapColumnState.sortByState;
242
+ const sortByState = windowColumnState.sortByState;
245
243
  const changeSortBy = (sortOp: COLUMN_SORT_TYPE | undefined) => (): void => {
246
- olapColumnState.changeSortBy(sortOp);
244
+ windowColumnState.changeSortBy(sortOp);
247
245
  };
248
246
  const changeSortCol = (
249
247
  val: { label: string; value: QueryBuilderTDSColumnState } | null,
@@ -256,7 +254,7 @@ const QueryBuilderOlapColumnModalEditor = observer(
256
254
  };
257
255
  return (
258
256
  <Dialog
259
- open={Boolean(olapGroupByState.editColumn)}
257
+ open={Boolean(windowState.editColumn)}
260
258
  onClose={close}
261
259
  classes={{
262
260
  root: 'editor-modal__root-container',
@@ -276,18 +274,18 @@ const QueryBuilderOlapColumnModalEditor = observer(
276
274
  >
277
275
  <ModalHeader
278
276
  title={
279
- createNewOlap
280
- ? 'Create OLAP GroupBy Column'
281
- : 'Update OLAP GroupByColumn'
277
+ createNewWindow
278
+ ? 'Create Window Function Column'
279
+ : 'Update Window Function Column'
282
280
  }
283
281
  />
284
282
  <div className="query-builder__olap__modal__body">
285
283
  <PanelFormSection>
286
284
  <div className="panel__content__form__section__header__label">
287
- OLAP Operator
285
+ Window Operator
288
286
  </div>
289
287
  <div className="panel__content__form__section__header__prompt">
290
- OLAP aggregation function to apply and column if required by
288
+ Window aggregation function to apply and column if required by
291
289
  function
292
290
  </div>
293
291
  <div className="panel__content__form__section__list">
@@ -298,13 +296,13 @@ const QueryBuilderOlapColumnModalEditor = observer(
298
296
  'query-builder__olap__column__operation__operator__label',
299
297
  {
300
298
  'query-builder__olap__column__operation__operator__label__agg':
301
- !olapOpColumn,
299
+ !windowOpColumn,
302
300
  },
303
301
  )}
304
302
  >
305
303
  {operationState.operator.getLabel()}
306
304
  </div>
307
- {olapOpColumn && (
305
+ {windowOpColumn && (
308
306
  <div className="panel__content__form__section__list__item query-builder__olap__tds__column__options">
309
307
  <CustomSelectorInput
310
308
  className="query-builder__olap__tds__column__dropdown"
@@ -312,8 +310,8 @@ const QueryBuilderOlapColumnModalEditor = observer(
312
310
  disabled={windowOptionsLabels.length < 1}
313
311
  onChange={changeOperatorCol}
314
312
  value={{
315
- value: olapOpColumn,
316
- label: olapOpColumn.columnName,
313
+ value: windowOpColumn,
314
+ label: windowOpColumn.columnName,
317
315
  }}
318
316
  darkMode={
319
317
  !applicationStore.TEMPORARY__isLightThemeEnabled
@@ -352,14 +350,14 @@ const QueryBuilderOlapColumnModalEditor = observer(
352
350
  <button
353
351
  className="query-builder__olap__column__operation__operator__badge"
354
352
  tabIndex={-1}
355
- title="Choose OLAP GroupBy Operator..."
353
+ title="Choose Window Function Operator..."
356
354
  >
357
355
  <SigmaIcon />
358
356
  </button>
359
357
  <button
360
358
  className="query-builder__olap__column__operation__operator__dropdown__trigger"
361
359
  tabIndex={-1}
362
- title="Choose OLAP GroupBy Operator..."
360
+ title="Choose Window Function Operator..."
363
361
  >
364
362
  <CaretDownIcon />
365
363
  </button>
@@ -378,15 +376,15 @@ const QueryBuilderOlapColumnModalEditor = observer(
378
376
  </div>
379
377
  <div className="panel__content__form__section__list">
380
378
  <div className="panel__content__form__section__list__items">
381
- {olapColumnState.windowColumns.map((value, idx) => (
379
+ {windowColumnState.windowColumns.map((value, idx) => (
382
380
  <TDSColumnSelectorEditor
383
381
  key={value.uuid}
384
382
  colValue={value}
385
383
  setColumn={(v: QueryBuilderTDSColumnState) =>
386
- olapColumnState.changeWindow(v, idx)
384
+ windowColumnState.changeWindow(v, idx)
387
385
  }
388
386
  deleteColumn={(v: QueryBuilderTDSColumnState): void =>
389
- olapColumnState.deleteWindow(v)
387
+ windowColumnState.deleteWindow(v)
390
388
  }
391
389
  tdsColOptions={windowOptions}
392
390
  />
@@ -479,14 +477,14 @@ const QueryBuilderOlapColumnModalEditor = observer(
479
477
  },
480
478
  )}
481
479
  tabIndex={-1}
482
- title="Choose OLAP SortBy Operator..."
480
+ title="Choose Window Function SortBy Operator..."
483
481
  >
484
482
  <SortIcon />
485
483
  </div>
486
484
  <div
487
485
  className="query-builder__olap__column__sortby__operator__dropdown__trigger"
488
486
  tabIndex={-1}
489
- title="Choose OLAP SortBy Operator..."
487
+ title="Choose Window Function SortBy Operator..."
490
488
  >
491
489
  <CaretDownIcon />
492
490
  </div>
@@ -497,15 +495,15 @@ const QueryBuilderOlapColumnModalEditor = observer(
497
495
 
498
496
  <PanelFormSection>
499
497
  <div className="panel__content__form__section__header__label">
500
- OLAP Column Name
498
+ Window Function Column Name
501
499
  </div>
502
500
  <div className="panel__content__form__section__header__prompt">
503
- Name of OLAP Column that will be part of TDS Result
501
+ Name of Window Function Column that will be part of TDS Result
504
502
  </div>
505
503
  <InputWithInlineValidation
506
504
  className="query-builder__olap__column__name__input input-group__input"
507
505
  spellCheck={false}
508
- value={olapColumnState.columnName}
506
+ value={windowColumnState.columnName}
509
507
  onChange={changeColumnName}
510
508
  validationErrorMessage={
511
509
  isDuplicatedColumnName ? 'Duplicated column' : undefined
@@ -514,7 +512,7 @@ const QueryBuilderOlapColumnModalEditor = observer(
514
512
  </PanelFormSection>
515
513
  </div>
516
514
  <ModalFooter>
517
- {createNewOlap ? (
515
+ {createNewWindow ? (
518
516
  <button className="btn modal__footer__close-btn" onClick={create}>
519
517
  Create
520
518
  </button>
@@ -569,20 +567,20 @@ const TDSColumnReferenceEditor = observer(
569
567
  };
570
568
 
571
569
  const handleDrop = useCallback(
572
- (item: QueryBuilderOLAPColumnDragSource): void => {
570
+ (item: QueryBuilderWindowColumnDragSource): void => {
573
571
  handleChange(item.columnState);
574
572
  },
575
573
  [handleChange],
576
574
  );
577
575
  const [{ isDragOver }, dropOpConnector] = useDrop<
578
- QueryBuilderOLAPColumnDragSource,
576
+ QueryBuilderWindowColumnDragSource,
579
577
  void,
580
578
  { isDragOver: boolean }
581
579
  >(
582
580
  () => ({
583
581
  accept: [
584
582
  QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
585
- QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
583
+ QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
586
584
  ],
587
585
  drop: (item, monitor): void => {
588
586
  if (!monitor.didDrop()) {
@@ -655,12 +653,12 @@ const TDSColumnReferenceEditor = observer(
655
653
  },
656
654
  );
657
655
 
658
- const QueryBuilderOlapGroupByColumnEditor = observer(
659
- (props: { olapColumnState: QueryBuilderOLAPGroupByColumnState }) => {
660
- const { olapColumnState } = props;
661
- const olapState = olapColumnState.olapState;
662
- const tdsState = olapState.tdsState;
663
- const operators = olapState.operators;
656
+ const QueryBuilderWindowColumnEditor = observer(
657
+ (props: { windowColumnState: QueryBuilderWindowColumnState }) => {
658
+ const { windowColumnState } = props;
659
+ const windowState = windowColumnState.windowState;
660
+ const tdsState = windowState.tdsState;
661
+ const operators = windowState.operators;
664
662
  // state
665
663
  const ref = useRef<HTMLDivElement>(null);
666
664
  const [windowAnchor, setWindowAnchor] = useState<HTMLButtonElement | null>(
@@ -682,58 +680,60 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
682
680
  // column Name
683
681
  const changeColumnName: React.ChangeEventHandler<HTMLInputElement> = (
684
682
  event,
685
- ) => olapColumnState.setColumnName(event.target.value);
686
- const isDuplicatedColumnName = tdsState.isDuplicateColumn(olapColumnState);
683
+ ) => windowColumnState.setColumnName(event.target.value);
684
+ const isDuplicatedColumnName =
685
+ tdsState.isDuplicateColumn(windowColumnState);
687
686
 
688
687
  // window columns
689
- const windowOptions = olapColumnState.possibleReferencedColumns;
688
+ const windowOptions = windowColumnState.possibleReferencedColumns;
690
689
  const addWindowOptions = windowOptions.filter(
691
- (e) => !olapColumnState.windowColumns.includes(e),
690
+ (e) => !windowColumnState.windowColumns.includes(e),
692
691
  );
693
692
  const addWindowValue = (): void => {
694
693
  if (addWindowOptions.length > 0) {
695
- olapColumnState.addWindow(guaranteeNonNullable(addWindowOptions[0]));
694
+ windowColumnState.addWindow(guaranteeNonNullable(addWindowOptions[0]));
696
695
  }
697
696
  };
698
697
 
699
698
  // operator
700
- const operationState = olapColumnState.operationState;
699
+ const operationState = windowColumnState.operationState;
701
700
  const aggregateColumn =
702
- operationState instanceof QueryBuilderTDS_OLAPAggreationOperatorState
701
+ operationState instanceof QueryBuilderTDS_WindowAggreationOperatorState
703
702
  ? operationState.columnState
704
703
  : undefined;
705
704
 
706
705
  const changeOperator =
707
- (olapOp: QueryBuilderTDS_OLAPOperator) => (): void => {
708
- olapColumnState.changeOperator(olapOp);
706
+ (olapOp: QueryBuilderTDS_WindowOperator) => (): void => {
707
+ windowColumnState.changeOperator(olapOp);
709
708
  };
710
709
 
711
710
  // sortby
712
- const sortByState = olapColumnState.sortByState;
711
+ const sortByState = windowColumnState.sortByState;
713
712
  const changeSortBy = (sortOp: COLUMN_SORT_TYPE | undefined) => (): void => {
714
- olapColumnState.changeSortBy(sortOp);
713
+ windowColumnState.changeSortBy(sortOp);
715
714
  };
716
715
 
717
716
  // action
718
- const isRemovalDisabled = olapState.tdsState.isColumnInUse(olapColumnState);
717
+ const isRemovalDisabled =
718
+ windowState.tdsState.isColumnInUse(windowColumnState);
719
719
  const removeColumn = (): void => {
720
- olapColumnState.olapState.removeColumn(olapColumnState);
720
+ windowColumnState.windowState.removeColumn(windowColumnState);
721
721
  };
722
722
  const editoColumn = (): void => {
723
- olapState.setEditColumn(olapColumnState);
723
+ windowState.setEditColumn(windowColumnState);
724
724
  };
725
725
 
726
726
  // Drag and Drop
727
727
  const handleHover = useCallback(
728
728
  (
729
- item: QueryBuilderOLAPColumnDragSource,
729
+ item: QueryBuilderWindowColumnDragSource,
730
730
  monitor: DropTargetMonitor,
731
731
  ): void => {
732
- const dragIndex = tdsState.olapGroupByState.olapColumns.findIndex(
732
+ const dragIndex = tdsState.windowState.windowColumns.findIndex(
733
733
  (e) => e === item.columnState,
734
734
  );
735
- const hoverIndex = tdsState.olapGroupByState.olapColumns.findIndex(
736
- (e) => e === olapColumnState,
735
+ const hoverIndex = tdsState.windowState.windowColumns.findIndex(
736
+ (e) => e === windowColumnState,
737
737
  );
738
738
  if (dragIndex === -1 || hoverIndex === -1 || dragIndex === hoverIndex) {
739
739
  return;
@@ -751,29 +751,29 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
751
751
  if (dragIndex > hoverIndex && dragDistance > distanceThreshold) {
752
752
  return;
753
753
  }
754
- olapState.moveColumn(dragIndex, hoverIndex);
754
+ windowState.moveColumn(dragIndex, hoverIndex);
755
755
  },
756
- [olapColumnState, olapState, tdsState.olapGroupByState.olapColumns],
756
+ [windowColumnState, windowState, tdsState.windowState.windowColumns],
757
757
  );
758
- const [, dropConnector] = useDrop<QueryBuilderOLAPColumnDragSource>(
758
+ const [, dropConnector] = useDrop<QueryBuilderWindowColumnDragSource>(
759
759
  () => ({
760
- accept: [QUERY_BUILDER_OLAP_COLUMN_DND_TYPE],
760
+ accept: [QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE],
761
761
  hover: (item, monitor): void => handleHover(item, monitor),
762
762
  }),
763
763
  [handleHover],
764
764
  );
765
765
  const [{ olapColumnBeingDragged }, dragConnector, dragPreviewConnector] =
766
766
  useDrag<
767
- QueryBuilderOLAPColumnDragSource,
767
+ QueryBuilderWindowColumnDragSource,
768
768
  void,
769
769
  {
770
770
  olapColumnBeingDragged: QueryBuilderTDSColumnState | undefined;
771
771
  }
772
772
  >(
773
773
  () => ({
774
- type: QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
774
+ type: QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
775
775
  item: () => ({
776
- columnState: olapColumnState,
776
+ columnState: windowColumnState,
777
777
  }),
778
778
  collect: (monitor) => ({
779
779
  /**
@@ -781,19 +781,19 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
781
781
  */
782
782
  olapColumnBeingDragged:
783
783
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
784
- (monitor.getItem() as QueryBuilderOLAPColumnDragSource | null)
784
+ (monitor.getItem() as QueryBuilderWindowColumnDragSource | null)
785
785
  ?.columnState,
786
786
  }),
787
787
  }),
788
- [olapColumnState],
788
+ [windowColumnState],
789
789
  );
790
- const isBeingDragged = olapColumnState === olapColumnBeingDragged;
790
+ const isBeingDragged = windowColumnState === olapColumnBeingDragged;
791
791
  dragConnector(dropConnector(ref));
792
792
  useDragPreviewLayer(dragPreviewConnector);
793
793
 
794
794
  const handleOpDrop = (val: QueryBuilderTDSColumnState): void => {
795
795
  if (
796
- operationState instanceof QueryBuilderTDS_OLAPAggreationOperatorState
796
+ operationState instanceof QueryBuilderTDS_WindowAggreationOperatorState
797
797
  ) {
798
798
  operationState.setColumnState(val);
799
799
  }
@@ -804,26 +804,26 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
804
804
  }
805
805
  };
806
806
  const handleWindowDrop = useCallback(
807
- (item: QueryBuilderOLAPColumnDragSource): void => {
807
+ (item: QueryBuilderWindowColumnDragSource): void => {
808
808
  const colState = item.columnState;
809
809
  if (
810
- olapColumnState.possibleReferencedColumns.includes(colState) &&
811
- !olapColumnState.windowColumns.includes(colState)
810
+ windowColumnState.possibleReferencedColumns.includes(colState) &&
811
+ !windowColumnState.windowColumns.includes(colState)
812
812
  ) {
813
- olapColumnState.addWindow(colState);
813
+ windowColumnState.addWindow(colState);
814
814
  }
815
815
  },
816
- [olapColumnState],
816
+ [windowColumnState],
817
817
  );
818
818
  const [{ isDragOver }, dropOpConnector] = useDrop<
819
- QueryBuilderOLAPColumnDragSource,
819
+ QueryBuilderWindowColumnDragSource,
820
820
  void,
821
821
  { isDragOver: boolean }
822
822
  >(
823
823
  () => ({
824
824
  accept: [
825
825
  QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
826
- QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
826
+ QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
827
827
  ],
828
828
  drop: (item, monitor): void => {
829
829
  if (!monitor.didDrop()) {
@@ -845,8 +845,8 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
845
845
  >
846
846
  <ContextMenu
847
847
  content={
848
- <QueryBuilderOlapGroupByColumnContextMenu
849
- columnState={olapColumnState}
848
+ <QueryBuilderWindowColumnContextMenu
849
+ columnState={windowColumnState}
850
850
  />
851
851
  }
852
852
  className={clsx('query-builder__olap__column__context-menu', {
@@ -880,7 +880,7 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
880
880
  tdsColumn={aggregateColumn}
881
881
  handleChange={handleOpDrop}
882
882
  selectionEditor={{
883
- options: olapColumnState.possibleReferencedColumns,
883
+ options: windowColumnState.possibleReferencedColumns,
884
884
  }}
885
885
  />
886
886
  )}
@@ -909,14 +909,14 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
909
909
  <button
910
910
  className="query-builder__olap__column__operation__operator__badge"
911
911
  tabIndex={-1}
912
- title="Choose OLAP GroupBy Operator..."
912
+ title="Choose Window Function Operator..."
913
913
  >
914
914
  <SigmaIcon />
915
915
  </button>
916
916
  <button
917
917
  className="query-builder__olap__column__operation__operator__dropdown__trigger"
918
918
  tabIndex={-1}
919
- title="Choose OLAP GroupBy Operator..."
919
+ title="Choose Window Function Operator..."
920
920
  >
921
921
  <CaretDownIcon />
922
922
  </button>
@@ -936,10 +936,10 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
936
936
  className="query-builder__dnd__placeholder"
937
937
  >
938
938
  <div
939
- title={`${olapColumnState.windowColumns.length} columns partitioned`}
939
+ title={`${windowColumnState.windowColumns.length} columns partitioned`}
940
940
  className="query-builder__olap__column__window__content__label"
941
941
  >
942
- ({olapColumnState.windowColumns.length})
942
+ ({windowColumnState.windowColumns.length})
943
943
  </div>
944
944
  <div
945
945
  className={clsx(
@@ -968,15 +968,15 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
968
968
  <div className="query-builder__olap__column__window__popover">
969
969
  <div className="panel__content__form__section__list">
970
970
  <div className="panel__content__form__section__list__items">
971
- {olapColumnState.windowColumns.map((value, idx) => (
971
+ {windowColumnState.windowColumns.map((value, idx) => (
972
972
  <TDSColumnSelectorEditor
973
973
  key={value.uuid}
974
974
  colValue={value}
975
975
  setColumn={(v: QueryBuilderTDSColumnState) =>
976
- olapColumnState.changeWindow(v, idx)
976
+ windowColumnState.changeWindow(v, idx)
977
977
  }
978
978
  deleteColumn={(v: QueryBuilderTDSColumnState): void =>
979
- olapColumnState.deleteWindow(v)
979
+ windowColumnState.deleteWindow(v)
980
980
  }
981
981
  tdsColOptions={windowOptions}
982
982
  />
@@ -1008,7 +1008,7 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
1008
1008
  tdsColumn={sortByState.columnState}
1009
1009
  handleChange={handleSortDrop}
1010
1010
  selectionEditor={{
1011
- options: olapColumnState.possibleReferencedColumns,
1011
+ options: windowColumnState.possibleReferencedColumns,
1012
1012
  }}
1013
1013
  />
1014
1014
  )}
@@ -1055,14 +1055,14 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
1055
1055
  },
1056
1056
  )}
1057
1057
  tabIndex={-1}
1058
- title="Choose OLAP SortBy Operator..."
1058
+ title="Choose Window Function SortBy Operator..."
1059
1059
  >
1060
1060
  <SortIcon />
1061
1061
  </button>
1062
1062
  <button
1063
1063
  className="query-builder__olap__column__sortby__operator__dropdown__trigger"
1064
1064
  tabIndex={-1}
1065
- title="Choose OLAP SortBy Operator..."
1065
+ title="Choose Window Function SortBy Operator..."
1066
1066
  >
1067
1067
  <CaretDownIcon />
1068
1068
  </button>
@@ -1073,7 +1073,7 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
1073
1073
  <InputWithInlineValidation
1074
1074
  className="query-builder__olap__column__name__input input-group__input"
1075
1075
  spellCheck={false}
1076
- value={olapColumnState.columnName}
1076
+ value={windowColumnState.columnName}
1077
1077
  onChange={changeColumnName}
1078
1078
  validationErrorMessage={
1079
1079
  isDuplicatedColumnName ? 'Duplicated column' : undefined
@@ -1109,46 +1109,46 @@ const QueryBuilderOlapGroupByColumnEditor = observer(
1109
1109
  },
1110
1110
  );
1111
1111
 
1112
- export const QueryBuilderOlapGroupByPanel = observer(
1113
- (props: { olapGroupByState: QueryBuilderOLAPGroupByState }) => {
1114
- const { olapGroupByState } = props;
1112
+ export const QueryBuilderTDSWindowPanel = observer(
1113
+ (props: { tdsWindowState: QueryBuilderWindowState }) => {
1114
+ const { tdsWindowState } = props;
1115
1115
  const applicationStore = useApplicationStore();
1116
- const createOlapGroupBy = (): void => {
1117
- const col = olapGroupByState.tdsState.tdsColumns[0];
1116
+ const createTDSWindow = (): void => {
1117
+ const col = tdsWindowState.tdsState.tdsColumns[0];
1118
1118
  if (col) {
1119
- const newOlapState = createOlapColumnState(
1119
+ const newWindowState = createWindowColumnState(
1120
1120
  col,
1121
- olapGroupByState.tdsState,
1121
+ tdsWindowState.tdsState,
1122
1122
  );
1123
- olapGroupByState.setEditColumn(newOlapState);
1123
+ tdsWindowState.setEditColumn(newWindowState);
1124
1124
  }
1125
1125
  };
1126
1126
  // Drag and Drop
1127
1127
  const handleDrop = useCallback(
1128
- async (item: QueryBuilderOLAPDropTarget): Promise<void> => {
1128
+ async (item: QueryBuilderWindowDropTarget): Promise<void> => {
1129
1129
  try {
1130
- const newOlapState = createOlapColumnState(
1130
+ const newWindowState = createWindowColumnState(
1131
1131
  item.columnState,
1132
- olapGroupByState.tdsState,
1132
+ tdsWindowState.tdsState,
1133
1133
  );
1134
- olapGroupByState.addOLAPColumn(newOlapState);
1134
+ tdsWindowState.addWindowColumn(newWindowState);
1135
1135
  } catch (error) {
1136
1136
  assertErrorThrown(error);
1137
1137
  applicationStore.notifyError(error.message);
1138
1138
  return;
1139
1139
  }
1140
1140
  },
1141
- [applicationStore, olapGroupByState],
1141
+ [applicationStore, tdsWindowState],
1142
1142
  );
1143
1143
  const [{ isDragOver }, dropTargetConnector] = useDrop<
1144
- QueryBuilderOLAPDropTarget,
1144
+ QueryBuilderWindowDropTarget,
1145
1145
  void,
1146
1146
  { isDragOver: boolean }
1147
1147
  >(
1148
1148
  () => ({
1149
1149
  accept: [
1150
1150
  QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
1151
- QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
1151
+ QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
1152
1152
  ],
1153
1153
  drop: (item, monitor): void => {
1154
1154
  if (!monitor.didDrop()) {
@@ -1163,24 +1163,24 @@ export const QueryBuilderOlapGroupByPanel = observer(
1163
1163
  );
1164
1164
  return (
1165
1165
  <div
1166
- data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_OLAP_GROUPBY}
1166
+ data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_WINDOW_GROUPBY}
1167
1167
  className="panel"
1168
1168
  >
1169
1169
  <div
1170
- data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_OLAP_GROUPBY}
1170
+ data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_WINDOW_GROUPBY}
1171
1171
  className="panel"
1172
1172
  >
1173
1173
  <div className="panel__header">
1174
1174
  <div className="panel__header__title">
1175
- <div className="panel__header__title__label">OLAP</div>
1175
+ <div className="panel__header__title__label">Window Function</div>
1176
1176
  </div>
1177
1177
  <div className="panel__header__actions">
1178
1178
  <button
1179
1179
  className="panel__header__action"
1180
- onClick={createOlapGroupBy}
1181
- disabled={!olapGroupByState.tdsState.tdsColumns.length}
1180
+ onClick={createTDSWindow}
1181
+ disabled={!tdsWindowState.tdsState.tdsColumns.length}
1182
1182
  tabIndex={-1}
1183
- title="Create OLAP GroupBy Column"
1183
+ title="Create Window Function Column"
1184
1184
  >
1185
1185
  <PlusIcon />
1186
1186
  </button>
@@ -1191,20 +1191,20 @@ export const QueryBuilderOlapGroupByPanel = observer(
1191
1191
  isDragOver={isDragOver}
1192
1192
  dropTargetConnector={dropTargetConnector}
1193
1193
  >
1194
- {olapGroupByState.isEmpty && (
1194
+ {tdsWindowState.isEmpty && (
1195
1195
  <BlankPanelPlaceholder
1196
- text="Add OLAP GroupBy Column"
1196
+ text="Add Window Function Column"
1197
1197
  tooltipText="Drag and drop columns here"
1198
1198
  />
1199
1199
  )}
1200
- {!olapGroupByState.isEmpty && (
1200
+ {!tdsWindowState.isEmpty && (
1201
1201
  <div
1202
1202
  data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_TDS}
1203
1203
  className="query-builder__olap__columns"
1204
1204
  >
1205
- {olapGroupByState.olapColumns.map((col) => (
1206
- <QueryBuilderOlapGroupByColumnEditor
1207
- olapColumnState={col}
1205
+ {tdsWindowState.windowColumns.map((col) => (
1206
+ <QueryBuilderWindowColumnEditor
1207
+ windowColumnState={col}
1208
1208
  key={col.uuid}
1209
1209
  />
1210
1210
  ))}
@@ -1212,10 +1212,10 @@ export const QueryBuilderOlapGroupByPanel = observer(
1212
1212
  )}
1213
1213
  </PanelDropZone>
1214
1214
  </PanelContent>
1215
- {olapGroupByState.editColumn && (
1216
- <QueryBuilderOlapColumnModalEditor
1217
- olapGroupByState={olapGroupByState}
1218
- olapColumnState={olapGroupByState.editColumn}
1215
+ {tdsWindowState.editColumn && (
1216
+ <QueryBuilderWindowColumnModalEditor
1217
+ windowState={tdsWindowState}
1218
+ windowColumnState={tdsWindowState.editColumn}
1219
1219
  />
1220
1220
  )}
1221
1221
  </div>