@finos/legend-application-repl 0.0.40 → 0.0.42
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/application/LegendREPL.d.ts +2 -2
- package/lib/application/LegendREPL.d.ts.map +1 -1
- package/lib/application/LegendREPL.js.map +1 -1
- package/lib/application/LegendREPLApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendREPLDocumentation.d.ts +2 -1
- package/lib/application/LegendREPLDocumentation.d.ts.map +1 -1
- package/lib/application/LegendREPLDocumentation.js +1 -0
- package/lib/application/LegendREPLDocumentation.js.map +1 -1
- package/lib/application/LegendREPLPluginManager.d.ts.map +1 -1
- package/lib/application/LegendREPLPluginManager.js.map +1 -1
- package/lib/components/LegendREPLApplication.js +2 -2
- package/lib/components/LegendREPLApplication.js.map +1 -1
- package/lib/components/LegendREPLFrameworkProvider.d.ts +3 -2
- package/lib/components/LegendREPLFrameworkProvider.d.ts.map +1 -1
- package/lib/components/LegendREPLFrameworkProvider.js +1 -1
- package/lib/components/LegendREPLFrameworkProvider.js.map +1 -1
- package/lib/components/REPLStoreProvider.d.ts.map +1 -1
- package/lib/components/REPLStoreProvider.js.map +1 -1
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js +3 -3
- 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 +14 -12
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +4 -4
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
- package/lib/components/repl/Alert.d.ts +14 -2
- package/lib/components/repl/Alert.d.ts.map +1 -1
- package/lib/components/repl/Alert.js +42 -24
- package/lib/components/repl/Alert.js.map +1 -1
- package/lib/components/repl/DocumentationPanel.d.ts +0 -5
- package/lib/components/repl/DocumentationPanel.d.ts.map +1 -1
- package/lib/components/repl/DocumentationPanel.js +2 -28
- package/lib/components/repl/DocumentationPanel.js.map +1 -1
- package/lib/components/repl/Form.d.ts +5 -0
- package/lib/components/repl/Form.d.ts.map +1 -1
- package/lib/components/repl/Form.js +27 -0
- package/lib/components/repl/Form.js.map +1 -1
- package/lib/components/repl/SettingsPanel.d.ts.map +1 -1
- package/lib/components/repl/SettingsPanel.js +6 -3
- package/lib/components/repl/SettingsPanel.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/server/REPLEngine.d.ts +1 -0
- package/lib/server/REPLEngine.d.ts.map +1 -1
- package/lib/server/REPLEngine.js.map +1 -1
- package/lib/stores/LayoutManagerState.d.ts +2 -1
- package/lib/stores/LayoutManagerState.d.ts.map +1 -1
- package/lib/stores/LayoutManagerState.js +8 -1
- package/lib/stores/LayoutManagerState.js.map +1 -1
- package/lib/stores/LegendREPLApplicationPlugin.d.ts +2 -1
- package/lib/stores/LegendREPLApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/REPLStore.d.ts +17 -2
- package/lib/stores/REPLStore.d.ts.map +1 -1
- package/lib/stores/REPLStore.js +15 -5
- package/lib/stores/REPLStore.js.map +1 -1
- package/lib/stores/dataCube/DataCubeEngine.d.ts +6 -1
- package/lib/stores/dataCube/DataCubeEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeEngine.js +19 -7
- package/lib/stores/dataCube/DataCubeEngine.js.map +1 -1
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +1 -0
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts +2 -3
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.js +2 -4
- package/lib/stores/dataCube/core/DataCubeConfiguration.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts +4 -4
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +70 -12
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +8 -2
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js +20 -15
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +5 -4
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts +2 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js +131 -11
- 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/DataCubeQuerySnapshotSubscriber.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js +28 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.js +2 -1
- package/lib/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts +9 -4
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js +20 -4
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +3 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +64 -9
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientExportEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js +23 -27
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.js +2 -9
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts +2 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js +63 -11
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts +3 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +14 -26
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.js +16 -2
- package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -1
- package/package.json +7 -7
- package/src/application/LegendREPL.tsx +3 -6
- package/src/application/LegendREPLApplicationConfig.ts +1 -1
- package/src/application/LegendREPLDocumentation.ts +1 -0
- package/src/application/LegendREPLPluginManager.ts +7 -9
- package/src/components/LegendREPLApplication.tsx +2 -2
- package/src/components/LegendREPLFrameworkProvider.tsx +2 -5
- package/src/components/REPLStoreProvider.tsx +1 -1
- package/src/components/dataCube/DataCube.tsx +1 -1
- package/src/components/dataCube/editor/DataCubeEditor.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorCodePanel.tsx +3 -3
- package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +35 -12
- package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +6 -6
- package/src/components/dataCube/grid/DataCubeGrid.tsx +4 -6
- package/src/components/repl/Alert.tsx +138 -94
- package/src/components/repl/DocumentationPanel.tsx +2 -50
- package/src/components/repl/Form.tsx +47 -0
- package/src/components/repl/SettingsPanel.tsx +42 -8
- package/src/index.tsx +4 -8
- package/src/server/REPLEngine.ts +1 -0
- package/src/stores/LayoutManagerState.ts +12 -4
- package/src/stores/LegendREPLApplicationPlugin.ts +2 -2
- package/src/stores/REPLStore.tsx +54 -7
- package/src/stores/dataCube/DataCubeEngine.ts +30 -13
- package/src/stores/dataCube/DataCubeState.ts +5 -4
- package/src/stores/dataCube/core/DataCubeConfiguration.ts +2 -6
- package/src/stores/dataCube/core/DataCubeCoreState.ts +3 -3
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +89 -17
- package/src/stores/dataCube/core/DataCubeQueryEngine.ts +11 -2
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +11 -9
- package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +154 -15
- package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +6 -6
- package/src/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.ts +3 -3
- package/src/stores/dataCube/editor/DataCubeEditorCodePanelState.ts +4 -6
- package/src/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.ts +43 -12
- package/src/stores/dataCube/editor/DataCubeEditorColumnsPanelState.ts +6 -8
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +4 -4
- package/src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts +5 -5
- package/src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts +5 -7
- package/src/stores/dataCube/editor/DataCubeEditorState.tsx +4 -4
- package/src/stores/dataCube/editor/DataCubeEditorVerticalPivotsPanelState.ts +4 -3
- package/src/stores/dataCube/editor/DataCubeMutableConfiguration.ts +102 -87
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +75 -15
- package/src/stores/dataCube/grid/DataCubeGridClientExportEngine.ts +2 -2
- package/src/stores/dataCube/grid/DataCubeGridConfigurationBuilder.tsx +28 -29
- package/src/stores/dataCube/grid/DataCubeGridControllerState.ts +7 -16
- package/src/stores/dataCube/grid/DataCubeGridQueryBuilder.ts +72 -10
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +27 -37
- package/src/stores/dataCube/grid/DataCubeGridState.ts +27 -9
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import { action, computed, makeObservable, observable } from 'mobx';
|
|
18
18
|
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
-
import
|
|
19
|
+
import {
|
|
20
|
+
_findCol,
|
|
21
|
+
type DataCubeQuerySnapshot,
|
|
22
|
+
} from '../core/DataCubeQuerySnapshot.js';
|
|
20
23
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
21
24
|
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
22
25
|
import { DataCubeMutableColumnConfiguration } from './DataCubeMutableConfiguration.js';
|
|
@@ -26,6 +29,11 @@ import {
|
|
|
26
29
|
type PlainObject,
|
|
27
30
|
} from '@finos/legend-shared';
|
|
28
31
|
import type { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
32
|
+
import {
|
|
33
|
+
DataCubeAggregateOperation,
|
|
34
|
+
DataCubeColumnKind,
|
|
35
|
+
} from '../core/DataCubeQueryEngine.js';
|
|
36
|
+
import { PRIMITIVE_TYPE } from '@finos/legend-graph';
|
|
29
37
|
|
|
30
38
|
export class DataCubeEditorColumnPropertiesPanelState
|
|
31
39
|
implements DataCubeQueryEditorPanelState
|
|
@@ -57,11 +65,11 @@ export class DataCubeEditorColumnPropertiesPanelState
|
|
|
57
65
|
this.dataCube = editor.dataCube;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
|
-
get hiddenColumns()
|
|
68
|
+
get hiddenColumns() {
|
|
61
69
|
return this.columns.filter((column) => column.hideFromView);
|
|
62
70
|
}
|
|
63
71
|
|
|
64
|
-
get configurableColumns()
|
|
72
|
+
get configurableColumns() {
|
|
65
73
|
return this.columns
|
|
66
74
|
.filter((column) =>
|
|
67
75
|
this.editor.columns.selector.selectedColumns.find(
|
|
@@ -71,39 +79,62 @@ export class DataCubeEditorColumnPropertiesPanelState
|
|
|
71
79
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
72
80
|
}
|
|
73
81
|
|
|
74
|
-
getColumnConfiguration(
|
|
75
|
-
colName: string | undefined,
|
|
76
|
-
): DataCubeMutableColumnConfiguration | undefined {
|
|
82
|
+
getColumnConfiguration(colName: string | undefined) {
|
|
77
83
|
return this.columns.find((col) => col.name === colName);
|
|
78
84
|
}
|
|
79
85
|
|
|
80
|
-
setColumns(val: DataCubeMutableColumnConfiguration[])
|
|
86
|
+
setColumns(val: DataCubeMutableColumnConfiguration[]) {
|
|
81
87
|
this.columns = val;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
setSelectedColumnName(val: string | undefined)
|
|
90
|
+
setSelectedColumnName(val: string | undefined) {
|
|
85
91
|
this.selectedColumnName = val;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
|
-
get selectedColumn()
|
|
94
|
+
get selectedColumn() {
|
|
89
95
|
return this.configurableColumns.find(
|
|
90
96
|
(column) => column.name === this.selectedColumnName,
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
setShowAdvancedSettings(val: boolean)
|
|
100
|
+
setShowAdvancedSettings(val: boolean) {
|
|
95
101
|
this.showAdvancedSettings = val;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
applySnaphot(
|
|
99
105
|
snapshot: DataCubeQuerySnapshot,
|
|
100
106
|
configuration: DataCubeConfiguration,
|
|
101
|
-
)
|
|
107
|
+
) {
|
|
102
108
|
this.setColumns(
|
|
103
109
|
(snapshot.data.configuration as { columns: PlainObject[] }).columns.map(
|
|
104
110
|
(column) => DataCubeMutableColumnConfiguration.create(column),
|
|
105
111
|
),
|
|
106
112
|
);
|
|
113
|
+
// derive the aggregation operation
|
|
114
|
+
this.columns.forEach((column) => {
|
|
115
|
+
if (column.kind === DataCubeColumnKind.MEASURE) {
|
|
116
|
+
const aggCol = _findCol(snapshot.data.groupBy?.aggColumns, column.name);
|
|
117
|
+
if (aggCol) {
|
|
118
|
+
column.setAggregateFunction(aggCol.operation);
|
|
119
|
+
column.setAggregateFunctionParameters(aggCol.parameters);
|
|
120
|
+
} else {
|
|
121
|
+
switch (column.type) {
|
|
122
|
+
case PRIMITIVE_TYPE.NUMBER:
|
|
123
|
+
case PRIMITIVE_TYPE.INTEGER:
|
|
124
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
|
125
|
+
case PRIMITIVE_TYPE.FLOAT: {
|
|
126
|
+
column.setAggregateFunction(DataCubeAggregateOperation.SUM);
|
|
127
|
+
column.setAggregateFunctionParameters([]);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
default: {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
107
138
|
if (!this.selectedColumn && this.columns.length) {
|
|
108
139
|
this.setSelectedColumnName(
|
|
109
140
|
getNonNullableEntry(this.configurableColumns, 0).name,
|
|
@@ -114,7 +145,7 @@ export class DataCubeEditorColumnPropertiesPanelState
|
|
|
114
145
|
buildSnapshot(
|
|
115
146
|
newSnapshot: DataCubeQuerySnapshot,
|
|
116
147
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
117
|
-
)
|
|
148
|
+
) {
|
|
118
149
|
newSnapshot.data.configuration = {
|
|
119
150
|
...newSnapshot.data.configuration,
|
|
120
151
|
// NOTE: make sure the order of column configurations is consistent with the order of selected columns
|
|
@@ -31,16 +31,14 @@ import { type DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
|
31
31
|
import { DataCubeMutableColumnConfiguration } from './DataCubeMutableConfiguration.js';
|
|
32
32
|
|
|
33
33
|
export class DataCubeEditorBasicColumnsSelectorState extends DataCubeEditorColumnsSelectorState<DataCubeEditorColumnsSelectorColumnState> {
|
|
34
|
-
override cloneColumn(
|
|
35
|
-
column: DataCubeEditorColumnsSelectorColumnState,
|
|
36
|
-
): DataCubeEditorColumnsSelectorColumnState {
|
|
34
|
+
override cloneColumn(column: DataCubeEditorColumnsSelectorColumnState) {
|
|
37
35
|
return new DataCubeEditorColumnsSelectorColumnState(
|
|
38
36
|
column.name,
|
|
39
37
|
column.type,
|
|
40
38
|
);
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
override get availableColumns()
|
|
41
|
+
override get availableColumns() {
|
|
44
42
|
return [
|
|
45
43
|
...this.editor.columns.sourceColumns,
|
|
46
44
|
// TODO: add extended columns
|
|
@@ -100,7 +98,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
100
98
|
* not propagate this change until user either leaves this panel or explicitly applies changes
|
|
101
99
|
* (i.e. publishes a new snapshot)
|
|
102
100
|
*/
|
|
103
|
-
propagateColumnSelectionChanges()
|
|
101
|
+
propagateColumnSelectionChanges() {
|
|
104
102
|
// prune column properties
|
|
105
103
|
this.editor.columnProperties.setColumns(
|
|
106
104
|
this.editor.columnProperties.columns.filter((column) =>
|
|
@@ -125,14 +123,14 @@ export class DataCubeEditorColumnsPanelState
|
|
|
125
123
|
// TODO: prune horizontal pivots columns
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
setSourceColumns(columns: DataCubeQuerySnapshotColumn[])
|
|
126
|
+
setSourceColumns(columns: DataCubeQuerySnapshotColumn[]) {
|
|
129
127
|
this.sourceColumns = columns;
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
applySnaphot(
|
|
133
131
|
snapshot: DataCubeQuerySnapshot,
|
|
134
132
|
configuration: DataCubeConfiguration,
|
|
135
|
-
)
|
|
133
|
+
) {
|
|
136
134
|
this.setSourceColumns(snapshot.data.sourceColumns);
|
|
137
135
|
this.selector.setSelectedColumns(
|
|
138
136
|
// extract selected columns from the configuration since the configuration specifies the order
|
|
@@ -150,7 +148,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
150
148
|
buildSnapshot(
|
|
151
149
|
newSnapshot: DataCubeQuerySnapshot,
|
|
152
150
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
153
|
-
)
|
|
151
|
+
) {
|
|
154
152
|
this.propagateColumnSelectionChanges();
|
|
155
153
|
newSnapshot.data.selectColumns = this.selector.selectedColumns
|
|
156
154
|
// TODO: filter by group extended columns
|
|
@@ -90,7 +90,7 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
90
90
|
|
|
91
91
|
setColumnsVisibility(
|
|
92
92
|
visibility: DataCubeEditorColumnsSelectorColumnsVisibility,
|
|
93
|
-
)
|
|
93
|
+
) {
|
|
94
94
|
this.columnsVisibility = visibility;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -124,16 +124,16 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
setSelectedColumns(val: T[])
|
|
127
|
+
setSelectedColumns(val: T[]) {
|
|
128
128
|
this.selectedColumns = val.map((col) => this.cloneColumn(col));
|
|
129
129
|
this.onChange?.(this);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
setAvailableColumnsSearchText(val: string)
|
|
132
|
+
setAvailableColumnsSearchText(val: string) {
|
|
133
133
|
this.availableColumnsSearchText = val;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
setSelectedColumnsSearchText(val: string)
|
|
136
|
+
setSelectedColumnsSearchText(val: string) {
|
|
137
137
|
this.selectedColumnsSearchText = val;
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -48,22 +48,22 @@ export class DataCubeEditorGeneralPropertiesPanelState
|
|
|
48
48
|
this.dataCube = editor.dataCube;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
setName(val: string)
|
|
51
|
+
setName(val: string) {
|
|
52
52
|
this.name = val;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
setLimit(val: number)
|
|
55
|
+
setLimit(val: number) {
|
|
56
56
|
this.limit = val;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
setConfiguration(val: DataCubeMutableConfiguration)
|
|
59
|
+
setConfiguration(val: DataCubeMutableConfiguration) {
|
|
60
60
|
this.configuration = val;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
applySnaphot(
|
|
64
64
|
snapshot: DataCubeQuerySnapshot,
|
|
65
65
|
configuration: DataCubeConfiguration,
|
|
66
|
-
)
|
|
66
|
+
) {
|
|
67
67
|
this.setName(snapshot.data.name);
|
|
68
68
|
this.setLimit(
|
|
69
69
|
snapshot.data.limit !== undefined && snapshot.data.limit > 0
|
|
@@ -78,7 +78,7 @@ export class DataCubeEditorGeneralPropertiesPanelState
|
|
|
78
78
|
buildSnapshot(
|
|
79
79
|
newSnapshot: DataCubeQuerySnapshot,
|
|
80
80
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
81
|
-
)
|
|
81
|
+
) {
|
|
82
82
|
const data = newSnapshot.data;
|
|
83
83
|
data.name = this.name;
|
|
84
84
|
data.limit = this.limit <= 0 ? undefined : this.limit;
|
|
@@ -44,15 +44,13 @@ export class DataCubeEditorSortColumnState extends DataCubeEditorColumnsSelector
|
|
|
44
44
|
this.operation = direction;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
setOperation(val: DataCubeQuerySortOperation)
|
|
47
|
+
setOperation(val: DataCubeQuerySortOperation) {
|
|
48
48
|
this.operation = val;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export class DataCubeEditorSortColumnsSelectorState extends DataCubeEditorColumnsSelectorState<DataCubeEditorSortColumnState> {
|
|
53
|
-
override cloneColumn(
|
|
54
|
-
column: DataCubeEditorSortColumnState,
|
|
55
|
-
): DataCubeEditorSortColumnState {
|
|
53
|
+
override cloneColumn(column: DataCubeEditorSortColumnState) {
|
|
56
54
|
return new DataCubeEditorSortColumnState(
|
|
57
55
|
column.name,
|
|
58
56
|
column.type,
|
|
@@ -60,7 +58,7 @@ export class DataCubeEditorSortColumnsSelectorState extends DataCubeEditorColumn
|
|
|
60
58
|
);
|
|
61
59
|
}
|
|
62
60
|
|
|
63
|
-
override get availableColumns()
|
|
61
|
+
override get availableColumns() {
|
|
64
62
|
return this.editor.columns.selector.selectedColumns.map(
|
|
65
63
|
(col) =>
|
|
66
64
|
new DataCubeEditorSortColumnState(
|
|
@@ -88,7 +86,7 @@ export class DataCubeEditorSortsPanelState
|
|
|
88
86
|
applySnaphot(
|
|
89
87
|
snapshot: DataCubeQuerySnapshot,
|
|
90
88
|
configuration: DataCubeConfiguration,
|
|
91
|
-
)
|
|
89
|
+
) {
|
|
92
90
|
this.selector.setSelectedColumns(
|
|
93
91
|
snapshot.data.sortColumns.map((col) => {
|
|
94
92
|
const column = this.selector.getColumn(col.name);
|
|
@@ -104,7 +102,7 @@ export class DataCubeEditorSortsPanelState
|
|
|
104
102
|
buildSnapshot(
|
|
105
103
|
newSnapshot: DataCubeQuerySnapshot,
|
|
106
104
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
107
|
-
)
|
|
105
|
+
) {
|
|
108
106
|
newSnapshot.data.sortColumns = this.selector.selectedColumns.map((col) => ({
|
|
109
107
|
name: col.name,
|
|
110
108
|
type: col.type,
|
|
@@ -77,11 +77,11 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
77
77
|
this.code = new DataCubeEditorCodePanelState(this);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
setCurrentTab(val: DataCubeEditorTab)
|
|
80
|
+
setCurrentTab(val: DataCubeEditorTab) {
|
|
81
81
|
this.currentTab = val;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
applyChanges()
|
|
84
|
+
applyChanges() {
|
|
85
85
|
const baseSnapshot = guaranteeNonNullable(this.getLatestSnapshot());
|
|
86
86
|
const snapshot = baseSnapshot.clone();
|
|
87
87
|
|
|
@@ -106,7 +106,7 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
106
106
|
override async applySnapshot(
|
|
107
107
|
snapshot: DataCubeQuerySnapshot,
|
|
108
108
|
previousSnapshot: DataCubeQuerySnapshot | undefined,
|
|
109
|
-
)
|
|
109
|
+
) {
|
|
110
110
|
const configuration = DataCubeConfiguration.serialization.fromJson(
|
|
111
111
|
snapshot.data.configuration,
|
|
112
112
|
);
|
|
@@ -119,7 +119,7 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotSubscriber {
|
|
|
119
119
|
this.columnProperties.applySnaphot(snapshot, configuration);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
override async initialize()
|
|
122
|
+
override async initialize() {
|
|
123
123
|
// do nothing
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -68,7 +68,7 @@ export class DataCubeEditorVerticalPivotsPanelState
|
|
|
68
68
|
applySnaphot(
|
|
69
69
|
snapshot: DataCubeQuerySnapshot,
|
|
70
70
|
configuration: DataCubeConfiguration,
|
|
71
|
-
)
|
|
71
|
+
) {
|
|
72
72
|
this.selector.setSelectedColumns(
|
|
73
73
|
(snapshot.data.groupBy?.columns ?? []).map(
|
|
74
74
|
(col) =>
|
|
@@ -80,7 +80,7 @@ export class DataCubeEditorVerticalPivotsPanelState
|
|
|
80
80
|
buildSnapshot(
|
|
81
81
|
newSnapshot: DataCubeQuerySnapshot,
|
|
82
82
|
baseSnapshot: DataCubeQuerySnapshot,
|
|
83
|
-
)
|
|
83
|
+
) {
|
|
84
84
|
newSnapshot.data.groupBy = this.selector.selectedColumns.length
|
|
85
85
|
? {
|
|
86
86
|
columns: this.selector.selectedColumns.map((column) => ({
|
|
@@ -99,7 +99,8 @@ export class DataCubeEditorVerticalPivotsPanelState
|
|
|
99
99
|
.map((column) => ({
|
|
100
100
|
name: column.name,
|
|
101
101
|
type: column.type,
|
|
102
|
-
|
|
102
|
+
operation: guaranteeNonNullable(column.aggregateFunction),
|
|
103
|
+
parameters: column.aggregateFunctionParameters,
|
|
103
104
|
})),
|
|
104
105
|
}
|
|
105
106
|
: undefined;
|