@finos/legend-application-repl 0.0.27 → 0.0.29
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
|
@@ -15,65 +15,156 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
-
import type { REPLStore } from '../../../stores/dataCube/DataCubeStore.js';
|
|
19
18
|
import { LicenseManager } from '@ag-grid-enterprise/core';
|
|
20
19
|
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
|
21
20
|
import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
|
|
22
21
|
import { RowGroupingModule } from '@ag-grid-enterprise/row-grouping';
|
|
23
22
|
import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
24
23
|
import { AgGridReact } from '@ag-grid-community/react';
|
|
25
|
-
import { useEffect } from 'react';
|
|
24
|
+
import { useEffect, useState } from 'react';
|
|
25
|
+
import { useREPLStore } from '../../REPLStoreProvider.js';
|
|
26
|
+
import { DataCubeIcon, Switch, cn } from '@finos/legend-art';
|
|
27
|
+
import {
|
|
28
|
+
INTERNAL__GRID_CLIENT_HEADER_HEIGHT,
|
|
29
|
+
INTERNAL__GRID_CLIENT_ROW_BUFFER,
|
|
30
|
+
INTERNAL__GRID_CLIENT_ROW_HEIGHT,
|
|
31
|
+
} from '../../../stores/dataCube/grid/DataCubeGridClientEngine.js';
|
|
26
32
|
|
|
27
33
|
// NOTE: This is a workaround to prevent ag-grid license key check from flooding the console screen
|
|
28
34
|
// with its stack trace in Chrome.
|
|
29
|
-
// We MUST NEVER completely surpress this warning, else it's a violation of the ag-grid license
|
|
35
|
+
// We MUST NEVER completely surpress this warning in production, else it's a violation of the ag-grid license!
|
|
36
|
+
// See https://www.ag-grid.com/javascript-data-grid/licensing/
|
|
30
37
|
const __INTERNAL__original_console_error = console.error; // eslint-disable-line no-console
|
|
31
|
-
// eslint-disable-next-line no-
|
|
32
|
-
|
|
33
|
-
// eslint-disable-
|
|
34
|
-
|
|
35
|
-
console.log(message); // eslint-disable-line no-console
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
+
// eslint-disable-next-line no-console
|
|
39
|
+
console.error = (message?: unknown, ...agrs: unknown[]): void => {
|
|
40
|
+
console.log(`%c ${message}`, 'color: silver'); // eslint-disable-line no-console
|
|
41
|
+
};
|
|
38
42
|
|
|
39
|
-
export const DataCubeGrid = observer((
|
|
40
|
-
const
|
|
41
|
-
const dataCubeState =
|
|
43
|
+
export const DataCubeGrid = observer(() => {
|
|
44
|
+
const replStore = useREPLStore();
|
|
45
|
+
const dataCubeState = replStore.dataCubeState;
|
|
46
|
+
const grid = dataCubeState.grid;
|
|
47
|
+
|
|
48
|
+
const [scrollHintText, setScrollHintText] = useState('');
|
|
42
49
|
|
|
43
50
|
useEffect(() => {
|
|
44
|
-
if (
|
|
45
|
-
LicenseManager.setLicenseKey(
|
|
51
|
+
if (grid.clientLicenseKey) {
|
|
52
|
+
LicenseManager.setLicenseKey(grid.clientLicenseKey);
|
|
46
53
|
}
|
|
47
|
-
}, [
|
|
54
|
+
}, [grid.clientLicenseKey]);
|
|
48
55
|
|
|
49
56
|
return (
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
RowGroupingModule,
|
|
66
|
-
MenuModule,
|
|
67
|
-
]}
|
|
68
|
-
onGridReady={(params): void => {
|
|
69
|
-
dataCubeState.grid.configureClient(params.api);
|
|
70
|
-
// eslint-disable-next-line no-process-env
|
|
71
|
-
if (process.env.NODE_ENV === 'development') {
|
|
57
|
+
<div className="data-cube-grid flex-1">
|
|
58
|
+
<div className="h-[calc(100%_-_20px)] w-full">
|
|
59
|
+
<AgGridReact
|
|
60
|
+
className="ag-theme-balham"
|
|
61
|
+
modules={[
|
|
62
|
+
// community
|
|
63
|
+
ClientSideRowModelModule,
|
|
64
|
+
// enterprise
|
|
65
|
+
ServerSideRowModelModule,
|
|
66
|
+
RowGroupingModule,
|
|
67
|
+
MenuModule,
|
|
68
|
+
]}
|
|
69
|
+
onGridReady={(params): void => {
|
|
70
|
+
grid.configureClient(params.api);
|
|
71
|
+
// restore original error logging
|
|
72
72
|
console.error = __INTERNAL__original_console_error; // eslint-disable-line no-console
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
}}
|
|
74
|
+
// -------------------------------------- ROW GROUPING --------------------------------------
|
|
75
|
+
rowGroupPanelShow="always"
|
|
76
|
+
suppressScrollOnNewData={true}
|
|
77
|
+
groupDisplayType="custom" // keeps the column set stable even when row grouping is used
|
|
78
|
+
suppressRowGroupHidesColumns={true} // keeps the column set stable even when row grouping is used
|
|
79
|
+
// -------------------------------------- PIVOT --------------------------------------
|
|
80
|
+
// pivotPanelShow="always"
|
|
81
|
+
// pivotMode={true}
|
|
82
|
+
// -------------------------------------- SERVER SIDE ROW MODEL --------------------------------------
|
|
83
|
+
rowModelType="serverSide"
|
|
84
|
+
serverSideDatasource={grid.clientDataSource}
|
|
85
|
+
// -------------------------------------- GENERIC --------------------------------------
|
|
86
|
+
suppressBrowserResizeObserver={true}
|
|
87
|
+
animateRows={false} // improve performance
|
|
88
|
+
// NOTE: since we shrink the spacing, more rows can be shown, as such, setting higher row
|
|
89
|
+
// buffer will improve scrolling performance, but compromise initial load and various
|
|
90
|
+
// actions performance
|
|
91
|
+
rowBuffer={INTERNAL__GRID_CLIENT_ROW_BUFFER}
|
|
92
|
+
rowHeight={INTERNAL__GRID_CLIENT_ROW_HEIGHT}
|
|
93
|
+
headerHeight={INTERNAL__GRID_CLIENT_HEADER_HEIGHT}
|
|
94
|
+
// Force multi-sorting since this is what the query supports anyway
|
|
95
|
+
alwaysMultiSort={true}
|
|
96
|
+
// Keeps the columns stable even when aggregation is used
|
|
97
|
+
suppressAggFuncInHeader={true}
|
|
98
|
+
// Show cursor position when scrolling
|
|
99
|
+
onBodyScroll={(event) => {
|
|
100
|
+
const rowCount = event.api.getDisplayedRowCount();
|
|
101
|
+
const range = event.api.getVerticalPixelRange();
|
|
102
|
+
const start = Math.max(
|
|
103
|
+
1,
|
|
104
|
+
Math.ceil(range.top / INTERNAL__GRID_CLIENT_ROW_HEIGHT) + 1,
|
|
105
|
+
);
|
|
106
|
+
const end = Math.min(
|
|
107
|
+
rowCount,
|
|
108
|
+
Math.floor(range.bottom / INTERNAL__GRID_CLIENT_ROW_HEIGHT),
|
|
109
|
+
);
|
|
110
|
+
setScrollHintText(`${start}-${end}/${rowCount}`);
|
|
111
|
+
}}
|
|
112
|
+
onBodyScrollEnd={() => setScrollHintText('')}
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
<div className="relative flex h-5 w-full justify-between border-b border-b-neutral-200 bg-neutral-100">
|
|
116
|
+
{Boolean(scrollHintText) && (
|
|
117
|
+
<div className="absolute -top-8 right-4 flex items-center rounded-sm border border-neutral-300 bg-neutral-100 p-1 pr-2 text-neutral-500 shadow-sm">
|
|
118
|
+
<DataCubeIcon.TableScroll className="text-lg" />
|
|
119
|
+
<div className="ml-1 font-mono text-sm">{scrollHintText}</div>
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
<div />
|
|
123
|
+
<div className="flex items-center">
|
|
124
|
+
<div className="select-none p-2 font-mono text-sm text-neutral-500">
|
|
125
|
+
{grid.clientDataSource.rowCount
|
|
126
|
+
? `(${grid.clientDataSource.rowCount} rows)`
|
|
127
|
+
: ''}
|
|
128
|
+
</div>
|
|
129
|
+
<div className="h-3 w-[1px] bg-neutral-200" />
|
|
130
|
+
<button
|
|
131
|
+
className="flex h-full items-center p-2"
|
|
132
|
+
onClick={(): void =>
|
|
133
|
+
grid.setPaginationEnabled(!grid.isPaginationEnabled)
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<Switch
|
|
137
|
+
checked={grid.isPaginationEnabled}
|
|
138
|
+
classes={{
|
|
139
|
+
root: 'p-0 w-6 h-5 flex items-center',
|
|
140
|
+
input: 'w-2',
|
|
141
|
+
checked: '!translate-x-2 ease-in-out duration-100 transition',
|
|
142
|
+
thumb: cn('w-2 h-2', {
|
|
143
|
+
'bg-sky-600': grid.isPaginationEnabled,
|
|
144
|
+
'bg-neutral-500': !grid.isPaginationEnabled,
|
|
145
|
+
}),
|
|
146
|
+
switchBase:
|
|
147
|
+
'p-0.5 mt-1 translate-x-0 ease-in-out duration-100 transition',
|
|
148
|
+
track: cn('h-3 w-5 border', {
|
|
149
|
+
'!bg-sky-100 border-sky-600': grid.isPaginationEnabled,
|
|
150
|
+
'!bg-neutral-100 border-neutral-500':
|
|
151
|
+
!grid.isPaginationEnabled,
|
|
152
|
+
}),
|
|
153
|
+
}}
|
|
154
|
+
disableRipple={true}
|
|
155
|
+
disableFocusRipple={true}
|
|
156
|
+
/>
|
|
157
|
+
<div
|
|
158
|
+
className={cn('text-sm', {
|
|
159
|
+
'text-sky-600': grid.isPaginationEnabled,
|
|
160
|
+
'text-neutral-500': !grid.isPaginationEnabled,
|
|
161
|
+
})}
|
|
162
|
+
>
|
|
163
|
+
Pagination
|
|
164
|
+
</div>
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
78
169
|
);
|
|
79
170
|
});
|
|
@@ -28,9 +28,9 @@ import type {
|
|
|
28
28
|
RelationType,
|
|
29
29
|
DataCubeExecutionInput,
|
|
30
30
|
DataCubeExecutionResult,
|
|
31
|
+
DataCubeGetBaseQueryResult,
|
|
31
32
|
} from './models/DataCubeEngineModels.js';
|
|
32
33
|
import type { V1_ValueSpecification } from '@finos/legend-graph';
|
|
33
|
-
import type { DataCubeQuery } from './models/DataCubeQuery.js';
|
|
34
34
|
|
|
35
35
|
export class REPLServerClient {
|
|
36
36
|
private readonly networkClient: NetworkClient;
|
|
@@ -72,7 +72,7 @@ export class REPLServerClient {
|
|
|
72
72
|
return this.networkClient.post(`${this.dataCube}/getQueryCode`, input);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
async getBaseQuery(): Promise<PlainObject<
|
|
75
|
+
async getBaseQuery(): Promise<PlainObject<DataCubeGetBaseQueryResult>> {
|
|
76
76
|
return this.networkClient.get(`${this.dataCube}/getBaseQuery`);
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
V1_serializeValueSpecification,
|
|
24
24
|
V1_lambdaModelSchema,
|
|
25
25
|
} from '@finos/legend-graph';
|
|
26
|
-
import type
|
|
26
|
+
import { DataCubeQuery, type DataCubeQueryColumn } from './DataCubeQuery.js';
|
|
27
27
|
|
|
28
28
|
export class DataCubeGetQueryCodeInput {
|
|
29
29
|
query!: V1_ValueSpecification; // TODO: @akphi - consider if we should update this to use Lambda instead
|
|
@@ -82,3 +82,25 @@ export type DataCubeExecutionResult = {
|
|
|
82
82
|
export type RelationType = {
|
|
83
83
|
columns: DataCubeQueryColumn[];
|
|
84
84
|
};
|
|
85
|
+
|
|
86
|
+
export class DataCubeGetBaseQueryResult {
|
|
87
|
+
query!: DataCubeQuery;
|
|
88
|
+
timestamp!: number;
|
|
89
|
+
partialQuery!: V1_ValueSpecification;
|
|
90
|
+
sourceQuery!: V1_ValueSpecification;
|
|
91
|
+
|
|
92
|
+
static readonly serialization = new SerializationFactory(
|
|
93
|
+
createModelSchema(DataCubeGetBaseQueryResult, {
|
|
94
|
+
partialQuery: custom(
|
|
95
|
+
(val) => V1_serializeValueSpecification(val, []),
|
|
96
|
+
(val) => V1_deserializeValueSpecification(val, []),
|
|
97
|
+
),
|
|
98
|
+
query: usingModelSchema(DataCubeQuery.serialization.schema),
|
|
99
|
+
sourceQuery: custom(
|
|
100
|
+
(val) => V1_serializeValueSpecification(val, []),
|
|
101
|
+
(val) => V1_deserializeValueSpecification(val, []),
|
|
102
|
+
),
|
|
103
|
+
timestamp: primitive(),
|
|
104
|
+
}),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
2
|
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
export const DATA_CUBE_DEFAULT_REPORT_NAME = 'New Report';
|
|
@@ -14,35 +14,36 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import type { REPLStore } from './DataCubeStore.js';
|
|
17
|
+
import type { REPLStore } from './REPLStore.js';
|
|
19
18
|
import { DataCubeGridState } from './grid/DataCubeGridState.js';
|
|
20
19
|
import { DataCubeEditorState } from './editor/DataCubeEditorState.js';
|
|
21
|
-
import type { DataCubeQuery } from '../../server/models/DataCubeQuery.js';
|
|
22
20
|
import { ActionState, assertErrorThrown } from '@finos/legend-shared';
|
|
23
21
|
import { DataCubeEngine } from './core/DataCubeEngine.js';
|
|
24
22
|
import { DataCubeQuerySnapshotManager } from './core/DataCubeQuerySnapshotManager.js';
|
|
25
|
-
import { buildSnapshotFromQuery } from './core/DataCubeQueryAnalyzer.js';
|
|
26
23
|
import type { LegendREPLApplicationStore } from '../LegendREPLBaseStore.js';
|
|
24
|
+
import { DataCubeCoreState } from './core/DataCubeCoreState.js';
|
|
25
|
+
import { validateAndBuildQuerySnapshot } from './core/DataCubeQuerySnapshotBuilder.js';
|
|
27
26
|
|
|
28
27
|
export class DataCubeState {
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
28
|
+
readonly replStore: REPLStore;
|
|
29
|
+
readonly application: LegendREPLApplicationStore;
|
|
31
30
|
readonly engine: DataCubeEngine;
|
|
32
31
|
readonly snapshotManager: DataCubeQuerySnapshotManager;
|
|
32
|
+
|
|
33
|
+
readonly core: DataCubeCoreState;
|
|
33
34
|
readonly grid: DataCubeGridState;
|
|
34
35
|
readonly editor: DataCubeEditorState;
|
|
35
|
-
readonly initState = ActionState.create();
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
readonly initState = ActionState.create();
|
|
38
38
|
|
|
39
|
-
constructor(
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.engine = new DataCubeEngine(this.
|
|
39
|
+
constructor(replStore: REPLStore) {
|
|
40
|
+
this.replStore = replStore;
|
|
41
|
+
this.application = replStore.applicationStore;
|
|
42
|
+
this.engine = new DataCubeEngine(this.replStore.client);
|
|
43
43
|
|
|
44
44
|
// NOTE: snapshot manager must be instantiated before subscribers
|
|
45
45
|
this.snapshotManager = new DataCubeQuerySnapshotManager(this);
|
|
46
|
+
this.core = new DataCubeCoreState(this);
|
|
46
47
|
this.grid = new DataCubeGridState(this);
|
|
47
48
|
this.editor = new DataCubeEditorState(this);
|
|
48
49
|
}
|
|
@@ -50,19 +51,24 @@ export class DataCubeState {
|
|
|
50
51
|
async initialize(): Promise<void> {
|
|
51
52
|
this.initState.inProgress();
|
|
52
53
|
try {
|
|
53
|
-
await
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
await Promise.all(
|
|
55
|
+
[this.core, this.editor, this.grid].map(async (state) => {
|
|
56
|
+
this.snapshotManager.registerSubscriber(state);
|
|
57
|
+
await state.initialize();
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
const result = await this.engine.getBaseQuery();
|
|
61
|
+
const initialSnapshot = validateAndBuildQuerySnapshot(
|
|
62
|
+
result.partialQuery,
|
|
63
|
+
result.sourceQuery,
|
|
64
|
+
result.query,
|
|
61
65
|
);
|
|
66
|
+
initialSnapshot.timestamp = result.timestamp;
|
|
62
67
|
this.snapshotManager.broadcastSnapshot(initialSnapshot);
|
|
63
68
|
this.initState.complete();
|
|
64
69
|
} catch (error: unknown) {
|
|
65
70
|
assertErrorThrown(error);
|
|
71
|
+
this.application.notificationService.notifyError(error);
|
|
66
72
|
this.initState.fail();
|
|
67
73
|
}
|
|
68
74
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { DataCubeQuerySnapshotSubscriber } from './DataCubeQuerySnapshotSubscriber.js';
|
|
20
|
+
import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
21
|
+
import { DATA_CUBE_DEFAULT_REPORT_NAME } from '../DataCubeDefaultConfig.js';
|
|
22
|
+
import type { DataCubeQuery } from '../../../server/models/DataCubeQuery.js';
|
|
23
|
+
import { formatDate } from '@finos/legend-shared';
|
|
24
|
+
|
|
25
|
+
export class DataCubeCoreState extends DataCubeQuerySnapshotSubscriber {
|
|
26
|
+
baseQuery!: DataCubeQuery;
|
|
27
|
+
name = DATA_CUBE_DEFAULT_REPORT_NAME;
|
|
28
|
+
private startTime?: number | undefined;
|
|
29
|
+
|
|
30
|
+
constructor(dataCube: DataCubeState) {
|
|
31
|
+
super(dataCube);
|
|
32
|
+
|
|
33
|
+
makeObservable(this, {
|
|
34
|
+
name: observable,
|
|
35
|
+
setName: action,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setName(val: string): void {
|
|
40
|
+
this.name = val;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override async applySnapshot(snapshot: DataCubeQuerySnapshot): Promise<void> {
|
|
44
|
+
const data = snapshot.data;
|
|
45
|
+
this.setName(data.name);
|
|
46
|
+
if (!this.startTime) {
|
|
47
|
+
this.startTime = snapshot.timestamp;
|
|
48
|
+
}
|
|
49
|
+
this.application.layoutService.setWindowTitle(
|
|
50
|
+
`\u25A6 ${data.name}${this.startTime ? ` - ${formatDate(new Date(this.startTime), 'HH:mm:ss EEE MMM dd yyyy')}` : ''}`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
override async initialize(): Promise<void> {
|
|
55
|
+
// do nothing
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -24,8 +24,10 @@ import {
|
|
|
24
24
|
V1_buildExecutionResult,
|
|
25
25
|
} from '@finos/legend-graph';
|
|
26
26
|
import type { REPLServerClient } from '../../../server/REPLServerClient.js';
|
|
27
|
-
import {
|
|
28
|
-
|
|
27
|
+
import {
|
|
28
|
+
DataCubeGetBaseQueryResult,
|
|
29
|
+
type CompletionItem,
|
|
30
|
+
} from '../../../server/models/DataCubeEngineModels.js';
|
|
29
31
|
import { guaranteeType } from '@finos/legend-shared';
|
|
30
32
|
|
|
31
33
|
export class DataCubeEngine {
|
|
@@ -59,8 +61,8 @@ export class DataCubeEngine {
|
|
|
59
61
|
);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
async getBaseQuery(): Promise<
|
|
63
|
-
return
|
|
64
|
+
async getBaseQuery(): Promise<DataCubeGetBaseQueryResult> {
|
|
65
|
+
return DataCubeGetBaseQueryResult.serialization.fromJson(
|
|
64
66
|
await this.client.getBaseQuery(),
|
|
65
67
|
);
|
|
66
68
|
}
|