@finos/legend-application 0.2.2 → 1.1.0
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/CHANGELOG.md +24 -0
- package/lib/application/LegendApplication.d.ts +22 -11
- package/lib/application/LegendApplication.d.ts.map +1 -1
- package/lib/application/LegendApplication.js +28 -14
- package/lib/application/LegendApplication.js.map +1 -1
- package/lib/application/LegendApplicationPluginManager.d.ts +31 -0
- package/lib/application/LegendApplicationPluginManager.d.ts.map +1 -0
- package/lib/application/LegendApplicationPluginManager.js +47 -0
- package/lib/application/LegendApplicationPluginManager.js.map +1 -0
- package/lib/components/ActionAlert.d.ts +1 -0
- package/lib/components/ActionAlert.d.ts.map +1 -1
- package/lib/components/ActionAlert.js +2 -1
- package/lib/components/ActionAlert.js.map +1 -1
- package/lib/components/ApplicationStoreProvider.d.ts +3 -5
- package/lib/components/ApplicationStoreProvider.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProvider.js +4 -2
- package/lib/components/ApplicationStoreProvider.js.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts +6 -3
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.js +3 -4
- package/lib/components/ApplicationStoreProviderTestUtils.js.map +1 -1
- package/lib/components/BlockingAlert.d.ts +1 -0
- package/lib/components/BlockingAlert.d.ts.map +1 -1
- package/lib/components/BlockingAlert.js +3 -2
- package/lib/components/BlockingAlert.js.map +1 -1
- package/lib/components/LambdaEditor.d.ts +3 -2
- package/lib/components/LambdaEditor.d.ts.map +1 -1
- package/lib/components/LambdaEditor.js +5 -6
- package/lib/components/LambdaEditor.js.map +1 -1
- package/lib/components/{NotificationSnackbar.d.ts → LegendApplicationComponentFrameworkProvider.d.ts} +5 -4
- package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts.map +1 -0
- package/lib/components/LegendApplicationComponentFrameworkProvider.js +25 -0
- package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +1 -0
- package/lib/components/{ApplicationBackdrop.d.ts → NotificationManager.d.ts} +3 -4
- package/lib/components/NotificationManager.d.ts.map +1 -0
- package/lib/components/{NotificationSnackbar.js → NotificationManager.js} +14 -15
- package/lib/components/NotificationManager.js.map +1 -0
- package/lib/components/TextInputEditor.d.ts +2 -3
- package/lib/components/TextInputEditor.d.ts.map +1 -1
- package/lib/components/TextInputEditor.js +1 -1
- package/lib/components/TextInputEditor.js.map +1 -1
- package/lib/components/WebApplicationNavigatorProvider.d.ts +3 -2
- package/lib/components/WebApplicationNavigatorProvider.d.ts.map +1 -1
- package/lib/components/WebApplicationNavigatorProvider.js +1 -1
- package/lib/components/WebApplicationNavigatorProvider.js.map +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts.map +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/stores/ApplicationStore.d.ts +7 -3
- package/lib/stores/ApplicationStore.d.ts.map +1 -1
- package/lib/stores/ApplicationStore.js +12 -5
- package/lib/stores/ApplicationStore.js.map +1 -1
- package/lib/stores/ApplicationStoreTestUtils.d.ts +2 -1
- package/lib/stores/ApplicationStoreTestUtils.d.ts.map +1 -1
- package/lib/stores/ApplicationStoreTestUtils.js +1 -2
- package/lib/stores/ApplicationStoreTestUtils.js.map +1 -1
- package/lib/stores/LambdaEditorState.d.ts +2 -3
- package/lib/stores/LambdaEditorState.d.ts.map +1 -1
- package/lib/stores/LambdaEditorState.js +1 -1
- package/lib/stores/LambdaEditorState.js.map +1 -1
- package/lib/stores/WebApplicationNavigator.d.ts +7 -0
- package/lib/stores/WebApplicationNavigator.d.ts.map +1 -1
- package/lib/stores/WebApplicationNavigator.js.map +1 -1
- package/package.json +18 -20
- package/src/application/LegendApplication.tsx +58 -27
- package/src/application/LegendApplicationPluginManager.tsx +73 -0
- package/src/components/ActionAlert.tsx +3 -2
- package/src/components/ApplicationStoreProvider.tsx +6 -7
- package/src/components/ApplicationStoreProviderTestUtils.tsx +7 -12
- package/src/components/BlockingAlert.tsx +4 -2
- package/src/components/LambdaEditor.tsx +19 -14
- package/src/components/{ApplicationBackdrop.tsx → LegendApplicationComponentFrameworkProvider.tsx} +18 -5
- package/src/components/{NotificationSnackbar.tsx → NotificationManager.tsx} +30 -25
- package/src/components/TextInputEditor.tsx +6 -4
- package/src/components/WebApplicationNavigatorProvider.tsx +2 -4
- package/src/components/WebApplicationNavigatorProviderTestUtils.tsx +1 -2
- package/src/index.ts +3 -6
- package/src/stores/ApplicationStore.ts +27 -5
- package/src/stores/ApplicationStoreTestUtils.ts +3 -2
- package/src/stores/LambdaEditorState.ts +6 -4
- package/src/stores/WebApplicationNavigator.ts +7 -0
- package/tsconfig.json +3 -3
- package/lib/components/ApplicationBackdrop.d.ts.map +0 -1
- package/lib/components/ApplicationBackdrop.js +0 -20
- package/lib/components/ApplicationBackdrop.js.map +0 -1
- package/lib/components/NotificationSnackbar.d.ts.map +0 -1
- package/lib/components/NotificationSnackbar.js.map +0 -1
- package/lib/network/TelemetryEvent.d.ts +0 -19
- package/lib/network/TelemetryEvent.d.ts.map +0 -1
- package/lib/network/TelemetryEvent.js +0 -20
- package/lib/network/TelemetryEvent.js.map +0 -1
- package/src/network/TelemetryEvent.ts +0 -19
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { useRef, useEffect, useState, useMemo } from 'react';
|
|
18
|
-
import
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
editor as monacoEditorAPI,
|
|
20
|
+
type IDisposable,
|
|
21
|
+
type IKeyboardEvent,
|
|
22
|
+
} from 'monaco-editor';
|
|
20
23
|
import { observer } from 'mobx-react-lite';
|
|
21
24
|
import { useResizeDetector } from 'react-resize-detector';
|
|
22
25
|
import {
|
|
@@ -27,22 +30,23 @@ import {
|
|
|
27
30
|
baseTextEditorSettings,
|
|
28
31
|
getEditorValue,
|
|
29
32
|
normalizeLineEnding,
|
|
33
|
+
FilledWindowMaximizeIcon,
|
|
34
|
+
LongArrowAltDownIcon,
|
|
35
|
+
LongArrowAltUpIcon,
|
|
36
|
+
Dialog,
|
|
30
37
|
} from '@finos/legend-art';
|
|
31
|
-
import {
|
|
32
|
-
FaLongArrowAltDown,
|
|
33
|
-
FaLongArrowAltUp,
|
|
34
|
-
FaWindowMaximize,
|
|
35
|
-
} from 'react-icons/fa';
|
|
36
38
|
import type { LambdaEditorState } from '../stores/LambdaEditorState';
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
+
import {
|
|
40
|
+
debounce,
|
|
41
|
+
noop,
|
|
42
|
+
type DebouncedFunc,
|
|
43
|
+
type GeneratorFn,
|
|
44
|
+
} from '@finos/legend-shared';
|
|
39
45
|
import { flowResult } from 'mobx';
|
|
40
|
-
import type
|
|
41
|
-
import { ParserError } from '@finos/legend-graph';
|
|
46
|
+
import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
|
|
42
47
|
import { APPLICATION_TEST_ID } from './ApplicationTestID';
|
|
43
48
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
44
49
|
import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const';
|
|
45
|
-
import { Dialog } from '@material-ui/core';
|
|
46
50
|
|
|
47
51
|
export type LambdaEditorOnKeyDownEventHandler = {
|
|
48
52
|
matcher: (event: IKeyboardEvent) => boolean;
|
|
@@ -397,7 +401,7 @@ const LambdaEditorInline = observer(
|
|
|
397
401
|
tabIndex={-1}
|
|
398
402
|
title="Toggle Expand"
|
|
399
403
|
>
|
|
400
|
-
{isExpanded ? <
|
|
404
|
+
{isExpanded ? <LongArrowAltUpIcon /> : <LongArrowAltDownIcon />}
|
|
401
405
|
</button>
|
|
402
406
|
)}
|
|
403
407
|
{!disablePopUp && (
|
|
@@ -408,7 +412,7 @@ const LambdaEditorInline = observer(
|
|
|
408
412
|
tabIndex={-1}
|
|
409
413
|
title="Open..."
|
|
410
414
|
>
|
|
411
|
-
<
|
|
415
|
+
<FilledWindowMaximizeIcon />
|
|
412
416
|
</button>
|
|
413
417
|
)}
|
|
414
418
|
</div>
|
|
@@ -610,6 +614,7 @@ const LambdaEditorPopUp = observer(
|
|
|
610
614
|
<Dialog
|
|
611
615
|
open={true}
|
|
612
616
|
TransitionProps={{
|
|
617
|
+
appear: false, // disable transition
|
|
613
618
|
onEnter,
|
|
614
619
|
}}
|
|
615
620
|
onClose={noop} // disallow closing dialog by using Esc key or clicking on the backdrop
|
package/src/components/{ApplicationBackdrop.tsx → LegendApplicationComponentFrameworkProvider.tsx}
RENAMED
|
@@ -14,9 +14,22 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { LegendStyleProvider } from '@finos/legend-art';
|
|
18
|
+
import { ActionAlert } from './ActionAlert';
|
|
19
|
+
import { BlockingAlert } from './BlockingAlert';
|
|
20
|
+
import { NotificationManager } from './NotificationManager';
|
|
19
21
|
|
|
20
|
-
export const
|
|
21
|
-
|
|
22
|
-
)
|
|
22
|
+
export const LegendApplicationComponentFrameworkProvider: React.FC<{
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}> = (props) => {
|
|
25
|
+
const { children } = props;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<LegendStyleProvider>
|
|
29
|
+
<BlockingAlert />
|
|
30
|
+
<ActionAlert />
|
|
31
|
+
<NotificationManager />
|
|
32
|
+
{children}
|
|
33
|
+
</LegendStyleProvider>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -15,26 +15,28 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
-
import type { SnackbarCloseReason } from '@material-ui/core/Snackbar';
|
|
19
|
-
import Snackbar from '@material-ui/core/Snackbar';
|
|
20
|
-
import SnackbarContent from '@material-ui/core/SnackbarContent';
|
|
21
18
|
import {
|
|
22
19
|
DEFAULT_NOTIFICATION_HIDE_TIME,
|
|
23
20
|
NOTIFCATION_SEVERITY,
|
|
24
21
|
} from '../stores/ApplicationStore';
|
|
25
|
-
import {
|
|
26
|
-
FaTimes,
|
|
27
|
-
FaCheckCircle,
|
|
28
|
-
FaInfoCircle,
|
|
29
|
-
FaTimesCircle,
|
|
30
|
-
FaExclamationTriangle,
|
|
31
|
-
FaBug,
|
|
32
|
-
} from 'react-icons/fa';
|
|
33
22
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
34
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
Notification,
|
|
25
|
+
NotificationContent,
|
|
26
|
+
type NotificationCloseReason,
|
|
27
|
+
ChevronDownIcon,
|
|
28
|
+
ChevronUpIcon,
|
|
29
|
+
TimesIcon,
|
|
30
|
+
ExclamationTriangleIcon,
|
|
31
|
+
TimesCircleIcon,
|
|
32
|
+
CheckCircleIcon,
|
|
33
|
+
InfoCircleIcon,
|
|
34
|
+
BugIcon,
|
|
35
|
+
clsx,
|
|
36
|
+
} from '@finos/legend-art';
|
|
35
37
|
import { useState } from 'react';
|
|
36
38
|
|
|
37
|
-
export const
|
|
39
|
+
export const NotificationManager = observer(() => {
|
|
38
40
|
const applicationStore = useApplicationStore();
|
|
39
41
|
const notification = applicationStore.notification;
|
|
40
42
|
const isOpen = Boolean(notification);
|
|
@@ -43,35 +45,35 @@ export const NotificationSnackbar = observer(() => {
|
|
|
43
45
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
44
46
|
let notificationIcon = (
|
|
45
47
|
<div className="notification__message__content__icon notification__message__content__icon--info">
|
|
46
|
-
<
|
|
48
|
+
<InfoCircleIcon />
|
|
47
49
|
</div>
|
|
48
50
|
);
|
|
49
51
|
switch (severity) {
|
|
50
52
|
case NOTIFCATION_SEVERITY.ILEGAL_STATE:
|
|
51
53
|
notificationIcon = (
|
|
52
54
|
<div className="notification__message__content__icon notification__message__content__icon--error">
|
|
53
|
-
<
|
|
55
|
+
<BugIcon />
|
|
54
56
|
</div>
|
|
55
57
|
);
|
|
56
58
|
break;
|
|
57
59
|
case NOTIFCATION_SEVERITY.ERROR:
|
|
58
60
|
notificationIcon = (
|
|
59
61
|
<div className="notification__message__content__icon notification__message__content__icon--error">
|
|
60
|
-
<
|
|
62
|
+
<TimesCircleIcon />
|
|
61
63
|
</div>
|
|
62
64
|
);
|
|
63
65
|
break;
|
|
64
66
|
case NOTIFCATION_SEVERITY.WARNING:
|
|
65
67
|
notificationIcon = (
|
|
66
68
|
<div className="notification__message__content__icon notification__message__content__icon--warning">
|
|
67
|
-
<
|
|
69
|
+
<ExclamationTriangleIcon />
|
|
68
70
|
</div>
|
|
69
71
|
);
|
|
70
72
|
break;
|
|
71
73
|
case NOTIFCATION_SEVERITY.SUCCESS:
|
|
72
74
|
notificationIcon = (
|
|
73
75
|
<div className="notification__message__content__icon notification__message__content__icon--success">
|
|
74
|
-
<
|
|
76
|
+
<CheckCircleIcon />
|
|
75
77
|
</div>
|
|
76
78
|
);
|
|
77
79
|
break;
|
|
@@ -87,19 +89,22 @@ export const NotificationSnackbar = observer(() => {
|
|
|
87
89
|
const toggleExpansion = (): void => setIsExpanded(!isExpanded);
|
|
88
90
|
|
|
89
91
|
const onSnackbarAutoHideOrClickAway = (
|
|
90
|
-
event: React.SyntheticEvent<unknown
|
|
91
|
-
reason:
|
|
92
|
+
event: React.SyntheticEvent<unknown> | Event,
|
|
93
|
+
reason: NotificationCloseReason,
|
|
92
94
|
): void => {
|
|
93
95
|
// NOTE: we only should not allow dismissing the notification on click-away. First of call, this might not be desirable
|
|
94
96
|
// second, this clashes with modal that traps focus, e.g. when we have another modal open and want to show a notification
|
|
95
|
-
// the notification focus is stolen by the modal leading to the
|
|
97
|
+
// the notification focus is stolen by the modal leading to the notification immediately gets clicked-away and closed
|
|
96
98
|
if (reason === 'timeout') {
|
|
97
99
|
handleClose();
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
102
|
|
|
101
103
|
return (
|
|
102
|
-
<
|
|
104
|
+
<Notification
|
|
105
|
+
TransitionProps={{
|
|
106
|
+
appear: false,
|
|
107
|
+
}}
|
|
103
108
|
classes={{
|
|
104
109
|
root: 'notification',
|
|
105
110
|
anchorOriginBottomRight: 'notification__position',
|
|
@@ -125,7 +130,7 @@ export const NotificationSnackbar = observer(() => {
|
|
|
125
130
|
: ''
|
|
126
131
|
}
|
|
127
132
|
>
|
|
128
|
-
<
|
|
133
|
+
<NotificationContent
|
|
129
134
|
classes={{
|
|
130
135
|
root: 'notification__content',
|
|
131
136
|
message: 'notification__message',
|
|
@@ -163,10 +168,10 @@ export const NotificationSnackbar = observer(() => {
|
|
|
163
168
|
tabIndex={-1}
|
|
164
169
|
title={'Dismiss'}
|
|
165
170
|
>
|
|
166
|
-
<
|
|
171
|
+
<TimesIcon />
|
|
167
172
|
</button>,
|
|
168
173
|
]}
|
|
169
174
|
/>
|
|
170
|
-
</
|
|
175
|
+
</Notification>
|
|
171
176
|
);
|
|
172
177
|
});
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { useState, useRef, useEffect } from 'react';
|
|
18
|
-
import
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
type IDisposable,
|
|
20
|
+
type IKeyboardEvent,
|
|
21
|
+
editor as monacoEditorAPI,
|
|
22
|
+
} from 'monaco-editor';
|
|
20
23
|
import { useResizeDetector } from 'react-resize-detector';
|
|
21
24
|
import {
|
|
22
25
|
disposeEditor,
|
|
@@ -26,8 +29,7 @@ import {
|
|
|
26
29
|
getEditorValue,
|
|
27
30
|
normalizeLineEnding,
|
|
28
31
|
} from '@finos/legend-art';
|
|
29
|
-
import type
|
|
30
|
-
import { EDITOR_THEME, TAB_SIZE } from '../const';
|
|
32
|
+
import { type EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const';
|
|
31
33
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
32
34
|
|
|
33
35
|
export type TextInputEditorOnKeyDownEventHandler = {
|
|
@@ -25,11 +25,9 @@ const WebApplicationNavigatorContext = createContext<
|
|
|
25
25
|
WebApplicationNavigator | undefined
|
|
26
26
|
>(undefined);
|
|
27
27
|
|
|
28
|
-
export const WebApplicationNavigatorProvider
|
|
29
|
-
children,
|
|
30
|
-
}: {
|
|
28
|
+
export const WebApplicationNavigatorProvider: React.FC<{
|
|
31
29
|
children: React.ReactNode;
|
|
32
|
-
})
|
|
30
|
+
}> = ({ children }) => {
|
|
33
31
|
const history = useHistory() as History;
|
|
34
32
|
const navigator = useLocalObservable(
|
|
35
33
|
() => new WebApplicationNavigator(history),
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { createMemoryHistory } from 'history';
|
|
18
17
|
import { WebApplicationNavigator } from '../stores/WebApplicationNavigator';
|
|
19
|
-
import type
|
|
18
|
+
import { createMemoryHistory, type History } from 'history';
|
|
20
19
|
|
|
21
20
|
export const TEST__provideMockedWebApplicationNavigator = (customization?: {
|
|
22
21
|
mock?: WebApplicationNavigator;
|
package/src/index.ts
CHANGED
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
export * from './const';
|
|
18
18
|
|
|
19
|
+
export * from './application/LegendApplicationPluginManager';
|
|
19
20
|
export * from './application/LegendApplication';
|
|
20
21
|
|
|
21
22
|
export * from './components/ApplicationStoreProvider';
|
|
22
23
|
export * from './components/WebApplicationNavigatorProvider';
|
|
24
|
+
export * from './components/LegendApplicationComponentFrameworkProvider';
|
|
23
25
|
|
|
24
26
|
export * from './components/ApplicationStoreProviderTestUtils';
|
|
25
27
|
export * from './components/WebApplicationNavigatorProviderTestUtils';
|
|
28
|
+
|
|
26
29
|
export { AppHeader } from './components/AppHeader';
|
|
27
|
-
export { BlockingAlert } from './components/BlockingAlert';
|
|
28
|
-
export { ActionAlert } from './components/ActionAlert';
|
|
29
|
-
export { NotificationSnackbar } from './components/NotificationSnackbar';
|
|
30
|
-
export { ApplicationBackdrop } from './components/ApplicationBackdrop';
|
|
31
30
|
export * from './components/TextInputEditor';
|
|
32
31
|
export * from './components/LambdaEditor';
|
|
33
32
|
|
|
@@ -41,5 +40,3 @@ export * from './stores/PackageableElementOption';
|
|
|
41
40
|
export { GRAMMAR_ELEMENT_TYPE_LABEL } from './stores/PureLanguageSupport';
|
|
42
41
|
|
|
43
42
|
export * from './stores/ApplicationStoreTestUtils';
|
|
44
|
-
|
|
45
|
-
export * from './network/TelemetryEvent';
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import type { Log, SuperGenericFunction } from '@finos/legend-shared';
|
|
18
17
|
import {
|
|
18
|
+
type SuperGenericFunction,
|
|
19
|
+
EventNotifierService,
|
|
20
|
+
TracerService,
|
|
21
|
+
TelemetryService,
|
|
19
22
|
assertTrue,
|
|
23
|
+
Log,
|
|
20
24
|
LogEvent,
|
|
21
25
|
assertErrorThrown,
|
|
22
26
|
isString,
|
|
@@ -26,6 +30,7 @@ import { makeAutoObservable, action } from 'mobx';
|
|
|
26
30
|
import { APPLICATION_LOG_EVENT } from './ApplicationLogEvent';
|
|
27
31
|
import type { LegendApplicationConfig } from './ApplicationConfig';
|
|
28
32
|
import type { WebApplicationNavigator } from './WebApplicationNavigator';
|
|
33
|
+
import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager';
|
|
29
34
|
|
|
30
35
|
export enum ActionAlertType {
|
|
31
36
|
STANDARD = 'STANDARD',
|
|
@@ -97,12 +102,20 @@ export class Notification {
|
|
|
97
102
|
export class ApplicationStore<T extends LegendApplicationConfig> {
|
|
98
103
|
navigator: WebApplicationNavigator;
|
|
99
104
|
notification?: Notification | undefined;
|
|
100
|
-
log: Log;
|
|
101
105
|
blockingAlertInfo?: BlockingAlertInfo | undefined;
|
|
102
106
|
actionAlertInfo?: ActionAlertInfo | undefined;
|
|
103
107
|
config: T;
|
|
104
108
|
|
|
105
|
-
|
|
109
|
+
log: Log = new Log();
|
|
110
|
+
telemetryService = new TelemetryService();
|
|
111
|
+
tracerService = new TracerService();
|
|
112
|
+
eventNotifierService = new EventNotifierService();
|
|
113
|
+
|
|
114
|
+
constructor(
|
|
115
|
+
config: T,
|
|
116
|
+
navigator: WebApplicationNavigator,
|
|
117
|
+
pluginManager: LegendApplicationPluginManager,
|
|
118
|
+
) {
|
|
106
119
|
makeAutoObservable(this, {
|
|
107
120
|
navigator: false,
|
|
108
121
|
setBlockingAlert: action,
|
|
@@ -117,7 +130,16 @@ export class ApplicationStore<T extends LegendApplicationConfig> {
|
|
|
117
130
|
|
|
118
131
|
this.config = config;
|
|
119
132
|
this.navigator = navigator;
|
|
120
|
-
|
|
133
|
+
|
|
134
|
+
// Register plugins
|
|
135
|
+
this.log.registerPlugins(pluginManager.getLoggerPlugins());
|
|
136
|
+
this.telemetryService.registerPlugins(
|
|
137
|
+
pluginManager.getTelemetryServicePlugins(),
|
|
138
|
+
);
|
|
139
|
+
this.tracerService.registerPlugins(pluginManager.getTracerServicePlugins());
|
|
140
|
+
this.eventNotifierService.registerPlugins(
|
|
141
|
+
pluginManager.getEventNotifierPlugins(),
|
|
142
|
+
);
|
|
121
143
|
}
|
|
122
144
|
|
|
123
145
|
setBlockingAlert(alertInfo: BlockingAlertInfo | undefined): void {
|
|
@@ -208,7 +230,7 @@ export class ApplicationStore<T extends LegendApplicationConfig> {
|
|
|
208
230
|
notifyError(content: Error | string, actions?: NotificationAction[]): void {
|
|
209
231
|
let message: string | undefined;
|
|
210
232
|
if (content instanceof ApplicationError) {
|
|
211
|
-
message = content.
|
|
233
|
+
message = content.detail;
|
|
212
234
|
} else if (content instanceof Error) {
|
|
213
235
|
message = content.message;
|
|
214
236
|
} else {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
import { ApplicationStore } from './ApplicationStore';
|
|
18
18
|
import { createBrowserHistory } from 'history';
|
|
19
19
|
import { WebApplicationNavigator } from './WebApplicationNavigator';
|
|
20
|
-
import { Log } from '@finos/legend-shared';
|
|
21
20
|
import type { LegendApplicationConfig } from './ApplicationConfig';
|
|
21
|
+
import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager';
|
|
22
22
|
|
|
23
23
|
export const TEST_DATA__applicationVersion = {
|
|
24
24
|
buildTime: '2001-01-01T00:00:00-0000',
|
|
@@ -30,9 +30,10 @@ export const TEST__getTestApplicationStore = <
|
|
|
30
30
|
T extends LegendApplicationConfig,
|
|
31
31
|
>(
|
|
32
32
|
config: T,
|
|
33
|
+
pluginManager: LegendApplicationPluginManager,
|
|
33
34
|
): ApplicationStore<T> =>
|
|
34
35
|
new ApplicationStore(
|
|
35
36
|
config,
|
|
36
37
|
new WebApplicationNavigator(createBrowserHistory()),
|
|
37
|
-
|
|
38
|
+
pluginManager,
|
|
38
39
|
);
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observable, action, computed, makeObservable, flow } from 'mobx';
|
|
18
|
-
import type
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
import { type GeneratorFn, uuid } from '@finos/legend-shared';
|
|
19
|
+
import {
|
|
20
|
+
type ParserError,
|
|
21
|
+
type CompilationError,
|
|
22
|
+
SourceInformation,
|
|
23
|
+
} from '@finos/legend-graph';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* This is not strictly meant for lambda. The idea is to create an editor that allows
|
|
@@ -34,6 +34,13 @@ import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
|
34
34
|
*
|
|
35
35
|
* As such, instead, we should design a more generic concept `Location` to pass around.
|
|
36
36
|
* We would need to flesh out the details, but this is the rough idea.
|
|
37
|
+
*
|
|
38
|
+
* Another thought is that we should also generalize Router so it handles more than just
|
|
39
|
+
* URLs. If we make `router` and `navigator` work together, we can potentially generalize
|
|
40
|
+
* application navigation
|
|
41
|
+
*
|
|
42
|
+
* However, this depends on how and when we move to another platform, like `electron` for example
|
|
43
|
+
* See https://github.com/finos/legend-studio/issues/718
|
|
37
44
|
*/
|
|
38
45
|
interface ApplicationNavigator<T> {
|
|
39
46
|
reload(): void;
|
package/tsconfig.json
CHANGED
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"./src/const.ts",
|
|
35
35
|
"./src/index.ts",
|
|
36
36
|
"./src/components/ApplicationTestID.ts",
|
|
37
|
-
"./src/network/TelemetryEvent.ts",
|
|
38
37
|
"./src/stores/ApplicationConfig.ts",
|
|
39
38
|
"./src/stores/ApplicationLogEvent.ts",
|
|
40
39
|
"./src/stores/ApplicationStore.ts",
|
|
@@ -44,14 +43,15 @@
|
|
|
44
43
|
"./src/stores/PureLanguageSupport.ts",
|
|
45
44
|
"./src/stores/WebApplicationNavigator.ts",
|
|
46
45
|
"./src/application/LegendApplication.tsx",
|
|
46
|
+
"./src/application/LegendApplicationPluginManager.tsx",
|
|
47
47
|
"./src/components/ActionAlert.tsx",
|
|
48
48
|
"./src/components/AppHeader.tsx",
|
|
49
|
-
"./src/components/ApplicationBackdrop.tsx",
|
|
50
49
|
"./src/components/ApplicationStoreProvider.tsx",
|
|
51
50
|
"./src/components/ApplicationStoreProviderTestUtils.tsx",
|
|
52
51
|
"./src/components/BlockingAlert.tsx",
|
|
53
52
|
"./src/components/LambdaEditor.tsx",
|
|
54
|
-
"./src/components/
|
|
53
|
+
"./src/components/LegendApplicationComponentFrameworkProvider.tsx",
|
|
54
|
+
"./src/components/NotificationManager.tsx",
|
|
55
55
|
"./src/components/TextInputEditor.tsx",
|
|
56
56
|
"./src/components/WebApplicationNavigatorProvider.tsx",
|
|
57
57
|
"./src/components/WebApplicationNavigatorProviderTestUtils.tsx"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationBackdrop.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationBackdrop.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,eAAO,MAAM,mBAAmB,WAAoB;IAAE,MAAM,OAAO,CAAA;CAAE;;CAEnE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Backdrop } from '@material-ui/core';
|
|
18
|
-
import { observer } from 'mobx-react-lite';
|
|
19
|
-
export const ApplicationBackdrop = observer((props) => (_jsx(Backdrop, { className: "backdrop", open: props.open }, void 0)));
|
|
20
|
-
//# sourceMappingURL=ApplicationBackdrop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationBackdrop.js","sourceRoot":"","sources":["../../src/components/ApplicationBackdrop.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,CAAC,KAAwB,EAAE,EAAE,CAAC,CACxE,KAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,WAAI,CACpD,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationSnackbar.d.ts","sourceRoot":"","sources":["../../src/components/NotificationSnackbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,eAAO,MAAM,oBAAoB;;CAuI/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationSnackbar.js","sourceRoot":"","sources":["../../src/components/NotificationSnackbar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,GAAG,EAAE;IAChD,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,YAAY,GAAG,gBAAgB,CAAC,YAAY,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;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BAAsB,EAEhC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,CAAC,EACZ,KAAK,EAAE,SAAS,YAEhB,KAAC,OAAO,aAAG,IALP,OAAO,CAMJ;aACV,WACD,IA9CA,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;QACxD,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,EAAE,CA6CC,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,19 +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
|
-
export declare enum CORE_TELEMETRY_EVENT {
|
|
17
|
-
APPLICATION_LOADED = "Application loaded"
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=TelemetryEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryEvent.d.ts","sourceRoot":"","sources":["../../src/network/TelemetryEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,oBAAoB;IAC9B,kBAAkB,uBAAuB;CAC1C"}
|
|
@@ -1,20 +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
|
-
export var CORE_TELEMETRY_EVENT;
|
|
17
|
-
(function (CORE_TELEMETRY_EVENT) {
|
|
18
|
-
CORE_TELEMETRY_EVENT["APPLICATION_LOADED"] = "Application loaded";
|
|
19
|
-
})(CORE_TELEMETRY_EVENT || (CORE_TELEMETRY_EVENT = {}));
|
|
20
|
-
//# sourceMappingURL=TelemetryEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryEvent.js","sourceRoot":"","sources":["../../src/network/TelemetryEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC9B,iEAAyC,CAAA;AAC3C,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,QAE/B"}
|
|
@@ -1,19 +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
|
-
export enum CORE_TELEMETRY_EVENT {
|
|
18
|
-
APPLICATION_LOADED = 'Application loaded',
|
|
19
|
-
}
|