@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @finos/legend-application
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#788](https://github.com/finos/legend-studio/pull/788) [`ca293f83`](https://github.com/finos/legend-studio/commit/ca293f83e554f488f58ee77249838b6b87a3e3da) ([@akphi](https://github.com/akphi)) - Rename `notification snackbar` to `notification manager`. Bundle `notification manager`, `blocking alert`, and `action alert` as well as `LegendStyleProvider` into `LegendApplicationComponentFrameworkProvider`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#768](https://github.com/finos/legend-studio/pull/768) [`f2927570`](https://github.com/finos/legend-studio/commit/f2927570b2afdc2954912bdbb20058606d2cf8bc) ([@gayathrir11](https://github.com/gayathrir11)) - Handle empty error messages from Engine.
|
|
12
|
+
|
|
13
|
+
## 1.0.3
|
|
14
|
+
|
|
15
|
+
## 1.0.2
|
|
16
|
+
|
|
17
|
+
## 1.0.1
|
|
18
|
+
|
|
19
|
+
## 1.0.0
|
|
20
|
+
|
|
21
|
+
### Major Changes
|
|
22
|
+
|
|
23
|
+
- [#707](https://github.com/finos/legend-studio/pull/707) [`5d9912d9`](https://github.com/finos/legend-studio/commit/5d9912d9a2c883e23d8852325a25fe59ae7597b1) ([@akphi](https://github.com/akphi)) - **BREAKING CHANGE:** Loggers are now considered as plugins, as such, we nolonger expose `.withLoggers()` when booting the application.
|
|
24
|
+
|
|
25
|
+
* [#707](https://github.com/finos/legend-studio/pull/707) [`5d9912d9`](https://github.com/finos/legend-studio/commit/5d9912d9a2c883e23d8852325a25fe59ae7597b1) ([@akphi](https://github.com/akphi)) - **BREAKING CHANGE:** Create a new abstract class `LegendApplicationPluginManager` that contains plugins that is relevant at application level, such as `telemetry`, `tracer`, `logger`, etc. Now all specific Legend applications plugin manager must extend this class, e.g. `LegendStudioPluginManager extends LegendApplicationPluginManager`.
|
|
26
|
+
|
|
3
27
|
## 0.2.2
|
|
4
28
|
|
|
5
29
|
## 0.2.1
|
|
@@ -14,35 +14,46 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { LegendApplicationConfig, LegendApplicationConfigurationData, LegendApplicationVersionData } from '../stores/ApplicationConfig';
|
|
17
|
-
import type
|
|
18
|
-
import { Log } from '@finos/legend-shared';
|
|
17
|
+
import { type AbstractPlugin, type AbstractPreset, LogEvent } from '@finos/legend-shared';
|
|
19
18
|
import type { GraphPluginManager } from '@finos/legend-graph';
|
|
19
|
+
import type { LegendApplicationPluginManager } from './LegendApplicationPluginManager';
|
|
20
|
+
export declare abstract class LegendApplicationLogger {
|
|
21
|
+
abstract debug(event: LogEvent, ...data: unknown[]): void;
|
|
22
|
+
abstract info(event: LogEvent, ...data: unknown[]): void;
|
|
23
|
+
abstract warn(event: LogEvent, ...data: unknown[]): void;
|
|
24
|
+
abstract error(event: LogEvent, ...data: unknown[]): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class LegendApplicationWebConsole extends LegendApplicationLogger {
|
|
27
|
+
debug(event: LogEvent, ...data: unknown[]): void;
|
|
28
|
+
info(event: LogEvent, ...data: unknown[]): void;
|
|
29
|
+
warn(event: LogEvent, ...data: unknown[]): void;
|
|
30
|
+
error(event: LogEvent, ...data: unknown[]): void;
|
|
31
|
+
}
|
|
20
32
|
export declare const setupTextEdtiorAPI: (pluginManager: GraphPluginManager) => void;
|
|
21
|
-
export declare const setupLegendApplicationUILibrary: (pluginManager: GraphPluginManager,
|
|
33
|
+
export declare const setupLegendApplicationUILibrary: (pluginManager: GraphPluginManager, logger: LegendApplicationLogger) => Promise<void>;
|
|
22
34
|
export declare abstract class LegendApplication {
|
|
23
35
|
protected config: LegendApplicationConfig;
|
|
24
|
-
protected
|
|
36
|
+
protected logger: LegendApplicationLogger;
|
|
37
|
+
protected pluginManager: LegendApplicationPluginManager;
|
|
25
38
|
protected basePresets: AbstractPreset[];
|
|
26
39
|
protected basePlugins: AbstractPlugin[];
|
|
27
|
-
protected log: Log;
|
|
28
40
|
protected baseUrl: string;
|
|
29
|
-
protected pluginRegister?: ((pluginManager:
|
|
41
|
+
protected pluginRegister?: ((pluginManager: LegendApplicationPluginManager, config: LegendApplicationConfig) => void) | undefined;
|
|
30
42
|
protected _isConfigured: boolean;
|
|
31
|
-
protected constructor(pluginManager:
|
|
43
|
+
protected constructor(pluginManager: LegendApplicationPluginManager);
|
|
32
44
|
setup(options: {
|
|
33
45
|
/** Base URL of the application. e.g. /studio/, /query/ */
|
|
34
46
|
baseUrl: string;
|
|
35
47
|
/**
|
|
36
|
-
* Provide an alternative mechanism to register plugins and presets
|
|
37
|
-
* by allowing configuring specific plugin or preset.
|
|
48
|
+
* Provide an alternative mechanism to register and configure plugins and presets
|
|
49
|
+
* which is more flexible by allowing configuring specific plugin or preset.
|
|
38
50
|
*/
|
|
39
|
-
pluginRegister?: (pluginManager:
|
|
51
|
+
pluginRegister?: (pluginManager: LegendApplicationPluginManager, config: LegendApplicationConfig) => void;
|
|
40
52
|
}): LegendApplication;
|
|
41
53
|
protected withBasePresets(presets: AbstractPreset[]): LegendApplication;
|
|
42
54
|
protected withBasePlugins(plugins: AbstractPlugin[]): LegendApplication;
|
|
43
55
|
withPresets(presets: AbstractPreset[]): LegendApplication;
|
|
44
56
|
withPlugins(plugins: AbstractPlugin[]): LegendApplication;
|
|
45
|
-
withLoggers(loggers: Logger[]): LegendApplication;
|
|
46
57
|
fetchApplicationConfiguration(baseUrl: string): Promise<[LegendApplicationConfig, Record<PropertyKey, object>]>;
|
|
47
58
|
protected abstract configureApplication(configData: LegendApplicationConfigurationData, versionData: LegendApplicationVersionData, baseUrl: string): Promise<LegendApplicationConfig>;
|
|
48
59
|
protected abstract loadApplication(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendApplication.d.ts","sourceRoot":"","sources":["../../src/application/LegendApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,KAAK,EACV,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"LegendApplication.d.ts","sourceRoot":"","sources":["../../src/application/LegendAp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AAkC,EAC9C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC;IAEnC,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAE7C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CA+B7B"}
|
|
@@ -17,9 +17,26 @@ import { configure as configureMobx } from 'mobx';
|
|
|
17
17
|
import { editor as monacoEditorAPI, languages as monacoLanguagesAPI, } from 'monaco-editor';
|
|
18
18
|
import { configuration, generateLanguageMonarch, theme, } from '../stores/PureLanguageSupport';
|
|
19
19
|
import { EDITOR_THEME, EDITOR_LANGUAGE, MONOSPACED_FONT_FAMILY, } from '../const';
|
|
20
|
-
import { assertErrorThrown, LogEvent,
|
|
20
|
+
import { assertErrorThrown, LogEvent, guaranteeNonEmptyString, assertNonNullable, NetworkClient, } from '@finos/legend-shared';
|
|
21
21
|
import { APPLICATION_LOG_EVENT } from '../stores/ApplicationLogEvent';
|
|
22
22
|
import { configureComponents } from '@finos/legend-art';
|
|
23
|
+
export class LegendApplicationLogger {
|
|
24
|
+
}
|
|
25
|
+
const { debug, info, warn, error } = console;
|
|
26
|
+
export class LegendApplicationWebConsole extends LegendApplicationLogger {
|
|
27
|
+
debug(event, ...data) {
|
|
28
|
+
debug(`[${event.timestamp}] ${event.name} ${data.length ? ':' : ''}`, ...data);
|
|
29
|
+
}
|
|
30
|
+
info(event, ...data) {
|
|
31
|
+
info(`[${event.timestamp}] ${event.name} ${data.length ? ':' : ''}`, ...data);
|
|
32
|
+
}
|
|
33
|
+
warn(event, ...data) {
|
|
34
|
+
warn(`[${event.timestamp}] ${event.name} ${data.length ? ':' : ''}`, ...data);
|
|
35
|
+
}
|
|
36
|
+
error(event, ...data) {
|
|
37
|
+
error(`[${event.timestamp}] ${event.name} ${data.length ? ':' : ''}`, ...data);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
23
40
|
export const setupTextEdtiorAPI = (pluginManager) => {
|
|
24
41
|
// Register Pure as a language in `monaco-editor`
|
|
25
42
|
monacoEditorAPI.defineTheme(EDITOR_THEME.LEGEND, theme);
|
|
@@ -34,7 +51,7 @@ export const setupTextEdtiorAPI = (pluginManager) => {
|
|
|
34
51
|
// This is not considered side-effect that hinders tree-shaking because the effectful calls
|
|
35
52
|
// are embedded in the function
|
|
36
53
|
// See https://sgom.es/posts/2020-06-15-everything-you-never-wanted-to-know-about-side-effects/
|
|
37
|
-
export const setupLegendApplicationUILibrary = async (pluginManager,
|
|
54
|
+
export const setupLegendApplicationUILibrary = async (pluginManager, logger) => {
|
|
38
55
|
setupTextEdtiorAPI(pluginManager);
|
|
39
56
|
/**
|
|
40
57
|
* Since we use a custom fonts for text-editor, we want to make sure the font is loaded before any text-editor is opened
|
|
@@ -46,13 +63,13 @@ export const setupLegendApplicationUILibrary = async (pluginManager, log) => {
|
|
|
46
63
|
.then(() => {
|
|
47
64
|
if (document.fonts.check(`1em ${MONOSPACED_FONT_FAMILY}`)) {
|
|
48
65
|
monacoEditorAPI.remeasureFonts();
|
|
49
|
-
|
|
66
|
+
logger.info(LogEvent.create(APPLICATION_LOG_EVENT.TEXT_EDITOR_FONT_LOADED), `Monospaced font '${MONOSPACED_FONT_FAMILY}' has been loaded`);
|
|
50
67
|
}
|
|
51
68
|
else {
|
|
52
|
-
|
|
69
|
+
logger.error(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_SETUP_FAILURE), fontLoadFailureErrorMessage);
|
|
53
70
|
}
|
|
54
71
|
})
|
|
55
|
-
.catch(() =>
|
|
72
|
+
.catch(() => logger.error(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_SETUP_FAILURE), fontLoadFailureErrorMessage));
|
|
56
73
|
configureMobx({
|
|
57
74
|
// Force state modification to be done via actions
|
|
58
75
|
// See https://github.com/mobxjs/mobx/blob/gh-pages/docs/refguide/api.md#enforceactions
|
|
@@ -62,15 +79,16 @@ export const setupLegendApplicationUILibrary = async (pluginManager, log) => {
|
|
|
62
79
|
};
|
|
63
80
|
export class LegendApplication {
|
|
64
81
|
config;
|
|
82
|
+
logger;
|
|
65
83
|
pluginManager;
|
|
66
84
|
basePresets = [];
|
|
67
85
|
basePlugins = [];
|
|
68
|
-
log = new Log();
|
|
69
86
|
baseUrl;
|
|
70
87
|
pluginRegister;
|
|
71
88
|
_isConfigured = false;
|
|
72
89
|
constructor(pluginManager) {
|
|
73
90
|
this.pluginManager = pluginManager;
|
|
91
|
+
this.logger = new LegendApplicationWebConsole();
|
|
74
92
|
}
|
|
75
93
|
setup(options) {
|
|
76
94
|
this.baseUrl = guaranteeNonEmptyString(options.baseUrl, `Can't setup application: 'baseUrl' is missing or empty`);
|
|
@@ -94,10 +112,6 @@ export class LegendApplication {
|
|
|
94
112
|
this.pluginManager.usePlugins([...this.basePlugins, ...plugins]);
|
|
95
113
|
return this;
|
|
96
114
|
}
|
|
97
|
-
withLoggers(loggers) {
|
|
98
|
-
loggers.forEach((logger) => this.log.registerLogger(logger));
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
115
|
async fetchApplicationConfiguration(baseUrl) {
|
|
102
116
|
const client = new NetworkClient();
|
|
103
117
|
let configData;
|
|
@@ -106,7 +120,7 @@ export class LegendApplication {
|
|
|
106
120
|
}
|
|
107
121
|
catch (error) {
|
|
108
122
|
assertErrorThrown(error);
|
|
109
|
-
this.
|
|
123
|
+
this.logger.error(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_CONFIGURATION_FAILURE), error);
|
|
110
124
|
}
|
|
111
125
|
assertNonNullable(configData, `Can't fetch Legend application configuration`);
|
|
112
126
|
let versionData;
|
|
@@ -115,7 +129,7 @@ export class LegendApplication {
|
|
|
115
129
|
}
|
|
116
130
|
catch (error) {
|
|
117
131
|
assertErrorThrown(error);
|
|
118
|
-
this.
|
|
132
|
+
this.logger.error(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_CONFIGURATION_FAILURE), error);
|
|
119
133
|
}
|
|
120
134
|
assertNonNullable(versionData, `Can't fetch Legend application version`);
|
|
121
135
|
return [
|
|
@@ -134,11 +148,11 @@ export class LegendApplication {
|
|
|
134
148
|
this.pluginManager.configure(extensionConfigData);
|
|
135
149
|
this.pluginManager.install();
|
|
136
150
|
await this.loadApplication();
|
|
137
|
-
this.
|
|
151
|
+
this.logger.info(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_LOADED), 'Legend application loaded');
|
|
138
152
|
}
|
|
139
153
|
catch (error) {
|
|
140
154
|
assertErrorThrown(error);
|
|
141
|
-
this.
|
|
155
|
+
this.logger.error(LogEvent.create(APPLICATION_LOG_EVENT.APPLICATION_FAILURE), 'Failed to load Legend application');
|
|
142
156
|
throw error;
|
|
143
157
|
}
|
|
144
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendApplication.js","sourceRoot":"","sources":["../../src/application/LegendApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,SAAS,IAAI,kBAAkB,GAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,GACN,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendApplication.js","sourceRoot":"","sources":["../../src/application/LegendApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,SAAS,IAAI,kBAAkB,GAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,GACN,MAAM,+BAA+B,CAAC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CAAC;SACb;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import { type EventNotifierPlugin, type EventNotifierServicePluginManager, type LoggerPlugin, type LoggerPluginManager, type TelemetryServicePlugin, type TelemetryServicePluginManager, type TracerServicePlugin, type TracerServicePluginManager, AbstractPluginManager } from '@finos/legend-shared';
|
|
17
|
+
export declare class LegendApplicationPluginManager extends AbstractPluginManager implements LoggerPluginManager, TelemetryServicePluginManager, TracerServicePluginManager, EventNotifierServicePluginManager {
|
|
18
|
+
protected loggerPlugins: LoggerPlugin[];
|
|
19
|
+
protected telemetryServicePlugins: TelemetryServicePlugin[];
|
|
20
|
+
protected tracerServicePlugins: TracerServicePlugin<unknown>[];
|
|
21
|
+
protected eventNotifierPlugins: EventNotifierPlugin[];
|
|
22
|
+
registerLoggerPlugin(plugin: LoggerPlugin): void;
|
|
23
|
+
registerTelemetryServicePlugin(plugin: TelemetryServicePlugin): void;
|
|
24
|
+
registerTracerServicePlugin(plugin: TracerServicePlugin<unknown>): void;
|
|
25
|
+
registerEventNotifierPlugin(plugin: EventNotifierPlugin): void;
|
|
26
|
+
getLoggerPlugins(): LoggerPlugin[];
|
|
27
|
+
getTelemetryServicePlugins(): TelemetryServicePlugin[];
|
|
28
|
+
getTracerServicePlugins(): TracerServicePlugin<unknown>[];
|
|
29
|
+
getEventNotifierPlugins(): EventNotifierPlugin[];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=LegendApplicationPluginManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendApplicationPluginManager.d.ts","sourceRoot":"","sources":["../../src/application/LegendApplicationPluginManager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EACtC,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,8BACX,SAAQ,qBACR,YACE,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,iCAAiC;IAEnC,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAC7C,SAAS,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,CAAM;IACjE,SAAS,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAM;IACpE,SAAS,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAAM;IAE3D,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAIhD,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAIpE,2BAA2B,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,IAAI;IAIvE,2BAA2B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAI9D,gBAAgB,IAAI,YAAY,EAAE;IAIlC,0BAA0B,IAAI,sBAAsB,EAAE;IAItD,uBAAuB,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;IAIzD,uBAAuB,IAAI,mBAAmB,EAAE;CAGjD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
import { AbstractPluginManager, } from '@finos/legend-shared';
|
|
17
|
+
export class LegendApplicationPluginManager extends AbstractPluginManager {
|
|
18
|
+
loggerPlugins = [];
|
|
19
|
+
telemetryServicePlugins = [];
|
|
20
|
+
tracerServicePlugins = [];
|
|
21
|
+
eventNotifierPlugins = [];
|
|
22
|
+
registerLoggerPlugin(plugin) {
|
|
23
|
+
this.loggerPlugins.push(plugin);
|
|
24
|
+
}
|
|
25
|
+
registerTelemetryServicePlugin(plugin) {
|
|
26
|
+
this.telemetryServicePlugins.push(plugin);
|
|
27
|
+
}
|
|
28
|
+
registerTracerServicePlugin(plugin) {
|
|
29
|
+
this.tracerServicePlugins.push(plugin);
|
|
30
|
+
}
|
|
31
|
+
registerEventNotifierPlugin(plugin) {
|
|
32
|
+
this.eventNotifierPlugins.push(plugin);
|
|
33
|
+
}
|
|
34
|
+
getLoggerPlugins() {
|
|
35
|
+
return [...this.loggerPlugins];
|
|
36
|
+
}
|
|
37
|
+
getTelemetryServicePlugins() {
|
|
38
|
+
return [...this.telemetryServicePlugins];
|
|
39
|
+
}
|
|
40
|
+
getTracerServicePlugins() {
|
|
41
|
+
return [...this.tracerServicePlugins];
|
|
42
|
+
}
|
|
43
|
+
getEventNotifierPlugins() {
|
|
44
|
+
return [...this.eventNotifierPlugins];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=LegendApplicationPluginManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendApplicationPluginManager.js","sourceRoot":"","sources":["../../src/application/LegendApplicationPluginManager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EASL,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,8BACX,SAAQ,qBAAqB;IAOnB,aAAa,GAAmB,EAAE,CAAC;IACnC,uBAAuB,GAA6B,EAAE,CAAC;IACvD,oBAAoB,GAAmC,EAAE,CAAC;IAC1D,oBAAoB,GAA0B,EAAE,CAAC;IAE3D,oBAAoB,CAAC,MAAoB;QACvC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,8BAA8B,CAAC,MAA8B;QAC3D,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,2BAA2B,CAAC,MAAoC;QAC9D,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,2BAA2B,CAAC,MAA2B;QACrD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;QACd,OAAO,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,0BAA0B;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,uBAAuB;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,uBAAuB;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionAlert.d.ts","sourceRoot":"","sources":["../../src/components/ActionAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"ActionAlert.d.ts","sourceRoot":"","sources":["../../src/components/ActionAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AA4GH,eAAO,MAAM,WAAW;;CAQtB,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import Dialog from '@
|
|
17
|
+
import { Dialog } from '@finos/legend-art';
|
|
18
18
|
import { ActionAlertActionType, ActionAlertType, } from '../stores/ApplicationStore';
|
|
19
19
|
import { observer } from 'mobx-react-lite';
|
|
20
20
|
import { noop } from '@finos/legend-shared';
|
|
@@ -47,6 +47,7 @@ const ActionAlertInner = observer((props) => {
|
|
|
47
47
|
handleSubmit();
|
|
48
48
|
};
|
|
49
49
|
return (_jsx(Dialog, { open: Boolean(applicationStore.actionAlertInfo), onClose: noop, TransitionProps: {
|
|
50
|
+
appear: false,
|
|
50
51
|
onEnter: handleEnter,
|
|
51
52
|
}, children: _jsxs("form", { onSubmit: onSubmit, className: `modal search-modal modal--dark blocking-alert blocking-alert--${(type ?? ActionAlertType.STANDARD).toLowerCase()}`, children: [title && (_jsx("div", { className: "modal__header", children: _jsx("div", { className: "modal__title", children: _jsx("div", { className: "modal__title__label", children: title }, void 0) }, void 0) }, void 0)), _jsxs("div", { className: "modal__body", children: [_jsx("div", { className: "blocking-alert__summary-text", children: message }, void 0), _jsx("div", { className: "blocking-alert__prompt-text", children: prompt }, void 0)] }, void 0), _jsxs("div", { className: "modal__footer", children: [actions.map((action) => {
|
|
52
53
|
// NOTE: need to prevent default for the submit button, otherwise, we would get the warning "Form submission canceled because the form is not connected"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionAlert.js","sourceRoot":"","sources":["../../src/components/ActionAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionAlert.js","sourceRoot":"","sources":["../../src/components/ActionAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,eAAe,GAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,wBAAwB,GAAG,CAAC,IAA2B,EAAU,EAAE;IACvE,QAAQ,IAAI,EAAE;QACZ,KAAK,qBAAqB,CAAC,oBAAoB;YAC7C,OAAO,cAAc,CAAC;QACxB,KAAK,qBAAqB,CAAC,OAAO,CAAC;QACnC,KAAK,qBAAqB,CAAC,QAAQ,CAAC;QACpC;YACE,OAAO,WAAW,CAAC;KACtB;AACH,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAC,KAAgC,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzE,MAAM,WAAW,GAAG,GAAS,EAAE;QAC7B,OAAO,EAAE,EAAE,CAAC;QACZ,gBAAgB,CAAC,m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C;gCACnB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;gCACnB,WAAW,EAAE,CAAC;4BAChB,CAAC,CAAC;4BACF,OAAO,CACL,iBAEE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAC1C,SAAS,EAAE,iBAAiB,wBAAwB,CAClD,MAAM,CAAC,IAAI,IAAI,qBAAqB,CAAC,QAAQ,CAC9C,EAAE,EACH,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAGjC,MAAM,CAAC,KAAK,IATR,MAAM,CAAC,KAAK,CAUV,CACV,CAAC;wBACJ,CAAC,CAAC,EACD,CAAC,OAAO,CAAC,MAAM,IAAI,CAClB,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,gDAAgD,EAC1D,OAAO,EAAE,WAAW,+BAGb,CACV,YACG,YACD,WACA,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE;IACvC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,eAAe,GAAG,gBAAgB,CAAC,eAAe,CAAC;IAEzD,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAC,gBAAgB,IAAC,IAAI,EAAE,eAAe,WAAI,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
|
@@ -15,13 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ApplicationStore } from '../stores/ApplicationStore';
|
|
17
17
|
import type { LegendApplicationConfig } from '../stores/ApplicationConfig';
|
|
18
|
-
import type {
|
|
19
|
-
|
|
20
|
-
export declare const ApplicationStoreProvider: <T extends LegendApplicationConfig>({ children, config, navigator, log, }: {
|
|
18
|
+
import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager';
|
|
19
|
+
export declare const ApplicationStoreProvider: <T extends LegendApplicationConfig>({ children, config, pluginManager, }: {
|
|
21
20
|
children: React.ReactNode;
|
|
22
21
|
config: T;
|
|
23
|
-
|
|
24
|
-
log: Log;
|
|
22
|
+
pluginManager: LegendApplicationPluginManager;
|
|
25
23
|
}) => React.ReactElement;
|
|
26
24
|
export declare const useApplicationStore: <T extends LegendApplicationConfig>() => ApplicationStore<T>;
|
|
27
25
|
//# sourceMappingURL=ApplicationStoreProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStoreProvider.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationStoreProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationStoreProvider.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationStoreProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAMpG,eAAO,MAAM,wBAAwB;cAKzB,MAAM,SAAS;;mBAEV,8BAA8B;MAC3C,MAAM,YAUT,CAAC;AAEF,eAAO,MAAM,mBAAmB,8DAM7B,CAAC"}
|
|
@@ -18,9 +18,11 @@ import { createContext, useContext } from 'react';
|
|
|
18
18
|
import { useLocalObservable } from 'mobx-react-lite';
|
|
19
19
|
import { ApplicationStore } from '../stores/ApplicationStore';
|
|
20
20
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
21
|
+
import { useWebApplicationNavigator } from './WebApplicationNavigatorProvider';
|
|
21
22
|
const ApplicationStoreContext = createContext(undefined);
|
|
22
|
-
export const ApplicationStoreProvider = ({ children, config,
|
|
23
|
-
const
|
|
23
|
+
export const ApplicationStoreProvider = ({ children, config, pluginManager, }) => {
|
|
24
|
+
const navigator = useWebApplicationNavigator();
|
|
25
|
+
const applicationStore = useLocalObservable(() => new ApplicationStore(config, navigator, pluginManager));
|
|
24
26
|
return (_jsx(ApplicationStoreContext.Provider, { value: applicationStore, children: children }, void 0));
|
|
25
27
|
};
|
|
26
28
|
export const useApplicationStore = () => guaranteeNonNullable(useContext(ApplicationStoreContext), `Can't find application store in context`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStoreProvider.js","sourceRoot":"","sources":["../../src/components/ApplicationStoreProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationStoreProvider.js","sourceRoot":"","sources":["../../src/components/ApplicationStoreProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAG/E,MAAM,uBAAuB,GAAG,aAAa,CAE3C,SAAS,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAoC,EAC1E,QAAQ,EACR,MAAM,EACN,aAAa,GAKd,EAAsB,EAAE;IACvB,MAAM,SAAS,GAAG,0BAA0B,EAAE,CAAC;IAC/C,MAAM,gBAAgB,GAAG,kBAAkB,CACzC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAC7D,CAAC;IACF,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,YACtD,QAAQ,WACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAEV,EAAE,CACzB,oBAAoB,CAClB,UAAU,CAAC,uBAAuB,CAAoC,EACtE,yCAAyC,CAC1C,CAAC"}
|
|
@@ -13,14 +13,17 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
import { ApplicationStore } from '../stores/ApplicationStore';
|
|
17
18
|
import { WebApplicationNavigator } from '../stores/WebApplicationNavigator';
|
|
18
19
|
import type { LegendApplicationConfig } from '../stores/ApplicationConfig';
|
|
19
|
-
|
|
20
|
+
import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager';
|
|
21
|
+
export declare const TEST__ApplicationStoreProvider: React.FC<{
|
|
20
22
|
children: React.ReactNode;
|
|
21
23
|
config: LegendApplicationConfig;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
pluginManager: LegendApplicationPluginManager;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const TEST__provideMockedApplicationStore: <T extends LegendApplicationConfig>(config: T, pluginManager: LegendApplicationPluginManager, customization?: {
|
|
24
27
|
mock?: ApplicationStore<T>;
|
|
25
28
|
navigator?: WebApplicationNavigator;
|
|
26
29
|
} | undefined) => ApplicationStore<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStoreProviderTestUtils.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationStoreProviderTestUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"ApplicationStoreProviderTestUtils.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationStoreProviderTestUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAEpG,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC;IACpD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,uBAAuB,CAAC;IAChC,aAAa,EAAE,8BAA8B,CAAC;CAC/C,CAIA,CAAC;AAEF,eAAO,MAAM,mCAAmC,gEAI/B,8BAA8B;;gBAG/B,uBAAuB;qCAetC,CAAC"}
|
|
@@ -18,12 +18,11 @@ import { createMemoryHistory } from 'history';
|
|
|
18
18
|
import { ApplicationStore } from '../stores/ApplicationStore';
|
|
19
19
|
import { WebApplicationNavigator } from '../stores/WebApplicationNavigator';
|
|
20
20
|
import { ApplicationStoreProvider } from './ApplicationStoreProvider';
|
|
21
|
-
|
|
22
|
-
export const
|
|
23
|
-
export const TEST__provideMockedApplicationStore = (config, customization) => {
|
|
21
|
+
export const TEST__ApplicationStoreProvider = ({ children, config, pluginManager }) => (_jsx(ApplicationStoreProvider, { config: config, pluginManager: pluginManager, children: children }, void 0));
|
|
22
|
+
export const TEST__provideMockedApplicationStore = (config, pluginManager, customization) => {
|
|
24
23
|
const value = customization?.mock ??
|
|
25
24
|
new ApplicationStore(config, customization?.navigator ??
|
|
26
|
-
new WebApplicationNavigator(createMemoryHistory()),
|
|
25
|
+
new WebApplicationNavigator(createMemoryHistory()), pluginManager);
|
|
27
26
|
const MockedApplicationStoreProvider = require('./ApplicationStoreProvider'); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
|
|
28
27
|
MockedApplicationStoreProvider.useApplicationStore = jest.fn();
|
|
29
28
|
MockedApplicationStoreProvider.useApplicationStore.mockReturnValue(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStoreProviderTestUtils.js","sourceRoot":"","sources":["../../src/components/ApplicationStoreProviderTestUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationStoreProviderTestUtils.js","sourceRoot":"","sources":["../../src/components/ApplicationStoreProviderTestUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,MAAM,CAAC,MAAM,8BAA8B,GAItC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAC5C,KAAC,wBAAwB,IAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,YACnE,QAAQ,WACgB,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAGjD,MAAS,EACT,aAA6C,EAC7C,aAGC,EACoB,EAAE;IACvB,MAAM,KAAK,GACT,aAAa,EAAE,IAAI;QACnB,IAAI,gBAAgB,CAClB,MAAM,EACN,aAAa,EAAE,SAAS;YACtB,IAAI,uBAAuB,CAAC,mBAAmB,EAAE,CAAC,EACpD,aAAa,CACd,CAAC;IACJ,MAAM,8BAA8B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC,8DAA8D;IAC5I,8BAA8B,CAAC,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC/D,8BAA8B,CAAC,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
/**
|
|
17
18
|
* The users of this need to justify their use case because blocking app disrupts the UX flow.
|
|
18
19
|
* Of course there are legitimate use cases but please consult the team when you do so.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockingAlert.d.ts","sourceRoot":"","sources":["../../src/components/BlockingAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"BlockingAlert.d.ts","sourceRoot":"","sources":["../../src/components/BlockingAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAOH;;;;GAIG;AACH,eAAO,MAAM,aAAa;;CA8BxB,CAAC"}
|
|
@@ -14,9 +14,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import Dialog from '@material-ui/core/Dialog';
|
|
18
17
|
import { observer } from 'mobx-react-lite';
|
|
19
|
-
import { PanelLoadingIndicator } from '@finos/legend-art';
|
|
18
|
+
import { PanelLoadingIndicator, Dialog } from '@finos/legend-art';
|
|
20
19
|
import { noop } from '@finos/legend-shared';
|
|
21
20
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
22
21
|
/**
|
|
@@ -33,6 +32,8 @@ export const BlockingAlert = observer(() => {
|
|
|
33
32
|
return (_jsx(Dialog, { open: Boolean(info), onClose: noop, classes: {
|
|
34
33
|
root: 'blocking-alert__root-container',
|
|
35
34
|
container: 'blocking-alert__container',
|
|
35
|
+
}, TransitionProps: {
|
|
36
|
+
appear: false, // disable transition
|
|
36
37
|
}, children: _jsxs("div", { className: "modal modal--dark blocking-alert", children: [_jsx(PanelLoadingIndicator, { isLoading: Boolean(info.showLoading) }, void 0), _jsxs("div", { className: "modal__body", children: [_jsx("div", { className: "blocking-alert__message", children: info.message }, void 0), info.prompt && (_jsx("div", { className: "blocking-alert__message__prompt", children: info.prompt }, void 0))] }, void 0)] }, void 0) }, void 0));
|
|
37
38
|
});
|
|
38
39
|
//# sourceMappingURL=BlockingAlert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockingAlert.js","sourceRoot":"","sources":["../../src/components/BlockingAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"BlockingAlert.js","sourceRoot":"","sources":["../../src/components/BlockingAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE;IACzC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAG,gBAAgB,CAAC,iBAAiB,CAAC;IAEhD,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EACnB,OAAO,EAAE,IAAI,EACb,OAAO,EAAE;YACP,IAAI,EAAE,gCAAgC;YACtC,SAAS,EAAE,2BAA2B;SACvC,EACD,eAAe,EAAE;YACf,MAAM,EAAE,KAAK,EAAE,qBAAqB;SACrC,YAED,eAAK,SAAS,EAAC,kCAAkC,aAC/C,KAAC,qBAAqB,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,WAAI,EAC/D,eAAK,SAAS,EAAC,aAAa,aAC1B,cAAK,SAAS,EAAC,yBAAyB,YAAE,IAAI,CAAC,OAAO,WAAO,EAC5D,IAAI,CAAC,MAAM,IAAI,CACd,cAAK,SAAS,EAAC,iCAAiC,YAAE,IAAI,CAAC,MAAM,WAAO,CACrE,YACG,YACF,WACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
/// <reference types="react" />
|
|
17
|
+
import { type IKeyboardEvent } from 'monaco-editor';
|
|
17
18
|
import type { LambdaEditorState } from '../stores/LambdaEditorState';
|
|
18
|
-
import type
|
|
19
|
+
import { type Type } from '@finos/legend-graph';
|
|
19
20
|
export declare type LambdaEditorOnKeyDownEventHandler = {
|
|
20
21
|
matcher: (event: IKeyboardEvent) => boolean;
|
|
21
22
|
action: (event: IKeyboardEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LambdaEditor.d.ts","sourceRoot":"","sources":["../../src/components/LambdaEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"LambdaEditor.d.ts","sourceRoot":"","sources":["../../src/components/LambdaEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAgBvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAQrE,OAAO,EAAiC,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAK/E,oBAAY,iCAAiC,GAAG;IAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACzC,CAAC;AA+mBF;;;GAGG;AACH,eAAO,MAAM,YAAY;gBAET,MAAM,GAAG,SAAS;cACpB,OAAO;uBACE,iBAAiB;IACpC;;;;OAIG;mBACY,IAAI,GAAG,SAAS;0BACT,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS;gCACrB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;IACpD;;;;;;;;;;;;;OAaG;mBACY,OAAO;IACtB;;;OAGG;4BACqB,OAAO,KAAK,IAAI;IACxC;;OAEG;uBACgB,OAAO,GAAG,SAAS;IACtC;;;;;OAKG;qBACc,OAAO,GAAG,SAAS;IACpC;;OAEG;mBACY,OAAO,GAAG,SAAS;IAClC;;OAEG;gCACyB,OAAO,GAAG,SAAS;IAC/C;;OAEG;mBACY,OAAO,GAAG,SAAS;IAClC;;;OAGG;6BACsB,iCAAiC,EAAE;;;CAiG/D,CAAC"}
|
|
@@ -15,18 +15,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { useRef, useEffect, useState, useMemo } from 'react';
|
|
18
|
-
import { editor as monacoEditorAPI } from 'monaco-editor';
|
|
18
|
+
import { editor as monacoEditorAPI, } from 'monaco-editor';
|
|
19
19
|
import { observer } from 'mobx-react-lite';
|
|
20
20
|
import { useResizeDetector } from 'react-resize-detector';
|
|
21
|
-
import { clsx, setErrorMarkers, disposeEditor, disableEditorHotKeys, baseTextEditorSettings, getEditorValue, normalizeLineEnding, } from '@finos/legend-art';
|
|
22
|
-
import {
|
|
23
|
-
import { noop, debounce } from '@finos/legend-shared';
|
|
21
|
+
import { clsx, setErrorMarkers, disposeEditor, disableEditorHotKeys, baseTextEditorSettings, getEditorValue, normalizeLineEnding, FilledWindowMaximizeIcon, LongArrowAltDownIcon, LongArrowAltUpIcon, Dialog, } from '@finos/legend-art';
|
|
22
|
+
import { debounce, noop, } from '@finos/legend-shared';
|
|
24
23
|
import { flowResult } from 'mobx';
|
|
25
24
|
import { ParserError } from '@finos/legend-graph';
|
|
26
25
|
import { APPLICATION_TEST_ID } from './ApplicationTestID';
|
|
27
26
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
28
27
|
import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const';
|
|
29
|
-
import { Dialog } from '@material-ui/core';
|
|
30
28
|
const LambdaErrorFeedback = (props) => {
|
|
31
29
|
const { error, discardChanges } = props;
|
|
32
30
|
if (!error) {
|
|
@@ -233,7 +231,7 @@ const LambdaEditorInline = observer((props) => {
|
|
|
233
231
|
'lambda-editor__editor__expected-return-type--highlighted': matchedExpectedType?.(),
|
|
234
232
|
}), onClick: selectTypeLabel, tabIndex: -1, title: 'Toggle highlight expected type', children: expectedType?.name ?? 'unknown' }, void 0)), !onExpectedTypeLabelSelect && (_jsx("div", { className: clsx('lambda-editor__editor__expected-return-type', {
|
|
235
233
|
'lambda-editor__editor__expected-return-type--highlighted': matchedExpectedType?.(),
|
|
236
|
-
}), children: expectedType?.name ?? 'unknown' }, void 0))] }, void 0)), !disableExpansion && !forceExpansion && (_jsx("button", { className: "lambda-editor__editor__expand-btn", onClick: toggleExpandedMode, disabled: Boolean(parserError), tabIndex: -1, title: "Toggle Expand", children: isExpanded ? _jsx(
|
|
234
|
+
}), children: expectedType?.name ?? 'unknown' }, void 0))] }, void 0)), !disableExpansion && !forceExpansion && (_jsx("button", { className: "lambda-editor__editor__expand-btn", onClick: toggleExpandedMode, disabled: Boolean(parserError), tabIndex: -1, title: "Toggle Expand", children: isExpanded ? _jsx(LongArrowAltUpIcon, {}, void 0) : _jsx(LongArrowAltDownIcon, {}, void 0) }, void 0)), !disablePopUp && (_jsx("button", { className: "lambda-editor__action", onClick: openInPopUp, disabled: Boolean(parserError), tabIndex: -1, title: "Open...", children: _jsx(FilledWindowMaximizeIcon, {}, void 0) }, void 0))] }, void 0), !hideErrorBar && (_jsx(LambdaErrorFeedback, { error: parserError ?? compilationError, discardChanges: discardChanges }, void 0))] }, void 0));
|
|
237
235
|
});
|
|
238
236
|
const LambdaEditorPopUp = observer((props) => {
|
|
239
237
|
const { className, disabled, lambdaEditorState, transformStringToLambda, onKeyDownEventHandlers, onClose, } = props;
|
|
@@ -373,6 +371,7 @@ const LambdaEditorPopUp = observer((props) => {
|
|
|
373
371
|
}
|
|
374
372
|
}, [editor]); // dispose editor
|
|
375
373
|
return (_jsx(Dialog, { open: true, TransitionProps: {
|
|
374
|
+
appear: false,
|
|
376
375
|
onEnter,
|
|
377
376
|
}, onClose: noop, classes: {
|
|
378
377
|
root: 'editor-modal__root-container',
|