@finos/legend-application-repl 0.0.28 → 0.0.30
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.
- package/grammar/datacube_filter__lexer.g4 +40 -0
- package/grammar/datacube_filter__parser.g4 +14 -0
- package/grammar/generateGrammar.js +43 -0
- package/grammar/parser/generated/datacube_filter__lexer.interp +59 -0
- package/grammar/parser/generated/datacube_filter__lexer.tokens +14 -0
- package/grammar/parser/generated/datacube_filter__lexer.ts +142 -0
- package/grammar/parser/generated/datacube_filter__parser.interp +38 -0
- package/grammar/parser/generated/datacube_filter__parser.tokens +14 -0
- package/grammar/parser/generated/datacube_filter__parser.ts +514 -0
- package/grammar/parser/parser.ts +55 -0
- package/lib/components/Core_LegendREPLApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendREPLApplicationPlugin.js +0 -7
- package/lib/components/Core_LegendREPLApplicationPlugin.js.map +1 -1
- package/lib/components/LegendREPLApplication.d.ts +0 -1
- package/lib/components/LegendREPLApplication.d.ts.map +1 -1
- package/lib/components/LegendREPLFrameworkProvider.d.ts +0 -1
- package/lib/components/LegendREPLFrameworkProvider.d.ts.map +1 -1
- package/lib/components/REPLStoreProvider.d.ts +1 -1
- package/lib/components/REPLStoreProvider.d.ts.map +1 -1
- package/lib/components/REPLStoreProvider.js +1 -1
- package/lib/components/REPLStoreProvider.js.map +1 -1
- package/lib/components/dataCube/DataCube.d.ts.map +1 -1
- package/lib/components/dataCube/DataCube.js +15 -4
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts +2 -4
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js +109 -32
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.d.ts +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js +178 -104
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js.map +1 -1
- package/lib/components/dataCube/editor/{DataCubeEditorSortPanel.d.ts → DataCubeEditorColumnPropertiesPanel.d.ts} +2 -5
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts +22 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js +230 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js +26 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js.map +1 -0
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts +1 -4
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js +75 -30
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
- package/lib/grammar/generated/datacube_filter__lexer.d.ts +31 -0
- package/lib/grammar/generated/datacube_filter__lexer.js +118 -0
- package/lib/grammar/generated/datacube_filter__parser.d.ts +91 -0
- package/lib/grammar/generated/datacube_filter__parser.js +485 -0
- package/lib/grammar/parser.d.ts +16 -0
- package/lib/grammar/parser.js +39 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +9 -6
- package/lib/server/REPLServerClient.d.ts +2 -3
- package/lib/server/REPLServerClient.d.ts.map +1 -1
- package/lib/server/models/DataCubeEngineModels.d.ts +8 -1
- package/lib/server/models/DataCubeEngineModels.d.ts.map +1 -1
- package/lib/server/models/DataCubeEngineModels.js +13 -0
- package/lib/server/models/DataCubeEngineModels.js.map +1 -1
- package/lib/stores/dataCube/DataCubeDefaultConfig.d.ts +17 -0
- package/lib/stores/dataCube/DataCubeDefaultConfig.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeDefaultConfig.js +17 -0
- package/lib/stores/dataCube/DataCubeDefaultConfig.js.map +1 -0
- package/lib/stores/dataCube/DataCubeState.d.ts +6 -6
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +18 -14
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/{DataCubeStore.d.ts → REPLStore.d.ts} +1 -1
- package/lib/stores/dataCube/REPLStore.d.ts.map +1 -0
- package/lib/stores/dataCube/{DataCubeStore.js → REPLStore.js} +1 -1
- package/lib/stores/dataCube/REPLStore.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts +29 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.js +46 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeEngine.d.ts +2 -3
- package/lib/stores/dataCube/core/DataCubeEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeEngine.js +2 -3
- package/lib/stores/dataCube/core/DataCubeEngine.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts +27 -3
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +210 -278
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +72 -0
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js +67 -0
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +73 -38
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js +101 -40
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts +32 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js +232 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts +8 -2
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js +20 -5
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts +8 -3
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js +8 -4
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js.map +1 -1
- package/lib/stores/dataCube/editor/{DataCubeEditorCodeState.d.ts → DataCubeEditorCodePanelState.d.ts} +6 -5
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/{DataCubeEditorCodeState.js → DataCubeEditorCodePanelState.js} +7 -7
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts +30 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js +51 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +29 -0
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js +63 -0
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/{DataCubeEditorQuerySnapshotBuilder.d.ts → DataCubeEditorPanelState.d.ts} +2 -2
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/{DataCubeEditorQuerySnapshotBuilder.js → DataCubeEditorPanelState.js} +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts +34 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js +67 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +10 -7
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +25 -17
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +13 -7
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +87 -86
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts +20 -0
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js +103 -0
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts +7 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js +121 -214
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts +25 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +83 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +6 -5
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.js +32 -10
- package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -1
- package/package.json +15 -12
- package/src/components/Core_LegendREPLApplicationPlugin.tsx +0 -7
- package/src/components/REPLStoreProvider.tsx +1 -1
- package/src/components/dataCube/DataCube.tsx +51 -29
- package/src/components/dataCube/editor/DataCubeEditor.tsx +204 -95
- package/src/components/dataCube/editor/DataCubeEditorCodePanel.tsx +186 -190
- package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +42 -0
- package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorColumnsSelector.tsx +408 -0
- package/src/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorFilterPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +48 -0
- package/src/components/dataCube/editor/DataCubeEditorHPivotsPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorSortsPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorVPivotsPanel.tsx +41 -0
- package/src/components/dataCube/grid/DataCubeGrid.tsx +134 -43
- package/src/server/REPLServerClient.ts +2 -2
- package/src/server/models/DataCubeEngineModels.ts +23 -1
- package/{lib/grid.css → src/stores/dataCube/DataCubeDefaultConfig.ts} +2 -2
- package/src/stores/dataCube/DataCubeState.ts +26 -20
- package/src/stores/dataCube/core/DataCubeCoreState.ts +57 -0
- package/src/stores/dataCube/core/DataCubeEngine.ts +6 -4
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +349 -353
- package/src/stores/dataCube/core/DataCubeQueryEngine.ts +90 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +168 -156
- package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +398 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +37 -5
- package/src/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.ts +13 -5
- package/src/stores/dataCube/editor/{DataCubeEditorCodeState.ts → DataCubeEditorCodePanelState.ts} +6 -6
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +61 -0
- package/src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts +80 -0
- package/src/stores/dataCube/editor/{DataCubeEditorQuerySnapshotBuilder.ts → DataCubeEditorPanelState.ts} +1 -1
- package/src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts +116 -0
- package/src/stores/dataCube/editor/DataCubeEditorState.ts +29 -20
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +96 -128
- package/src/stores/dataCube/grid/DataCubeGridQueryBuilder.ts +154 -0
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.tsx +191 -0
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +127 -0
- package/src/stores/dataCube/grid/DataCubeGridState.ts +41 -14
- package/tsconfig.json +23 -9
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.d.ts.map +0 -1
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.js +0 -61
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.js.map +0 -1
- package/lib/grid.css.map +0 -1
- package/lib/repl.css +0 -17
- package/lib/repl.css.map +0 -1
- package/lib/stores/dataCube/DataCubeMetaModelConst.d.ts +0 -63
- package/lib/stores/dataCube/DataCubeMetaModelConst.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeMetaModelConst.js +0 -72
- package/lib/stores/dataCube/DataCubeMetaModelConst.js.map +0 -1
- package/lib/stores/dataCube/DataCubeStore.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeStore.js.map +0 -1
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.d.ts +0 -37
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.d.ts.map +0 -1
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.js +0 -269
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.js.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodeState.d.ts.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodeState.js.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.d.ts.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.js.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.d.ts +0 -46
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.d.ts.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.js +0 -133
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.js.map +0 -1
- package/src/components/dataCube/editor/DataCubeEditorSortPanel.tsx +0 -274
- package/src/stores/dataCube/DataCubeMetaModelConst.ts +0 -76
- package/src/stores/dataCube/core/DataCubeQueryAnalyzer.ts +0 -424
- package/src/stores/dataCube/editor/DataCubeEditorSortState.ts +0 -198
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.ts +0 -281
- /package/src/stores/dataCube/{DataCubeStore.ts → REPLStore.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
export class DataCubeEditorGeneralPropertiesPanelState {
|
|
18
|
+
dataCube;
|
|
19
|
+
name = '';
|
|
20
|
+
limit = -1;
|
|
21
|
+
constructor(dataCube) {
|
|
22
|
+
this.dataCube = dataCube;
|
|
23
|
+
makeObservable(this, {
|
|
24
|
+
name: observable,
|
|
25
|
+
setName: action,
|
|
26
|
+
limit: observable,
|
|
27
|
+
setLimit: action,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
setName(val) {
|
|
31
|
+
this.name = val;
|
|
32
|
+
}
|
|
33
|
+
setLimit(val) {
|
|
34
|
+
this.limit = Math.round(val === undefined || val < 0 ? -1 : val);
|
|
35
|
+
}
|
|
36
|
+
applySnaphot(snapshot) {
|
|
37
|
+
this.setName(snapshot.data.name);
|
|
38
|
+
this.setLimit(snapshot.data.limit);
|
|
39
|
+
}
|
|
40
|
+
buildSnapshot(newSnapshot, baseSnapshot) {
|
|
41
|
+
const data = baseSnapshot.data;
|
|
42
|
+
// name
|
|
43
|
+
if (this.name !== data.name) {
|
|
44
|
+
data.name = this.name;
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// limit
|
|
48
|
+
if (data.limit === undefined) {
|
|
49
|
+
if (this.limit !== -1) {
|
|
50
|
+
data.limit = this.limit;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if (this.limit !== data.limit) {
|
|
56
|
+
data.limit = this.limit;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=DataCubeEditorGeneralPropertiesPanelState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeEditorGeneralPropertiesPanelState.js","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAK1D,MAAM,OAAO,yCAAyC;IAG3C,QAAQ,CAAiB;IAClC,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAG,CAAC,CAAC,CAAC;IAEX,YAAY,QAAuB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,cAAc,CAAC,IAAI,EAAE;YACnB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,MAAM;YAEf,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,GAAW;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAuB;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACnE,CAAC;IAED,YAAY,CAAC,QAA+B;QAC1C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,aAAa,CACX,WAAkC,EAClC,YAAmC;QAEnC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAC/B,OAAO;QACP,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,QAAQ;QACR,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
17
|
-
export interface
|
|
17
|
+
export interface DataCubeQueryEditorPanelState {
|
|
18
18
|
/**
|
|
19
19
|
* Update the editor state based on the snapshot
|
|
20
20
|
*/
|
|
@@ -25,4 +25,4 @@ export interface DataCubeQueryEditorSubState {
|
|
|
25
25
|
*/
|
|
26
26
|
buildSnapshot(newSnapshot: DataCubeQuerySnapshot, baseSnapshot: DataCubeQuerySnapshot): boolean;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=DataCubeEditorPanelState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeEditorPanelState.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,aAAa,CACX,WAAW,EAAE,qBAAqB,EAClC,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeEditorPanelState.js","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { DataCubeState } from '../DataCubeState.js';
|
|
17
|
+
import { DataCubeQuerySnapshotSortDirection, type DataCubeQuerySnapshot, type DataCubeQuerySnapshotColumn } from '../core/DataCubeQuerySnapshot.js';
|
|
18
|
+
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
19
|
+
import { DataCubeEditorColumnsSelectorColumnState, DataCubeEditorColumnsSelectorState } from './DataCubeEditorColumnsSelectorState.js';
|
|
20
|
+
export declare class DataCubeEditorSortColumnState extends DataCubeEditorColumnsSelectorColumnState {
|
|
21
|
+
readonly column: DataCubeQuerySnapshotColumn;
|
|
22
|
+
direction: DataCubeQuerySnapshotSortDirection;
|
|
23
|
+
constructor(column: DataCubeQuerySnapshotColumn, direction: DataCubeQuerySnapshotSortDirection);
|
|
24
|
+
get name(): string;
|
|
25
|
+
setDirection(val: DataCubeQuerySnapshotSortDirection): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class DataCubeEditorSortsPanelState implements DataCubeQueryEditorPanelState {
|
|
28
|
+
readonly dataCube: DataCubeState;
|
|
29
|
+
readonly columnsSelector: DataCubeEditorColumnsSelectorState<DataCubeEditorSortColumnState>;
|
|
30
|
+
constructor(dataCube: DataCubeState);
|
|
31
|
+
applySnaphot(snapshot: DataCubeQuerySnapshot): void;
|
|
32
|
+
buildSnapshot(newSnapshot: DataCubeQuerySnapshot, baseSnapshot: DataCubeQuerySnapshot): boolean;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=DataCubeEditorSortsPanelState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeEditorSortsPanelState.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,kCAAkC,EAElC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAEjC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF,OAAO,EACL,wCAAwC,EACxC,kCAAkC,EACnC,MAAM,yCAAyC,CAAC;AAEjD,qBAAa,6BAA8B,SAAQ,wCAAwC;IACzF,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC7C,SAAS,EAAE,kCAAkC,CAAC;gBAG5C,MAAM,EAAE,2BAA2B,EACnC,SAAS,EAAE,kCAAkC;IAa/C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,YAAY,CAAC,GAAG,EAAE,kCAAkC,GAAG,IAAI;CAG5D;AAED,qBAAa,6BACX,YAAW,6BAA6B;IAExC,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAG,kCAAkC,CAAC,6BAA6B,CAAC,CAAC;gBAEjF,QAAQ,EAAE,aAAa;IAKnC,YAAY,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IA2BnD,aAAa,CACX,WAAW,EAAE,qBAAqB,EAClC,YAAY,EAAE,qBAAqB,GAClC,OAAO;CAcX"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { DataCubeQuerySnapshotSortDirection, _getCol, } from '../core/DataCubeQuerySnapshot.js';
|
|
18
|
+
import { deepEqual } from '@finos/legend-shared';
|
|
19
|
+
import { DataCubeEditorColumnsSelectorColumnState, DataCubeEditorColumnsSelectorState, } from './DataCubeEditorColumnsSelectorState.js';
|
|
20
|
+
export class DataCubeEditorSortColumnState extends DataCubeEditorColumnsSelectorColumnState {
|
|
21
|
+
column;
|
|
22
|
+
direction;
|
|
23
|
+
constructor(column, direction) {
|
|
24
|
+
super();
|
|
25
|
+
makeObservable(this, {
|
|
26
|
+
direction: observable,
|
|
27
|
+
setDirection: action,
|
|
28
|
+
});
|
|
29
|
+
this.column = column;
|
|
30
|
+
this.direction = direction;
|
|
31
|
+
}
|
|
32
|
+
get name() {
|
|
33
|
+
return this.column.name;
|
|
34
|
+
}
|
|
35
|
+
setDirection(val) {
|
|
36
|
+
this.direction = val;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class DataCubeEditorSortsPanelState {
|
|
40
|
+
dataCube;
|
|
41
|
+
columnsSelector;
|
|
42
|
+
constructor(dataCube) {
|
|
43
|
+
this.dataCube = dataCube;
|
|
44
|
+
this.columnsSelector = new DataCubeEditorColumnsSelectorState();
|
|
45
|
+
}
|
|
46
|
+
applySnaphot(snapshot) {
|
|
47
|
+
const columns = snapshot.stageCols('sort');
|
|
48
|
+
const sortColumns = snapshot.data.sortColumns;
|
|
49
|
+
this.columnsSelector.setAvailableColumns(columns
|
|
50
|
+
.filter((col) => !sortColumns.find((sortCol) => sortCol.name === col.name))
|
|
51
|
+
.map((col) => new DataCubeEditorSortColumnState(_getCol(columns, col.name), DataCubeQuerySnapshotSortDirection.ASCENDING)));
|
|
52
|
+
this.columnsSelector.setSelectedColumns(sortColumns.map((col) => new DataCubeEditorSortColumnState(_getCol(columns, col.name), col.direction)));
|
|
53
|
+
}
|
|
54
|
+
buildSnapshot(newSnapshot, baseSnapshot) {
|
|
55
|
+
const newSortColumns = this.columnsSelector.selectedColumns.map((sortInfo) => ({
|
|
56
|
+
name: sortInfo.column.name,
|
|
57
|
+
type: sortInfo.column.type,
|
|
58
|
+
direction: sortInfo.direction,
|
|
59
|
+
}));
|
|
60
|
+
if (!deepEqual(newSortColumns, baseSnapshot.data.sortColumns)) {
|
|
61
|
+
newSnapshot.data.sortColumns = newSortColumns;
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=DataCubeEditorSortsPanelState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeEditorSortsPanelState.js","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EACL,kCAAkC,EAClC,OAAO,GAIR,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,wCAAwC,EACxC,kCAAkC,GACnC,MAAM,yCAAyC,CAAC;AAEjD,MAAM,OAAO,6BAA8B,SAAQ,wCAAwC;IAChF,MAAM,CAA8B;IAC7C,SAAS,CAAqC;IAE9C,YACE,MAAmC,EACnC,SAA6C;QAE7C,KAAK,EAAE,CAAC;QAER,cAAc,CAAC,IAAI,EAAE;YACnB,SAAS,EAAE,UAAU;YACrB,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,YAAY,CAAC,GAAuC;QAClD,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IACvB,CAAC;CACF;AAED,MAAM,OAAO,6BAA6B;IAG/B,QAAQ,CAAiB;IACzB,eAAe,CAAqE;IAE7F,YAAY,QAAuB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,IAAI,kCAAkC,EAAE,CAAC;IAClE,CAAC;IAED,YAAY,CAAC,QAA+B;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;QAC9C,IAAI,CAAC,eAAe,CAAC,mBAAmB,CACtC,OAAO;aACJ,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CACnE;aACA,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,IAAI,6BAA6B,CAC/B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,EAC1B,kCAAkC,CAAC,SAAS,CAC7C,CACJ,CACJ,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,kBAAkB,CACrC,WAAW,CAAC,GAAG,CACb,CAAC,GAAG,EAAE,EAAE,CACN,IAAI,6BAA6B,CAC/B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,EAC1B,GAAG,CAAC,SAAS,CACd,CACJ,CACF,CAAC;IACJ,CAAC;IAED,aAAa,CACX,WAAkC,EAClC,YAAmC;QAEnC,MAAM,cAAc,GAClB,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACtD,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI;YAC1B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI;YAC1B,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC9B,CAAC,CAAC,CAAC;QAEN,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9D,WAAW,CAAC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC;YAC9C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -14,31 +14,34 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { DataCubeState } from '../DataCubeState.js';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { DataCubeEditorSortsPanelState } from './DataCubeEditorSortsPanelState.js';
|
|
18
|
+
import { DataCubeEditorCodePanelState } from './DataCubeEditorCodePanelState.js';
|
|
19
19
|
import { DataCubeQuerySnapshotSubscriber } from '../core/DataCubeQuerySnapshotSubscriber.js';
|
|
20
20
|
import { type DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
21
|
+
import { DataCubeEditorGeneralPropertiesPanelState } from './DataCubeEditorGeneralPropertiesPanelState.js';
|
|
21
22
|
export declare enum DATA_CUBE_EDITOR_TAB {
|
|
22
23
|
COLUMNS = "Columns",
|
|
23
24
|
VERTICAL_PIVOTS = "VPivots",
|
|
24
25
|
HORIZONTAL_PIVOTS = "HPivots",
|
|
25
26
|
SORTS = "Sorts",
|
|
26
27
|
EXTENDED_COLUMNS = "Extended Columns",
|
|
28
|
+
FILTER = "Filter",
|
|
27
29
|
GENERAL_PROPERTIES = "General Properties",
|
|
28
30
|
COLUMN_PROPERTIES = "Column Properties",
|
|
29
|
-
|
|
31
|
+
CODE = "Code"
|
|
30
32
|
}
|
|
31
33
|
export declare class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
34
|
+
readonly sortsPanel: DataCubeEditorSortsPanelState;
|
|
35
|
+
readonly generalPropertiesPanel: DataCubeEditorGeneralPropertiesPanelState;
|
|
36
|
+
readonly codePanel: DataCubeEditorCodePanelState;
|
|
35
37
|
isPanelOpen: boolean;
|
|
36
38
|
currentTab: DATA_CUBE_EDITOR_TAB;
|
|
37
|
-
constructor(
|
|
39
|
+
constructor(dataCube: DataCubeState);
|
|
38
40
|
openPanel(): void;
|
|
39
41
|
closePanel(): void;
|
|
40
42
|
setCurrentTab(val: DATA_CUBE_EDITOR_TAB): void;
|
|
41
43
|
applyChanges(): void;
|
|
42
44
|
applySnapshot(snapshot: DataCubeQuerySnapshot): Promise<void>;
|
|
45
|
+
initialize(): Promise<void>;
|
|
43
46
|
}
|
|
44
47
|
//# sourceMappingURL=DataCubeEditorState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCubeEditorState.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DataCubeEditorState.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,yCAAyC,EAAE,MAAM,gDAAgD,CAAC;AAE3G,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,eAAe,YAAY;IAC3B,iBAAiB,YAAY;IAC7B,KAAK,UAAU;IACf,gBAAgB,qBAAqB;IACrC,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;IACvC,IAAI,SAAS;CAGd;AAED,qBAAa,mBAAoB,SAAQ,+BAA+B;IACtE,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC;IACnD,QAAQ,CAAC,sBAAsB,EAAE,yCAAyC,CAAC;IAC3E,QAAQ,CAAC,SAAS,EAAE,4BAA4B,CAAC;IAEjD,WAAW,UAAS;IACpB,UAAU,uBAA2C;gBAEzC,QAAQ,EAAE,aAAa;IAqBnC,SAAS,IAAI,IAAI;IAIjB,UAAU,IAAI,IAAI;IAIlB,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI;IAI9C,YAAY,IAAI,IAAI;IAcL,aAAa,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3C"}
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { action, makeObservable, observable } from 'mobx';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { DataCubeEditorSortsPanelState } from './DataCubeEditorSortsPanelState.js';
|
|
18
|
+
import { DataCubeEditorCodePanelState } from './DataCubeEditorCodePanelState.js';
|
|
19
19
|
import { DataCubeQuerySnapshotSubscriber } from '../core/DataCubeQuerySnapshotSubscriber.js';
|
|
20
|
-
import {
|
|
20
|
+
import {} from '../core/DataCubeQuerySnapshot.js';
|
|
21
21
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
22
|
+
import { DataCubeEditorGeneralPropertiesPanelState } from './DataCubeEditorGeneralPropertiesPanelState.js';
|
|
22
23
|
export var DATA_CUBE_EDITOR_TAB;
|
|
23
24
|
(function (DATA_CUBE_EDITOR_TAB) {
|
|
24
25
|
DATA_CUBE_EDITOR_TAB["COLUMNS"] = "Columns";
|
|
@@ -26,20 +27,21 @@ export var DATA_CUBE_EDITOR_TAB;
|
|
|
26
27
|
DATA_CUBE_EDITOR_TAB["HORIZONTAL_PIVOTS"] = "HPivots";
|
|
27
28
|
DATA_CUBE_EDITOR_TAB["SORTS"] = "Sorts";
|
|
28
29
|
DATA_CUBE_EDITOR_TAB["EXTENDED_COLUMNS"] = "Extended Columns";
|
|
30
|
+
DATA_CUBE_EDITOR_TAB["FILTER"] = "Filter";
|
|
29
31
|
DATA_CUBE_EDITOR_TAB["GENERAL_PROPERTIES"] = "General Properties";
|
|
30
32
|
DATA_CUBE_EDITOR_TAB["COLUMN_PROPERTIES"] = "Column Properties";
|
|
31
|
-
DATA_CUBE_EDITOR_TAB["
|
|
33
|
+
DATA_CUBE_EDITOR_TAB["CODE"] = "Code";
|
|
32
34
|
// DEVELOPER_OPTIONS = 'Developer',
|
|
33
35
|
// PIVOT_LAYOUT = 'Pivot Layout',
|
|
34
36
|
})(DATA_CUBE_EDITOR_TAB || (DATA_CUBE_EDITOR_TAB = {}));
|
|
35
37
|
export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
sortsPanel;
|
|
39
|
+
generalPropertiesPanel;
|
|
40
|
+
codePanel;
|
|
39
41
|
isPanelOpen = false;
|
|
40
|
-
currentTab = DATA_CUBE_EDITOR_TAB.
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
42
|
+
currentTab = DATA_CUBE_EDITOR_TAB.GENERAL_PROPERTIES;
|
|
43
|
+
constructor(dataCube) {
|
|
44
|
+
super(dataCube);
|
|
43
45
|
makeObservable(this, {
|
|
44
46
|
applyChanges: action,
|
|
45
47
|
currentTab: observable,
|
|
@@ -48,9 +50,9 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
48
50
|
openPanel: action,
|
|
49
51
|
closePanel: action,
|
|
50
52
|
});
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
53
|
+
this.sortsPanel = new DataCubeEditorSortsPanelState(this.dataCube);
|
|
54
|
+
this.generalPropertiesPanel = new DataCubeEditorGeneralPropertiesPanelState(this.dataCube);
|
|
55
|
+
this.codePanel = new DataCubeEditorCodePanelState(this.dataCube);
|
|
54
56
|
}
|
|
55
57
|
openPanel() {
|
|
56
58
|
this.isPanelOpen = true;
|
|
@@ -62,16 +64,22 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
62
64
|
this.currentTab = val;
|
|
63
65
|
}
|
|
64
66
|
applyChanges() {
|
|
65
|
-
// let createNew = false;
|
|
66
67
|
const baseSnapshot = guaranteeNonNullable(this.getLatestSnapshot());
|
|
67
|
-
const snapshot =
|
|
68
|
-
const createNew =
|
|
68
|
+
const snapshot = baseSnapshot.clone();
|
|
69
|
+
const createNew = [
|
|
70
|
+
this.sortsPanel.buildSnapshot(snapshot, baseSnapshot),
|
|
71
|
+
this.generalPropertiesPanel.buildSnapshot(snapshot, baseSnapshot),
|
|
72
|
+
].some(Boolean);
|
|
69
73
|
if (createNew) {
|
|
70
74
|
this.publishSnapshot(snapshot);
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
async applySnapshot(snapshot) {
|
|
74
|
-
this.
|
|
78
|
+
this.sortsPanel.applySnaphot(snapshot);
|
|
79
|
+
this.generalPropertiesPanel.applySnaphot(snapshot);
|
|
80
|
+
}
|
|
81
|
+
async initialize() {
|
|
82
|
+
// do nothing
|
|
75
83
|
}
|
|
76
84
|
}
|
|
77
85
|
//# sourceMappingURL=DataCubeEditorState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCubeEditorState.js","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DataCubeEditorState.js","sourceRoot":"","sources":["../../../../src/stores/dataCube/editor/DataCubeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,yCAAyC,EAAE,MAAM,gDAAgD,CAAC;AAE3G,MAAM,CAAN,IAAY,oBAYX;AAZD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,mDAA2B,CAAA;IAC3B,qDAA6B,CAAA;IAC7B,uCAAe,CAAA;IACf,6DAAqC,CAAA;IACrC,yCAAiB,CAAA;IACjB,iEAAyC,CAAA;IACzC,+DAAuC,CAAA;IACvC,qCAAa,CAAA;IACb,mCAAmC;IACnC,iCAAiC;AACnC,CAAC,EAZW,oBAAoB,KAApB,oBAAoB,QAY/B;AAED,MAAM,OAAO,mBAAoB,SAAQ,+BAA+B;IAC7D,UAAU,CAAgC;IAC1C,sBAAsB,CAA4C;IAClE,SAAS,CAA+B;IAEjD,WAAW,GAAG,KAAK,CAAC;IACpB,UAAU,GAAG,oBAAoB,CAAC,kBAAkB,CAAC;IAErD,YAAY,QAAuB;QACjC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,cAAc,CAAC,IAAI,EAAE;YACnB,YAAY,EAAE,MAAM;YAEpB,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE,MAAM;YAErB,WAAW,EAAE,UAAU;YACvB,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,MAAM;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,IAAI,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnE,IAAI,CAAC,sBAAsB,GAAG,IAAI,yCAAyC,CACzE,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;IAED,SAAS;QACP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,aAAa,CAAC,GAAyB;QACrC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,YAAY;QACV,MAAM,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC;QAEtC,MAAM,SAAS,GAAG;YAChB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC;YACrD,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC;SAClE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEhB,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAEQ,KAAK,CAAC,aAAa,CAAC,QAA+B;QAC1D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;IAEQ,KAAK,CAAC,UAAU;QACvB,aAAa;IACf,CAAC;CACF"}
|
|
@@ -15,21 +15,27 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IServerSideDatasource, IServerSideGetRowsParams } from '@ag-grid-community/core';
|
|
17
17
|
import type { DataCubeGridState } from './DataCubeGridState.js';
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
export declare const INTERNAL__GRID_CLIENT_HEADER_HEIGHT = 24;
|
|
19
|
+
export declare const INTERNAL__GRID_CLIENT_ROW_HEIGHT = 20;
|
|
20
|
+
export declare const INTERNAL__GRID_CLIENT_ROW_BUFFER = 50;
|
|
21
|
+
export declare const INTERNAL__GRID_CLIENT_TREE_COLUMN_ID = "INTERNAL__tree";
|
|
22
|
+
export declare const INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID = "INTERNAL__count";
|
|
23
23
|
export declare enum GridClientSortDirection {
|
|
24
24
|
ASCENDING = "asc",
|
|
25
25
|
DESCENDING = "desc"
|
|
26
26
|
}
|
|
27
|
-
export declare
|
|
27
|
+
export declare enum GridClientAggregateOperation {
|
|
28
|
+
COUNT = "count",
|
|
29
|
+
SUM = "sum",
|
|
30
|
+
MAX = "max",
|
|
31
|
+
MIN = "min",
|
|
32
|
+
AVERAGE = "avg"
|
|
33
|
+
}
|
|
28
34
|
export declare class DataCubeGridClientServerSideDataSource implements IServerSideDatasource {
|
|
29
35
|
readonly grid: DataCubeGridState;
|
|
36
|
+
rowCount: number | undefined;
|
|
30
37
|
constructor(grid: DataCubeGridState);
|
|
31
38
|
fetchRows(params: IServerSideGetRowsParams<unknown, unknown>): Promise<void>;
|
|
32
39
|
getRows(params: IServerSideGetRowsParams<unknown, unknown>): void;
|
|
33
|
-
private syncSnapshot;
|
|
34
40
|
}
|
|
35
41
|
//# sourceMappingURL=DataCubeGridClientEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCubeGridClientEngine.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/grid/DataCubeGridClientEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"DataCubeGridClientEngine.d.ts","sourceRoot":"","sources":["../../../../src/stores/dataCube/grid/DataCubeGridClientEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAmBhE,eAAO,MAAM,mCAAmC,KAAK,CAAC;AACtD,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,oCAAoC,mBAAmB,CAAC;AACrE,eAAO,MAAM,sDAAsD,oBAChD,CAAC;AAEpB,oBAAY,uBAAuB;IACjC,SAAS,QAAQ;IACjB,UAAU,SAAS;CACpB;AAED,oBAAY,4BAA4B;IACtC,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,OAAO,QAAQ;CAChB;AAgBD,qBAAa,sCACX,YAAW,qBAAqB;IAEhC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;gBAE7B,IAAI,EAAE,iBAAiB;IAQ7B,SAAS,CACb,MAAM,EAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,GACjD,OAAO,CAAC,IAAI,CAAC;IA6EhB,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,IAAI;CAUlE"}
|
|
@@ -13,122 +13,123 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { V1_Lambda, PRIMITIVE_TYPE, extractElementNameFromPath, } from '@finos/legend-graph';
|
|
20
|
-
import { DATA_CUBE_COLUMN_SORT_DIRECTION, DATA_CUBE_FILTER_OPERATION, DATA_CUBE_FUNCTIONS, } from '../DataCubeMetaModelConst.js';
|
|
16
|
+
import { LogEvent, assertErrorThrown, guaranteeNonNullable, isBoolean, } from '@finos/legend-shared';
|
|
17
|
+
import { buildExecutableQuery } from '../core/DataCubeQueryBuilder.js';
|
|
18
|
+
import { V1_Lambda } from '@finos/legend-graph';
|
|
21
19
|
import { APPLICATION_EVENT } from '@finos/legend-application';
|
|
20
|
+
import { buildQuerySnapshot } from './DataCubeGridQuerySnapshotBuilder.js';
|
|
21
|
+
import { generateRowGroupingDrilldownExecutableQueryPostProcessor } from './DataCubeGridQueryBuilder.js';
|
|
22
|
+
import { makeObservable, observable, runInAction } from 'mobx';
|
|
23
|
+
export const INTERNAL__GRID_CLIENT_HEADER_HEIGHT = 24;
|
|
24
|
+
export const INTERNAL__GRID_CLIENT_ROW_HEIGHT = 20;
|
|
25
|
+
export const INTERNAL__GRID_CLIENT_ROW_BUFFER = 50;
|
|
26
|
+
export const INTERNAL__GRID_CLIENT_TREE_COLUMN_ID = 'INTERNAL__tree';
|
|
27
|
+
export const INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID = 'INTERNAL__count';
|
|
22
28
|
export var GridClientSortDirection;
|
|
23
29
|
(function (GridClientSortDirection) {
|
|
24
30
|
GridClientSortDirection["ASCENDING"] = "asc";
|
|
25
31
|
GridClientSortDirection["DESCENDING"] = "desc";
|
|
26
32
|
})(GridClientSortDirection || (GridClientSortDirection = {}));
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
export var GridClientAggregateOperation;
|
|
34
|
+
(function (GridClientAggregateOperation) {
|
|
35
|
+
GridClientAggregateOperation["COUNT"] = "count";
|
|
36
|
+
GridClientAggregateOperation["SUM"] = "sum";
|
|
37
|
+
GridClientAggregateOperation["MAX"] = "max";
|
|
38
|
+
GridClientAggregateOperation["MIN"] = "min";
|
|
39
|
+
GridClientAggregateOperation["AVERAGE"] = "avg";
|
|
40
|
+
})(GridClientAggregateOperation || (GridClientAggregateOperation = {}));
|
|
41
|
+
function TDStoRowData(tds) {
|
|
42
|
+
return tds.rows.map((_row, rowIdx) => {
|
|
43
|
+
const row = {};
|
|
44
|
+
const cols = tds.columns;
|
|
45
|
+
_row.values.forEach((value, colIdx) => {
|
|
46
|
+
// `ag-grid` shows `false` value as empty string so we have
|
|
47
|
+
// call `.toString()` to avoid this behavior.
|
|
48
|
+
row[cols[colIdx]] = isBoolean(value) ? String(value) : value;
|
|
49
|
+
});
|
|
50
|
+
row.rowNumber = rowIdx;
|
|
51
|
+
return row;
|
|
34
52
|
});
|
|
35
|
-
|
|
36
|
-
return row;
|
|
37
|
-
});
|
|
53
|
+
}
|
|
38
54
|
export class DataCubeGridClientServerSideDataSource {
|
|
39
55
|
grid;
|
|
56
|
+
rowCount = undefined;
|
|
40
57
|
constructor(grid) {
|
|
58
|
+
makeObservable(this, {
|
|
59
|
+
rowCount: observable,
|
|
60
|
+
});
|
|
41
61
|
this.grid = grid;
|
|
42
62
|
}
|
|
43
63
|
async fetchRows(params) {
|
|
64
|
+
// ------------------------------ GRID OPTIONS ------------------------------
|
|
65
|
+
// Here, we make adjustments to the grid display in response to the new
|
|
66
|
+
// request, in case the grid action has not impacted the layout in an
|
|
67
|
+
// adequate way.
|
|
68
|
+
// Toggle the visibility of the tree column based on the presence of row-group columns
|
|
69
|
+
if (params.request.rowGroupCols.length) {
|
|
70
|
+
params.api.setColumnsVisible([INTERNAL__GRID_CLIENT_TREE_COLUMN_ID], true);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
params.api.setColumnsVisible([INTERNAL__GRID_CLIENT_TREE_COLUMN_ID], false);
|
|
74
|
+
}
|
|
75
|
+
// ------------------------------ SNAPSHOT ------------------------------
|
|
44
76
|
const currentSnapshot = guaranteeNonNullable(this.grid.getLatestSnapshot());
|
|
45
|
-
const syncedSnapshot =
|
|
77
|
+
const syncedSnapshot = buildQuerySnapshot(params.request, currentSnapshot);
|
|
46
78
|
if (syncedSnapshot.uuid !== currentSnapshot.uuid) {
|
|
47
79
|
this.grid.publishSnapshot(syncedSnapshot);
|
|
48
80
|
}
|
|
81
|
+
// ------------------------------ DATA ------------------------------
|
|
49
82
|
try {
|
|
50
|
-
const executableQuery =
|
|
83
|
+
const executableQuery = buildExecutableQuery(syncedSnapshot, {
|
|
84
|
+
postProcessor: generateRowGroupingDrilldownExecutableQueryPostProcessor(params.request.groupKeys),
|
|
85
|
+
pagination: this.grid.isPaginationEnabled &&
|
|
86
|
+
params.request.startRow !== undefined &&
|
|
87
|
+
params.request.endRow !== undefined
|
|
88
|
+
? {
|
|
89
|
+
start: params.request.startRow,
|
|
90
|
+
end: params.request.endRow,
|
|
91
|
+
}
|
|
92
|
+
: undefined,
|
|
93
|
+
});
|
|
51
94
|
const lambda = new V1_Lambda();
|
|
52
95
|
lambda.body.push(executableQuery);
|
|
53
|
-
const result = await this.grid.
|
|
54
|
-
const rowData =
|
|
55
|
-
|
|
96
|
+
const result = await this.grid.dataCube.engine.executeQuery(lambda);
|
|
97
|
+
const rowData = TDStoRowData(result.result);
|
|
98
|
+
if (this.grid.isPaginationEnabled) {
|
|
99
|
+
params.success({ rowData });
|
|
100
|
+
// Only update row count when loading the top-level drilldown data
|
|
101
|
+
if (params.request.groupKeys.length === 0) {
|
|
102
|
+
runInAction(() => {
|
|
103
|
+
this.rowCount = (params.request.startRow ?? 0) + rowData.length;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
params.success({
|
|
109
|
+
rowData,
|
|
110
|
+
// Setting row count to disable inifite-scrolling when pagination is disabled
|
|
111
|
+
// See https://www.ag-grid.com/javascript-data-grid/infinite-scrolling/#setting-last-row-index
|
|
112
|
+
rowCount: rowData.length,
|
|
113
|
+
});
|
|
114
|
+
// Only update row count when loading the top-level drilldown data
|
|
115
|
+
if (params.request.groupKeys.length === 0) {
|
|
116
|
+
runInAction(() => {
|
|
117
|
+
this.rowCount = rowData.length;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
56
121
|
}
|
|
57
122
|
catch (error) {
|
|
58
123
|
assertErrorThrown(error);
|
|
59
|
-
this.grid.
|
|
124
|
+
this.grid.dataCube.application.notificationService.notifyError(error);
|
|
60
125
|
params.fail();
|
|
61
126
|
}
|
|
62
127
|
}
|
|
63
128
|
getRows(params) {
|
|
64
129
|
this.fetchRows(params).catch((error) => {
|
|
65
130
|
assertErrorThrown(error);
|
|
66
|
-
this.grid.
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
syncSnapshot(request, baseSnapshot) {
|
|
70
|
-
let createNew = false;
|
|
71
|
-
// --------------------------------- GROUP BY ---------------------------------
|
|
72
|
-
const groupByExpandedKeys = request.groupKeys;
|
|
73
|
-
const groupByColumns = request.rowGroupCols.map((r) => {
|
|
74
|
-
const column = baseSnapshot.columns.find((col) => col.name === r.id);
|
|
75
|
-
return {
|
|
76
|
-
name: r.id,
|
|
77
|
-
type: guaranteeNonNullable(column).type,
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
const groupByAggColumns = request.valueCols.map((v) => {
|
|
81
|
-
const type = baseSnapshot.columns.find((col) => col.name === v.field)?.type;
|
|
82
|
-
return {
|
|
83
|
-
name: v.field,
|
|
84
|
-
type: type,
|
|
85
|
-
function: v.aggFunc,
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
let groupByFilter;
|
|
89
|
-
for (let index = 0; index < groupByExpandedKeys.length; index++) {
|
|
90
|
-
const groupFilter = {
|
|
91
|
-
conditions: [
|
|
92
|
-
{
|
|
93
|
-
name: guaranteeNonNullable(groupByColumns.at(index)).name,
|
|
94
|
-
type: PRIMITIVE_TYPE.STRING,
|
|
95
|
-
operation: DATA_CUBE_FILTER_OPERATION.EQUALS,
|
|
96
|
-
value: groupByExpandedKeys.at(index),
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
groupOperation: extractElementNameFromPath(DATA_CUBE_FUNCTIONS.AND),
|
|
100
|
-
};
|
|
101
|
-
groupByFilter = groupFilter;
|
|
102
|
-
}
|
|
103
|
-
// --------------------------------- SORT ---------------------------------
|
|
104
|
-
const newSortColumns = request.sortModel.map((sortInfo) => {
|
|
105
|
-
const column = guaranteeNonNullable(baseSnapshot.columns.find((col) => col.name === sortInfo.colId));
|
|
106
|
-
return {
|
|
107
|
-
name: sortInfo.colId,
|
|
108
|
-
type: column.type,
|
|
109
|
-
direction: sortInfo.sort === GridClientSortDirection.ASCENDING
|
|
110
|
-
? DATA_CUBE_COLUMN_SORT_DIRECTION.ASCENDING
|
|
111
|
-
: DATA_CUBE_COLUMN_SORT_DIRECTION.DESCENDING,
|
|
112
|
-
};
|
|
131
|
+
this.grid.dataCube.application.logService.error(LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED), `Error ocurred while fetching data for grid should have been handled gracefully`, error);
|
|
113
132
|
});
|
|
114
|
-
if (!deepEqual(newSortColumns, baseSnapshot.sortColumns) ||
|
|
115
|
-
!deepEqual(groupByExpandedKeys, baseSnapshot.groupByExpandedKeys) ||
|
|
116
|
-
!deepEqual(groupByColumns, baseSnapshot.groupByColumns) ||
|
|
117
|
-
!deepEqual(groupByAggColumns, baseSnapshot.groupByAggColumns) ||
|
|
118
|
-
!deepEqual(groupByFilter, baseSnapshot.groupByFilter)) {
|
|
119
|
-
createNew = true;
|
|
120
|
-
}
|
|
121
|
-
// --------------------------------- FINALIZE ---------------------------------
|
|
122
|
-
if (createNew) {
|
|
123
|
-
const newSnapshot = cloneSnapshot(baseSnapshot);
|
|
124
|
-
newSnapshot.sortColumns = newSortColumns;
|
|
125
|
-
newSnapshot.groupByExpandedKeys = groupByExpandedKeys;
|
|
126
|
-
newSnapshot.groupByColumns = groupByColumns;
|
|
127
|
-
newSnapshot.groupByAggColumns = groupByAggColumns;
|
|
128
|
-
newSnapshot.groupByFilter = groupByFilter;
|
|
129
|
-
return newSnapshot;
|
|
130
|
-
}
|
|
131
|
-
return baseSnapshot;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
//# sourceMappingURL=DataCubeGridClientEngine.js.map
|