@finos/legend-application-studio 13.1.0 → 13.1.1

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.
@@ -47,7 +47,7 @@ export const LegendStudioApplicationRoot = observer(() => {
47
47
  useEffect(() => {
48
48
  flowResult(baseStore.initialize()).catch(applicationStore.alertUnhandledError);
49
49
  }, [applicationStore, baseStore]);
50
- return (_jsxs("div", { className: "app", children: [!baseStore.isSDLCAuthorized && (_jsx("div", { className: "app__page", children: _jsx(PanelLoadingIndicator, { isLoading: true }) })), baseStore.isSDLCAuthorized && (_jsxs(_Fragment, { children: [_jsx(VirtualAssistant, {}), _jsxs(Switch, { children: [_jsx(Route, { exact: true, path: [
50
+ return (_jsxs("div", { className: "app", children: [!baseStore.applicationSDLCSetupState.isSDLCAuthorized && (_jsx("div", { className: "app__page", children: _jsx(PanelLoadingIndicator, { isLoading: true }) })), baseStore.applicationSDLCSetupState.isSDLCAuthorized && (_jsxs(_Fragment, { children: [_jsx(VirtualAssistant, {}), _jsxs(Switch, { children: [_jsx(Route, { exact: true, path: [
51
51
  LEGEND_STUDIO_ROUTE_PATTERN.VIEW,
52
52
  LEGEND_STUDIO_ROUTE_PATTERN.VIEW_BY_GAV,
53
53
  LEGEND_STUDIO_ROUTE_PATTERN.VIEW_BY_GAV_ENTITY,
@@ -1 +1 @@
1
- {"version":3,"file":"LegendStudioApplication.js","sourceRoot":"","sources":["../../src/components/LegendStudioApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO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,CACJ,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAC7C,CAAC,KAGA,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAE/C,OAAO,CACL,KAAC,wBAAwB,IACvB,MAAM,EAAE;YACN,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,SAAS,EAAE,MAAM,CAAC,aAAa;YAC/B,WAAW,EAAE,MAAM,CAAC,qBAAqB;SAC1C,YAED,KAAC,yBAAyB,IACxB,MAAM,EAAE;gBACN,SAAS,EAAE,MAAM,CAAC,cAAc;aACjC,YAED,KAAC,yBAAyB,IACxB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,gBAAgB,CAAC,GAAG,YAEzB,KAAC,6BAA6B,IAAC,aAAa,EAAE,aAAa,YACzD,KAAC,2CAA2C,cAC1C,KAAC,2BAA2B,KAAG,GACa,GAChB,GACN,GACF,GACH,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"LegendStudioApplication.js","sourceRoot":"","sources":["../../src/components/LegendStudioApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,IAAI,EACJ,SAAS,E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AC,KAGA,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAE/C,OAAO,CACL,KAAC,wBAAwB,IACvB,MAAM,EAAE;YACN,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,SAAS,EAAE,MAAM,CAAC,aAAa;YAC/B,WAAW,EAAE,MAAM,CAAC,qBAAqB;SAC1C,YAED,KAAC,yBAAyB,IACxB,MAAM,EAAE;gBACN,SAAS,EAAE,MAAM,CAAC,cAAc;aACjC,YAED,KAAC,yBAAyB,IACxB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,gBAAgB,CAAC,GAAG,YAEzB,KAAC,6BAA6B,IAAC,aAAa,EAAE,aAAa,YACzD,KAAC,2CAA2C,cAC1C,KAAC,2BAA2B,KAAG,GACa,GAChB,GACN,GACF,GACH,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC"}
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-studio v13.1.0
1
+ /** @license @finos/legend-application-studio v13.1.1
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "13.1.0",
3
+ "version": "13.1.1",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { type GeneratorFn, ActionState } from '@finos/legend-shared';
17
- import { type ApplicationStore } from '@finos/legend-application';
18
- import { SDLCServerClient } from '@finos/legend-server-sdlc';
17
+ import { type ApplicationStore, LegendApplicationSDLCSetupState } from '@finos/legend-application';
18
+ import type { SDLCServerClient } from '@finos/legend-server-sdlc';
19
19
  import type { DepotServerClient } from '@finos/legend-server-depot';
20
20
  import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
21
21
  import type { LegendStudioApplicationConfig } from '../application/LegendStudioApplicationConfig.js';
@@ -23,16 +23,11 @@ import type { LegendStudioApplicationPlugin } from './LegendStudioApplicationPlu
23
23
  export declare type LegendStudioApplicationStore = ApplicationStore<LegendStudioApplicationConfig, LegendStudioApplicationPlugin>;
24
24
  export declare class LegendStudioBaseStore {
25
25
  applicationStore: LegendStudioApplicationStore;
26
- sdlcServerClient: SDLCServerClient;
27
26
  depotServerClient: DepotServerClient;
28
27
  pluginManager: LegendStudioPluginManager;
29
28
  initState: ActionState;
30
- isSDLCAuthorized: boolean;
31
- SDLCServerTermsOfServicesUrlsToView: string[];
29
+ applicationSDLCSetupState: LegendApplicationSDLCSetupState;
32
30
  constructor(applicationStore: LegendStudioApplicationStore, sdlcServerClient: SDLCServerClient, depotServerClient: DepotServerClient, pluginManager: LegendStudioPluginManager);
33
31
  initialize(): GeneratorFn<void>;
34
- private initializeSDLCServerClient;
35
- get needsToAcceptSDLCServerTermsOfServices(): boolean;
36
- dismissSDLCServerTermsOfServicesAlert(): void;
37
32
  }
38
33
  //# sourceMappingURL=LegendStudioBaseStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LegendStudioBaseStore.d.ts","sourceRoot":"","sources":["../../src/stores/LegendStudioBaseStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,WAAW,EAIhB,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,2BAA2B,CAAC;AASnC,OAAO,EAAQ,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iDA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4BAA4B,GAAG,gBAAgB,CACzD,6BAA6B,EAC7B,6BAA6B,CAC9B,CAAC;AAEF,qBAAa,qBAAqB;IAChC,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,yBAAyB,CAAC;IAEzC,SAAS,cAAwB;IACjC,yBAAyB,EAAE,+BAA+B,CAAC;gBAGzD,gBAAgB,EAAE,4BAA4B,EAC9C,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,yBAAyB;IAwBzC,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC;CAsCjC"}
@@ -13,36 +13,27 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { HttpStatus, NetworkClientError, ActionState, LogEvent, assertErrorThrown, } from '@finos/legend-shared';
17
- import { ActionAlertActionType, ActionAlertType, ApplicationTelemetry, } from '@finos/legend-application';
18
- import { action, computed, flow, flowResult, makeObservable, observable, } from 'mobx';
19
- import { User, SDLCServerClient } from '@finos/legend-server-sdlc';
20
- import { LEGEND_STUDIO_APP_EVENT } from './LegendStudioAppEvent.js';
16
+ import { ActionState } from '@finos/legend-shared';
17
+ import { ApplicationTelemetry, LegendApplicationSDLCSetupState, } from '@finos/legend-application';
18
+ import { flow, flowResult, makeObservable } from 'mobx';
21
19
  import { LegendStudioEventService } from './LegendStudioEventService.js';
22
20
  const UNKNOWN_USER_ID = '(unknown)';
23
21
  export class LegendStudioBaseStore {
24
22
  applicationStore;
25
- sdlcServerClient;
26
23
  depotServerClient;
27
24
  pluginManager;
28
25
  initState = ActionState.create();
29
- isSDLCAuthorized = false;
30
- SDLCServerTermsOfServicesUrlsToView = [];
26
+ applicationSDLCSetupState;
31
27
  constructor(applicationStore, sdlcServerClient, depotServerClient, pluginManager) {
32
28
  makeObservable(this, {
33
- isSDLCAuthorized: observable,
34
- SDLCServerTermsOfServicesUrlsToView: observable,
35
- needsToAcceptSDLCServerTermsOfServices: computed,
36
29
  initialize: flow,
37
- initializeSDLCServerClient: flow,
38
- dismissSDLCServerTermsOfServicesAlert: action,
39
30
  });
40
31
  this.applicationStore = applicationStore;
41
- this.sdlcServerClient = sdlcServerClient;
32
+ this.applicationSDLCSetupState = new LegendApplicationSDLCSetupState(applicationStore, sdlcServerClient);
42
33
  this.depotServerClient = depotServerClient;
43
34
  this.pluginManager = pluginManager;
44
35
  // Register plugins
45
- this.sdlcServerClient.setTracerService(this.applicationStore.tracerService);
36
+ this.applicationSDLCSetupState.sdlcServerClient.setTracerService(this.applicationStore.tracerService);
46
37
  this.depotServerClient.setTracerService(this.applicationStore.tracerService);
47
38
  }
48
39
  *initialize() {
@@ -52,20 +43,10 @@ export class LegendStudioBaseStore {
52
43
  }
53
44
  this.initState.inProgress();
54
45
  // setup SDLC server client
55
- yield flowResult(this.initializeSDLCServerClient());
56
- let currentUserID = UNKNOWN_USER_ID;
57
- try {
58
- const currentUser = User.serialization.fromJson((yield this.sdlcServerClient.getCurrentUser()));
59
- this.sdlcServerClient.setCurrentUser(currentUser);
60
- currentUserID = currentUser.userId;
61
- }
62
- catch (error) {
63
- assertErrorThrown(error);
64
- this.applicationStore.log.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
65
- this.applicationStore.notifyWarning(error.message);
66
- }
46
+ yield flowResult(this.applicationSDLCSetupState.initializeSDLCServerClient());
67
47
  // setup telemetry service
68
- this.applicationStore.telemetryService.setUserId(currentUserID);
48
+ this.applicationStore.telemetryService.setUserId(this.applicationSDLCSetupState.sdlcServerClient.currentUser?.userId ??
49
+ UNKNOWN_USER_ID);
69
50
  ApplicationTelemetry.logEvent_ApplicationInitialized(this.applicationStore.telemetryService, {
70
51
  browser: {
71
52
  userAgent: navigator.userAgent,
@@ -78,82 +59,5 @@ export class LegendStudioBaseStore {
78
59
  LegendStudioEventService.create(this.applicationStore.eventService).notify_ApplicationLoaded();
79
60
  this.initState.complete();
80
61
  }
81
- *initializeSDLCServerClient() {
82
- try {
83
- this.isSDLCAuthorized =
84
- (yield this.sdlcServerClient.isAuthorized());
85
- if (!this.isSDLCAuthorized) {
86
- this.applicationStore.navigator.jumpTo(SDLCServerClient.authorizeCallbackUrl(this.applicationStore.config.sdlcServerUrl, this.applicationStore.navigator.getCurrentLocation()));
87
- }
88
- else {
89
- // Only proceed intialization after passing authorization check
90
- // check terms of service agreement status
91
- this.SDLCServerTermsOfServicesUrlsToView =
92
- (yield this.sdlcServerClient.hasAcceptedTermsOfService());
93
- if (this.SDLCServerTermsOfServicesUrlsToView.length) {
94
- this.applicationStore.setActionAlertInfo({
95
- message: `Please read and accept the SDLC servers' terms of service`,
96
- prompt: `Click 'Done' when you have accepted all the terms`,
97
- type: ActionAlertType.CAUTION,
98
- actions: [
99
- {
100
- label: 'See terms of services',
101
- default: true,
102
- handler: () => this.SDLCServerTermsOfServicesUrlsToView.forEach((url) => this.applicationStore.navigator.openNewWindow(url)),
103
- type: ActionAlertActionType.PROCEED,
104
- },
105
- {
106
- label: 'Done',
107
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
108
- handler: () => {
109
- this.dismissSDLCServerTermsOfServicesAlert();
110
- this.applicationStore.navigator.reload();
111
- },
112
- },
113
- ],
114
- });
115
- }
116
- // fetch server features config
117
- yield this.sdlcServerClient.fetchServerFeaturesConfiguration();
118
- }
119
- }
120
- catch (error) {
121
- assertErrorThrown(error);
122
- if (
123
- // eslint-disable-next-line no-process-env
124
- process.env.NODE_ENV === 'development' &&
125
- error instanceof NetworkClientError &&
126
- error.response.status === HttpStatus.UNAUTHORIZED) {
127
- this.applicationStore.setActionAlertInfo({
128
- message: 'The first time the application starts in development mode, the developer would need to authenticate using SDLC server. Please do so then manually reload the app',
129
- type: ActionAlertType.STANDARD,
130
- actions: [
131
- {
132
- label: 'Authenticate using SDLC',
133
- type: ActionAlertActionType.PROCEED,
134
- default: true,
135
- handler: () => {
136
- this.applicationStore.navigator.openNewWindow(this.sdlcServerClient.currentUserUrl);
137
- this.applicationStore.setBlockingAlert({
138
- message: 'Waiting for the developer to authenticate using SDLC server',
139
- prompt: 'Please manually reload the application after authentication',
140
- });
141
- },
142
- },
143
- ],
144
- });
145
- }
146
- else {
147
- this.applicationStore.log.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
148
- this.applicationStore.notifyError(error);
149
- }
150
- }
151
- }
152
- get needsToAcceptSDLCServerTermsOfServices() {
153
- return Boolean(this.SDLCServerTermsOfServicesUrlsToView.length);
154
- }
155
- dismissSDLCServerTermsOfServicesAlert() {
156
- this.SDLCServerTermsOfServicesUrlsToView = [];
157
- }
158
62
  }
159
63
  //# sourceMappingURL=LegendStudioBaseStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LegendStudioBaseStore.js","sourceRoot":"","sources":["../../src/stores/LegendStudioBaseStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,qBAAqB,EACrB,eAAe,EACf,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,MAAM,eAAe,GAAG,WAAW,CAAC;AAOpC,MAAM,OAAO,qBAAqB;IAChC,gBAAgB,CAA+B;IAC/C,gBAAgB,CAAmB;IACnC,iBAAiB,CAAoB;IACrC,aAAa,CAA4B;IAEzC,SAAS,G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,CAAC,MAAM,KAAK,UAAU,CAAC,YAAY,EACjD;gBACA,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC;oBACvC,OAAO,EACL,kKAAkK;oBACpK,IAAI,EAAE,eAAe,CAAC,QAAQ;oBAC9B,OAAO,EAAE;wBACP;4BACE,KAAK,EAAE,yBAAyB;4BAChC,IAAI,EAAE,qBAAqB,CAAC,OAAO;4BACnC,OAAO,EAAE,IAAI;4BACb,OAAO,EAAE,GAAS,EAAE;gCAClB,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAC3C,IAAI,CAAC,gBAAgB,CAAC,cAAc,CACrC,CAAC;gCACF,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC;oCACrC,OAAO,EACL,6DAA6D;oCAC/D,MAAM,EACJ,6DAA6D;iCAChE,CAAC,CAAC;4BACL,CAAC;yBACF;qBACF;iBACF,CAAC,CAAC;aACJ;iBAAM;gBACL,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAC7B,QAAQ,CAAC,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,EAC7D,KAAK,CACN,CAAC;gBACF,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aAC1C;SACF;IACH,CAAC;IAED,IAAI,sCAAsC;QACxC,OAAO,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,qCAAqC;QACnC,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAC;IAChD,CAAC;CACF"}
1
+ {"version":3,"file":"LegendStudioBaseStore.js","sourceRoot":"","sources":["../../src/stores/LegendStudioBaseStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAEL,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,E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gB,CAAC,gBAAgB,CAAC,SAAS,CAC9C,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM;YACjE,eAAe,CAClB,CAAC;QAEF,oBAAoB,CAAC,+BAA+B,CAClD,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EACtC;YACE,OAAO,EAAE;gBACP,SAAS,EAAE,SAAS,CAAC,SAAS;aAC/B;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;gBAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;aAC3B;SACF,CACF,CAAC;QACF,wBAAwB,CAAC,MAAM,CAC7B,IAAI,CAAC,gBAAgB,CAAC,YAAY,CACnC,CAAC,wBAAwB,EAAE,CAAC;QAE7B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "13.1.0",
3
+ "version": "13.1.1",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -44,13 +44,13 @@
44
44
  "test:watch": "jest --watch"
45
45
  },
46
46
  "dependencies": {
47
- "@finos/legend-application": "7.1.0",
48
- "@finos/legend-art": "3.0.0",
49
- "@finos/legend-graph": "14.0.0",
50
- "@finos/legend-server-depot": "3.0.5",
51
- "@finos/legend-server-sdlc": "4.0.7",
52
- "@finos/legend-shared": "6.0.0",
53
- "@finos/legend-storage": "3.0.4",
47
+ "@finos/legend-application": "7.1.1",
48
+ "@finos/legend-art": "3.0.1",
49
+ "@finos/legend-graph": "14.0.1",
50
+ "@finos/legend-server-depot": "3.0.6",
51
+ "@finos/legend-server-sdlc": "4.0.8",
52
+ "@finos/legend-shared": "6.0.1",
53
+ "@finos/legend-storage": "3.0.5",
54
54
  "@testing-library/react": "13.3.0",
55
55
  "@types/react": "18.0.17",
56
56
  "@types/react-dom": "18.0.6",
@@ -73,7 +73,7 @@
73
73
  "serializr": "2.0.5"
74
74
  },
75
75
  "devDependencies": {
76
- "@finos/legend-dev-utils": "2.0.10",
76
+ "@finos/legend-dev-utils": "2.0.11",
77
77
  "@jest/globals": "28.1.3",
78
78
  "cross-env": "7.0.3",
79
79
  "eslint": "8.22.0",
@@ -119,12 +119,12 @@ export const LegendStudioApplicationRoot = observer(() => {
119
119
 
120
120
  return (
121
121
  <div className="app">
122
- {!baseStore.isSDLCAuthorized && (
122
+ {!baseStore.applicationSDLCSetupState.isSDLCAuthorized && (
123
123
  <div className="app__page">
124
124
  <PanelLoadingIndicator isLoading={true} />
125
125
  </div>
126
126
  )}
127
- {baseStore.isSDLCAuthorized && (
127
+ {baseStore.applicationSDLCSetupState.isSDLCAuthorized && (
128
128
  <>
129
129
  {/* TODO: consider moving this to `LegendApplicationComponentFrameworkProvider` */}
130
130
  <VirtualAssistant />
@@ -14,31 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {
18
- type GeneratorFn,
19
- type PlainObject,
20
- HttpStatus,
21
- NetworkClientError,
22
- ActionState,
23
- LogEvent,
24
- assertErrorThrown,
25
- } from '@finos/legend-shared';
17
+ import { type GeneratorFn, ActionState } from '@finos/legend-shared';
26
18
  import {
27
19
  type ApplicationStore,
28
- ActionAlertActionType,
29
- ActionAlertType,
30
20
  ApplicationTelemetry,
21
+ LegendApplicationSDLCSetupState,
31
22
  } from '@finos/legend-application';
32
- import {
33
- action,
34
- computed,
35
- flow,
36
- flowResult,
37
- makeObservable,
38
- observable,
39
- } from 'mobx';
40
- import { User, SDLCServerClient } from '@finos/legend-server-sdlc';
41
- import { LEGEND_STUDIO_APP_EVENT } from './LegendStudioAppEvent.js';
23
+ import { flow, flowResult, makeObservable } from 'mobx';
24
+ import type { SDLCServerClient } from '@finos/legend-server-sdlc';
42
25
  import type { DepotServerClient } from '@finos/legend-server-depot';
43
26
  import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
44
27
  import type { LegendStudioApplicationConfig } from '../application/LegendStudioApplicationConfig.js';
@@ -54,14 +37,11 @@ export type LegendStudioApplicationStore = ApplicationStore<
54
37
 
55
38
  export class LegendStudioBaseStore {
56
39
  applicationStore: LegendStudioApplicationStore;
57
- sdlcServerClient: SDLCServerClient;
58
40
  depotServerClient: DepotServerClient;
59
41
  pluginManager: LegendStudioPluginManager;
60
42
 
61
43
  initState = ActionState.create();
62
-
63
- isSDLCAuthorized = false;
64
- SDLCServerTermsOfServicesUrlsToView: string[] = [];
44
+ applicationSDLCSetupState: LegendApplicationSDLCSetupState;
65
45
 
66
46
  constructor(
67
47
  applicationStore: LegendStudioApplicationStore,
@@ -69,23 +49,23 @@ export class LegendStudioBaseStore {
69
49
  depotServerClient: DepotServerClient,
70
50
  pluginManager: LegendStudioPluginManager,
71
51
  ) {
72
- makeObservable<LegendStudioBaseStore, 'initializeSDLCServerClient'>(this, {
73
- isSDLCAuthorized: observable,
74
- SDLCServerTermsOfServicesUrlsToView: observable,
75
- needsToAcceptSDLCServerTermsOfServices: computed,
52
+ makeObservable(this, {
76
53
  initialize: flow,
77
- initializeSDLCServerClient: flow,
78
- dismissSDLCServerTermsOfServicesAlert: action,
79
54
  });
80
55
 
81
56
  this.applicationStore = applicationStore;
82
- this.sdlcServerClient = sdlcServerClient;
57
+ this.applicationSDLCSetupState = new LegendApplicationSDLCSetupState(
58
+ applicationStore,
59
+ sdlcServerClient,
60
+ );
83
61
  this.depotServerClient = depotServerClient;
84
62
 
85
63
  this.pluginManager = pluginManager;
86
64
 
87
65
  // Register plugins
88
- this.sdlcServerClient.setTracerService(this.applicationStore.tracerService);
66
+ this.applicationSDLCSetupState.sdlcServerClient.setTracerService(
67
+ this.applicationStore.tracerService,
68
+ );
89
69
  this.depotServerClient.setTracerService(
90
70
  this.applicationStore.tracerService,
91
71
  );
@@ -101,26 +81,15 @@ export class LegendStudioBaseStore {
101
81
  this.initState.inProgress();
102
82
 
103
83
  // setup SDLC server client
104
- yield flowResult(this.initializeSDLCServerClient());
105
-
106
- let currentUserID = UNKNOWN_USER_ID;
107
- try {
108
- const currentUser = User.serialization.fromJson(
109
- (yield this.sdlcServerClient.getCurrentUser()) as PlainObject<User>,
110
- );
111
- this.sdlcServerClient.setCurrentUser(currentUser);
112
- currentUserID = currentUser.userId;
113
- } catch (error) {
114
- assertErrorThrown(error);
115
- this.applicationStore.log.error(
116
- LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
117
- error,
118
- );
119
- this.applicationStore.notifyWarning(error.message);
120
- }
84
+ yield flowResult(
85
+ this.applicationSDLCSetupState.initializeSDLCServerClient(),
86
+ );
121
87
 
122
88
  // setup telemetry service
123
- this.applicationStore.telemetryService.setUserId(currentUserID);
89
+ this.applicationStore.telemetryService.setUserId(
90
+ this.applicationSDLCSetupState.sdlcServerClient.currentUser?.userId ??
91
+ UNKNOWN_USER_ID,
92
+ );
124
93
 
125
94
  ApplicationTelemetry.logEvent_ApplicationInitialized(
126
95
  this.applicationStore.telemetryService,
@@ -140,100 +109,4 @@ export class LegendStudioBaseStore {
140
109
 
141
110
  this.initState.complete();
142
111
  }
143
-
144
- private *initializeSDLCServerClient(): GeneratorFn<void> {
145
- try {
146
- this.isSDLCAuthorized =
147
- (yield this.sdlcServerClient.isAuthorized()) as boolean;
148
- if (!this.isSDLCAuthorized) {
149
- this.applicationStore.navigator.jumpTo(
150
- SDLCServerClient.authorizeCallbackUrl(
151
- this.applicationStore.config.sdlcServerUrl,
152
- this.applicationStore.navigator.getCurrentLocation(),
153
- ),
154
- );
155
- } else {
156
- // Only proceed intialization after passing authorization check
157
-
158
- // check terms of service agreement status
159
- this.SDLCServerTermsOfServicesUrlsToView =
160
- (yield this.sdlcServerClient.hasAcceptedTermsOfService()) as string[];
161
- if (this.SDLCServerTermsOfServicesUrlsToView.length) {
162
- this.applicationStore.setActionAlertInfo({
163
- message: `Please read and accept the SDLC servers' terms of service`,
164
- prompt: `Click 'Done' when you have accepted all the terms`,
165
- type: ActionAlertType.CAUTION,
166
- actions: [
167
- {
168
- label: 'See terms of services',
169
- default: true,
170
- handler: (): void =>
171
- this.SDLCServerTermsOfServicesUrlsToView.forEach((url) =>
172
- this.applicationStore.navigator.openNewWindow(url),
173
- ),
174
- type: ActionAlertActionType.PROCEED,
175
- },
176
- {
177
- label: 'Done',
178
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
179
- handler: (): void => {
180
- this.dismissSDLCServerTermsOfServicesAlert();
181
- this.applicationStore.navigator.reload();
182
- },
183
- },
184
- ],
185
- });
186
- }
187
-
188
- // fetch server features config
189
- yield this.sdlcServerClient.fetchServerFeaturesConfiguration();
190
- }
191
- } catch (error) {
192
- assertErrorThrown(error);
193
- if (
194
- // eslint-disable-next-line no-process-env
195
- process.env.NODE_ENV === 'development' &&
196
- error instanceof NetworkClientError &&
197
- error.response.status === HttpStatus.UNAUTHORIZED
198
- ) {
199
- this.applicationStore.setActionAlertInfo({
200
- message:
201
- 'The first time the application starts in development mode, the developer would need to authenticate using SDLC server. Please do so then manually reload the app',
202
- type: ActionAlertType.STANDARD,
203
- actions: [
204
- {
205
- label: 'Authenticate using SDLC',
206
- type: ActionAlertActionType.PROCEED,
207
- default: true,
208
- handler: (): void => {
209
- this.applicationStore.navigator.openNewWindow(
210
- this.sdlcServerClient.currentUserUrl,
211
- );
212
- this.applicationStore.setBlockingAlert({
213
- message:
214
- 'Waiting for the developer to authenticate using SDLC server',
215
- prompt:
216
- 'Please manually reload the application after authentication',
217
- });
218
- },
219
- },
220
- ],
221
- });
222
- } else {
223
- this.applicationStore.log.error(
224
- LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
225
- error,
226
- );
227
- this.applicationStore.notifyError(error);
228
- }
229
- }
230
- }
231
-
232
- get needsToAcceptSDLCServerTermsOfServices(): boolean {
233
- return Boolean(this.SDLCServerTermsOfServicesUrlsToView.length);
234
- }
235
-
236
- dismissSDLCServerTermsOfServicesAlert(): void {
237
- this.SDLCServerTermsOfServicesUrlsToView = [];
238
- }
239
112
  }