@finos/legend-application-repl 0.0.36 → 0.0.37

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 (240) hide show
  1. package/README.md +1 -1
  2. package/lib/__lib__/LegendREPLEvent.d.ts +1 -1
  3. package/lib/__lib__/LegendREPLEvent.d.ts.map +1 -1
  4. package/lib/__lib__/LegendREPLEvent.js +5 -5
  5. package/lib/__lib__/LegendREPLEvent.js.map +1 -1
  6. package/lib/__lib__/LegendREPLSetting.d.ts +1 -1
  7. package/lib/__lib__/LegendREPLSetting.d.ts.map +1 -1
  8. package/lib/__lib__/LegendREPLSetting.js +4 -4
  9. package/lib/__lib__/LegendREPLSetting.js.map +1 -1
  10. package/lib/application/LegendREPL.d.ts +1 -1
  11. package/lib/application/LegendREPL.d.ts.map +1 -1
  12. package/lib/application/LegendREPL.js +2 -2
  13. package/lib/application/LegendREPL.js.map +1 -1
  14. package/lib/application/LegendREPLDocumentation.d.ts +21 -0
  15. package/lib/application/LegendREPLDocumentation.d.ts.map +1 -0
  16. package/lib/application/LegendREPLDocumentation.js +22 -0
  17. package/lib/application/LegendREPLDocumentation.js.map +1 -0
  18. package/lib/components/Core_LegendREPLApplicationPlugin.js +2 -2
  19. package/lib/components/Core_LegendREPLApplicationPlugin.js.map +1 -1
  20. package/lib/components/LegendREPLApplication.d.ts.map +1 -1
  21. package/lib/components/LegendREPLApplication.js +3 -2
  22. package/lib/components/LegendREPLApplication.js.map +1 -1
  23. package/lib/components/LegendREPLFrameworkProvider.d.ts.map +1 -1
  24. package/lib/components/LegendREPLFrameworkProvider.js +2 -2
  25. package/lib/components/LegendREPLFrameworkProvider.js.map +1 -1
  26. package/lib/components/REPLStoreProvider.d.ts +4 -2
  27. package/lib/components/REPLStoreProvider.d.ts.map +1 -1
  28. package/lib/components/REPLStoreProvider.js +13 -7
  29. package/lib/components/REPLStoreProvider.js.map +1 -1
  30. package/lib/components/dataCube/DataCube.d.ts.map +1 -1
  31. package/lib/components/dataCube/DataCube.js +31 -13
  32. package/lib/components/dataCube/DataCube.js.map +1 -1
  33. package/lib/components/dataCube/editor/DataCubeEditor.d.ts +1 -3
  34. package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -1
  35. package/lib/components/dataCube/editor/DataCubeEditor.js +18 -20
  36. package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
  37. package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js +12 -12
  38. package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js.map +1 -1
  39. package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
  40. package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js +45 -43
  41. package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
  42. package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +4 -4
  43. package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -1
  44. package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js +4 -4
  45. package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js.map +1 -1
  46. package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js +4 -4
  47. package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js.map +1 -1
  48. package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -1
  49. package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +22 -22
  50. package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -1
  51. package/lib/components/dataCube/editor/DataCubeEditorHorizontalPivotsPanel.js +4 -4
  52. package/lib/components/dataCube/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -1
  53. package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js +5 -5
  54. package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js.map +1 -1
  55. package/lib/components/dataCube/editor/DataCubeEditorVerticalPivotsPanel.js +2 -2
  56. package/lib/components/dataCube/editor/DataCubeEditorVerticalPivotsPanel.js.map +1 -1
  57. package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
  58. package/lib/components/dataCube/grid/DataCubeGrid.js +37 -45
  59. package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
  60. package/lib/components/dataCube/grid/DataCubeGridShared.js +2 -2
  61. package/lib/components/dataCube/grid/DataCubeGridShared.js.map +1 -1
  62. package/lib/components/repl/Alert.d.ts +23 -0
  63. package/lib/components/repl/Alert.d.ts.map +1 -0
  64. package/lib/components/repl/Alert.js +73 -0
  65. package/lib/components/repl/Alert.js.map +1 -0
  66. package/lib/components/repl/DocumentationPanel.d.ts +24 -0
  67. package/lib/components/repl/DocumentationPanel.d.ts.map +1 -0
  68. package/lib/components/repl/DocumentationPanel.js +56 -0
  69. package/lib/components/repl/DocumentationPanel.js.map +1 -0
  70. package/lib/components/{dataCube/editor/DataCubeEditorShared.d.ts → repl/Form.d.ts} +11 -11
  71. package/lib/components/repl/Form.d.ts.map +1 -0
  72. package/lib/components/{dataCube/editor/DataCubeEditorShared.js → repl/Form.js} +13 -13
  73. package/lib/components/repl/Form.js.map +1 -0
  74. package/lib/components/{REPLWindow.d.ts → repl/LayoutManager.d.ts} +11 -17
  75. package/lib/components/repl/LayoutManager.d.ts.map +1 -0
  76. package/lib/components/repl/LayoutManager.js +116 -0
  77. package/lib/components/repl/LayoutManager.js.map +1 -0
  78. package/lib/components/{dataCube/editor/DataCubeEditorDeveloperPanel.d.ts → repl/SettingsPanel.d.ts} +2 -2
  79. package/lib/components/repl/SettingsPanel.d.ts.map +1 -0
  80. package/lib/components/repl/SettingsPanel.js +47 -0
  81. package/lib/components/repl/SettingsPanel.js.map +1 -0
  82. package/lib/index.css +1 -1
  83. package/lib/package.json +18 -21
  84. package/lib/server/DataCubeQuery.d.ts.map +1 -0
  85. package/lib/server/{models/DataCubeQuery.js → DataCubeQuery.js} +6 -6
  86. package/lib/server/DataCubeQuery.js.map +1 -0
  87. package/lib/server/{models/DataCubeEngineModels.d.ts → REPLEngine.d.ts} +7 -1
  88. package/lib/server/REPLEngine.d.ts.map +1 -0
  89. package/lib/server/{models/DataCubeEngineModels.js → REPLEngine.js} +9 -1
  90. package/lib/server/REPLEngine.js.map +1 -0
  91. package/lib/server/REPLServerClient.d.ts +2 -2
  92. package/lib/server/REPLServerClient.d.ts.map +1 -1
  93. package/lib/server/REPLServerClient.js +2 -2
  94. package/lib/server/REPLServerClient.js.map +1 -1
  95. package/lib/stores/LayoutManagerState.d.ts +62 -0
  96. package/lib/stores/LayoutManagerState.d.ts.map +1 -0
  97. package/lib/stores/LayoutManagerState.js +121 -0
  98. package/lib/stores/LayoutManagerState.js.map +1 -0
  99. package/lib/stores/LegendREPLApplicationPlugin.d.ts +1 -0
  100. package/lib/stores/LegendREPLApplicationPlugin.d.ts.map +1 -1
  101. package/lib/stores/LegendREPLApplicationPlugin.js +8 -0
  102. package/lib/stores/LegendREPLApplicationPlugin.js.map +1 -1
  103. package/lib/stores/LegendREPLBaseStore.d.ts +2 -2
  104. package/lib/stores/LegendREPLBaseStore.d.ts.map +1 -1
  105. package/lib/stores/LegendREPLBaseStore.js +4 -4
  106. package/lib/stores/LegendREPLBaseStore.js.map +1 -1
  107. package/lib/stores/REPLStore.d.ts +12 -4
  108. package/lib/stores/REPLStore.d.ts.map +1 -1
  109. package/lib/stores/REPLStore.js +77 -25
  110. package/lib/stores/REPLStore.js.map +1 -1
  111. package/lib/stores/dataCube/{DataCubeInfrastructure.d.ts → DataCubeEngine.d.ts} +21 -21
  112. package/lib/stores/dataCube/DataCubeEngine.d.ts.map +1 -0
  113. package/lib/stores/dataCube/{DataCubeInfrastructure.js → DataCubeEngine.js} +50 -35
  114. package/lib/stores/dataCube/DataCubeEngine.js.map +1 -0
  115. package/lib/stores/dataCube/DataCubeState.d.ts +4 -4
  116. package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
  117. package/lib/stores/dataCube/DataCubeState.js +13 -8
  118. package/lib/stores/dataCube/DataCubeState.js.map +1 -1
  119. package/lib/stores/dataCube/core/DataCubeCoreState.d.ts +1 -1
  120. package/lib/stores/dataCube/core/DataCubeCoreState.d.ts.map +1 -1
  121. package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +2 -2
  122. package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -1
  123. package/lib/stores/dataCube/core/DataCubeQueryEngine.js +2 -2
  124. package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -1
  125. package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts +1 -1
  126. package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -1
  127. package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts +1 -1
  128. package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts.map +1 -1
  129. package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts.map +1 -1
  130. package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js +4 -0
  131. package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js.map +1 -1
  132. package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js +1 -1
  133. package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js.map +1 -1
  134. package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +5 -8
  135. package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
  136. package/lib/stores/dataCube/editor/DataCubeEditorState.js +19 -29
  137. package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
  138. package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +1 -1
  139. package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
  140. package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +31 -28
  141. package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
  142. package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.d.ts.map +1 -1
  143. package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.js +7 -2
  144. package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.js.map +1 -1
  145. package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -1
  146. package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js +9 -8
  147. package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js.map +1 -1
  148. package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.d.ts.map +1 -1
  149. package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js +2 -6
  150. package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js.map +1 -1
  151. package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -1
  152. package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +0 -2
  153. package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
  154. package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +0 -2
  155. package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -1
  156. package/lib/stores/dataCube/grid/DataCubeGridState.js +1 -7
  157. package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -1
  158. package/package.json +24 -27
  159. package/src/__lib__/LegendREPLEvent.ts +1 -1
  160. package/src/__lib__/LegendREPLSetting.ts +1 -1
  161. package/src/application/LegendREPL.tsx +2 -2
  162. package/{lib/grammar/parser.d.ts → src/application/LegendREPLDocumentation.ts} +6 -1
  163. package/src/components/Core_LegendREPLApplicationPlugin.tsx +2 -2
  164. package/src/components/LegendREPLApplication.tsx +2 -0
  165. package/src/components/LegendREPLFrameworkProvider.tsx +2 -4
  166. package/src/components/REPLStoreProvider.tsx +24 -18
  167. package/src/components/dataCube/DataCube.tsx +69 -26
  168. package/src/components/dataCube/editor/DataCubeEditor.tsx +89 -98
  169. package/src/components/dataCube/editor/DataCubeEditorCodePanel.tsx +12 -12
  170. package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +112 -115
  171. package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +4 -4
  172. package/src/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.tsx +4 -4
  173. package/src/components/dataCube/editor/DataCubeEditorFilterPanel.tsx +4 -4
  174. package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +76 -88
  175. package/src/components/dataCube/editor/DataCubeEditorHorizontalPivotsPanel.tsx +4 -4
  176. package/src/components/dataCube/editor/DataCubeEditorSortsPanel.tsx +5 -5
  177. package/src/components/dataCube/editor/DataCubeEditorVerticalPivotsPanel.tsx +2 -2
  178. package/src/components/dataCube/grid/DataCubeGrid.tsx +45 -53
  179. package/src/components/dataCube/grid/DataCubeGridShared.tsx +2 -2
  180. package/src/components/repl/Alert.tsx +138 -0
  181. package/src/components/repl/DocumentationPanel.tsx +88 -0
  182. package/src/components/{dataCube/editor/DataCubeEditorShared.tsx → repl/Form.tsx} +12 -12
  183. package/src/components/repl/LayoutManager.tsx +190 -0
  184. package/src/components/repl/SettingsPanel.tsx +148 -0
  185. package/src/server/{models/DataCubeQuery.ts → DataCubeQuery.ts} +3 -3
  186. package/src/server/{models/DataCubeEngineModels.ts → REPLEngine.ts} +13 -0
  187. package/src/server/REPLServerClient.ts +4 -3
  188. package/src/stores/LayoutManagerState.ts +168 -0
  189. package/src/stores/LegendREPLApplicationPlugin.ts +9 -0
  190. package/src/stores/LegendREPLBaseStore.ts +4 -4
  191. package/src/stores/REPLStore.tsx +145 -0
  192. package/src/stores/dataCube/{DataCubeInfrastructure.ts → DataCubeEngine.ts} +66 -46
  193. package/src/stores/dataCube/DataCubeState.ts +14 -9
  194. package/src/stores/dataCube/core/DataCubeCoreState.ts +1 -1
  195. package/src/stores/dataCube/core/DataCubeQueryEngine.ts +2 -3
  196. package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +1 -1
  197. package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +1 -1
  198. package/src/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.ts +10 -0
  199. package/src/stores/dataCube/editor/DataCubeEditorCodePanelState.ts +1 -1
  200. package/src/stores/dataCube/editor/{DataCubeEditorState.ts → DataCubeEditorState.tsx} +12 -24
  201. package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +23 -12
  202. package/src/stores/dataCube/grid/DataCubeGridClientExportEngine.ts +4 -1
  203. package/src/stores/dataCube/grid/DataCubeGridConfigurationBuilder.tsx +9 -11
  204. package/src/stores/dataCube/grid/DataCubeGridMenuBuilder.tsx +2 -6
  205. package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +0 -3
  206. package/src/stores/dataCube/grid/DataCubeGridState.ts +1 -11
  207. package/tsconfig.json +12 -8
  208. package/grammar/datacube_filter__lexer.g4 +0 -40
  209. package/grammar/datacube_filter__parser.g4 +0 -14
  210. package/grammar/generateGrammar.js +0 -43
  211. package/grammar/parser/generated/datacube_filter__lexer.interp +0 -59
  212. package/grammar/parser/generated/datacube_filter__lexer.tokens +0 -14
  213. package/grammar/parser/generated/datacube_filter__lexer.ts +0 -142
  214. package/grammar/parser/generated/datacube_filter__parser.interp +0 -38
  215. package/grammar/parser/generated/datacube_filter__parser.tokens +0 -14
  216. package/grammar/parser/generated/datacube_filter__parser.ts +0 -514
  217. package/grammar/parser/parser.ts +0 -55
  218. package/lib/components/REPLWindow.d.ts.map +0 -1
  219. package/lib/components/REPLWindow.js +0 -117
  220. package/lib/components/REPLWindow.js.map +0 -1
  221. package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.d.ts.map +0 -1
  222. package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js +0 -28
  223. package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js.map +0 -1
  224. package/lib/components/dataCube/editor/DataCubeEditorShared.d.ts.map +0 -1
  225. package/lib/components/dataCube/editor/DataCubeEditorShared.js.map +0 -1
  226. package/lib/grammar/generated/datacube_filter__lexer.d.ts +0 -31
  227. package/lib/grammar/generated/datacube_filter__lexer.js +0 -118
  228. package/lib/grammar/generated/datacube_filter__parser.d.ts +0 -91
  229. package/lib/grammar/generated/datacube_filter__parser.js +0 -485
  230. package/lib/grammar/parser.js +0 -39
  231. package/lib/server/models/DataCubeEngineModels.d.ts.map +0 -1
  232. package/lib/server/models/DataCubeEngineModels.js.map +0 -1
  233. package/lib/server/models/DataCubeQuery.d.ts.map +0 -1
  234. package/lib/server/models/DataCubeQuery.js.map +0 -1
  235. package/lib/stores/dataCube/DataCubeInfrastructure.d.ts.map +0 -1
  236. package/lib/stores/dataCube/DataCubeInfrastructure.js.map +0 -1
  237. package/src/components/REPLWindow.tsx +0 -179
  238. package/src/components/dataCube/editor/DataCubeEditorDeveloperPanel.tsx +0 -43
  239. package/src/stores/REPLStore.ts +0 -48
  240. /package/lib/server/{models/DataCubeQuery.d.ts → DataCubeQuery.d.ts} +0 -0
