@finos/legend-application-repl 0.0.29 → 0.0.31
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.d.ts.map +1 -1
- package/lib/components/dataCube/DataCube.js +13 -9
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js +4 -2
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js +163 -6
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts +5 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js +130 -47
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js.map +1 -1
- package/lib/{stores/dataCube/DataCubeDefaultConfig.d.ts → components/dataCube/editor/DataCubeEditorDeveloperPanel.d.ts} +4 -2
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js +27 -0
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +104 -5
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorShared.d.ts +46 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.js +171 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js +36 -3
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js +42 -26
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
- package/{src/stores/dataCube/DataCubeDefaultConfig.ts → lib/components/dataCube/grid/DataCubeGridShared.d.ts} +3 -2
- package/lib/components/dataCube/grid/DataCubeGridShared.d.ts.map +1 -0
- package/lib/components/dataCube/grid/DataCubeGridShared.js +25 -0
- package/lib/components/dataCube/grid/DataCubeGridShared.js.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.d.ts +23 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.d.ts.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js +382 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js.map +1 -0
- package/lib/{stores/dataCube/DataCubeDefaultConfig.js → components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts} +4 -2
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js +83 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +4 -2
- package/lib/server/models/DataCubeQuery.d.ts +3 -5
- package/lib/server/models/DataCubeQuery.d.ts.map +1 -1
- package/lib/server/models/DataCubeQuery.js +0 -2
- package/lib/server/models/DataCubeQuery.js.map +1 -1
- package/lib/stores/dataCube/DataCubeState.d.ts +11 -2
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +34 -5
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/REPLStore.d.ts +1 -1
- package/lib/stores/dataCube/REPLStore.d.ts.map +1 -1
- package/lib/stores/dataCube/REPLStore.js +3 -3
- package/lib/stores/dataCube/REPLStore.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts +89 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.js +161 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.d.ts +25 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.js +44 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeCoreState.js +3 -3
- package/lib/stores/dataCube/core/DataCubeCoreState.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +8 -8
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +82 -4
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js +131 -3
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +19 -5
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js +36 -6
- 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 +37 -18
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js +6 -2
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts +3 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js +4 -2
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +33 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js +57 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts +3 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js +10 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +8 -3
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js +20 -24
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.d.ts +27 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js +30 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts +13 -6
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js +64 -19
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +4 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +15 -10
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts +95 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js +369 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +7 -2
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +29 -2
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js +0 -9
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js +4 -3
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +16 -28
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
- package/package.json +10 -8
- package/src/components/dataCube/DataCube.tsx +44 -23
- package/src/components/dataCube/editor/DataCubeEditor.tsx +6 -1
- package/src/components/dataCube/editor/DataCubeEditorCodePanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +837 -7
- package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorColumnsSelector.tsx +264 -50
- package/src/components/dataCube/editor/DataCubeEditorDeveloperPanel.tsx +41 -0
- package/src/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorFilterPanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +682 -13
- package/src/components/dataCube/editor/DataCubeEditorHPivotsPanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorShared.tsx +448 -0
- package/src/components/dataCube/editor/DataCubeEditorSortsPanel.tsx +103 -4
- package/src/components/dataCube/editor/DataCubeEditorVPivotsPanel.tsx +2 -2
- package/src/components/dataCube/grid/DataCubeGrid.tsx +65 -32
- package/src/components/dataCube/grid/DataCubeGridShared.tsx +41 -0
- package/src/components/dataCube/grid/menu/DataCubeGridMenu.tsx +394 -0
- package/src/components/dataCube/grid/menu/DataCubeGridSortsMenu.tsx +120 -0
- package/src/server/models/DataCubeQuery.ts +2 -6
- package/src/stores/dataCube/DataCubeState.ts +39 -5
- package/src/stores/dataCube/REPLStore.ts +3 -3
- package/src/stores/dataCube/core/DataCubeConfiguration.ts +200 -0
- package/src/stores/dataCube/core/DataCubeConfigurationBuilder.ts +56 -0
- package/src/stores/dataCube/core/DataCubeCoreState.ts +3 -3
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +13 -13
- package/src/stores/dataCube/core/DataCubeQueryEngine.ts +136 -4
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +43 -6
- package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +45 -24
- package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +9 -2
- package/src/stores/dataCube/editor/DataCubeEditorCodePanelState.ts +5 -2
- package/src/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.ts +82 -0
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +12 -0
- package/src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts +31 -28
- package/src/stores/dataCube/editor/DataCubeEditorHPivotPanelState.ts +43 -0
- package/src/stores/dataCube/editor/DataCubeEditorPanelState.ts +1 -1
- package/src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts +92 -25
- package/src/stores/dataCube/editor/DataCubeEditorState.ts +17 -10
- package/src/stores/dataCube/editor/DataCubeMutableConfiguration.ts +533 -0
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +33 -2
- package/src/stores/dataCube/grid/DataCubeGridQueryBuilder.ts +0 -10
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.tsx +4 -3
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +16 -36
- package/tsconfig.json +10 -1
- package/lib/stores/dataCube/DataCubeDefaultConfig.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeDefaultConfig.js.map +0 -1
|
@@ -17,44 +17,47 @@
|
|
|
17
17
|
import { action, makeObservable, observable } from 'mobx';
|
|
18
18
|
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
19
|
import {
|
|
20
|
-
|
|
20
|
+
DataCubeQuerySnapshotSortOperation,
|
|
21
21
|
_getCol,
|
|
22
22
|
type DataCubeQuerySnapshot,
|
|
23
23
|
type DataCubeQuerySnapshotColumn,
|
|
24
|
-
type DataCubeQuerySnapshotSortColumn,
|
|
25
24
|
} from '../core/DataCubeQuerySnapshot.js';
|
|
26
25
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
27
|
-
import { deepEqual } from '@finos/legend-shared';
|
|
28
26
|
import {
|
|
29
27
|
DataCubeEditorColumnsSelectorColumnState,
|
|
30
28
|
DataCubeEditorColumnsSelectorState,
|
|
31
29
|
} from './DataCubeEditorColumnsSelectorState.js';
|
|
30
|
+
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
32
31
|
|
|
33
32
|
export class DataCubeEditorSortColumnState extends DataCubeEditorColumnsSelectorColumnState {
|
|
34
33
|
readonly column: DataCubeQuerySnapshotColumn;
|
|
35
|
-
|
|
34
|
+
operation: DataCubeQuerySnapshotSortOperation;
|
|
36
35
|
|
|
37
36
|
constructor(
|
|
38
37
|
column: DataCubeQuerySnapshotColumn,
|
|
39
|
-
direction:
|
|
38
|
+
direction: DataCubeQuerySnapshotSortOperation,
|
|
40
39
|
) {
|
|
41
40
|
super();
|
|
42
41
|
|
|
43
42
|
makeObservable(this, {
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
operation: observable,
|
|
44
|
+
setOperation: action,
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
this.column = column;
|
|
49
|
-
this.
|
|
48
|
+
this.operation = direction;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
get name(): string {
|
|
53
52
|
return this.column.name;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
this.
|
|
55
|
+
override resetWhenMadeAvailable(): void {
|
|
56
|
+
this.setOperation(DataCubeQuerySnapshotSortOperation.ASCENDING);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
setOperation(val: DataCubeQuerySnapshotSortOperation): void {
|
|
60
|
+
this.operation = val;
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -62,13 +65,82 @@ export class DataCubeEditorSortsPanelState
|
|
|
62
65
|
implements DataCubeQueryEditorPanelState
|
|
63
66
|
{
|
|
64
67
|
readonly dataCube!: DataCubeState;
|
|
68
|
+
readonly editor!: DataCubeEditorState;
|
|
65
69
|
readonly columnsSelector!: DataCubeEditorColumnsSelectorState<DataCubeEditorSortColumnState>;
|
|
66
70
|
|
|
67
|
-
constructor(
|
|
68
|
-
this.
|
|
71
|
+
constructor(editor: DataCubeEditorState) {
|
|
72
|
+
this.editor = editor;
|
|
73
|
+
this.dataCube = editor.dataCube;
|
|
69
74
|
this.columnsSelector = new DataCubeEditorColumnsSelectorState();
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
getActionableSortColumn(
|
|
78
|
+
colName: string,
|
|
79
|
+
operation: DataCubeQuerySnapshotSortOperation,
|
|
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,
|
|
94
|
+
): void {
|
|
95
|
+
const column = this.getActionableSortColumn(colName, operation);
|
|
96
|
+
if (!column) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
column.setOperation(operation);
|
|
100
|
+
|
|
101
|
+
this.columnsSelector.setAvailableColumns(
|
|
102
|
+
[
|
|
103
|
+
...this.columnsSelector.availableColumns,
|
|
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
|
+
|
|
72
144
|
applySnaphot(snapshot: DataCubeQuerySnapshot): void {
|
|
73
145
|
const columns = snapshot.stageCols('sort');
|
|
74
146
|
const sortColumns = snapshot.data.sortColumns;
|
|
@@ -81,7 +153,7 @@ export class DataCubeEditorSortsPanelState
|
|
|
81
153
|
(col) =>
|
|
82
154
|
new DataCubeEditorSortColumnState(
|
|
83
155
|
_getCol(columns, col.name),
|
|
84
|
-
|
|
156
|
+
DataCubeQuerySnapshotSortOperation.ASCENDING,
|
|
85
157
|
),
|
|
86
158
|
),
|
|
87
159
|
);
|
|
@@ -90,7 +162,7 @@ export class DataCubeEditorSortsPanelState
|
|
|
90
162
|
(col) =>
|
|
91
163
|
new DataCubeEditorSortColumnState(
|
|
92
164
|
_getCol(columns, col.name),
|
|
93
|
-
col.
|
|
165
|
+
col.operation,
|
|
94
166
|
),
|
|
95
167
|
),
|
|
96
168
|
);
|
|
@@ -99,18 +171,13 @@ export class DataCubeEditorSortsPanelState
|
|
|
99
171
|
buildSnapshot(
|
|
100
172
|
newSnapshot: DataCubeQuerySnapshot,
|
|
101
173
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
102
|
-
):
|
|
103
|
-
|
|
104
|
-
|
|
174
|
+
): void {
|
|
175
|
+
newSnapshot.data.sortColumns = this.columnsSelector.selectedColumns.map(
|
|
176
|
+
(sortInfo) => ({
|
|
105
177
|
name: sortInfo.column.name,
|
|
106
178
|
type: sortInfo.column.type,
|
|
107
|
-
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
if (!deepEqual(newSortColumns, baseSnapshot.data.sortColumns)) {
|
|
111
|
-
newSnapshot.data.sortColumns = newSortColumns;
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
return false;
|
|
179
|
+
operation: sortInfo.operation,
|
|
180
|
+
}),
|
|
181
|
+
);
|
|
115
182
|
}
|
|
116
183
|
}
|
|
@@ -22,6 +22,7 @@ import { DataCubeQuerySnapshotSubscriber } from '../core/DataCubeQuerySnapshotSu
|
|
|
22
22
|
import { type DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
23
23
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
24
24
|
import { DataCubeEditorGeneralPropertiesPanelState } from './DataCubeEditorGeneralPropertiesPanelState.js';
|
|
25
|
+
import { DataCubeEditorColumnPropertiesPanelState } from './DataCubeEditorColumnPropertiesPanelState.js';
|
|
25
26
|
|
|
26
27
|
export enum DATA_CUBE_EDITOR_TAB {
|
|
27
28
|
COLUMNS = 'Columns',
|
|
@@ -33,13 +34,13 @@ export enum DATA_CUBE_EDITOR_TAB {
|
|
|
33
34
|
GENERAL_PROPERTIES = 'General Properties',
|
|
34
35
|
COLUMN_PROPERTIES = 'Column Properties',
|
|
35
36
|
CODE = 'Code',
|
|
36
|
-
|
|
37
|
-
// PIVOT_LAYOUT = 'Pivot Layout',
|
|
37
|
+
DEVELOPER = 'Developer',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
41
41
|
readonly sortsPanel: DataCubeEditorSortsPanelState;
|
|
42
42
|
readonly generalPropertiesPanel: DataCubeEditorGeneralPropertiesPanelState;
|
|
43
|
+
readonly columnPropertiesPanel: DataCubeEditorColumnPropertiesPanelState;
|
|
43
44
|
readonly codePanel: DataCubeEditorCodePanelState;
|
|
44
45
|
|
|
45
46
|
isPanelOpen = false;
|
|
@@ -59,11 +60,14 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
59
60
|
closePanel: action,
|
|
60
61
|
});
|
|
61
62
|
|
|
62
|
-
this.sortsPanel = new DataCubeEditorSortsPanelState(this
|
|
63
|
+
this.sortsPanel = new DataCubeEditorSortsPanelState(this);
|
|
63
64
|
this.generalPropertiesPanel = new DataCubeEditorGeneralPropertiesPanelState(
|
|
64
|
-
this
|
|
65
|
+
this,
|
|
65
66
|
);
|
|
66
|
-
this.
|
|
67
|
+
this.columnPropertiesPanel = new DataCubeEditorColumnPropertiesPanelState(
|
|
68
|
+
this,
|
|
69
|
+
);
|
|
70
|
+
this.codePanel = new DataCubeEditorCodePanelState(this);
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
openPanel(): void {
|
|
@@ -82,12 +86,14 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
82
86
|
const baseSnapshot = guaranteeNonNullable(this.getLatestSnapshot());
|
|
83
87
|
const snapshot = baseSnapshot.clone();
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
this.sortsPanel.buildSnapshot(snapshot, baseSnapshot);
|
|
90
|
+
// NOTE: snapshot must be processed first to build the container configuration
|
|
91
|
+
// before proceeding to process the columns' configuration
|
|
92
|
+
this.generalPropertiesPanel.buildSnapshot(snapshot, baseSnapshot);
|
|
93
|
+
this.columnPropertiesPanel.buildSnapshot(snapshot, baseSnapshot);
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
snapshot.finalize();
|
|
96
|
+
if (snapshot.hashCode !== baseSnapshot.hashCode) {
|
|
91
97
|
this.publishSnapshot(snapshot);
|
|
92
98
|
}
|
|
93
99
|
}
|
|
@@ -95,6 +101,7 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
95
101
|
override async applySnapshot(snapshot: DataCubeQuerySnapshot): Promise<void> {
|
|
96
102
|
this.sortsPanel.applySnaphot(snapshot);
|
|
97
103
|
this.generalPropertiesPanel.applySnaphot(snapshot);
|
|
104
|
+
this.columnPropertiesPanel.applySnaphot(snapshot);
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
override async initialize(): Promise<void> {
|