@finos/legend-application-repl 1.0.34 → 1.0.36

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.
Files changed (56) hide show
  1. package/lib/__lib__/LegendREPLSetting.d.ts +2 -5
  2. package/lib/__lib__/LegendREPLSetting.d.ts.map +1 -1
  3. package/lib/__lib__/LegendREPLSetting.js +4 -7
  4. package/lib/__lib__/LegendREPLSetting.js.map +1 -1
  5. package/lib/application/LegendREPL.js +1 -1
  6. package/lib/application/LegendREPL.js.map +1 -1
  7. package/lib/application/LegendREPLNavigation.d.ts +1 -1
  8. package/lib/application/LegendREPLNavigation.js +1 -1
  9. package/lib/components/LegendREPLDataCubeHeader.d.ts +2 -4
  10. package/lib/components/LegendREPLDataCubeHeader.d.ts.map +1 -1
  11. package/lib/components/LegendREPLDataCubeHeader.js +25 -9
  12. package/lib/components/LegendREPLDataCubeHeader.js.map +1 -1
  13. package/lib/components/LegendREPLFramworkProvider.d.ts.map +1 -1
  14. package/lib/components/LegendREPLFramworkProvider.js +2 -2
  15. package/lib/components/LegendREPLFramworkProvider.js.map +1 -1
  16. package/lib/components/LegendREPLPublishDataCubeAlert.js +1 -1
  17. package/lib/components/LegendREPLPublishDataCubeAlert.js.map +1 -1
  18. package/lib/components/{LegendREPLApplication.d.ts → LegendREPLWebApplication.d.ts} +1 -1
  19. package/lib/components/LegendREPLWebApplication.d.ts.map +1 -0
  20. package/lib/components/LegendREPLWebApplication.js +84 -0
  21. package/lib/components/LegendREPLWebApplication.js.map +1 -0
  22. package/lib/index.css +1 -1
  23. package/lib/package.json +1 -1
  24. package/lib/stores/LegendREPLBaseStore.d.ts +15 -6
  25. package/lib/stores/LegendREPLBaseStore.d.ts.map +1 -1
  26. package/lib/stores/LegendREPLBaseStore.js +75 -33
  27. package/lib/stores/LegendREPLBaseStore.js.map +1 -1
  28. package/lib/stores/LegendREPLDataCubeEngine.d.ts +16 -22
  29. package/lib/stores/LegendREPLDataCubeEngine.d.ts.map +1 -1
  30. package/lib/stores/LegendREPLDataCubeEngine.js +89 -88
  31. package/lib/stores/LegendREPLDataCubeEngine.js.map +1 -1
  32. package/lib/stores/LegendREPLDataCubeSource.d.ts +14 -2
  33. package/lib/stores/LegendREPLDataCubeSource.d.ts.map +1 -1
  34. package/lib/stores/LegendREPLDataCubeSource.js +24 -0
  35. package/lib/stores/LegendREPLDataCubeSource.js.map +1 -1
  36. package/lib/stores/LegendREPLServerClient.d.ts +5 -17
  37. package/lib/stores/LegendREPLServerClient.d.ts.map +1 -1
  38. package/lib/stores/LegendREPLServerClient.js +1 -26
  39. package/lib/stores/LegendREPLServerClient.js.map +1 -1
  40. package/package.json +6 -6
  41. package/src/__lib__/LegendREPLSetting.ts +2 -5
  42. package/src/application/LegendREPL.tsx +1 -1
  43. package/src/application/LegendREPLNavigation.ts +1 -1
  44. package/src/components/LegendREPLDataCubeHeader.tsx +15 -12
  45. package/src/components/LegendREPLFramworkProvider.tsx +2 -4
  46. package/src/components/LegendREPLPublishDataCubeAlert.tsx +1 -1
  47. package/src/components/LegendREPLWebApplication.tsx +157 -0
  48. package/src/stores/LegendREPLBaseStore.tsx +104 -40
  49. package/src/stores/LegendREPLDataCubeEngine.ts +135 -139
  50. package/src/stores/LegendREPLDataCubeSource.ts +35 -2
  51. package/src/stores/LegendREPLServerClient.ts +3 -39
  52. package/tsconfig.json +1 -1
  53. package/lib/components/LegendREPLApplication.d.ts.map +0 -1
  54. package/lib/components/LegendREPLApplication.js +0 -67
  55. package/lib/components/LegendREPLApplication.js.map +0 -1
  56. package/src/components/LegendREPLApplication.tsx +0 -125