@@ -0,0 +1,145 @@
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 type { LegendREPLApplicationStore } from './LegendREPLBaseStore.js';
18
+ import { REPLServerClient } from '../server/REPLServerClient.js';
19
+ import {
20
+ ActionState,
21
+ assertErrorThrown,
22
+ LogEvent,
23
+ NetworkClient,
24
+ } from '@finos/legend-shared';
25
+ import { makeObservable, observable } from 'mobx';
26
+ import { DataCubeState } from './dataCube/DataCubeState.js';
27
+ import { DataCubeEngine } from './dataCube/DataCubeEngine.js';
28
+ import { LicenseManager } from '@ag-grid-enterprise/core';
29
+ import { ActionAlertType, APPLICATION_EVENT } from '@finos/legend-application';
30
+ import {
31
+ DEFAULT_ALERT_WINDOW_CONFIG,
32
+ LayoutConfiguration,
33
+ LayoutManagerState,
34
+ SingletonModeDisplayState,
35
+ WindowState,
36
+ } from './LayoutManagerState.js';
37
+ import { ErrorAlert } from '../components/repl/Alert.js';
38
+ import { DocumentationPanel } from '../components/repl/DocumentationPanel.js';
39
+ import { SettingsPanel } from '../components/repl/SettingsPanel.js';
40
+
41
+ export class REPLStore {
42
+ readonly application: LegendREPLApplicationStore;
43
+ readonly client: REPLServerClient;
44
+ readonly layout: LayoutManagerState;
45
+ readonly initState = ActionState.create();
46
+ readonly settingsDisplay: SingletonModeDisplayState;
47
+ readonly documentationDisplay: SingletonModeDisplayState;
48
+
49
+ dataCubeEngine!: DataCubeEngine;
50
+
51
+ // TODO: when we support multi-view, we would need to support multiple states
52
+ dataCube!: DataCubeState;
53
+
54
+ constructor(application: LegendREPLApplicationStore) {
55
+ makeObservable(this, {
56
+ dataCube: observable,
57
+ });
58
+
59
+ this.application = application;
60
+ this.client = new REPLServerClient(
61
+ new NetworkClient({
62
+ baseUrl: this.application.config.useDynamicREPLServer
63
+ ? window.location.origin +
64
+ this.application.config.baseAddress.replace('/repl/', '')
65
+ : this.application.config.replUrl,
66
+ }),
67
+ );
68
+ this.layout = new LayoutManagerState(this.application);
69
+ this.dataCubeEngine = new DataCubeEngine(this);
70
+ this.dataCube = new DataCubeState(this);
71
+ this.settingsDisplay = new SingletonModeDisplayState(
72
+ this.layout,
73
+ 'Settings',
74
+ () => <SettingsPanel />,
75
+ );
76
+ this.settingsDisplay.configuration.window = {
77
+ x: -50,
78
+ y: 50,
79
+ width: 600,
80
+ height: 400,
81
+ minWidth: 300,
82
+ minHeight: 200,
83
+ center: false,
84
+ };
85
+ this.documentationDisplay = new SingletonModeDisplayState(
86
+ this.layout,
87
+ 'Documentation',
88
+ () => <DocumentationPanel />,
89
+ );
90
+ this.documentationDisplay.configuration.window = {
91
+ x: -50,
92
+ y: -50,
93
+ width: 400,
94
+ height: 400,
95
+ minWidth: 300,
96
+ minHeight: 200,
97
+ center: false,
98
+ };
99
+ }
100
+
101
+ notifyError(error: Error, message: string, text?: string | undefined): void {
102
+ this.application.notificationService.notifyError(error);
103
+ const window = new WindowState(
104
+ new LayoutConfiguration('Error', () => (
105
+ <ErrorAlert message={message} text={text} />
106
+ )),
107
+ );
108
+ window.configuration.window = DEFAULT_ALERT_WINDOW_CONFIG;
109
+ this.layout.newWindow(window);
110
+ }
111
+
112
+ async initialize(): Promise<void> {
113
+ if (!this.initState.isInInitialState) {
114
+ // eslint-disable-next-line no-process-env
115
+ if (process.env.NODE_ENV === 'production') {
116
+ this.application.notificationService.notifyIllegalState(
117
+ 'REPL store is re-initialized',
118
+ );
119
+ } else {
120
+ this.application.logService.debug(
121
+ LogEvent.create(APPLICATION_EVENT.DEBUG),
122
+ 'REPL store is re-initialized',
123
+ );
124
+ }
125
+ return;
126
+ }
127
+ this.initState.inProgress();
128
+
129
+ try {
130
+ const info = await this.dataCubeEngine.getInfrastructureInfo();
131
+ if (info.gridClientLicense) {
132
+ LicenseManager.setLicenseKey(info.gridClientLicense);
133
+ }
134
+ this.initState.pass();
135
+ } catch (error: unknown) {
136
+ assertErrorThrown(error);
137
+ this.application.alertService.setActionAlertInfo({
138
+ message: `Initialization failure: ${error.message}`,
139
+ type: ActionAlertType.ERROR,
140
+ actions: [],
141
+ });
142
+ this.initState.fail();
143
+ }
144
+ }
145
+ }
@@ -26,22 +26,70 @@ import {
26
26
  import type { REPLServerClient } from '../../server/REPLServerClient.js';
27
27
  import {
28
28
  DataCubeGetBaseQueryResult,
29
+ type DataCubeInfrastructureInfo,
29
30
  type CompletionItem,
30
- } from '../../server/models/DataCubeEngineModels.js';
31
+ } from '../../server/REPLEngine.js';
31
32
  import { guaranteeType } from '@finos/legend-shared';
