@finos/legend-application 11.0.3 → 12.0.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/lib/application/LegendApplication.js +1 -1
- package/lib/application/LegendApplication.js.map +1 -1
- package/lib/application/LegendApplicationPluginManager.d.ts +1 -1
- package/lib/application/LegendApplicationPluginManager.d.ts.map +1 -1
- package/lib/components/ActionAlert.d.ts.map +1 -1
- package/lib/components/ActionAlert.js +5 -5
- package/lib/components/ActionAlert.js.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.js +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.js.map +1 -1
- package/lib/components/BlockingAlert.js +1 -1
- package/lib/components/BlockingAlert.js.map +1 -1
- package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts.map +1 -1
- package/lib/components/LegendApplicationComponentFrameworkProvider.js +5 -5
- package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +1 -1
- package/lib/components/NotificationManager.js +5 -5
- package/lib/components/NotificationManager.js.map +1 -1
- package/lib/components/VirtualAssistant.d.ts.map +1 -1
- package/lib/components/VirtualAssistant.js +4 -4
- package/lib/components/VirtualAssistant.js.map +1 -1
- package/lib/components/WebApplicationNavigatorProvider.d.ts +1 -1
- 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/components/shared/DocumentationLink.d.ts.map +1 -1
- package/lib/components/shared/DocumentationLink.js +5 -3
- package/lib/components/shared/DocumentationLink.js.map +1 -1
- package/lib/components/shared/TextInputEditor.js +1 -1
- package/lib/components/shared/TextInputEditor.js.map +1 -1
- package/lib/components/useCommands.d.ts +1 -1
- package/lib/components/useCommands.d.ts.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +10 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -7
- package/lib/index.js.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/AlertService.d.ts +13 -3
- package/lib/stores/AlertService.d.ts.map +1 -1
- package/lib/stores/AlertService.js +36 -0
- package/lib/stores/AlertService.js.map +1 -1
- package/lib/stores/ApplicationEvent.d.ts +0 -1
- package/lib/stores/ApplicationEvent.d.ts.map +1 -1
- package/lib/stores/ApplicationEvent.js +0 -1
- package/lib/stores/ApplicationEvent.js.map +1 -1
- package/lib/stores/ApplicationStore.d.ts +27 -51
- package/lib/stores/ApplicationStore.d.ts.map +1 -1
- package/lib/stores/ApplicationStore.js +51 -182
- package/lib/stores/ApplicationStore.js.map +1 -1
- package/lib/stores/ApplicationStoreTestUtils.js +1 -1
- package/lib/stores/ApplicationStoreTestUtils.js.map +1 -1
- package/lib/stores/ClipboardService.d.ts +22 -0
- package/lib/stores/ClipboardService.d.ts.map +1 -0
- package/lib/stores/ClipboardService.js +29 -0
- package/lib/stores/ClipboardService.js.map +1 -0
- package/lib/stores/{CommandCenter.d.ts → CommandService.d.ts} +2 -2
- package/lib/stores/CommandService.d.ts.map +1 -0
- package/lib/stores/{CommandCenter.js → CommandService.js} +3 -3
- package/lib/stores/CommandService.js.map +1 -0
- package/lib/stores/DocumentationService.js +3 -3
- package/lib/stores/DocumentationService.js.map +1 -1
- package/lib/stores/IdentityService.d.ts +7 -1
- package/lib/stores/IdentityService.d.ts.map +1 -1
- package/lib/stores/IdentityService.js +16 -1
- package/lib/stores/IdentityService.js.map +1 -1
- package/lib/stores/KeyboardShortcutsService.d.ts.map +1 -1
- package/lib/stores/KeyboardShortcutsService.js +2 -9
- package/lib/stores/KeyboardShortcutsService.js.map +1 -1
- package/lib/stores/LayoutService.d.ts +35 -0
- package/lib/stores/LayoutService.d.ts.map +1 -0
- package/lib/stores/LayoutService.js +53 -0
- package/lib/stores/LayoutService.js.map +1 -0
- package/lib/stores/LegendApplicationPlugin.d.ts +2 -2
- package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/NotificationService.d.ts +20 -0
- package/lib/stores/NotificationService.d.ts.map +1 -1
- package/lib/stores/NotificationService.js +75 -0
- package/lib/stores/NotificationService.js.map +1 -1
- package/lib/stores/TelemetryService.d.ts +4 -1
- package/lib/stores/TelemetryService.d.ts.map +1 -1
- package/lib/stores/TelemetryService.js +13 -1
- package/lib/stores/TelemetryService.js.map +1 -1
- package/lib/stores/event/EventService.d.ts.map +1 -0
- package/lib/stores/event/EventService.js.map +1 -0
- package/lib/stores/event/IframeEventNotifierPlugin.d.ts.map +1 -0
- package/lib/stores/{IframeEventNotifierPlugin.js → event/IframeEventNotifierPlugin.js} +1 -1
- package/lib/stores/event/IframeEventNotifierPlugin.js.map +1 -0
- package/lib/stores/{WebApplicationNavigator.d.ts → navigation/NavigationService.d.ts} +11 -35
- package/lib/stores/navigation/NavigationService.d.ts.map +1 -0
- package/lib/stores/navigation/NavigationService.js +22 -0
- package/lib/stores/navigation/NavigationService.js.map +1 -0
- package/lib/stores/navigation/WebApplicationNavigator.d.ts +46 -0
- package/lib/stores/navigation/WebApplicationNavigator.d.ts.map +1 -0
- package/lib/stores/navigation/WebApplicationNavigator.js.map +1 -0
- package/lib/stores/navigation/WebApplicationRouter.d.ts.map +1 -0
- package/lib/stores/navigation/WebApplicationRouter.js.map +1 -0
- package/lib/stores/pure-language/PureLanguageSupport.d.ts.map +1 -0
- package/lib/stores/{PureLanguageSupport.js → pure-language/PureLanguageSupport.js} +1 -1
- package/lib/stores/pure-language/PureLanguageSupport.js.map +1 -0
- package/lib/stores/{PureLanguageTextEditorSupport.d.ts → pure-language/PureLanguageTextEditorSupport.d.ts} +1 -1
- package/lib/stores/pure-language/PureLanguageTextEditorSupport.d.ts.map +1 -0
- package/lib/stores/pure-language/PureLanguageTextEditorSupport.js.map +1 -0
- package/lib/stores/storage/ApplicationStorage.d.ts +52 -0
- package/lib/stores/storage/ApplicationStorage.d.ts.map +1 -0
- package/lib/stores/storage/ApplicationStorage.js +37 -0
- package/lib/stores/storage/ApplicationStorage.js.map +1 -0
- package/lib/stores/storage/StorageService.d.ts +38 -0
- package/lib/stores/storage/StorageService.d.ts.map +1 -0
- package/lib/stores/storage/StorageService.js +65 -0
- package/lib/stores/storage/StorageService.js.map +1 -0
- package/lib/stores/terminal/XTerm.js +4 -4
- package/lib/stores/terminal/XTerm.js.map +1 -1
- package/package.json +7 -7
- package/src/application/LegendApplication.tsx +1 -1
- package/src/application/LegendApplicationPluginManager.tsx +1 -1
- package/src/components/ActionAlert.tsx +7 -5
- package/src/components/ApplicationStoreProviderTestUtils.tsx +1 -1
- package/src/components/BlockingAlert.tsx +1 -1
- package/src/components/LegendApplicationComponentFrameworkProvider.tsx +7 -5
- package/src/components/NotificationManager.tsx +5 -5
- package/src/components/VirtualAssistant.tsx +8 -4
- package/src/components/WebApplicationNavigatorProvider.tsx +1 -1
- package/src/components/WebApplicationNavigatorProviderTestUtils.tsx +1 -1
- package/src/components/shared/DocumentationLink.tsx +13 -5
- package/src/components/shared/TextInputEditor.tsx +1 -1
- package/src/components/useCommands.tsx +1 -1
- package/src/index.ts +10 -7
- package/src/stores/AlertService.ts +47 -3
- package/src/stores/ApplicationEvent.ts +0 -1
- package/src/stores/ApplicationStore.ts +64 -275
- package/src/stores/ApplicationStoreTestUtils.ts +1 -1
- package/src/stores/ClipboardService.ts +33 -0
- package/src/stores/{CommandCenter.ts → CommandService.ts} +2 -2
- package/src/stores/DocumentationService.ts +3 -3
- package/src/stores/IdentityService.ts +23 -1
- package/src/stores/KeyboardShortcutsService.ts +2 -15
- package/src/stores/LayoutService.ts +59 -0
- package/src/stores/LegendApplicationPlugin.ts +2 -2
- package/src/stores/NotificationService.ts +143 -0
- package/src/stores/TelemetryService.ts +15 -1
- package/src/stores/{IframeEventNotifierPlugin.ts → event/IframeEventNotifierPlugin.ts} +1 -1
- package/src/stores/navigation/NavigationService.ts +98 -0
- package/src/stores/{WebApplicationNavigator.ts → navigation/WebApplicationNavigator.ts} +5 -74
- package/src/stores/{PureLanguageSupport.ts → pure-language/PureLanguageSupport.ts} +1 -1
- package/src/stores/{PureLanguageTextEditorSupport.ts → pure-language/PureLanguageTextEditorSupport.ts} +1 -1
- package/src/stores/storage/ApplicationStorage.ts +78 -0
- package/src/stores/storage/StorageService.ts +90 -0
- package/src/stores/terminal/XTerm.ts +4 -4
- package/tsconfig.json +12 -7
- package/lib/stores/CommandCenter.d.ts.map +0 -1
- package/lib/stores/CommandCenter.js.map +0 -1
- package/lib/stores/EventService.d.ts.map +0 -1
- package/lib/stores/EventService.js.map +0 -1
- package/lib/stores/IframeEventNotifierPlugin.d.ts.map +0 -1
- package/lib/stores/IframeEventNotifierPlugin.js.map +0 -1
- package/lib/stores/PureLanguageSupport.d.ts.map +0 -1
- package/lib/stores/PureLanguageSupport.js.map +0 -1
- package/lib/stores/PureLanguageTextEditorSupport.d.ts.map +0 -1
- package/lib/stores/PureLanguageTextEditorSupport.js.map +0 -1
- package/lib/stores/WebApplicationNavigator.d.ts.map +0 -1
- package/lib/stores/WebApplicationNavigator.js.map +0 -1
- package/lib/stores/WebApplicationRouter.d.ts.map +0 -1
- package/lib/stores/WebApplicationRouter.js.map +0 -1
- /package/lib/stores/{EventService.d.ts → event/EventService.d.ts} +0 -0
- /package/lib/stores/{EventService.js → event/EventService.js} +0 -0
- /package/lib/stores/{IframeEventNotifierPlugin.d.ts → event/IframeEventNotifierPlugin.d.ts} +0 -0
- /package/lib/stores/{WebApplicationNavigator.js → navigation/WebApplicationNavigator.js} +0 -0
- /package/lib/stores/{WebApplicationRouter.d.ts → navigation/WebApplicationRouter.d.ts} +0 -0
- /package/lib/stores/{WebApplicationRouter.js → navigation/WebApplicationRouter.js} +0 -0
- /package/lib/stores/{PureLanguageSupport.d.ts → pure-language/PureLanguageSupport.d.ts} +0 -0
- /package/lib/stores/{PureLanguageTextEditorSupport.js → pure-language/PureLanguageTextEditorSupport.js} +0 -0
- /package/src/stores/{EventService.ts → event/EventService.ts} +0 -0
- /package/src/stores/{WebApplicationRouter.ts → navigation/WebApplicationRouter.ts} +0 -0
|
@@ -13,210 +13,89 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { TracerService,
|
|
17
|
-
import { action, makeObservable, observable } from 'mobx';
|
|
16
|
+
import { TracerService, LogService, LogEvent, uuid, } from '@finos/legend-shared';
|
|
18
17
|
import { APPLICATION_EVENT } from './ApplicationEvent.js';
|
|
19
18
|
import { DocumentationService } from './DocumentationService.js';
|
|
20
19
|
import { AssistantService } from './AssistantService.js';
|
|
21
|
-
import { EventService } from './EventService.js';
|
|
20
|
+
import { EventService } from './event/EventService.js';
|
|
22
21
|
import { ApplicationNavigationContextService } from './ApplicationNavigationContextService.js';
|
|
23
|
-
import {
|
|
22
|
+
import { CommandService } from './CommandService.js';
|
|
24
23
|
import { KeyboardShortcutsService } from './KeyboardShortcutsService.js';
|
|
25
24
|
import { TerminalService } from './TerminalService.js';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
25
|
+
import { AlertService } from './AlertService.js';
|
|
26
|
+
import { NotificationService } from './NotificationService.js';
|
|
27
|
+
import { IdentityService } from './IdentityService.js';
|
|
28
|
+
import { StorageService } from './storage/StorageService.js';
|
|
28
29
|
import { TelemetryService } from './TelemetryService.js';
|
|
29
30
|
import { TimeService } from './TimeService.js';
|
|
31
|
+
import { LayoutService } from './LayoutService.js';
|
|
32
|
+
import { ClipboardService } from './ClipboardService.js';
|
|
33
|
+
import { NavigationService } from './navigation/NavigationService.js';
|
|
30
34
|
export class ApplicationStore {
|
|
31
35
|
uuid = uuid();
|
|
32
36
|
config;
|
|
33
37
|
pluginManager;
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// TODO: refactor this to `NotificationService`
|
|
43
|
-
notification;
|
|
44
|
-
// TODO: refactor this to `AlertService`
|
|
45
|
-
blockingAlertInfo;
|
|
46
|
-
actionAlertInfo;
|
|
47
|
-
// NOTE: we have considered consider renaming this to `LogService`
|
|
48
|
-
log = new Log();
|
|
38
|
+
// core
|
|
39
|
+
identityService;
|
|
40
|
+
storageService;
|
|
41
|
+
timeService = new TimeService();
|
|
42
|
+
commandService;
|
|
43
|
+
keyboardShortcutsService;
|
|
44
|
+
layoutService = new LayoutService();
|
|
45
|
+
clipboardService;
|
|
49
46
|
terminalService;
|
|
50
|
-
|
|
47
|
+
logService = new LogService();
|
|
48
|
+
navigationService;
|
|
49
|
+
navigationContextService;
|
|
50
|
+
// support
|
|
51
51
|
documentationService;
|
|
52
52
|
assistantService;
|
|
53
|
-
// event
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
keyboardShortcutsService;
|
|
61
|
-
// TODO: config
|
|
62
|
-
// See https://github.com/finos/legend-studio/issues/407
|
|
63
|
-
// backdrop
|
|
64
|
-
backdropContainerElementID;
|
|
65
|
-
showBackdrop = false;
|
|
66
|
-
// theme
|
|
53
|
+
// event
|
|
54
|
+
alertService;
|
|
55
|
+
notificationService;
|
|
56
|
+
eventService;
|
|
57
|
+
telemetryService;
|
|
58
|
+
tracerService;
|
|
59
|
+
constructor(config,
|
|
67
60
|
/**
|
|
68
|
-
* NOTE:
|
|
69
|
-
* we
|
|
70
|
-
* See https://github.com/finos/legend-studio/issues/264
|
|
61
|
+
* NOTE: as of now, we only support web environment, we will not provide a generic `ApplicationNavigator`
|
|
62
|
+
* This is something we need to think about when we potentially move to another platform
|
|
71
63
|
*/
|
|
72
|
-
|
|
73
|
-
constructor(config, navigator, pluginManager) {
|
|
74
|
-
makeObservable(this, {
|
|
75
|
-
currentUser: observable,
|
|
76
|
-
notification: observable,
|
|
77
|
-
blockingAlertInfo: observable,
|
|
78
|
-
actionAlertInfo: observable,
|
|
79
|
-
TEMPORARY__isLightThemeEnabled: observable,
|
|
80
|
-
backdropContainerElementID: observable,
|
|
81
|
-
showBackdrop: observable,
|
|
82
|
-
setBackdropContainerElementID: action,
|
|
83
|
-
setShowBackdrop: action,
|
|
84
|
-
setBlockingAlert: action,
|
|
85
|
-
setActionAlertInfo: action,
|
|
86
|
-
setCurrentUser: action,
|
|
87
|
-
setNotification: action,
|
|
88
|
-
notify: action,
|
|
89
|
-
notifySuccess: action,
|
|
90
|
-
notifyWarning: action,
|
|
91
|
-
notifyIllegalState: action,
|
|
92
|
-
notifyError: action,
|
|
93
|
-
TEMPORARY__setIsLightThemeEnabled: action,
|
|
94
|
-
});
|
|
64
|
+
navigator, pluginManager) {
|
|
95
65
|
this.config = config;
|
|
96
|
-
this.navigator = navigator;
|
|
97
66
|
this.pluginManager = pluginManager;
|
|
67
|
+
this.timeService = new TimeService();
|
|
68
|
+
this.layoutService = new LayoutService();
|
|
98
69
|
// NOTE: set the logger first so other loading could use the configured logger
|
|
99
|
-
this.
|
|
70
|
+
this.logService = new LogService();
|
|
71
|
+
this.logService.registerPlugins(pluginManager.getLoggerPlugins());
|
|
72
|
+
this.identityService = new IdentityService(this);
|
|
73
|
+
this.storageService = new StorageService(this);
|
|
74
|
+
this.clipboardService = new ClipboardService(this);
|
|
100
75
|
this.terminalService = new TerminalService(this);
|
|
76
|
+
this.commandService = new CommandService(this);
|
|
77
|
+
this.keyboardShortcutsService = new KeyboardShortcutsService(this);
|
|
78
|
+
this.navigationService = new NavigationService(navigator);
|
|
101
79
|
this.navigationContextService = new ApplicationNavigationContextService(this);
|
|
102
80
|
this.documentationService = new DocumentationService(this);
|
|
103
81
|
this.assistantService = new AssistantService(this);
|
|
82
|
+
this.alertService = new AlertService(this);
|
|
83
|
+
this.notificationService = new NotificationService();
|
|
84
|
+
this.eventService = new EventService();
|
|
85
|
+
this.eventService.registerEventNotifierPlugins(pluginManager.getEventNotifierPlugins());
|
|
86
|
+
this.telemetryService = new TelemetryService(this);
|
|
104
87
|
this.telemetryService.registerPlugins(pluginManager.getTelemetryServicePlugins());
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.keyboardShortcutsService = new KeyboardShortcutsService(this);
|
|
88
|
+
this.telemetryService.setup();
|
|
89
|
+
this.tracerService = new TracerService();
|
|
108
90
|
this.tracerService.registerPlugins(pluginManager.getTracerServicePlugins());
|
|
109
|
-
this.eventService.registerEventNotifierPlugins(pluginManager.getEventNotifierPlugins());
|
|
110
|
-
}
|
|
111
|
-
TEMPORARY__setIsLightThemeEnabled(val) {
|
|
112
|
-
this.TEMPORARY__isLightThemeEnabled = val;
|
|
113
|
-
}
|
|
114
|
-
setupTelemetryService() {
|
|
115
|
-
this.telemetryService.setup({
|
|
116
|
-
userId: this.currentUser,
|
|
117
|
-
appName: this.config.appName,
|
|
118
|
-
appSessionId: this.uuid,
|
|
119
|
-
// appStartTime: this.time timestamp,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Change the ID used to find the base element to mount the backdrop on.
|
|
124
|
-
* This is useful when we want to use backdrop with embedded application which
|
|
125
|
-
* requires its own backdrop usage.
|
|
126
|
-
*/
|
|
127
|
-
setBackdropContainerElementID(val) {
|
|
128
|
-
this.backdropContainerElementID = val;
|
|
129
|
-
}
|
|
130
|
-
setShowBackdrop(val) {
|
|
131
|
-
this.showBackdrop = val;
|
|
132
|
-
}
|
|
133
|
-
setBlockingAlert(alertInfo) {
|
|
134
|
-
if (alertInfo) {
|
|
135
|
-
this.keyboardShortcutsService.blockGlobalHotkeys();
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.keyboardShortcutsService.unblockGlobalHotkeys();
|
|
139
|
-
}
|
|
140
|
-
this.blockingAlertInfo = alertInfo;
|
|
141
|
-
}
|
|
142
|
-
setActionAlertInfo(alertInfo) {
|
|
143
|
-
if (this.actionAlertInfo && alertInfo) {
|
|
144
|
-
this.notifyIllegalState('Action alert is stacked: new alert is invoked while another one is being displayed');
|
|
145
|
-
}
|
|
146
|
-
if (alertInfo) {
|
|
147
|
-
this.keyboardShortcutsService.blockGlobalHotkeys();
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.keyboardShortcutsService.unblockGlobalHotkeys();
|
|
151
|
-
}
|
|
152
|
-
this.actionAlertInfo = alertInfo;
|
|
153
|
-
}
|
|
154
|
-
setCurrentUser(val) {
|
|
155
|
-
this.currentUser = val;
|
|
156
|
-
}
|
|
157
|
-
setNotification(notification) {
|
|
158
|
-
this.notification = notification;
|
|
159
|
-
}
|
|
160
|
-
notify(message, actions, autoHideDuration) {
|
|
161
|
-
this.setNotification(new Notification(NOTIFCATION_SEVERITY.INFO, message, actions ?? [], autoHideDuration === null
|
|
162
|
-
? undefined
|
|
163
|
-
: autoHideDuration ?? DEFAULT_NOTIFICATION_HIDE_TIME));
|
|
164
|
-
}
|
|
165
|
-
notifySuccess(message, actions, autoHideDuration) {
|
|
166
|
-
this.setNotification(new Notification(NOTIFCATION_SEVERITY.SUCCESS, message, actions ?? [], autoHideDuration === null
|
|
167
|
-
? undefined
|
|
168
|
-
: autoHideDuration ?? DEFAULT_NOTIFICATION_HIDE_TIME));
|
|
169
|
-
}
|
|
170
|
-
notifyWarning(content, actions, autoHideDuration) {
|
|
171
|
-
this.setNotification(new Notification(NOTIFCATION_SEVERITY.WARNING, content instanceof Error ? content.message : content, actions ?? [], autoHideDuration === null
|
|
172
|
-
? undefined
|
|
173
|
-
: autoHideDuration ?? DEFAULT_NOTIFICATION_HIDE_TIME));
|
|
174
|
-
}
|
|
175
|
-
notifyIllegalState(message, actions, autoHideDuration) {
|
|
176
|
-
this.setNotification(new Notification(NOTIFCATION_SEVERITY.ILEGAL_STATE, isString(message) ? `[PLEASE NOTIFY DEVELOPER] ${message}` : message, actions ?? [], autoHideDuration === null
|
|
177
|
-
? undefined
|
|
178
|
-
: autoHideDuration ?? DEFAULT_NOTIFICATION_HIDE_TIME));
|
|
179
|
-
}
|
|
180
|
-
notifyError(content, actions) {
|
|
181
|
-
let message;
|
|
182
|
-
if (content instanceof ApplicationError) {
|
|
183
|
-
message = content.detail;
|
|
184
|
-
}
|
|
185
|
-
else if (content instanceof Error) {
|
|
186
|
-
message = content.message;
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
assertTrue(isString(content), `Can't display error`);
|
|
190
|
-
message = content;
|
|
191
|
-
}
|
|
192
|
-
if (message) {
|
|
193
|
-
this.setNotification(new Notification(NOTIFCATION_SEVERITY.ERROR, message, actions ?? [], undefined));
|
|
194
|
-
}
|
|
195
91
|
}
|
|
196
|
-
/**
|
|
197
|
-
* This function creates a more user-friendly way to throw error in the UI. Rather than crashing the whole app, we will
|
|
198
|
-
* just notify and replacing the value should get with an alternative (e.g. `undefined`). A good use-case for this
|
|
199
|
-
* is where we would not expect an error to throw (i.e. `IllegalStateError`), but we want to be sure that if the error
|
|
200
|
-
* ever occurs, it still shows very apparently in the UI, as such, printing out in the console is not good enough,
|
|
201
|
-
* but crashing the app is bad too, so this is a good balance.
|
|
202
|
-
*/
|
|
203
|
-
notifyAndReturnAlternativeOnError = (fn, alternative) => {
|
|
204
|
-
try {
|
|
205
|
-
return fn();
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
assertErrorThrown(error);
|
|
209
|
-
this.notifyIllegalState(error.message);
|
|
210
|
-
return alternative;
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
92
|
/**
|
|
214
93
|
* When we call store/state functions from the component, we should handle error thrown at these functions instead
|
|
215
94
|
* of throwing them to the UI. This enforces that by throwing `IllegalStateError`
|
|
216
95
|
*/
|
|
217
96
|
alertUnhandledError = (error) => {
|
|
218
|
-
this.
|
|
219
|
-
this.notifyIllegalState(error.message);
|
|
97
|
+
this.logService.error(LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED), 'Encountered unhandled error in component tree', error);
|
|
98
|
+
this.notificationService.notifyIllegalState(error.message);
|
|
220
99
|
};
|
|
221
100
|
/**
|
|
222
101
|
* Guarantee that the action being used by the component does not throw unhandled errors
|
|
@@ -224,15 +103,5 @@ export class ApplicationStore {
|
|
|
224
103
|
guardUnhandledError = (actionFn) => () => {
|
|
225
104
|
actionFn().catch(this.alertUnhandledError);
|
|
226
105
|
};
|
|
227
|
-
async copyTextToClipboard(text) {
|
|
228
|
-
// This is a much cleaner way which requires HTTPS
|
|
229
|
-
// See https://developers.google.com/web/updates/2018/03/clipboardapi
|
|
230
|
-
await navigator.clipboard.writeText(text).catch((error) => {
|
|
231
|
-
this.notifyError(error);
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
notifyUnsupportedFeature(featureName) {
|
|
235
|
-
this.notifyWarning(`Unsupported feature: ${featureName}`);
|
|
236
|
-
}
|
|
237
106
|
}
|
|
238
107
|
//# sourceMappingURL=ApplicationStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStore.js","sourceRoot":"","sources":["../../src/stores/ApplicationStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ApplicationStore.js","sourceRoot":"","sources":["../../src/stores/ApplicationStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,QAAQ,EACR,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,E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AAY,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAC5C,aAAa,CAAC,uBAAuB,EAAE,CACxC,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,gBAAgB,CAAC,eAAe,CACnC,aAAa,CAAC,0BAA0B,EAAE,CAC3C,CAAC;QACF,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,aAAa,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;OAGG;IACH,mBAAmB,GAAG,CAAC,KAAY,EAAQ,EAAE;QAC3C,IAAI,CAAC,UAAU,CAAC,KAAK,CACnB,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,kCAAkC,CAAC,EACrE,+CAA+C,EAC/C,KAAK,CACN,CAAC;QACF,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC;IAEF;;OAEG;IACH,mBAAmB,GACjB,CAAC,QAA6B,EAAgB,EAAE,CAChD,GAAS,EAAE;QACT,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC7C,CAAC,CAAC;CACL"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ApplicationStore } from './ApplicationStore.js';
|
|
17
17
|
import { createBrowserHistory } from 'history';
|
|
18
|
-
import { WebApplicationNavigator } from './WebApplicationNavigator.js';
|
|
18
|
+
import { WebApplicationNavigator } from './navigation/WebApplicationNavigator.js';
|
|
19
19
|
import { LegendApplicationConfig } from '../application/LegendApplicationConfig.js';
|
|
20
20
|
import { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager.js';
|
|
21
21
|
export const TEST_DATA__applicationVersion = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationStoreTestUtils.js","sourceRoot":"","sources":["../../src/stores/ApplicationStoreTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ApplicationStoreTestUtils.js","sourceRoot":"","sources":["../../src/stores/ApplicationStoreTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AASlG,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,SAAS,EAAE,0BAA0B;IACrC,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;CAC5B,CAAC;AAEF,MAAM,6BAA8B,SAAQ,uBAAuB;CAAG;AAEtE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,eAAe,GAAG,EAAE,EACK,EAAE;IAC3B,MAAM,MAAM,GAAG,IAAI,6BAA6B,CAAC;QAC/C,UAAU,EAAE;YACV,GAAG,EAAE,MAAM;YACX,OAAO,EAAE,MAAM;YACf,GAAG,eAAe;SACnB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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 { GenericLegendApplicationStore } from './ApplicationStore.js';
|
|
17
|
+
export declare class ClipboardService {
|
|
18
|
+
readonly applicationStore: GenericLegendApplicationStore;
|
|
19
|
+
constructor(applicationStore: GenericLegendApplicationStore);
|
|
20
|
+
copyTextToClipboard(text: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ClipboardService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipboardService.d.ts","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;gBAE7C,gBAAgB,EAAE,6BAA6B;IAIrD,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOvD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 class ClipboardService {
|
|
17
|
+
applicationStore;
|
|
18
|
+
constructor(applicationStore) {
|
|
19
|
+
this.applicationStore = applicationStore;
|
|
20
|
+
}
|
|
21
|
+
async copyTextToClipboard(text) {
|
|
22
|
+
// This is a much cleaner way which requires HTTPS
|
|
23
|
+
// See https://developers.google.com/web/updates/2018/03/clipboardapi
|
|
24
|
+
await navigator.clipboard.writeText(text).catch((error) => {
|
|
25
|
+
this.applicationStore.notificationService.notifyError(error);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ClipboardService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipboardService.js","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,gBAAgB;IAClB,gBAAgB,CAAgC;IAEzD,YAAY,gBAA+C;QACzD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAAY;QACpC,kDAAkD;QAClD,qEAAqE;QACrE,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACxD,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -43,7 +43,7 @@ export type Command = {
|
|
|
43
43
|
trigger?: () => boolean;
|
|
44
44
|
action?: (args?: CommandArguments) => void;
|
|
45
45
|
};
|
|
46
|
-
export declare class
|
|
46
|
+
export declare class CommandService {
|
|
47
47
|
readonly applicationStore: GenericLegendApplicationStore;
|
|
48
48
|
readonly commandRegistry: Map<string, Command>;
|
|
49
49
|
constructor(applicationStore: GenericLegendApplicationStore);
|
|
@@ -51,4 +51,4 @@ export declare class CommandCenter {
|
|
|
51
51
|
deregisterCommand(commandKey: string): void;
|
|
52
52
|
runCommand(commandKey: string, args?: CommandArguments): boolean;
|
|
53
53
|
}
|
|
54
|
-
//# sourceMappingURL=
|
|
54
|
+
//# sourceMappingURL=CommandService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandService.d.ts","sourceRoot":"","sources":["../../src/stores/CommandService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,IAAI,IAAI,CAAC;IACzB,kBAAkB,IAAI,IAAI,CAAC;CAC5B;AACD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACnE,eAAO,MAAM,0CAA0C,eACzC,OAAO,MAAM,EAAE,kBAAkB,CAAC,KAC7C,uBAAuB,EAIrB,CAAC;AACN,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AACF,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,qBAAa,cAAc;IACzB,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IACzD,QAAQ,CAAC,eAAe,uBAA8B;gBAE1C,gBAAgB,EAAE,6BAA6B;IAU3D,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAcvC,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAI3C,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO;CAQjE"}
|
|
@@ -20,7 +20,7 @@ export const collectKeyedCommandConfigEntriesFromConfig = (rawEntries) => Object
|
|
|
20
20
|
key: entry[0],
|
|
21
21
|
content: entry[1],
|
|
22
22
|
}));
|
|
23
|
-
export class
|
|
23
|
+
export class CommandService {
|
|
24
24
|
applicationStore;
|
|
25
25
|
commandRegistry = new Map();
|
|
26
26
|
constructor(applicationStore) {
|
|
@@ -34,7 +34,7 @@ export class CommandCenter {
|
|
|
34
34
|
registerCommand(command) {
|
|
35
35
|
const commandKey = command.key;
|
|
36
36
|
if (this.commandRegistry.has(commandKey)) {
|
|
37
|
-
this.applicationStore.
|
|
37
|
+
this.applicationStore.logService.warn(LogEvent.create(APPLICATION_EVENT.APPLICATION_COMMAND_CENTER_REGISTRATION__FAILURE), `Can't register command: command is already registered`);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
this.commandRegistry.set(commandKey, command);
|
|
@@ -51,4 +51,4 @@ export class CommandCenter {
|
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
//# sourceMappingURL=
|
|
54
|
+
//# sourceMappingURL=CommandService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandService.js","sourceRoot":"","sources":["../../src/stores/CommandService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAuB1D,MAAM,CAAC,MAAM,0CAA0C,GAAG,CACxD,UAA8C,EACnB,EAAE,CAC7B,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACzC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CAClB,CAAC,CAAC,CAAC;AAUN,MAAM,OAAO,cAAc;IAChB,gBAAgB,CAAgC;IAChD,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEtD,YAAY,gBAA+C;QACzD,cAAc,CAAC,IAAI,EAAE;YACnB,eAAe,EAAE,UAAU;YAC3B,eAAe,EAAE,MAAM;YACvB,iBAAiB,EAAE,MAAM;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,eAAe,CAAC,OAAgB;QAC9B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;QAC/B,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACxC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CACnC,QAAQ,CAAC,MAAM,CACb,iBAAiB,CAAC,gDAAgD,CACnE,EACD,uDAAuD,CACxD,CAAC;YACF,OAAO;SACR;QACD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,UAAkB;QAClC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,UAAkB,EAAE,IAAuB;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;YACtD,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;YACvB,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -70,7 +70,7 @@ export class DocumentationService {
|
|
|
70
70
|
// NOTE: Entries specified natively will not override each other. This is to prevent entries from extensions
|
|
71
71
|
// accidentally overide entries from core.
|
|
72
72
|
if (this.hasDocEntry(entry.key)) {
|
|
73
|
-
applicationStore.
|
|
73
|
+
applicationStore.logService.warn(LogEvent.create(APPLICATION_EVENT.APPLICATION_DOCUMENTATION_LOAD__SKIP), entry.key);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
this.docRegistry.set(entry.key, entry.content);
|
|
@@ -92,7 +92,7 @@ export class DocumentationService {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
if (missingDocumentationEntries.length) {
|
|
95
|
-
applicationStore.
|
|
95
|
+
applicationStore.logService.warn(LogEvent.create(APPLICATION_EVENT.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK__FAILURE), `Can't find corresponding documentation entry for keys:\n${missingDocumentationEntries
|
|
96
96
|
.map((key) => `- ${key}`)
|
|
97
97
|
.join('\n')}`);
|
|
98
98
|
}
|
|
@@ -105,7 +105,7 @@ export class DocumentationService {
|
|
|
105
105
|
// This allows extensions to broaden related doc entries for contextual docs
|
|
106
106
|
// If we need to support this behavior, we could create a dedicated extension method
|
|
107
107
|
if (this.hasContextualDocEntry(entry.context)) {
|
|
108
|
-
applicationStore.
|
|
108
|
+
applicationStore.logService.warn(LogEvent.create(APPLICATION_EVENT.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD__SKIP), entry.context);
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
111
|
const existingDocEntry = this.getDocEntry(entry.documentationKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationService.js","sourceRoot":"","sources":["../../src/stores/DocumentationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,oBAAoB,EACpB,QAAQ,EACR,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAsC1D,MAAM,OAAO,kBAAkB;IACpB,iBAAiB,CAAU;IAEpC,YAAY,CAA4B;IACxC,KAAK,CAAsB;IAC3B,IAAI,CAAsB;IAC1B,GAAG,CAAsB;IACzB,OAAO,CAAwB;IAE/B,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,kBAAkB,EAAE;QACpC,YAAY,EAAE,MAAM,CAClB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EACZ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CACvC;QACD,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACpC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC5B,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC3B,GAAG,EAAE,QAAQ,C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OAAO,EAAE,gBAAgB,CAAC,CAAC;aAC9D;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,qBAAqB,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,qBAAqB,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,gBAAgB;QACd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,kBAAkB;QAChB,MAAM,MAAM,GAA6C,EAAE,CAAC;QAC5D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACtC,MAAM,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,yBAAyB;QACvB,MAAM,MAAM,GAAkC,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC7C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -13,5 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
import type { GenericLegendApplicationStore } from './ApplicationStore.js';
|
|
17
|
+
export declare class IdentityService {
|
|
18
|
+
readonly applicationStore: GenericLegendApplicationStore;
|
|
19
|
+
currentUser: string;
|
|
20
|
+
constructor(applicationStore: GenericLegendApplicationStore);
|
|
21
|
+
setCurrentUser(val: string): void;
|
|
22
|
+
}
|
|
17
23
|
//# sourceMappingURL=IdentityService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityService.d.ts","sourceRoot":"","sources":["../../src/stores/IdentityService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"IdentityService.d.ts","sourceRoot":"","sources":["../../src/stores/IdentityService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAI3E,qBAAa,eAAe;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IAEzD,WAAW,SAAmB;gBAElB,gBAAgB,EAAE,6BAA6B;IAS3D,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGlC"}
|
|
@@ -13,5 +13,20 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
const UNKNOWN_USER_ID = '(unknown)';
|
|
18
|
+
export class IdentityService {
|
|
19
|
+
applicationStore;
|
|
20
|
+
currentUser = UNKNOWN_USER_ID;
|
|
21
|
+
constructor(applicationStore) {
|
|
22
|
+
makeObservable(this, {
|
|
23
|
+
currentUser: observable,
|
|
24
|
+
setCurrentUser: action,
|
|
25
|
+
});
|
|
26
|
+
this.applicationStore = applicationStore;
|
|
27
|
+
}
|
|
28
|
+
setCurrentUser(val) {
|
|
29
|
+
this.currentUser = val;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
17
32
|
//# sourceMappingURL=IdentityService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityService.js","sourceRoot":"","sources":["../../src/stores/IdentityService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"IdentityService.js","sourceRoot":"","sources":["../../src/stores/IdentityService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG1D,MAAM,eAAe,GAAG,WAAW,CAAC;AAEpC,MAAM,OAAO,eAAe;IACjB,gBAAgB,CAAgC;IAEzD,WAAW,GAAG,eAAe,CAAC;IAE9B,YAAY,gBAA+C;QACzD,cAAc,CAAC,IAAI,EAAE;YACnB,WAAW,EAAE,UAAU;YACvB,cAAc,EAAE,MAAM;SACvB,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,cAAc,CAAC,GAAW;QACxB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardShortcutsService.d.ts","sourceRoot":"","sources":["../../src/stores/KeyboardShortcutsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"KeyboardShortcutsService.d.ts","sourceRoot":"","sources":["../../src/stores/KeyboardShortcutsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E,qBAAa,wBAAwB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,MAAM,wBAA+B;IAC9C,QAAQ,CAAC,aAAa,wBAA+B;IACrD,gBAAgB,UAAS;gBAEb,gBAAgB,EAAE,6BAA6B;IAkC3D,kBAAkB,IAAI,IAAI;IAI1B,oBAAoB,IAAI,IAAI;IAI5B,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAe3D,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;CAYvC"}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { isNonNullable
|
|
16
|
+
import { isNonNullable } from '@finos/legend-shared';
|
|
17
17
|
import { action, makeObservable, observable } from 'mobx';
|
|
18
|
-
import { APPLICATION_EVENT } from './ApplicationEvent.js';
|
|
19
18
|
export class KeyboardShortcutsService {
|
|
20
19
|
applicationStore;
|
|
21
20
|
/**
|
|
@@ -57,12 +56,6 @@ export class KeyboardShortcutsService {
|
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
|
-
// Warn when detected multiple commands bound to the same key combination
|
|
61
|
-
Array.from(this.keyMap.entries()).forEach(([keyCombination, commands]) => {
|
|
62
|
-
if (commands.length > 1) {
|
|
63
|
-
this.applicationStore.log.warn(LogEvent.create(APPLICATION_EVENT.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK__FAILURE), `Found multiple commands with key binding '${keyCombination}'`);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
59
|
}
|
|
67
60
|
blockGlobalHotkeys() {
|
|
68
61
|
this.isHotkeysBlocked = true;
|
|
@@ -89,7 +82,7 @@ export class KeyboardShortcutsService {
|
|
|
89
82
|
const mappedCommandKeys = this.keyMap.get(keyCombination) ?? [];
|
|
90
83
|
for (const commandKey of mappedCommandKeys) {
|
|
91
84
|
// find the first command that works then escape
|
|
92
|
-
if (this.applicationStore.
|
|
85
|
+
if (this.applicationStore.commandService.runCommand(commandKey)) {
|
|
93
86
|
return;
|
|
94
87
|
}
|
|
95
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardShortcutsService.js","sourceRoot":"","sources":["../../src/stores/KeyboardShortcutsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"KeyboardShortcutsService.js","sourceRoot":"","sources":["../../src/stores/KeyboardShortcutsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG1D,MAAM,OAAO,wBAAwB;IAC1B,gBAAgB,CAAgC;IACzD;;;OAGG;IACM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IACrC,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAC;IACrD,gBAAgB,GAAG,KAAK,CAAC;IAEzB,YAAY,gBAA+C;QACzD,cAAc,CAAC,IAAI,EAAE;YACnB,MAAM,EAAE,UAAU;YAClB,aAAa,EAAE,UAAU;YACzB,gBAAgB,EAAE,UAAU;YAC5B,SAAS,EAAE,MAAM;YACjB,kBAAkB,EAAE,MAAM;YAC1B,oBAAoB,EAAE,MAAM;SAC7B,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,gBAAgB,CAAC,aAAa;aAChC,qBAAqB,EAAE;aACvB,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,iCAAiC,EAAE,EAAE,IAAI,EAAE,CAAC;aACvE,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,6EAA6E;YAC7E,8EAA8E;YAC9E,+EAA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