@@ -1,125 +0,0 @@
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 {
18
- BrowserEnvironmentProvider,
19
- Route,
20
- Routes,
21
- } from '@finos/legend-application/browser';
22
- import { observer } from 'mobx-react-lite';
23
- import { useEffect, useMemo } from 'react';
24
- import { formatDate, LogEvent } from '@finos/legend-shared';
25
- import { LegendREPLDataCubeEngine } from '../stores/LegendREPLDataCubeEngine.js';
26
- import { DataCube, DataCubeSettingKey } from '@finos/legend-data-cube';
27
- import { APPLICATION_EVENT } from '@finos/legend-application';
28
- import { LegendREPLDataCubeSource } from '../stores/LegendREPLDataCubeSource.js';
29
- import { LegendREPLDataCubeHeader } from './LegendREPLDataCubeHeader.js';
30
- import {
31
- LegendREPLFrameworkProvider,
32
- useLegendREPLBaseStore,
33
- } from './LegendREPLFramworkProvider.js';
34
-
35
- const LegendREPLDataCube = observer(() => {
36
- const baseStore = useLegendREPLBaseStore();
37
- const engine = useMemo(
38
- () => new LegendREPLDataCubeEngine(baseStore),
39
- [baseStore],
40
- );
41
- const application = baseStore.application;
42
-
43
- useEffect(() => {
44
- engine.blockNavigation(
45
- // Only block navigation in production
46
- // eslint-disable-next-line no-process-env
47
- [() => process.env.NODE_ENV === 'production'],
48
- undefined,
49
- () => {
50
- engine.logWarning(
51
- LogEvent.create(APPLICATION_EVENT.NAVIGATION_BLOCKED),
52
- `Navigation from the application is blocked`,
53
- );
54
- },
55
- );
56
- return (): void => {
57
- engine.unblockNavigation();
58
- };
59
- }, [engine]);
60
-
61
- return (
62
- <DataCube
63
- engine={engine}
64
- options={{
65
- onNameChanged(name, source) {
66
- const timestamp =
67
- source instanceof LegendREPLDataCubeSource
68
- ? source.timestamp
69
- : undefined;
70
- application.layoutService.setWindowTitle(
71
- `\u229E ${name}${timestamp ? ` - ${formatDate(new Date(timestamp), 'HH:mm:ss EEE MMM dd yyyy')}` : ''}`,
72
- );
73
- },
74
- onSettingChanged(key, value) {
75
- engine.persistSettingValue(key, value);
76
- },
77
-
78
- enableDebugMode: application.settingService.getBooleanValue(
79
- DataCubeSettingKey.ENABLE_DEBUG_MODE,
80
- ),
81
- gridClientRowBuffer: application.settingService.getNumericValue(
82
- DataCubeSettingKey.GRID_CLIENT_ROW_BUFFER,
83
- ),
84
- gridClientPurgeClosedRowNodes:
85
- application.settingService.getBooleanValue(
86
- DataCubeSettingKey.GRID_CLIENT_PURGE_CLOSED_ROW_NODES,
87
- ),
88
- gridClientSuppressLargeDatasetWarning:
89
- application.settingService.getBooleanValue(
90
- DataCubeSettingKey.GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING,
91
- ),
92
- innerHeaderComponent: (dataCube) => (
93
- <LegendREPLDataCubeHeader dataCube={dataCube} />
94
- ),
95
- }}
96
- />
97
- );
98
- });
99
-
100
- export const LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN = Object.freeze({
101
- DATA_CUBE: `/dataCube`,
102
- });
103
-
104
- export const LegendREPLRouter = observer(() => (
105
- <div className="h-full">
106
- <Routes>
107
- <Route
108
- path={LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN.DATA_CUBE}
109
- element={<LegendREPLDataCube />}
110
- />
111
- </Routes>
112
- </div>
113
- ));
114
-
115
- export const LegendREPLWebApplication = (props: { baseUrl: string }) => {
116
- const { baseUrl } = props;
117
-
118
- return (
119
- <BrowserEnvironmentProvider baseUrl={baseUrl}>
120
- <LegendREPLFrameworkProvider>
121
- <LegendREPLRouter />
122
- </LegendREPLFrameworkProvider>
123
- </BrowserEnvironmentProvider>
124
- );
125
- };