32
33
  import type { LegendREPLApplicationStore } from '../LegendREPLBaseStore.js';
33
34
  import type { REPLStore } from '../REPLStore.js';
34
35
  import { action, makeObservable, observable } from 'mobx';
35
36
 
36
- class DataCubeEngine {
37
+ export const DEFAULT_ENABLE_DEBUG_MODE = false;
38
+ export const DEFAULT_GRID_CLIENT_ROW_BUFFER = 50;
39
+ export const DEFAULT_GRID_CLIENT_PURGE_CLOSED_ROW_NODES = false;
40
+
41
+ export class DataCubeEngine {
42
+ readonly repl: REPLStore;
43
+ readonly application: LegendREPLApplicationStore;
37
44
  private readonly client: REPLServerClient;
38
45
 
39
- constructor(client: REPLServerClient) {
40
- this.client = client;
46
+ enableDebugMode = DEFAULT_ENABLE_DEBUG_MODE;
47
+ gridClientRowBuffer = DEFAULT_GRID_CLIENT_ROW_BUFFER;
48
+ gridClientPurgeClosedRowNodes = false;
49
+
50
+ constructor(repl: REPLStore) {
51
+ makeObservable(this, {
52
+ enableDebugMode: observable,
53
+ setEnableDebugMode: action,
54
+
55
+ gridClientRowBuffer: observable,
56
+ setGridClientRowBuffer: action,
57
+
58
+ gridClientPurgeClosedRowNodes: observable,
59
+ setGridClientPurgeClosedRowNodes: action,
60
+ });
61
+
62
+ this.repl = repl;
63
+ this.application = repl.application;
64
+ this.client = repl.client;
65
+ }
66
+
67
+ setEnableDebugMode(enableDebugMode: boolean): void {
68
+ this.enableDebugMode = enableDebugMode;
69
+ this.applyChanges();
70
+ }
71
+
72
+ setGridClientRowBuffer(rowBuffer: number): void {
73
+ this.gridClientRowBuffer = rowBuffer;
74
+ this.applyChanges();
75
+ }
76
+
77
+ setGridClientPurgeClosedRowNodes(purgeClosedRowNodes: boolean): void {
78
+ this.gridClientPurgeClosedRowNodes = purgeClosedRowNodes;
79
+ this.applyChanges();
80
+ }
81
+
82
+ private applyChanges(): void {
83
+ // When we support multi-view (i.e. multiple instances of DataCubes) we would need to traverse
84
+ // through and update the configurations of all of their grid clients
85
+ this.repl.dataCube.grid.client.updateGridOptions({
86
+ rowBuffer: this.gridClientRowBuffer,
87
+ purgeClosedRowNodes: this.gridClientPurgeClosedRowNodes,
88
+ });
41
89
  }
42
90
 
43
- async getGridClientLicenseKey(): Promise<string> {
44
- return this.client.getGridClientLicenseKey();
91
+ async getInfrastructureInfo(): Promise<DataCubeInfrastructureInfo> {
92
+ return this.client.getInfrastructureInfo();
45
93
  }
46
94
 
47
95
  async getQueryTypeahead(
@@ -70,49 +118,21 @@ class DataCubeEngine {
70
118
  );
71
119
  }
72
120
 
73
- async executeQuery(query: V1_Lambda): Promise<TDSExecutionResult> {
121
+ async executeQuery(
122
+ query: V1_Lambda,
123
+ ): Promise<{ result: TDSExecutionResult; executedSQL: string }> {
74
124
  const result = await this.client.executeQuery({
75
125
  query: V1_serializeValueSpecification(query, []),
126
+ debug: this.enableDebugMode,
76
127
  });
77
- return guaranteeType(
78
- V1_buildExecutionResult(
79
- V1_serializeExecutionResult(JSON.parse(result.result)),
128
+ return {
129
+ result: guaranteeType(
130
+ V1_buildExecutionResult(
131
+ V1_serializeExecutionResult(JSON.parse(result.result)),
132
+ ),
133
+ TDSExecutionResult,
80
134
  ),
81
- TDSExecutionResult,
82
- );
83
- }
84
- }
85
-
86
- /**
87
- * Infrastructure for data cube, can be shared across multiple data cube states
88
- */
89
- export class DataCubeInfrastructure {
90
- readonly replStore: REPLStore;
91
- readonly application: LegendREPLApplicationStore;
92
- readonly engine: DataCubeEngine;
93
-
94
- gridClientRowBuffer = 50;
95
- enableDebugMode = false;
96
-
97
- constructor(replStore: REPLStore) {
98
- makeObservable(this, {
99
- gridClientRowBuffer: observable,
100
- setGridClientRowBuffer: action,
101
-
102
- enableDebugMode: observable,
103
- setEnableDebugMode: action,
104
- });
105
-
106
- this.replStore = replStore;
107
- this.application = replStore.applicationStore;
108
- this.engine = new DataCubeEngine(replStore.client);
109
- }
110
-
111
- setGridClientRowBuffer(rowBuffer: number): void {
112
- this.gridClientRowBuffer = rowBuffer;
113
- }
114
-
115
- setEnableDebugMode(enableDebugMode: boolean): void {
116
- this.enableDebugMode = enableDebugMode;
135
+ executedSQL: result.executedSQL,
136
+ };
117
137
  }
118
138
  }
@@ -23,7 +23,8 @@ import type { LegendREPLApplicationStore } from '../LegendREPLBaseStore.js';
23
23
  import { DataCubeCoreState } from './core/DataCubeCoreState.js';
24
24
  import { validateAndBuildQuerySnapshot } from './core/DataCubeQuerySnapshotBuilder.js';
25
25
  import { action, makeObservable, observable } from 'mobx';
26
- import type { DataCubeInfrastructure } from './DataCubeInfrastructure.js';
26
+ import type { DataCubeEngine } from './DataCubeEngine.js';
27
+ import { ActionAlertType } from '@finos/legend-application';
27
28
 
28
29
  export class DataCubeTask {
29
30
  uuid = uuid();
@@ -41,9 +42,9 @@ export class DataCubeTask {
41
42
  }
42
43
 
43
44
  export class DataCubeState {
44
- readonly replStore: REPLStore;
45
+ readonly repl: REPLStore;
45
46
  readonly application: LegendREPLApplicationStore;
46
- readonly infrastructure: DataCubeInfrastructure;
47
+ readonly engine: DataCubeEngine;
47
48
  readonly snapshotManager: DataCubeQuerySnapshotManager;
48
49
 
49
50
  readonly core: DataCubeCoreState;
@@ -52,16 +53,16 @@ export class DataCubeState {
52
53
 
53
54
  readonly runningTasks = new Map<string, DataCubeTask>();
54
55
 
55
- constructor(replStore: REPLStore) {
56
+ constructor(repl: REPLStore) {
56
57
  makeObservable(this, {
57
58
  runningTasks: observable,
58
59
  newTask: action,
59
60
  endTask: action,
60
61
  });
61
62
 
62
- this.replStore = replStore;
63
- this.application = replStore.applicationStore;
64
- this.infrastructure = replStore.dataCubeInfrastructure;
63
+ this.repl = repl;
64
+ this.application = repl.application;
65
+ this.engine = repl.dataCubeEngine;
65
66
 
66
67
  // NOTE: snapshot manager must be instantiated before subscribers
67
68
  this.snapshotManager = new DataCubeQuerySnapshotManager(this);
@@ -93,7 +94,7 @@ export class DataCubeState {
93
94
  },
94
95
  ),
95
96
  );
96
- const result = await this.infrastructure.engine.getBaseQuery();
97
+ const result = await this.engine.getBaseQuery();
97
98
  const initialSnapshot = validateAndBuildQuerySnapshot(
98
99
  result.partialQuery,
99
100
  result.sourceQuery,
@@ -103,7 +104,11 @@ export class DataCubeState {
103
104
  this.snapshotManager.broadcastSnapshot(initialSnapshot);
104
105
  } catch (error: unknown) {
105
106
  assertErrorThrown(error);
106
- this.application.notificationService.notifyError(error);
107
+ this.repl.application.alertService.setActionAlertInfo({
108
+ message: `Initialization failure: ${error.message}`,
109
+ type: ActionAlertType.ERROR,
110
+ actions: [],
111
+ });
107
112
  } finally {
108
113
  this.endTask(task);
109
114
  }
@@ -18,7 +18,7 @@ import { action, makeObservable, observable } from 'mobx';
18
18
  import type { DataCubeState } from '../DataCubeState.js';
19
19
  import { DataCubeQuerySnapshotSubscriber } from './DataCubeQuerySnapshotSubscriber.js';
20
20
  import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
21
- import type { DataCubeQuery } from '../../../server/models/DataCubeQuery.js';
21
+ import type { DataCubeQuery } from '../../../server/DataCubeQuery.js';
22
22
  import { formatDate } from '@finos/legend-shared';
23
23
  import { DEFAULT_REPORT_NAME } from './DataCubeQueryEngine.js';
24
24
 
@@ -245,15 +245,14 @@ export function getDataType(type: string): DataCubeColumnDataType {
245
245
  export const DEFAULT_URL_LABEL_QUERY_PARAM = 'dataCube.linkLabel';
246
246
 
247
247
  export const DEFAULT_GRID_LINE_COLOR = TailwindCSSPalette.neutral[200];
248
- export const DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR =
249
- TailwindCSSPalette.sky[100];
248
+ export const DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR = '#d7e0eb';
250
249
 
251
250
  export const DEFAULT_COLUMN_WIDTH = 300;
252
251
  export const DEFAULT_COLUMN_MIN_WIDTH = 50;
253
252
  export const DEFAULT_COLUMN_MAX_WIDTH = undefined;
254
253
 
255
254
  export const DEFAULT_FONT_FAMILY = DataCubeFont.ROBOTO;
256
- export const DEFAULT_FONT_SIZE = 12;
255
+ export const DEFAULT_FONT_SIZE = 11;
257
256
  export const DEFAULT_FONT_BOLD = false;
258
257
  export const DEFAULT_FONT_ITALIC = false;
259
258
  export const DEFAULT_FONT_CASE = undefined;
@@ -33,7 +33,7 @@ import {
33
33
  matchFunctionName,
34
34
  type V1_ValueSpecification,
35
35
  } from '@finos/legend-graph';
36
- import type { DataCubeQuery } from '../../../server/models/DataCubeQuery.js';
36
+ import type { DataCubeQuery } from '../../../server/DataCubeQuery.js';
37
37
  import {
38
38
  DataCubeQuerySnapshot,
39
39
  type DataCubeQuerySnapshotColumn,
@@ -24,7 +24,7 @@ import {
24
24
  assertErrorThrown,
25
25
  guaranteeNonNullable,
26
26
  } from '@finos/legend-shared';
27
- import type { DataCubeQuery } from '../../../server/models/DataCubeQuery.js';
27
+ import type { DataCubeQuery } from '../../../server/DataCubeQuery.js';
28
28
 
29
29
  // TODO: set a stack depth when we implement undo/redo
30
30
  // const DATA_CUBE_MAX_SNAPSHOT_COUNT = 100;
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { deepDiff } from '@finos/legend-shared';
17
18
  import type { LegendREPLApplicationStore } from '../../LegendREPLBaseStore.js';
18
19
  import type { DataCubeState } from '../DataCubeState.js';
19
20
  import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
@@ -42,6 +43,15 @@ export abstract class DataCubeQuerySnapshotSubscriber {
42
43
  }
43
44
 
44
45
  publishSnapshot(snapshot: DataCubeQuerySnapshot): void {
46
+ if (this.dataCube.engine.enableDebugMode) {
47
+ this.application.debugProcess(
48
+ `New Snapshot`,
49
+ '\nSnapshot',
50
+ snapshot,
51
+ '\nDiff',
52
+ deepDiff(snapshot, this.latestSnapshot ?? {}),
53
+ );
54
+ }
45
55
  this.latestSnapshot = snapshot;
46
56
  this.dataCube.snapshotManager.broadcastSnapshot(snapshot);
47
57
  }
@@ -106,7 +106,7 @@ export class DataCubeEditorCodePanelState {
106
106
  try {
107
107
  this.queryEditorState.setParserError(undefined);
108
108
  yield flowResult(
109
- this.dataCube.replStore.client.parseQuery({
109
+ this.dataCube.repl.client.parseQuery({
110
110
  code: `|${this.queryEditorState.query}`,
111
111
  }),
112
112
  );
@@ -20,15 +20,16 @@ import { DataCubeEditorSortsPanelState } from './DataCubeEditorSortsPanelState.j
20
20
  import { DataCubeEditorCodePanelState } from './DataCubeEditorCodePanelState.js';
21
21
  import { DataCubeQuerySnapshotSubscriber } from '../core/DataCubeQuerySnapshotSubscriber.js';
22
22
  import { type DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
23
- import { guaranteeNonNullable, uuid } from '@finos/legend-shared';
23
+ import { guaranteeNonNullable } from '@finos/legend-shared';
24
24
  import { DataCubeEditorGeneralPropertiesPanelState } from './DataCubeEditorGeneralPropertiesPanelState.js';
25
25
  import { DataCubeEditorColumnPropertiesPanelState } from './DataCubeEditorColumnPropertiesPanelState.js';
26
- import type { REPLWindowConfig } from '../../../components/REPLWindow.js';
27
26
  import { DataCubeEditorColumnsPanelState } from './DataCubeEditorColumnsPanelState.js';
28
27
  import { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
29
28
  import { DataCubeEditorVerticalPivotsPanelState } from './DataCubeEditorVerticalPivotsPanelState.js';
29
+ import { SingletonModeDisplayState } from '../../LayoutManagerState.js';
30
+ import { DataCubeEditor } from '../../../components/dataCube/editor/DataCubeEditor.js';
30
31
 
31
- export enum DATA_CUBE_EDITOR_TAB {
32
+ export enum DataCubeEditorTab {
32
33
  GENERAL_PROPERTIES = 'General Properties',
33
34
  COLUMN_PROPERTIES = 'Column Properties',
34
35
  FILTER = 'Filter',
@@ -41,6 +42,7 @@ export enum DATA_CUBE_EDITOR_TAB {
41
42
  }
42
43
 
43
44
  export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
45
+ readonly display: SingletonModeDisplayState;
44
46
  readonly generalProperties: DataCubeEditorGeneralPropertiesPanelState;
45
47
  readonly columnProperties: DataCubeEditorColumnPropertiesPanelState;
46
48
  readonly columns: DataCubeEditorColumnsPanelState;
@@ -48,14 +50,7 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
48
50
  readonly sorts: DataCubeEditorSortsPanelState;
49
51
  readonly code: DataCubeEditorCodePanelState;
50
52
 
51
- readonly window: REPLWindowConfig = {
52
- uuid: uuid(),
53
- title: 'Properties',
54
- center: true,
55
- };
56
-
57
- isPanelOpen = false;
58
- currentTab = DATA_CUBE_EDITOR_TAB.GENERAL_PROPERTIES;
53
+ currentTab = DataCubeEditorTab.GENERAL_PROPERTIES;
59
54
 
60
55
  constructor(dataCube: DataCubeState) {
61
56
  super(dataCube);
@@ -65,12 +60,13 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
65
60
 
66
61
  currentTab: observable,
67
62
  setCurrentTab: action,
68
-
69
- isPanelOpen: observable,
70
- openPanel: action,
71
- closePanel: action,
72
63
  });
73
64
 
65
+ this.display = new SingletonModeDisplayState(
66
+ this.dataCube.repl.layout,
67
+ 'Properties',
68
+ () => <DataCubeEditor />,
69
+ );
74
70
  this.generalProperties = new DataCubeEditorGeneralPropertiesPanelState(
75
71
  this,
76
72
  );
@@ -81,15 +77,7 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
81
77
  this.code = new DataCubeEditorCodePanelState(this);
82
78
  }
83
79
 
84
- openPanel(): void {
85
- this.isPanelOpen = true;
86
- }
87
-
88
- closePanel(): void {
89
- this.isPanelOpen = false;
90
- }
91
-
92
- setCurrentTab(val: DATA_CUBE_EDITOR_TAB): void {
80
+ setCurrentTab(val: DataCubeEditorTab): void {
93
81
  this.currentTab = val;
94
82
  }
95
83
 
@@ -48,7 +48,7 @@ export enum DataCubeGridClientExportFormat {
48
48
  PDF = 'PDF',
49
49
  }
50
50
 
51
- export enum INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME {
51
+ export enum INTERNAL__GridClientUtilityCssClassName {
52
52
  ROOT = 'data-cube-grid.ag-theme-balham',
53
53
  HIGHLIGHT_ROW = 'data-cube-grid__utility--highlight-row',
54
54
  SHOW_VERTICAL_GRID_LINES = 'data-cube-grid__utility--show-vertical-grid-lines',
@@ -68,29 +68,29 @@ export enum INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME {
68
68
  BACKGROUND_COLOR_PREFIX = 'data-cube-grid__utility--background-color-',
69
69
  }
70
70
  export const generateFontFamilyUtilityClassName = (fontFamily: string) =>
71
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_FAMILY_PREFIX}${fontFamily.replaceAll(' ', '-')}`;
71
+ `${INTERNAL__GridClientUtilityCssClassName.FONT_FAMILY_PREFIX}${fontFamily.replaceAll(' ', '-')}`;
72
72
  export const generateFontSizeUtilityClassName = (fontSize: number) =>
73
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_SIZE_PREFIX}${fontSize}`;
73
+ `${INTERNAL__GridClientUtilityCssClassName.FONT_SIZE_PREFIX}${fontSize}`;
74
74
  export const generateFontUnderlineUtilityClassName = (
75
75
  variant: string | undefined,
76
76
  ) =>
77
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_UNDERLINE_PREFIX}${variant ?? 'none'}`;
77
+ `${INTERNAL__GridClientUtilityCssClassName.FONT_UNDERLINE_PREFIX}${variant ?? 'none'}`;
78
78
  export const generateFontCaseUtilityClassName = (
79
79
  fontCase: string | undefined,
80
80
  ) =>
81
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_CASE_PREFIX}${fontCase ?? 'none'}`;
81
+ `${INTERNAL__GridClientUtilityCssClassName.FONT_CASE_PREFIX}${fontCase ?? 'none'}`;
82
82
  export const generateTextAlignUtilityClassName = (alignment: string) =>
83
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.TEXT_ALIGN_PREFIX}${alignment}`;
83
+ `${INTERNAL__GridClientUtilityCssClassName.TEXT_ALIGN_PREFIX}${alignment}`;
84
84
  export const generateTextColorUtilityClassName = (
85
85
  color: string,
86
86
  key: DataCubeConfigurationColorKey,
87
87
  ) =>
88
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.TEXT_COLOR_PREFIX}${key}-${color.substring(1)}`;
88
+ `${INTERNAL__GridClientUtilityCssClassName.TEXT_COLOR_PREFIX}${key}-${color.substring(1)}`;
89
89
  export const generateBackgroundColorUtilityClassName = (
90
90
  color: string,
91
91
  key: DataCubeConfigurationColorKey,
92
92
  ) =>
93
- `${INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.BACKGROUND_COLOR_PREFIX}${key}-${color.substring(1)}`;
93
+ `${INTERNAL__GridClientUtilityCssClassName.BACKGROUND_COLOR_PREFIX}${key}-${color.substring(1)}`;
94
94
 
95
95
  export const INTERNAL__GRID_CLIENT_SIDE_BAR_WIDTH = 200;
96
96
  export const INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH = 50;
@@ -224,9 +224,16 @@ export class DataCubeGridClientServerSideDataSource
224
224
  });
225
225
  const lambda = new V1_Lambda();
226
226
  lambda.body.push(executableQuery);
227
- const result =
228
- await this.grid.dataCube.infrastructure.engine.executeQuery(lambda);
229
- const rowData = TDStoRowData(result.result);
227
+ const result = await this.grid.dataCube.engine.executeQuery(lambda);
228
+ const rowData = TDStoRowData(result.result.result);
229
+ if (this.grid.dataCube.engine.enableDebugMode) {
230
+ this.grid.dataCube.application.debugProcess(
231
+ `Execution`,
232
+ `\nConfig: pagination=${this.grid.isPaginationEnabled}`,
233
+ `\nStats: ${rowData.length} rows, ${result.result.result.columns.length} columns`,
234
+ `\nSQL: ${result.executedSQL}`,
235
+ );
236
+ }
230
237
  if (this.grid.isPaginationEnabled) {
231
238
  params.success({ rowData });
232
239
  // Only update row count when loading the top-level drilldown data
@@ -251,7 +258,11 @@ export class DataCubeGridClientServerSideDataSource
251
258
  }
252
259
  } catch (error) {
253
260
  assertErrorThrown(error);
254
- this.grid.dataCube.application.notificationService.notifyError(error);
261
+ this.grid.dataCube.repl.notifyError(
262
+ error,
263
+ `Data fetch failure: ${error.message}`,
264
+ error.stack,
265
+ );
255
266
  params.fail();
256
267
  } finally {
257
268
  this.grid.dataCube.endTask(task);
@@ -158,12 +158,15 @@ export class DataCubeGridClientExportEngine {
158
158
 
159
159
  downloadFileUsingDataURI(
160
160
  `${fileName}.eml`,
161
- `${EMAIL_CONTENT}--${EMAIL_MIXED_BOUNDARY}\n` +
161
+ // NOTE: empty lines before email content can cause some mail client to not
162
+ // recognize the email content, e.g. Outlook
163
+ `${EMAIL_CONTENT.trimStart()}--${EMAIL_MIXED_BOUNDARY}\n` +
162
164
  `Content-Type: ${contentType}; name="${fileNameWithExtension}"\n` +
163
165
  `Content-Transfer-Encoding: base64\n` +
164
166
  `Content-Disposition: attachment; filename="${fileNameWithExtension}"\n\n` +
165
167
  `${attachment}\n\n` +
166
168
  `--${EMAIL_MIXED_BOUNDARY}--`,
169
+ // This MIME type here might not matter
167
170
  ContentType.MESSAGE_RFC822,
168
171
  );
169
172
  }
@@ -37,7 +37,7 @@ import {
37
37
  GridClientAggregateOperation,
38
38
  GridClientSortDirection,
39
39
  INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH,
40
- INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME,
40
+ INTERNAL__GridClientUtilityCssClassName,
41
41
  generateFontFamilyUtilityClassName,
42
42
  generateFontSizeUtilityClassName,
43
43
  generateFontUnderlineUtilityClassName,
@@ -301,10 +301,9 @@ function _displaySpec(columnData: ColumnData) {
301
301
  cellClassRules: {
302
302
  [generateFontFamilyUtilityClassName(fontFamily)]: () => true,
303
303
  [generateFontSizeUtilityClassName(fontSize)]: () => true,
304
- [INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_BOLD]: () => fontBold,
305
- [INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_ITALIC]: () =>
306
- fontItalic,
307
- [INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.FONT_STRIKETHROUGH]: () =>
304
+ [INTERNAL__GridClientUtilityCssClassName.FONT_BOLD]: () => fontBold,
305
+ [INTERNAL__GridClientUtilityCssClassName.FONT_ITALIC]: () => fontItalic,
306
+ [INTERNAL__GridClientUtilityCssClassName.FONT_STRIKETHROUGH]: () =>
308
307
  fontStrikethrough,
309
308
  [generateFontUnderlineUtilityClassName(fontUnderline)]: () =>
310
309
  Boolean(fontUnderline),
@@ -346,7 +345,7 @@ function _displaySpec(columnData: ColumnData) {
346
345
  ) => params.node.failedLoad,
347
346
  [generateBackgroundColorUtilityClassName(errorBackgroundColor, 'error')]:
348
347
  (params) => params.node.failedLoad,
349
- [INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.BLUR]: () => column.blur,
348
+ [INTERNAL__GridClientUtilityCssClassName.BLUR]: () => column.blur,
350
349
  },
351
350
  cellRenderer: cellRenderer,
352
351
  pinned:
@@ -449,6 +448,7 @@ export function generateBaseGridOptions(dataCube: DataCubeState): GridOptions {
449
448
  groupDisplayType: 'custom', // keeps the column set stable even when row grouping is used
450
449
  suppressRowGroupHidesColumns: true, // keeps the column set stable even when row grouping is used
451
450
  suppressAggFuncInHeader: true, // keeps the columns stable when aggregation is used
451
+ // purgeClosedRowNodes: true, // remove closed row nodes from the cache to allow reloading failed rows? - or should we have declarative action to retry?
452
452
  getChildCount: (data) =>
453
453
  data[INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID],
454
454
  // -------------------------------------- PIVOT --------------------------------------
@@ -510,7 +510,7 @@ export function generateBaseGridOptions(dataCube: DataCubeState): GridOptions {
510
510
  tooltipShowDelay: INTERNAL__GRID_CLIENT_TOOLTIP_SHOW_DELAY,
511
511
  tooltipInteraction: true,
512
512
  // -------------------------------------- COLUMN MOVING --------------------------------------
513
- // suppressDragLeaveHidesColumns: true,
513
+ suppressDragLeaveHidesColumns: true, // disable this since it's quite easy to accidentally hide columns while moving
514
514
  // -------------------------------------- SERVER SIDE ROW MODEL --------------------------------------
515
515
  suppressScrollOnNewData: true,
516
516
  suppressServerSideFullWidthLoadingRow: true, // make sure each column has its own loading indicator instead of the whole row
@@ -537,7 +537,7 @@ export function generateBaseGridOptions(dataCube: DataCubeState): GridOptions {
537
537
  ],
538
538
  position: 'right',
539
539
  },
540
- // allowDragFromColumnsToolPanel: true,
540
+ allowDragFromColumnsToolPanel: true,
541
541
  // -------------------------------------- PERFORMANCE --------------------------------------
542
542
  animateRows: false, // improve performance
543
543
  suppressColumnMoveAnimation: true, // improve performance
@@ -560,9 +560,7 @@ export function generateGridOptionsFromSnapshot(
560
560
  */
561
561
  rowClassRules: configuration.alternateRows
562
562
  ? {
563
- [INTERNAL__GRID_CLIENT_UTILITY_CSS_CLASS_NAME.HIGHLIGHT_ROW]: (
564
- params,
565
- ) =>
563
+ [INTERNAL__GridClientUtilityCssClassName.HIGHLIGHT_ROW]: (params) =>
566
564
  params.rowIndex % (configuration.alternateRowsCount * 2) >=
567
565
  configuration.alternateRowsCount,
568
566
  }