@finos/legend-application 7.1.1 → 7.1.2

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/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application v7.1.1
1
+ /** @license @finos/legend-application v7.1.2
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/index.d.ts CHANGED
@@ -34,7 +34,6 @@ export * from './stores/AssistantService.js';
34
34
  export * from './stores/ApplicationNavigationContextService.js';
35
35
  export * from './stores/LegendApplicationPlugin.js';
36
36
  export * from './stores/ApplicationStoreTestUtils.js';
37
- export * from './stores/LegendApplicationSDLCSetupState.js';
38
37
  export * from './components/shared/DocumentationLink.js';
39
38
  export * from './components/shared/TextInputEditor.js';
40
39
  export * from './components/shared/LambdaEditor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAE3B,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AAGzE,cAAc,kCAAkC,CAAC;AAEjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC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,yDAAyD,CAAC;AACxE,cAAc,kEAAkE,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,uCAAuC,CAAC"}
package/lib/index.js CHANGED
@@ -36,7 +36,6 @@ export * from './stores/AssistantService.js';
36
36
  export * from './stores/ApplicationNavigationContextService.js';
37
37
  export * from './stores/LegendApplicationPlugin.js';
38
38
  export * from './stores/ApplicationStoreTestUtils.js';
39
- export * from './stores/LegendApplicationSDLCSetupState.js';
40
39
  // ------------------------------------------- Shared components -------------------------------------------
41
40
  export * from './components/shared/DocumentationLink.js';
42
41
  export * from './components/shared/TextInputEditor.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAE3B,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,8EAA8E;AAC9E,kEAAkE;AAClE,cAAc,kCAAkC,CAAC;AAEjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,uCAAuC,CAAC;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Ac,oDAAoD,CAAC;AACnE,cAAc,yDAAyD,CAAC;AACxE,cAAc,kEAAkE,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,uCAAuC,CAAC"}
@@ -22,9 +22,10 @@ export declare const buildParametersLetLambdaFunc: (graph: PureModel, lambdaPara
22
22
  export declare class LambdaParameterState {
23
23
  readonly uuid: string;
24
24
  readonly parameter: VariableExpression;
25
+ readonly graph: PureModel;
25
26
  observableContext: ObserverContext;
26
27
  value: ValueSpecification | undefined;
27
- constructor(variableExpression: VariableExpression, observableContext: ObserverContext);
28
+ constructor(variableExpression: VariableExpression, observableContext: ObserverContext, graph: PureModel);
28
29
  mockParameterValue(): void;
29
30
  setValue(value: ValueSpecification | undefined): void;
30
31
  changeVariableType(type: Type): void;
@@ -1 +1 @@
1
- {"version":3,"file":"LambdaParameterState.d.ts","sourceRoot":"","sources":["../../../src/stores/shared/LambdaParameterState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,kBAAkB,EACvB,KAAK,SAAS,EAOd,kBAAkB,EAClB,cAAc,EAQf,MAAM,qBAAqB,CAAC;AAe7B,oBAAY,uBAAuB;IACjC,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,4BAA4B,UAChC,SAAS,0BACQ,oBAAoB,EAAE,KAC7C,cA6BF,CAAC;AACF,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,SAAU;IACvB,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,iBAAiB,EAAE,eAAe,CAAC;IACnC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;gBAGpC,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE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O,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAKvD,KAAK,IAAI,IAAI;CAId;AACD,qBAAa,qBAAqB;IAChC,eAAe,EAAE,oBAAoB,EAAE,CAAM;IAC7C,0BAA0B,qCAA4C;IAEtE,YAAY,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI;IAI7C,eAAe,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI;IAGhD,aAAa,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,IAAI;CAGjD"}
@@ -45,9 +45,10 @@ export const buildParametersLetLambdaFunc = (graph, lambdaParametersStates) => {
45
45
  export class LambdaParameterState {
46
46
  uuid = uuid();
47
47
  parameter;
48
+ graph;
48
49
  observableContext;
49
50
  value;
50
- constructor(variableExpression, observableContext) {
51
+ constructor(variableExpression, observableContext, graph) {
51
52
  makeObservable(this, {
52
53
  value: observable,
53
54
  setValue: action,
@@ -55,9 +56,10 @@ export class LambdaParameterState {
55
56
  });
56
57
  this.observableContext = observableContext;
57
58
  this.parameter = observe_VariableExpression(variableExpression);
59
+ this.graph = graph;
58
60
  }
59
61
  mockParameterValue() {
60
- this.setValue(generateVariableExpressionMockValue(this.parameter));
62
+ this.setValue(generateVariableExpressionMockValue(this.parameter, this.graph));
61
63
  }
62
64
  setValue(value) {
63
65
  if (value instanceof VariableExpression) {
@@ -1 +1 @@
1
- {"version":3,"file":"LambdaParameterState.js","sourceRoot":"","sources":["../../../src/stores/shared/LambdaParameterState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,WAAW,EACX,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,mCAAmC,GACpC,MAAM,qBAAqB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,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF;AACD,MAAM,OAAO,qBAAqB;IAChC,eAAe,GAA2B,EAAE,CAAC;IAC7C,0BAA0B,GAAG,IAAI,kCAAkC,EAAE,CAAC;IAEtE,YAAY,CAAC,GAAyB;QACpC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,eAAe,CAAC,GAAyB;QACvC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,aAAa,CAAC,GAA2B;QACvC,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"LambdaParameterState.js","sourceRoot":"","sources":["../../../src/stores/shared/LambdaParameterState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,WAAW,EACX,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,mCAAmC,GACpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAE/C,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,8CAAmB,CA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0B,GAAG,IAAI,kCAAkC,EAAE,CAAC;IAEtE,YAAY,CAAC,GAAyB;QACpC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,eAAe,CAAC,GAAyB;QACvC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,aAAa,CAAC,GAA2B;QACvC,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "description": "Legend application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -44,8 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@finos/legend-art": "3.0.1",
47
- "@finos/legend-graph": "14.0.1",
48
- "@finos/legend-server-sdlc": "4.0.8",
47
+ "@finos/legend-graph": "14.0.2",
49
48
  "@finos/legend-shared": "6.0.1",
50
49
  "@types/css-font-loading-module": "0.0.7",
51
50
  "@types/papaparse": "5.3.3",
package/src/index.ts CHANGED
@@ -40,7 +40,6 @@ export * from './stores/ApplicationNavigationContextService.js';
40
40
  export * from './stores/LegendApplicationPlugin.js';
41
41
 
42
42
  export * from './stores/ApplicationStoreTestUtils.js';
43
- export * from './stores/LegendApplicationSDLCSetupState.js';
44
43
 
45
44
  // ------------------------------------------- Shared components -------------------------------------------
46
45
 
@@ -90,12 +90,14 @@ export const buildParametersLetLambdaFunc = (
90
90
  export class LambdaParameterState {
91
91
  readonly uuid = uuid();
92
92
  readonly parameter: VariableExpression;
93
+ readonly graph: PureModel;
93
94
  observableContext: ObserverContext;
94
95
  value: ValueSpecification | undefined;
95
96
 
96
97
  constructor(
97
98
  variableExpression: VariableExpression,
98
99
  observableContext: ObserverContext,
100
+ graph: PureModel,
99
101
  ) {
100
102
  makeObservable(this, {
101
103
  value: observable,
@@ -104,10 +106,13 @@ export class LambdaParameterState {
104
106
  });
105
107
  this.observableContext = observableContext;
106
108
  this.parameter = observe_VariableExpression(variableExpression);
109
+ this.graph = graph;
107
110
  }
108
111
 
109
112
  mockParameterValue(): void {
110
- this.setValue(generateVariableExpressionMockValue(this.parameter));
113
+ this.setValue(
114
+ generateVariableExpressionMockValue(this.parameter, this.graph),
115
+ );
111
116
  }
112
117
 
113
118
  setValue(value: ValueSpecification | undefined): void {
package/tsconfig.json CHANGED
@@ -41,7 +41,6 @@
41
41
  "./src/stores/DocumentationService.ts",
42
42
  "./src/stores/EventService.ts",
43
43
  "./src/stores/LegendApplicationPlugin.ts",
44
- "./src/stores/LegendApplicationSDLCSetupState.ts",
45
44
  "./src/stores/PureLanguageSupport.ts",
46
45
  "./src/stores/WebApplicationNavigator.ts",
47
46
  "./src/stores/shared/ExecutionPlanState.ts",
@@ -1,30 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { SDLCServerClient } from '@finos/legend-server-sdlc';
17
- import { type GeneratorFn } from '@finos/legend-shared';
18
- import { type GenericLegendApplicationStore } from './ApplicationStore.js';
19
- export declare class LegendApplicationSDLCSetupState {
20
- applicationStore: GenericLegendApplicationStore;
21
- sdlcServerClient: SDLCServerClient;
22
- isSDLCAuthorized: boolean;
23
- SDLCServerTermsOfServicesUrlsToView: string[];
24
- constructor(applicationStore: GenericLegendApplicationStore, sdlcServerClient: SDLCServerClient);
25
- initializeSDLCServerClient(): GeneratorFn<void>;
26
- fetchCurrentUser(): GeneratorFn<void>;
27
- get needsToAcceptSDLCServerTermsOfServices(): boolean;
28
- dismissSDLCServerTermsOfServicesAlert(): void;
29
- }
30
- //# sourceMappingURL=LegendApplicationSDLCSetupState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LegendApplicationSDLCSetupState.d.ts","sourceRoot":"","sources":["../../src/stores/LegendApplicationSDLCSetupState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAQ,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,KAAK,WAAW,EAMjB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,EACL,KAAK,6BAA6B,EAGnC,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,+BAA+B;IAC1C,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,UAAS;IACzB,mCAAmC,EAAE,MAAM,EAAE,CAAM;gBAGjD,gBAAgB,EAAE,6BAA6B,EAC/C,gBAAgB,EAAE,gBAAgB;IAcnC,0BAA0B,IAAI,WAAW,CAAC,IAAI,CAAC;IAyF/C,gBAAgB,IAAI,WAAW,CAAC,IAAI,CAAC;IAgBtC,IAAI,sCAAsC,IAAI,OAAO,CAEpD;IAED,qCAAqC,IAAI,IAAI;CAG9C"}
@@ -1,128 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { SDLCServerClient, User } from '@finos/legend-server-sdlc';
17
- import { assertErrorThrown, HttpStatus, LogEvent, NetworkClientError, } from '@finos/legend-shared';
18
- import { action, computed, flow, flowResult, makeObservable, observable, } from 'mobx';
19
- import { APPLICATION_EVENT } from './ApplicationEvent.js';
20
- import { ActionAlertActionType, ActionAlertType, } from './ApplicationStore.js';
21
- export class LegendApplicationSDLCSetupState {
22
- applicationStore;
23
- sdlcServerClient;
24
- isSDLCAuthorized = false;
25
- SDLCServerTermsOfServicesUrlsToView = [];
26
- constructor(applicationStore, sdlcServerClient) {
27
- makeObservable(this, {
28
- isSDLCAuthorized: observable,
29
- SDLCServerTermsOfServicesUrlsToView: observable,
30
- dismissSDLCServerTermsOfServicesAlert: action,
31
- needsToAcceptSDLCServerTermsOfServices: computed,
32
- initializeSDLCServerClient: flow,
33
- fetchCurrentUser: flow,
34
- });
35
- this.applicationStore = applicationStore;
36
- this.sdlcServerClient = sdlcServerClient;
37
- }
38
- *initializeSDLCServerClient() {
39
- try {
40
- this.isSDLCAuthorized =
41
- (yield this.sdlcServerClient.isAuthorized());
42
- if (!this.isSDLCAuthorized) {
43
- this.applicationStore.navigator.jumpTo(SDLCServerClient.authorizeCallbackUrl(this.sdlcServerClient.baseUrl ?? '', this.applicationStore.navigator.getCurrentLocation()));
44
- }
45
- else {
46
- // Only proceed intialization after passing authorization check
47
- // check terms of service agreement status
48
- this.SDLCServerTermsOfServicesUrlsToView =
49
- (yield this.sdlcServerClient.hasAcceptedTermsOfService());
50
- if (this.SDLCServerTermsOfServicesUrlsToView.length) {
51
- this.applicationStore.setActionAlertInfo({
52
- message: `Please read and accept the SDLC servers' terms of service`,
53
- prompt: `Click 'Done' when you have accepted all the terms`,
54
- type: ActionAlertType.CAUTION,
55
- actions: [
56
- {
57
- label: 'See terms of services',
58
- default: true,
59
- handler: () => this.SDLCServerTermsOfServicesUrlsToView.forEach((url) => this.applicationStore.navigator.openNewWindow(url)),
60
- type: ActionAlertActionType.PROCEED,
61
- },
62
- {
63
- label: 'Done',
64
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
65
- handler: () => {
66
- this.dismissSDLCServerTermsOfServicesAlert();
67
- this.applicationStore.navigator.reload();
68
- },
69
- },
70
- ],
71
- });
72
- }
73
- // fetch server features config + current user
74
- yield this.sdlcServerClient.fetchServerFeaturesConfiguration();
75
- yield flowResult(this.fetchCurrentUser());
76
- }
77
- }
78
- catch (error) {
79
- assertErrorThrown(error);
80
- if (
81
- // eslint-disable-next-line no-process-env
82
- process.env.NODE_ENV === 'development' &&
83
- error instanceof NetworkClientError &&
84
- error.response.status === HttpStatus.UNAUTHORIZED) {
85
- this.applicationStore.setActionAlertInfo({
86
- 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',
87
- type: ActionAlertType.STANDARD,
88
- actions: [
89
- {
90
- label: 'Authenticate using SDLC',
91
- type: ActionAlertActionType.PROCEED,
92
- default: true,
93
- handler: () => {
94
- this.applicationStore.navigator.openNewWindow(this.sdlcServerClient.currentUserUrl);
95
- this.applicationStore.setBlockingAlert({
96
- message: 'Waiting for the developer to authenticate using SDLC server',
97
- prompt: 'Please manually reload the application after authentication',
98
- });
99
- },
100
- },
101
- ],
102
- });
103
- }
104
- else {
105
- this.applicationStore.log.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP_FAILURE), error);
106
- this.applicationStore.notifyError(error);
107
- }
108
- }
109
- }
110
- *fetchCurrentUser() {
111
- try {
112
- const currentUser = User.serialization.fromJson((yield this.sdlcServerClient.getCurrentUser()));
113
- this.sdlcServerClient.setCurrentUser(currentUser);
114
- }
115
- catch (error) {
116
- assertErrorThrown(error);
117
- this.applicationStore.log.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP_FAILURE), error);
118
- this.applicationStore.notifyWarning(error.message);
119
- }
120
- }
121
- get needsToAcceptSDLCServerTermsOfServices() {
122
- return Boolean(this.SDLCServerTermsOfServicesUrlsToView.length);
123
- }
124
- dismissSDLCServerTermsOfServicesAlert() {
125
- this.SDLCServerTermsOfServicesUrlsToView = [];
126
- }
127
- }
128
- //# sourceMappingURL=LegendApplicationSDLCSetupState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LegendApplicationSDLCSetupState.js","sourceRoot":"","sources":["../../src/stores/LegendApplicationSDLCSetupState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAEL,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAEL,qBAAqB,EACrB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,OAAO,+BAA+B;IAC1C,gBAAgB,CAAgC;IAChD,gBAAgB,CAAmB;IACnC,gBAAgB,GAAG,KAAK,CAAC;IACzB,mCAAmC,GAAa,EAAE,CAAC;IAEnD,YACE,gBAA+C,EAC/C,gBAAkC;QAElC,cAAc,CAAC,IAAI,EAAE;YACnB,gBAAgB,EAAE,UAAU;YAC5B,mCAAmC,EAAE,UAAU;YAC/C,qCAAqC,EAAE,MAAM;YAC7C,sCAAsC,EAAE,QAAQ;YAChD,0BAA0B,EAAE,IAAI;YAChC,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,CAAC,0BAA0B;QACzB,IAAI;YACF,IAAI,CAAC,gBAAgB;gBACnB,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAY,CAAC;YAC1D,IAAI,CAAC,IAAI,CAAC,gB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AW,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAC7B,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,EAC5D,KAAK,CACN,CAAC;YACF,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACpD;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,175 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { SDLCServerClient, User } from '@finos/legend-server-sdlc';
18
- import {
19
- type GeneratorFn,
20
- assertErrorThrown,
21
- HttpStatus,
22
- LogEvent,
23
- NetworkClientError,
24
- type PlainObject,
25
- } from '@finos/legend-shared';
26
- import {
27
- action,
28
- computed,
29
- flow,
30
- flowResult,
31
- makeObservable,
32
- observable,
33
- } from 'mobx';
34
- import { APPLICATION_EVENT } from './ApplicationEvent.js';
35
- import {
36
- type GenericLegendApplicationStore,
37
- ActionAlertActionType,
38
- ActionAlertType,
39
- } from './ApplicationStore.js';
40
-
41
- export class LegendApplicationSDLCSetupState {
42
- applicationStore: GenericLegendApplicationStore;
43
- sdlcServerClient: SDLCServerClient;
44
- isSDLCAuthorized = false;
45
- SDLCServerTermsOfServicesUrlsToView: string[] = [];
46
-
47
- constructor(
48
- applicationStore: GenericLegendApplicationStore,
49
- sdlcServerClient: SDLCServerClient,
50
- ) {
51
- makeObservable(this, {
52
- isSDLCAuthorized: observable,
53
- SDLCServerTermsOfServicesUrlsToView: observable,
54
- dismissSDLCServerTermsOfServicesAlert: action,
55
- needsToAcceptSDLCServerTermsOfServices: computed,
56
- initializeSDLCServerClient: flow,
57
- fetchCurrentUser: flow,
58
- });
59
- this.applicationStore = applicationStore;
60
- this.sdlcServerClient = sdlcServerClient;
61
- }
62
-
63
- *initializeSDLCServerClient(): GeneratorFn<void> {
64
- try {
65
- this.isSDLCAuthorized =
66
- (yield this.sdlcServerClient.isAuthorized()) as boolean;
67
- if (!this.isSDLCAuthorized) {
68
- this.applicationStore.navigator.jumpTo(
69
- SDLCServerClient.authorizeCallbackUrl(
70
- this.sdlcServerClient.baseUrl ?? '',
71
- this.applicationStore.navigator.getCurrentLocation(),
72
- ),
73
- );
74
- } else {
75
- // Only proceed intialization after passing authorization check
76
-
77
- // check terms of service agreement status
78
- this.SDLCServerTermsOfServicesUrlsToView =
79
- (yield this.sdlcServerClient.hasAcceptedTermsOfService()) as string[];
80
- if (this.SDLCServerTermsOfServicesUrlsToView.length) {
81
- this.applicationStore.setActionAlertInfo({
82
- message: `Please read and accept the SDLC servers' terms of service`,
83
- prompt: `Click 'Done' when you have accepted all the terms`,
84
- type: ActionAlertType.CAUTION,
85
- actions: [
86
- {
87
- label: 'See terms of services',
88
- default: true,
89
- handler: (): void =>
90
- this.SDLCServerTermsOfServicesUrlsToView.forEach((url) =>
91
- this.applicationStore.navigator.openNewWindow(url),
92
- ),
93
- type: ActionAlertActionType.PROCEED,
94
- },
95
- {
96
- label: 'Done',
97
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
98
- handler: (): void => {
99
- this.dismissSDLCServerTermsOfServicesAlert();
100
- this.applicationStore.navigator.reload();
101
- },
102
- },
103
- ],
104
- });
105
- }
106
-
107
- // fetch server features config + current user
108
- yield this.sdlcServerClient.fetchServerFeaturesConfiguration();
109
- yield flowResult(this.fetchCurrentUser());
110
- }
111
- } catch (error) {
112
- assertErrorThrown(error);
113
- if (
114
- // eslint-disable-next-line no-process-env
115
- process.env.NODE_ENV === 'development' &&
116
- error instanceof NetworkClientError &&
117
- error.response.status === HttpStatus.UNAUTHORIZED
118
- ) {
119
- this.applicationStore.setActionAlertInfo({
120
- message:
121
- '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',
122
- type: ActionAlertType.STANDARD,
123
- actions: [
124
- {
125
- label: 'Authenticate using SDLC',
126
- type: ActionAlertActionType.PROCEED,
127
- default: true,
128
- handler: (): void => {
129
- this.applicationStore.navigator.openNewWindow(
130
- this.sdlcServerClient.currentUserUrl,
131
- );
132
- this.applicationStore.setBlockingAlert({
133
- message:
134
- 'Waiting for the developer to authenticate using SDLC server',
135
- prompt:
136
- 'Please manually reload the application after authentication',
137
- });
138
- },
139
- },
140
- ],
141
- });
142
- } else {
143
- this.applicationStore.log.error(
144
- LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP_FAILURE),
145
- error,
146
- );
147
- this.applicationStore.notifyError(error);
148
- }
149
- }
150
- }
151
-
152
- *fetchCurrentUser(): GeneratorFn<void> {
153
- try {
154
- const currentUser = User.serialization.fromJson(
155
- (yield this.sdlcServerClient.getCurrentUser()) as PlainObject<User>,
156
- );
157
- this.sdlcServerClient.setCurrentUser(currentUser);
158
- } catch (error) {
159
- assertErrorThrown(error);
160
- this.applicationStore.log.error(
161
- LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP_FAILURE),
162
- error,
163
- );
164
- this.applicationStore.notifyWarning(error.message);
165
- }
166
- }
167
-
168
- get needsToAcceptSDLCServerTermsOfServices(): boolean {
169
- return Boolean(this.SDLCServerTermsOfServicesUrlsToView.length);
170
- }
171
-
172
- dismissSDLCServerTermsOfServicesAlert(): void {
173
- this.SDLCServerTermsOfServicesUrlsToView = [];
174
- }
175
- }