@finos/legend-application-repl 0.0.32 → 0.0.34
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/lib/components/dataCube/DataCube.js +3 -3
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js +4 -4
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js +3 -3
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +10 -3
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js +23 -37
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/{DataCubeEditorVPivotsPanel.d.ts → DataCubeEditorHorizontalPivotsPanel.d.ts} +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorHorizontalPivotsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/{DataCubeEditorHPivotsPanel.js → DataCubeEditorHorizontalPivotsPanel.js} +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js +6 -6
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/{DataCubeEditorHPivotsPanel.d.ts → DataCubeEditorVerticalPivotsPanel.d.ts} +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorVerticalPivotsPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/{DataCubeEditorVPivotsPanel.js → DataCubeEditorVerticalPivotsPanel.js} +5 -7
- package/lib/components/dataCube/editor/DataCubeEditorVerticalPivotsPanel.js.map +1 -0
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js +22 -3
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +17 -13
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +2 -2
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts +3 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.js +4 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +15 -15
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +22 -0
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js +25 -0
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +5 -40
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js +9 -54
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js +13 -7
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +4 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js +20 -5
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.d.ts +45 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.js +102 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts +26 -9
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js +50 -20
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +2 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts +2 -1
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts +12 -13
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js +23 -70
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +11 -7
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +28 -13
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/dataCube/editor/{DataCubeEditorHPivotPanelState.d.ts → DataCubeEditorVerticalPivotsPanelState.d.ts} +11 -4
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.js +62 -0
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts +5 -3
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js +8 -6
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +8 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +9 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.d.ts +31 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.js +147 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.js.map +1 -0
- package/lib/stores/dataCube/grid/{DataCubeGridQuerySnapshotAnalyzer.d.ts → DataCubeGridConfigurationBuilder.d.ts} +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/{DataCubeGridQuerySnapshotAnalyzer.js → DataCubeGridConfigurationBuilder.js} +95 -68
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.d.ts +62 -0
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.js +174 -0
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.js.map +1 -0
- package/lib/{components/dataCube/grid/menu/DataCubeGridMenu.d.ts → stores/dataCube/grid/DataCubeGridMenuBuilder.d.ts} +3 -7
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js +462 -0
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js +3 -3
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +9 -8
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +6 -2
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.js +8 -2
- package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -1
- package/package.json +23 -19
- package/src/components/dataCube/DataCube.tsx +3 -3
- package/src/components/dataCube/editor/DataCubeEditor.tsx +17 -17
- package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +5 -7
- package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +42 -8
- package/src/components/dataCube/editor/DataCubeEditorColumnsSelector.tsx +38 -79
- package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +3 -1
- package/src/components/dataCube/editor/{DataCubeEditorHPivotsPanel.tsx → DataCubeEditorHorizontalPivotsPanel.tsx} +1 -1
- package/src/components/dataCube/editor/DataCubeEditorSortsPanel.tsx +7 -9
- package/src/components/dataCube/editor/{DataCubeEditorVPivotsPanel.tsx → DataCubeEditorVerticalPivotsPanel.tsx} +6 -8
- package/src/components/dataCube/grid/DataCubeGrid.tsx +35 -8
- package/src/stores/dataCube/DataCubeState.ts +7 -5
- package/src/stores/dataCube/core/DataCubeConfiguration.ts +6 -0
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +16 -16
- package/src/stores/dataCube/core/DataCubeQueryEngine.ts +25 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +19 -58
- package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +12 -7
- package/src/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.ts +37 -5
- package/src/stores/dataCube/editor/DataCubeEditorColumnsPanelState.ts +162 -0
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +98 -23
- package/src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts +5 -1
- package/src/stores/dataCube/editor/DataCubeEditorPanelState.ts +5 -1
- package/src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts +48 -117
- package/src/stores/dataCube/editor/DataCubeEditorState.ts +33 -13
- package/src/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.ts +105 -0
- package/src/stores/dataCube/editor/DataCubeMutableConfiguration.ts +16 -7
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +9 -0
- package/src/stores/dataCube/grid/DataCubeGridClientExportEngine.ts +170 -0
- package/src/stores/dataCube/grid/{DataCubeGridQuerySnapshotAnalyzer.tsx → DataCubeGridConfigurationBuilder.tsx} +105 -77
- package/src/stores/dataCube/grid/DataCubeGridControllerState.ts +254 -0
- package/src/stores/dataCube/grid/DataCubeGridMenuBuilder.tsx +535 -0
- package/src/stores/dataCube/grid/DataCubeGridQueryBuilder.ts +3 -5
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +12 -10
- package/src/stores/dataCube/grid/DataCubeGridState.ts +10 -3
- package/tsconfig.json +8 -6
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.d.ts.map +0 -1
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js.map +0 -1
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.d.ts.map +0 -1
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js.map +0 -1
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.d.ts.map +0 -1
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js +0 -413
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js.map +0 -1
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts +0 -19
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts.map +0 -1
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js +0 -83
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.d.ts.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js +0 -30
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js.map +0 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts.map +0 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js.map +0 -1
- package/src/components/dataCube/grid/menu/DataCubeGridMenu.tsx +0 -441
- package/src/components/dataCube/grid/menu/DataCubeGridSortsMenu.tsx +0 -119
- package/src/stores/dataCube/editor/DataCubeEditorHPivotPanelState.ts +0 -43
|
@@ -0,0 +1,162 @@
|
|
|
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 { action, makeObservable, observable } from 'mobx';
|
|
18
|
+
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
+
import {
|
|
20
|
+
type DataCubeQuerySnapshot,
|
|
21
|
+
type DataCubeQuerySnapshotColumn,
|
|
22
|
+
} from '../core/DataCubeQuerySnapshot.js';
|
|
23
|
+
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
24
|
+
import {
|
|
25
|
+
DataCubeEditorColumnsSelectorColumnState,
|
|
26
|
+
DataCubeEditorColumnsSelectorColumnsVisibility,
|
|
27
|
+
DataCubeEditorColumnsSelectorState,
|
|
28
|
+
} from './DataCubeEditorColumnsSelectorState.js';
|
|
29
|
+
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
30
|
+
import { type DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
31
|
+
import { DataCubeMutableColumnConfiguration } from './DataCubeMutableConfiguration.js';
|
|
32
|
+
|
|
33
|
+
export class DataCubeEditorBasicColumnsSelectorState extends DataCubeEditorColumnsSelectorState<DataCubeEditorColumnsSelectorColumnState> {
|
|
34
|
+
override cloneColumn(
|
|
35
|
+
column: DataCubeEditorColumnsSelectorColumnState,
|
|
36
|
+
): DataCubeEditorColumnsSelectorColumnState {
|
|
37
|
+
return new DataCubeEditorColumnsSelectorColumnState(
|
|
38
|
+
column.name,
|
|
39
|
+
column.type,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override get availableColumns(): DataCubeEditorColumnsSelectorColumnState[] {
|
|
44
|
+
return [
|
|
45
|
+
...this.editor.columns.sourceColumns,
|
|
46
|
+
// TODO: add extended columns
|
|
47
|
+
].map(
|
|
48
|
+
(col) => new DataCubeEditorColumnsSelectorColumnState(col.name, col.type),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class DataCubeEditorColumnsPanelState
|
|
54
|
+
implements DataCubeQueryEditorPanelState
|
|
55
|
+
{
|
|
56
|
+
readonly dataCube!: DataCubeState;
|
|
57
|
+
readonly editor!: DataCubeEditorState;
|
|
58
|
+
readonly selector!: DataCubeEditorBasicColumnsSelectorState;
|
|
59
|
+
|
|
60
|
+
sourceColumns: DataCubeQuerySnapshotColumn[] = [];
|
|
61
|
+
|
|
62
|
+
constructor(editor: DataCubeEditorState) {
|
|
63
|
+
makeObservable(this, {
|
|
64
|
+
sourceColumns: observable,
|
|
65
|
+
setSourceColumns: action,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
this.editor = editor;
|
|
69
|
+
this.dataCube = editor.dataCube;
|
|
70
|
+
this.selector = new DataCubeEditorBasicColumnsSelectorState(editor, {
|
|
71
|
+
initialColumnsVisibility:
|
|
72
|
+
DataCubeEditorColumnsSelectorColumnsVisibility.HIDDEN,
|
|
73
|
+
onChange: (selector) => {
|
|
74
|
+
// populate a default configuration for the newly selected columns
|
|
75
|
+
selector.selectedColumns
|
|
76
|
+
.filter(
|
|
77
|
+
(col) =>
|
|
78
|
+
!this.editor.columnProperties.columns.find(
|
|
79
|
+
(column) => column.name === col.name,
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
.forEach((col) => {
|
|
83
|
+
this.editor.columnProperties.setColumns([
|
|
84
|
+
...this.editor.columnProperties.columns,
|
|
85
|
+
DataCubeMutableColumnConfiguration.createDefault({
|
|
86
|
+
name: col.name,
|
|
87
|
+
type: col.type,
|
|
88
|
+
}),
|
|
89
|
+
]);
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Propagate column selection changes to other states: column properties, sorts, pivots, etc.
|
|
97
|
+
*
|
|
98
|
+
* NOTE: Ideally, this should be called on every changes made to the column selection, but to
|
|
99
|
+
* give user some room for error, i.e. when user accidentally select/deselect columns, we would
|
|
100
|
+
* not propagate this change until user either leaves this panel or explicitly applies changes
|
|
101
|
+
* (i.e. publishes a new snapshot)
|
|
102
|
+
*/
|
|
103
|
+
propagateColumnSelectionChanges(): void {
|
|
104
|
+
// prune column properties
|
|
105
|
+
this.editor.columnProperties.setColumns(
|
|
106
|
+
this.editor.columnProperties.columns.filter((column) =>
|
|
107
|
+
this.selector.selectedColumns.find((col) => col.name === column.name),
|
|
108
|
+
),
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// prune sorts
|
|
112
|
+
this.editor.sorts.selector.setSelectedColumns(
|
|
113
|
+
this.editor.sorts.selector.selectedColumns.filter((column) =>
|
|
114
|
+
this.selector.selectedColumns.find((col) => col.name === column.name),
|
|
115
|
+
),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// prune vertical pivots columns
|
|
119
|
+
this.editor.verticalPivots.selector.setSelectedColumns(
|
|
120
|
+
this.editor.verticalPivots.selector.selectedColumns.filter((column) =>
|
|
121
|
+
this.selector.selectedColumns.find((col) => col.name === column.name),
|
|
122
|
+
),
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// TODO: prune horizontal pivots columns
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setSourceColumns(columns: DataCubeQuerySnapshotColumn[]): void {
|
|
129
|
+
this.sourceColumns = columns;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
applySnaphot(
|
|
133
|
+
snapshot: DataCubeQuerySnapshot,
|
|
134
|
+
configuration: DataCubeConfiguration,
|
|
135
|
+
): void {
|
|
136
|
+
this.setSourceColumns(snapshot.data.sourceColumns);
|
|
137
|
+
this.selector.setSelectedColumns(
|
|
138
|
+
// extract selected columns from the configuration since the configuration specifies the order
|
|
139
|
+
// taking into account the group extended columns
|
|
140
|
+
configuration.columns.map((col) => {
|
|
141
|
+
const column = this.selector.getColumn(col.name);
|
|
142
|
+
return new DataCubeEditorColumnsSelectorColumnState(
|
|
143
|
+
column.name,
|
|
144
|
+
column.type,
|
|
145
|
+
);
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
buildSnapshot(
|
|
151
|
+
newSnapshot: DataCubeQuerySnapshot,
|
|
152
|
+
baseSnapshot: DataCubeQuerySnapshot,
|
|
153
|
+
): void {
|
|
154
|
+
this.propagateColumnSelectionChanges();
|
|
155
|
+
newSnapshot.data.selectColumns = this.selector.selectedColumns
|
|
156
|
+
// TODO: filter by group extended columns
|
|
157
|
+
.map((col) => ({
|
|
158
|
+
name: col.name,
|
|
159
|
+
type: col.type,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -14,45 +14,119 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { makeObservable, observable, action } from 'mobx';
|
|
17
|
+
import { makeObservable, observable, action, computed } from 'mobx';
|
|
18
|
+
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
+
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
20
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
18
21
|
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
export class DataCubeEditorColumnsSelectorColumnState {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly type: string;
|
|
25
|
+
|
|
26
|
+
constructor(name: string, type: string) {
|
|
27
|
+
this.name = name;
|
|
28
|
+
this.type = type;
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export
|
|
32
|
+
export enum DataCubeEditorColumnsSelectorColumnsVisibility {
|
|
33
|
+
VISIBLE = 'visible',
|
|
34
|
+
VISIBLE_WITH_WARNING = 'visible-with-warning',
|
|
35
|
+
HIDDEN = 'hidden',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export abstract class DataCubeEditorColumnsSelectorState<
|
|
27
39
|
T extends DataCubeEditorColumnsSelectorColumnState,
|
|
28
40
|
> {
|
|
29
|
-
|
|
41
|
+
readonly dataCube!: DataCubeState;
|
|
42
|
+
readonly editor!: DataCubeEditorState;
|
|
43
|
+
|
|
30
44
|
selectedColumns: T[] = [];
|
|
45
|
+
|
|
31
46
|
availableColumnsSearchText = '';
|
|
32
47
|
selectedColumnsSearchText = '';
|
|
33
48
|
|
|
34
|
-
|
|
49
|
+
readonly onChange?:
|
|
50
|
+
| ((selector: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
51
|
+
| undefined;
|
|
52
|
+
columnsVisibility!: DataCubeEditorColumnsSelectorColumnsVisibility;
|
|
53
|
+
|
|
54
|
+
constructor(
|
|
55
|
+
editor: DataCubeEditorState,
|
|
56
|
+
options?: {
|
|
57
|
+
initialColumnsVisibility?:
|
|
58
|
+
| DataCubeEditorColumnsSelectorColumnsVisibility
|
|
59
|
+
| undefined;
|
|
60
|
+
onChange?:
|
|
61
|
+
| ((select: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
62
|
+
| undefined;
|
|
63
|
+
},
|
|
64
|
+
) {
|
|
35
65
|
makeObservable(this, {
|
|
36
|
-
availableColumns:
|
|
66
|
+
availableColumns: computed,
|
|
67
|
+
availableColumnsForDisplay: computed,
|
|
68
|
+
selectedColumnsForDisplay: computed,
|
|
69
|
+
|
|
37
70
|
selectedColumns: observable,
|
|
71
|
+
setSelectedColumns: action,
|
|
72
|
+
|
|
38
73
|
availableColumnsSearchText: observable,
|
|
74
|
+
setAvailableColumnsSearchText: action,
|
|
75
|
+
|
|
39
76
|
selectedColumnsSearchText: observable,
|
|
40
|
-
setAvailableColumns: action,
|
|
41
|
-
setSelectedColumns: action,
|
|
42
77
|
setSelectedColumnsSearchText: action,
|
|
43
|
-
|
|
78
|
+
|
|
79
|
+
columnsVisibility: observable,
|
|
80
|
+
setColumnsVisibility: action,
|
|
44
81
|
});
|
|
82
|
+
|
|
83
|
+
this.editor = editor;
|
|
84
|
+
this.dataCube = editor.dataCube;
|
|
85
|
+
this.onChange = options?.onChange;
|
|
86
|
+
this.columnsVisibility =
|
|
87
|
+
options?.initialColumnsVisibility ??
|
|
88
|
+
DataCubeEditorColumnsSelectorColumnsVisibility.VISIBLE;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setColumnsVisibility(
|
|
92
|
+
visibility: DataCubeEditorColumnsSelectorColumnsVisibility,
|
|
93
|
+
): void {
|
|
94
|
+
this.columnsVisibility = visibility;
|
|
45
95
|
}
|
|
46
96
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
97
|
+
abstract get availableColumns(): T[];
|
|
98
|
+
|
|
99
|
+
get availableColumnsForDisplay(): T[] {
|
|
100
|
+
return this.availableColumns
|
|
101
|
+
.filter(
|
|
102
|
+
(column) =>
|
|
103
|
+
!this.selectedColumns.find((col) => column.name === col.name),
|
|
104
|
+
)
|
|
105
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
106
|
+
.filter(
|
|
107
|
+
(column) =>
|
|
108
|
+
this.columnsVisibility !==
|
|
109
|
+
DataCubeEditorColumnsSelectorColumnsVisibility.HIDDEN ||
|
|
110
|
+
!this.editor.columnProperties.columns.find(
|
|
111
|
+
(col) => col.name === column.name,
|
|
112
|
+
)?.hideFromView,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
get selectedColumnsForDisplay(): T[] {
|
|
117
|
+
return this.selectedColumns.filter(
|
|
118
|
+
(column) =>
|
|
119
|
+
this.columnsVisibility !==
|
|
120
|
+
DataCubeEditorColumnsSelectorColumnsVisibility.HIDDEN ||
|
|
121
|
+
!this.editor.columnProperties.columns.find(
|
|
122
|
+
(col) => col.name === column.name,
|
|
123
|
+
)?.hideFromView,
|
|
124
|
+
);
|
|
52
125
|
}
|
|
53
126
|
|
|
54
127
|
setSelectedColumns(val: T[]): void {
|
|
55
|
-
this.selectedColumns = val;
|
|
128
|
+
this.selectedColumns = val.map((col) => this.cloneColumn(col));
|
|
129
|
+
this.onChange?.(this);
|
|
56
130
|
}
|
|
57
131
|
|
|
58
132
|
setAvailableColumnsSearchText(val: string): void {
|
|
@@ -63,11 +137,12 @@ export class DataCubeEditorColumnsSelectorState<
|
|
|
63
137
|
this.selectedColumnsSearchText = val;
|
|
64
138
|
}
|
|
65
139
|
|
|
66
|
-
|
|
67
|
-
return
|
|
140
|
+
getColumn(colName: string): T {
|
|
141
|
+
return guaranteeNonNullable(
|
|
142
|
+
this.availableColumns.find((col) => col.name === colName),
|
|
143
|
+
`Can't find column '${colName}'`,
|
|
144
|
+
);
|
|
68
145
|
}
|
|
69
146
|
|
|
70
|
-
|
|
71
|
-
return this.selectedColumns.find((col) => col.name === colName);
|
|
72
|
-
}
|
|
147
|
+
abstract cloneColumn(column: T): T;
|
|
73
148
|
}
|
|
@@ -20,6 +20,7 @@ import type { DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
|
20
20
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
21
21
|
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
22
22
|
import { DataCubeMutableConfiguration } from './DataCubeMutableConfiguration.js';
|
|
23
|
+
import type { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
23
24
|
|
|
24
25
|
export class DataCubeEditorGeneralPropertiesPanelState
|
|
25
26
|
implements DataCubeQueryEditorPanelState
|
|
@@ -59,7 +60,10 @@ export class DataCubeEditorGeneralPropertiesPanelState
|
|
|
59
60
|
this.configuration = val;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
applySnaphot(
|
|
63
|
+
applySnaphot(
|
|
64
|
+
snapshot: DataCubeQuerySnapshot,
|
|
65
|
+
configuration: DataCubeConfiguration,
|
|
66
|
+
): void {
|
|
63
67
|
this.setName(snapshot.data.name);
|
|
64
68
|
this.setLimit(
|
|
65
69
|
snapshot.data.limit !== undefined && snapshot.data.limit > 0
|
|
@@ -14,13 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import type { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
17
18
|
import type { DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
18
19
|
|
|
19
20
|
export interface DataCubeQueryEditorPanelState {
|
|
20
21
|
/**
|
|
21
22
|
* Update the editor state based on the snapshot
|
|
22
23
|
*/
|
|
23
|
-
applySnaphot(
|
|
24
|
+
applySnaphot(
|
|
25
|
+
snapshot: DataCubeQuerySnapshot,
|
|
26
|
+
configuration: DataCubeConfiguration,
|
|
27
|
+
): void;
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
* Build and enrich the snapshot with data from the editor state
|
|
@@ -16,48 +16,59 @@
|
|
|
16
16
|
|
|
17
17
|
import { action, makeObservable, observable } from 'mobx';
|
|
18
18
|
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
_getCol,
|
|
22
|
-
type DataCubeQuerySnapshot,
|
|
23
|
-
type DataCubeQuerySnapshotColumn,
|
|
24
|
-
} from '../core/DataCubeQuerySnapshot.js';
|
|
19
|
+
import { type DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
20
|
+
import { DataCubeQuerySortOperation } from '../core/DataCubeQueryEngine.js';
|
|
25
21
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
26
22
|
import {
|
|
27
23
|
DataCubeEditorColumnsSelectorColumnState,
|
|
28
24
|
DataCubeEditorColumnsSelectorState,
|
|
29
25
|
} from './DataCubeEditorColumnsSelectorState.js';
|
|
30
26
|
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
27
|
+
import type { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
31
28
|
|
|
32
29
|
export class DataCubeEditorSortColumnState extends DataCubeEditorColumnsSelectorColumnState {
|
|
33
|
-
|
|
34
|
-
operation: DataCubeQuerySnapshotSortOperation;
|
|
30
|
+
operation: DataCubeQuerySortOperation;
|
|
35
31
|
|
|
36
32
|
constructor(
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
name: string,
|
|
34
|
+
type: string,
|
|
35
|
+
direction: DataCubeQuerySortOperation,
|
|
39
36
|
) {
|
|
40
|
-
super();
|
|
37
|
+
super(name, type);
|
|
41
38
|
|
|
42
39
|
makeObservable(this, {
|
|
43
40
|
operation: observable,
|
|
44
41
|
setOperation: action,
|
|
45
42
|
});
|
|
46
43
|
|
|
47
|
-
this.column = column;
|
|
48
44
|
this.operation = direction;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
setOperation(val: DataCubeQuerySortOperation): void {
|
|
48
|
+
this.operation = val;
|
|
53
49
|
}
|
|
50
|
+
}
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
export class DataCubeEditorSortColumnsSelectorState extends DataCubeEditorColumnsSelectorState<DataCubeEditorSortColumnState> {
|
|
53
|
+
override cloneColumn(
|
|
54
|
+
column: DataCubeEditorSortColumnState,
|
|
55
|
+
): DataCubeEditorSortColumnState {
|
|
56
|
+
return new DataCubeEditorSortColumnState(
|
|
57
|
+
column.name,
|
|
58
|
+
column.type,
|
|
59
|
+
column.operation,
|
|
60
|
+
);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
this.
|
|
63
|
+
override get availableColumns(): DataCubeEditorSortColumnState[] {
|
|
64
|
+
return this.editor.columns.selector.selectedColumns.map(
|
|
65
|
+
(col) =>
|
|
66
|
+
new DataCubeEditorSortColumnState(
|
|
67
|
+
col.name,
|
|
68
|
+
col.type,
|
|
69
|
+
DataCubeQuerySortOperation.ASCENDING,
|
|
70
|
+
),
|
|
71
|
+
);
|
|
61
72
|
}
|
|
62
73
|
}
|
|
63
74
|
|
|
@@ -66,105 +77,27 @@ export class DataCubeEditorSortsPanelState
|
|
|
66
77
|
{
|
|
67
78
|
readonly dataCube!: DataCubeState;
|
|
68
79
|
readonly editor!: DataCubeEditorState;
|
|
69
|
-
readonly
|
|
80
|
+
readonly selector!: DataCubeEditorColumnsSelectorState<DataCubeEditorSortColumnState>;
|
|
70
81
|
|
|
71
82
|
constructor(editor: DataCubeEditorState) {
|
|
72
83
|
this.editor = editor;
|
|
73
84
|
this.dataCube = editor.dataCube;
|
|
74
|
-
this.
|
|
85
|
+
this.selector = new DataCubeEditorSortColumnsSelectorState(editor);
|
|
75
86
|
}
|
|
76
87
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
): DataCubeEditorSortColumnState | undefined {
|
|
81
|
-
let column = this.columnsSelector.getAvailableColumn(colName);
|
|
82
|
-
if (!column) {
|
|
83
|
-
const selectedColumn = this.columnsSelector.getSelectedColumn(colName);
|
|
84
|
-
if (selectedColumn && selectedColumn.operation !== operation) {
|
|
85
|
-
column = selectedColumn;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return column;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
sortByColumn(
|
|
92
|
-
colName: string,
|
|
93
|
-
operation: DataCubeQuerySnapshotSortOperation,
|
|
88
|
+
applySnaphot(
|
|
89
|
+
snapshot: DataCubeQuerySnapshot,
|
|
90
|
+
configuration: DataCubeConfiguration,
|
|
94
91
|
): void {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
...this.columnsSelector.selectedColumns,
|
|
105
|
-
].filter((col) => col.name !== colName),
|
|
106
|
-
);
|
|
107
|
-
this.columnsSelector.setSelectedColumns([column]);
|
|
108
|
-
this.editor.applyChanges();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
addSortByColumn(
|
|
112
|
-
colName: string,
|
|
113
|
-
operation: DataCubeQuerySnapshotSortOperation,
|
|
114
|
-
): void {
|
|
115
|
-
const column = this.getActionableSortColumn(colName, operation);
|
|
116
|
-
if (!column) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
column.setOperation(operation);
|
|
120
|
-
|
|
121
|
-
this.columnsSelector.setAvailableColumns(
|
|
122
|
-
this.columnsSelector.availableColumns.filter(
|
|
123
|
-
(col) => col.name !== colName,
|
|
124
|
-
),
|
|
125
|
-
);
|
|
126
|
-
this.columnsSelector.setSelectedColumns([
|
|
127
|
-
...this.columnsSelector.selectedColumns,
|
|
128
|
-
column,
|
|
129
|
-
]);
|
|
130
|
-
this.editor.applyChanges();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
clearAllSorts(): void {
|
|
134
|
-
if (this.columnsSelector.selectedColumns.length !== 0) {
|
|
135
|
-
this.columnsSelector.setAvailableColumns([
|
|
136
|
-
...this.columnsSelector.availableColumns,
|
|
137
|
-
...this.columnsSelector.selectedColumns,
|
|
138
|
-
]);
|
|
139
|
-
this.columnsSelector.setSelectedColumns([]);
|
|
140
|
-
this.editor.applyChanges();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
applySnaphot(snapshot: DataCubeQuerySnapshot): void {
|
|
145
|
-
const columns = snapshot.stageCols('sort');
|
|
146
|
-
const sortColumns = snapshot.data.sortColumns;
|
|
147
|
-
this.columnsSelector.setAvailableColumns(
|
|
148
|
-
columns
|
|
149
|
-
.filter(
|
|
150
|
-
(col) => !sortColumns.find((sortCol) => sortCol.name === col.name),
|
|
151
|
-
)
|
|
152
|
-
.map(
|
|
153
|
-
(col) =>
|
|
154
|
-
new DataCubeEditorSortColumnState(
|
|
155
|
-
_getCol(columns, col.name),
|
|
156
|
-
DataCubeQuerySnapshotSortOperation.ASCENDING,
|
|
157
|
-
),
|
|
158
|
-
),
|
|
159
|
-
);
|
|
160
|
-
this.columnsSelector.setSelectedColumns(
|
|
161
|
-
sortColumns.map(
|
|
162
|
-
(col) =>
|
|
163
|
-
new DataCubeEditorSortColumnState(
|
|
164
|
-
_getCol(columns, col.name),
|
|
165
|
-
col.operation,
|
|
166
|
-
),
|
|
167
|
-
),
|
|
92
|
+
this.selector.setSelectedColumns(
|
|
93
|
+
snapshot.data.sortColumns.map((col) => {
|
|
94
|
+
const column = this.selector.getColumn(col.name);
|
|
95
|
+
return new DataCubeEditorSortColumnState(
|
|
96
|
+
column.name,
|
|
97
|
+
column.type,
|
|
98
|
+
col.operation,
|
|
99
|
+
);
|
|
100
|
+
}),
|
|
168
101
|
);
|
|
169
102
|
}
|
|
170
103
|
|
|
@@ -172,12 +105,10 @@ export class DataCubeEditorSortsPanelState
|
|
|
172
105
|
newSnapshot: DataCubeQuerySnapshot,
|
|
173
106
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
174
107
|
): void {
|
|
175
|
-
newSnapshot.data.sortColumns = this.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}),
|
|
181
|
-
);
|
|
108
|
+
newSnapshot.data.sortColumns = this.selector.selectedColumns.map((col) => ({
|
|
109
|
+
name: col.name,
|
|
110
|
+
type: col.type,
|
|
111
|
+
operation: col.operation,
|
|
112
|
+
}));
|
|
182
113
|
}
|
|
183
114
|
}
|
|
@@ -24,23 +24,28 @@ import { guaranteeNonNullable, uuid } from '@finos/legend-shared';
|
|
|
24
24
|
import { DataCubeEditorGeneralPropertiesPanelState } from './DataCubeEditorGeneralPropertiesPanelState.js';
|
|
25
25
|
import { DataCubeEditorColumnPropertiesPanelState } from './DataCubeEditorColumnPropertiesPanelState.js';
|
|
26
26
|
import type { REPLWindowConfig } from '../../../components/REPLWindow.js';
|
|
27
|
+
import { DataCubeEditorColumnsPanelState } from './DataCubeEditorColumnsPanelState.js';
|
|
28
|
+
import { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
29
|
+
import { DataCubeEditorVerticalPivotsPanelState } from './DataCubeEditorVerticalPivotsPanelState.js';
|
|
27
30
|
|
|
28
31
|
export enum DATA_CUBE_EDITOR_TAB {
|
|
29
|
-
COLUMNS = 'Columns',
|
|
30
|
-
VERTICAL_PIVOTS = 'VPivots',
|
|
31
|
-
HORIZONTAL_PIVOTS = 'HPivots',
|
|
32
|
-
SORTS = 'Sorts',
|
|
33
|
-
EXTENDED_COLUMNS = 'Extended Columns',
|
|
34
|
-
FILTER = 'Filter',
|
|
35
32
|
GENERAL_PROPERTIES = 'General Properties',
|
|
36
33
|
COLUMN_PROPERTIES = 'Column Properties',
|
|
34
|
+
FILTER = 'Filter',
|
|
35
|
+
EXTENDED_COLUMNS = 'Extended Columns',
|
|
36
|
+
COLUMNS = 'Columns',
|
|
37
|
+
VERTICAL_PIVOTS = 'Vertical Pivots',
|
|
38
|
+
HORIZONTAL_PIVOTS = 'Horizontal Pivots',
|
|
39
|
+
SORTS = 'Sorts',
|
|
37
40
|
CODE = 'Code',
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
41
|
-
readonly sorts: DataCubeEditorSortsPanelState;
|
|
42
44
|
readonly generalProperties: DataCubeEditorGeneralPropertiesPanelState;
|
|
43
45
|
readonly columnProperties: DataCubeEditorColumnPropertiesPanelState;
|
|
46
|
+
readonly columns: DataCubeEditorColumnsPanelState;
|
|
47
|
+
readonly verticalPivots: DataCubeEditorVerticalPivotsPanelState;
|
|
48
|
+
readonly sorts: DataCubeEditorSortsPanelState;
|
|
44
49
|
readonly code: DataCubeEditorCodePanelState;
|
|
45
50
|
|
|
46
51
|
readonly window: REPLWindowConfig = {
|
|
@@ -66,11 +71,13 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
66
71
|
closePanel: action,
|
|
67
72
|
});
|
|
68
73
|
|
|
69
|
-
this.sorts = new DataCubeEditorSortsPanelState(this);
|
|
70
74
|
this.generalProperties = new DataCubeEditorGeneralPropertiesPanelState(
|
|
71
75
|
this,
|
|
72
76
|
);
|
|
73
77
|
this.columnProperties = new DataCubeEditorColumnPropertiesPanelState(this);
|
|
78
|
+
this.columns = new DataCubeEditorColumnsPanelState(this);
|
|
79
|
+
this.verticalPivots = new DataCubeEditorVerticalPivotsPanelState(this);
|
|
80
|
+
this.sorts = new DataCubeEditorSortsPanelState(this);
|
|
74
81
|
this.code = new DataCubeEditorCodePanelState(this);
|
|
75
82
|
}
|
|
76
83
|
|
|
@@ -90,9 +97,15 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
90
97
|
const baseSnapshot = guaranteeNonNullable(this.getLatestSnapshot());
|
|
91
98
|
const snapshot = baseSnapshot.clone();
|
|
92
99
|
|
|
100
|
+
// NOTE: column selection must be processed first so necassary
|
|
101
|
+
// prunings can be done to make sure other panel stats are in sync
|
|
102
|
+
// with the current column selection
|
|
103
|
+
this.columns.buildSnapshot(snapshot, baseSnapshot);
|
|
104
|
+
this.verticalPivots.buildSnapshot(snapshot, baseSnapshot);
|
|
93
105
|
this.sorts.buildSnapshot(snapshot, baseSnapshot);
|
|
94
|
-
|
|
95
|
-
//
|
|
106
|
+
|
|
107
|
+
// grid configuration must be processed before processing columns' configuration
|
|
108
|
+
// to properly generate the container configuration
|
|
96
109
|
this.generalProperties.buildSnapshot(snapshot, baseSnapshot);
|
|
97
110
|
this.columnProperties.buildSnapshot(snapshot, baseSnapshot);
|
|
98
111
|
|
|
@@ -106,9 +119,16 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
106
119
|
snapshot: DataCubeQuerySnapshot,
|
|
107
120
|
previousSnapshot: DataCubeQuerySnapshot | undefined,
|
|
108
121
|
): Promise<void> {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
const configuration = DataCubeConfiguration.serialization.fromJson(
|
|
123
|
+
snapshot.data.configuration,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
this.columns.applySnaphot(snapshot, configuration);
|
|
127
|
+
this.verticalPivots.applySnaphot(snapshot, configuration);
|
|
128
|
+
this.sorts.applySnaphot(snapshot, configuration);
|
|
129
|
+
|
|
130
|
+
this.generalProperties.applySnaphot(snapshot, configuration);
|
|
131
|
+
this.columnProperties.applySnaphot(snapshot, configuration);
|
|
112
132
|
}
|
|
113
133
|
|
|
114
134
|
override async initialize(): Promise<void> {
|