@finos/legend-extension-dsl-data-space 10.0.11 → 10.0.12
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/__lib__/DSL_DataSpace_LegendApplicationCommand.d.ts +28 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.d.ts.map +1 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.js +70 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.js.map +1 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.d.ts +20 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.d.ts.map +1 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.js +21 -0
- package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.js.map +1 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +3 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +13 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
- package/lib/components/DataSpaceDataAccess.js +5 -76
- package/lib/components/DataSpaceDataAccess.js.map +1 -1
- package/lib/components/DataSpaceDescription.d.ts.map +1 -1
- package/lib/components/DataSpaceDescription.js +2 -1
- package/lib/components/DataSpaceDescription.js.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.js +110 -39
- package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
- package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceExecutionContextViewer.js +3 -3
- package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -1
- package/lib/components/DataSpaceInfoPanel.d.ts.map +1 -1
- package/lib/components/DataSpaceInfoPanel.js +6 -6
- package/lib/components/DataSpaceInfoPanel.js.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.js +18 -8
- package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
- package/lib/components/DataSpacePlaceholder.d.ts +4 -0
- package/lib/components/DataSpacePlaceholder.d.ts.map +1 -1
- package/lib/components/DataSpacePlaceholder.js +6 -1
- package/lib/components/DataSpacePlaceholder.js.map +1 -1
- package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
- package/lib/components/DataSpaceQuickStart.js +24 -11
- package/lib/components/DataSpaceQuickStart.js.map +1 -1
- package/lib/components/DataSpaceSupportPanel.d.ts.map +1 -1
- package/lib/components/DataSpaceSupportPanel.js +17 -8
- package/lib/components/DataSpaceSupportPanel.js.map +1 -1
- package/lib/components/DataSpaceViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceViewer.js +34 -13
- package/lib/components/DataSpaceViewer.js.map +1 -1
- package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
- package/lib/components/DataSpaceViewerActivityBar.js +15 -12
- package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/DataSpaceLayoutState.d.ts +46 -0
- package/lib/stores/DataSpaceLayoutState.d.ts.map +1 -1
- package/lib/stores/DataSpaceLayoutState.js +184 -1
- package/lib/stores/DataSpaceLayoutState.js.map +1 -1
- package/lib/stores/DataSpaceModelsDocumentationState.d.ts +11 -2
- package/lib/stores/DataSpaceModelsDocumentationState.d.ts.map +1 -1
- package/lib/stores/DataSpaceModelsDocumentationState.js +41 -0
- package/lib/stores/DataSpaceModelsDocumentationState.js.map +1 -1
- package/lib/stores/DataSpaceQuickStartState.d.ts +24 -0
- package/lib/stores/DataSpaceQuickStartState.d.ts.map +1 -0
- package/lib/stores/DataSpaceQuickStartState.js +48 -0
- package/lib/stores/DataSpaceQuickStartState.js.map +1 -0
- package/lib/stores/DataSpaceViewerDiagramViewerState.d.ts +44 -0
- package/lib/stores/DataSpaceViewerDiagramViewerState.d.ts.map +1 -0
- package/lib/stores/DataSpaceViewerDiagramViewerState.js +194 -0
- package/lib/stores/DataSpaceViewerDiagramViewerState.js.map +1 -0
- package/lib/stores/DataSpaceViewerNavigation.d.ts +36 -0
- package/lib/stores/DataSpaceViewerNavigation.d.ts.map +1 -0
- package/lib/stores/DataSpaceViewerNavigation.js +47 -0
- package/lib/stores/DataSpaceViewerNavigation.js.map +1 -0
- package/lib/stores/DataSpaceViewerState.d.ts +22 -74
- package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
- package/lib/stores/DataSpaceViewerState.js +34 -259
- package/lib/stores/DataSpaceViewerState.js.map +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.js +8 -5
- package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts +8 -8
- package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
- package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
- package/lib/stores/studio/DataSpacePreviewState.js +15 -3
- package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
- package/package.json +13 -13
- package/src/__lib__/DSL_DataSpace_LegendApplicationCommand.ts +74 -0
- package/src/__lib__/DSL_DataSpace_LegendApplicationNavigation.ts +33 -0
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +20 -1
- package/src/components/DataSpaceDataAccess.tsx +9 -122
- package/src/components/DataSpaceDescription.tsx +5 -5
- package/src/components/DataSpaceDiagramViewer.tsx +449 -69
- package/src/components/DataSpaceExecutionContextViewer.tsx +47 -40
- package/src/components/DataSpaceInfoPanel.tsx +107 -117
- package/src/components/DataSpaceModelsDocumentation.tsx +31 -12
- package/src/components/DataSpacePlaceholder.tsx +22 -0
- package/src/components/DataSpaceQuickStart.tsx +95 -15
- package/src/components/DataSpaceSupportPanel.tsx +146 -14
- package/src/components/DataSpaceViewer.tsx +153 -23
- package/src/components/DataSpaceViewerActivityBar.tsx +40 -20
- package/src/components/index.ts +1 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +1 -1
- package/src/stores/DataSpaceLayoutState.ts +272 -0
- package/src/stores/DataSpaceModelsDocumentationState.ts +61 -2
- package/src/stores/DataSpaceQuickStartState.ts +91 -0
- package/src/stores/DataSpaceViewerDiagramViewerState.ts +245 -0
- package/src/stores/DataSpaceViewerNavigation.ts +64 -0
- package/src/stores/DataSpaceViewerState.ts +88 -401
- package/src/stores/query/DataSpaceAdvancedSearchState.ts +30 -6
- package/src/stores/query/DataSpaceQueryCreatorStore.ts +8 -8
- package/src/stores/query/DataSpaceQuerySetupStore.ts +1 -1
- package/src/stores/studio/DataSpacePreviewState.ts +27 -5
- package/tsconfig.json +5 -1
- package/lib/stores/DataSpaceViewerDataAccessState.d.ts +0 -35
- package/lib/stores/DataSpaceViewerDataAccessState.d.ts.map +0 -1
- package/lib/stores/DataSpaceViewerDataAccessState.js +0 -98
- package/lib/stores/DataSpaceViewerDataAccessState.js.map +0 -1
- package/src/stores/DataSpaceViewerDataAccessState.ts +0 -143
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
queryClass,
|
|
20
20
|
type EditorStore,
|
|
21
21
|
} from '@finos/legend-application-studio';
|
|
22
|
-
import type { ClassView } from '@finos/legend-extension-dsl-diagram/graph';
|
|
23
22
|
import {
|
|
24
23
|
type GeneratorFn,
|
|
25
24
|
guaranteeNonNullable,
|
|
@@ -31,7 +30,8 @@ import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElem
|
|
|
31
30
|
import type { DataSpaceAnalysisResult } from '../../graph-manager/action/analytics/DataSpaceAnalysis.js';
|
|
32
31
|
import { DSL_DataSpace_getGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
|
|
33
32
|
import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
|
|
34
|
-
import { InMemoryGraphData } from '@finos/legend-graph';
|
|
33
|
+
import { type Class, InMemoryGraphData } from '@finos/legend-graph';
|
|
34
|
+
import { EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl } from '../../__lib__/DSL_DataSpace_LegendApplicationNavigation.js';
|
|
35
35
|
|
|
36
36
|
export class DataSpacePreviewState extends EditorExtensionState {
|
|
37
37
|
readonly editorStore: EditorStore;
|
|
@@ -117,8 +117,13 @@ export class DataSpacePreviewState extends EditorExtensionState {
|
|
|
117
117
|
versionId,
|
|
118
118
|
analysisResult,
|
|
119
119
|
{
|
|
120
|
-
|
|
120
|
+
retrieveGraphData: () =>
|
|
121
121
|
new InMemoryGraphData(this.editorStore.graphManagerState.graph),
|
|
122
|
+
queryDataSpace: () => {
|
|
123
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
124
|
+
'This feature is not supported in preview mode',
|
|
125
|
+
);
|
|
126
|
+
},
|
|
122
127
|
viewProject: () => {
|
|
123
128
|
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
124
129
|
'This feature is not supported in preview mode',
|
|
@@ -129,11 +134,28 @@ export class DataSpacePreviewState extends EditorExtensionState {
|
|
|
129
134
|
'This feature is not supported in preview mode',
|
|
130
135
|
);
|
|
131
136
|
},
|
|
132
|
-
|
|
133
|
-
queryClass(
|
|
137
|
+
queryClass: (_class: Class): void => {
|
|
138
|
+
queryClass(_class, this.editorStore).catch(
|
|
134
139
|
this.editorStore.applicationStore.alertUnhandledError,
|
|
135
140
|
);
|
|
136
141
|
},
|
|
142
|
+
openServiceQuery: (servicePath: string): void => {
|
|
143
|
+
if (this.editorStore.applicationStore.config.queryApplicationUrl) {
|
|
144
|
+
this.editorStore.applicationStore.navigationService.navigator.visitAddress(
|
|
145
|
+
EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl(
|
|
146
|
+
this.editorStore.applicationStore.config.queryApplicationUrl,
|
|
147
|
+
groupId,
|
|
148
|
+
artifactId,
|
|
149
|
+
versionId,
|
|
150
|
+
servicePath,
|
|
151
|
+
),
|
|
152
|
+
);
|
|
153
|
+
} else {
|
|
154
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
155
|
+
'Query application URL is not configured',
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
137
159
|
},
|
|
138
160
|
);
|
|
139
161
|
this.loadDataSpaceState.pass();
|
package/tsconfig.json
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
34
|
"files": [
|
|
35
|
+
"./src/__lib__/DSL_DataSpace_LegendApplicationCommand.ts",
|
|
36
|
+
"./src/__lib__/DSL_DataSpace_LegendApplicationNavigation.ts",
|
|
35
37
|
"./src/__lib__/query/DSL_DataSpace_LegendQueryNavigation.ts",
|
|
36
38
|
"./src/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts",
|
|
37
39
|
"./src/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.ts",
|
|
@@ -60,7 +62,9 @@
|
|
|
60
62
|
"./src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts",
|
|
61
63
|
"./src/stores/DataSpaceLayoutState.ts",
|
|
62
64
|
"./src/stores/DataSpaceModelsDocumentationState.ts",
|
|
63
|
-
"./src/stores/
|
|
65
|
+
"./src/stores/DataSpaceQuickStartState.ts",
|
|
66
|
+
"./src/stores/DataSpaceViewerDiagramViewerState.ts",
|
|
67
|
+
"./src/stores/DataSpaceViewerNavigation.ts",
|
|
64
68
|
"./src/stores/DataSpaceViewerState.ts",
|
|
65
69
|
"./src/stores/query/DataSpaceAdvancedSearchState.ts",
|
|
66
70
|
"./src/stores/query/DataSpaceInfo.ts",
|
|
@@ -1,35 +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 { type GeneratorFn, ActionState } from '@finos/legend-shared';
|
|
17
|
-
import type { DataSpaceViewerState } from './DataSpaceViewerState.js';
|
|
18
|
-
import type { DatasetSpecification, DatasetEntitlementReport } from '@finos/legend-graph';
|
|
19
|
-
export declare class DataSpaceDatasetInfo {
|
|
20
|
-
readonly uuid: string;
|
|
21
|
-
readonly specification: DatasetSpecification;
|
|
22
|
-
entitlementReport?: DatasetEntitlementReport | undefined;
|
|
23
|
-
constructor(specification: DatasetSpecification);
|
|
24
|
-
setEntitlementReport(val: DatasetEntitlementReport | undefined): void;
|
|
25
|
-
}
|
|
26
|
-
export declare class DataSpaceViewerDataAccessState {
|
|
27
|
-
readonly dataSpaceViewerState: DataSpaceViewerState;
|
|
28
|
-
readonly fetchDatasetSpecificationsState: ActionState;
|
|
29
|
-
readonly fetchDatasetEntitlementReportsState: ActionState;
|
|
30
|
-
datasets: DataSpaceDatasetInfo[];
|
|
31
|
-
constructor(dataSpaceViewerState: DataSpaceViewerState);
|
|
32
|
-
fetchDatasetSpecifications(): GeneratorFn<void>;
|
|
33
|
-
fetchDatasetEntitlementReports(): GeneratorFn<void>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=DataSpaceViewerDataAccessState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataSpaceViewerDataAccessState.d.ts","sourceRoot":"","sources":["../../src/stores/DataSpaceViewerDataAccessState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,SAAU;IACvB,QAAQ,CAAC,aAAa,EAAG,oBAAoB,CAAC;IAE9C,iBAAiB,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;gBAE7C,aAAa,EAAE,oBAAoB;IAS/C,oBAAoB,CAAC,GAAG,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI;CAGtE;AAED,qBAAa,8BAA8B;IACzC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAEpD,QAAQ,CAAC,+BAA+B,cAAwB;IAChE,QAAQ,CAAC,mCAAmC,cAAwB;IAEpE,QAAQ,EAAE,oBAAoB,EAAE,CAAM;gBAE1B,oBAAoB,EAAE,oBAAoB;IAUrD,0BAA0B,IAAI,WAAW,CAAC,IAAI,CAAC;IA8B/C,8BAA8B,IAAI,WAAW,CAAC,IAAI,CAAC;CA6CrD"}
|
|
@@ -1,98 +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 { ActionState, assertErrorThrown, uuid, } from '@finos/legend-shared';
|
|
17
|
-
import { action, flow, makeObservable, observable } from 'mobx';
|
|
18
|
-
export class DataSpaceDatasetInfo {
|
|
19
|
-
uuid = uuid();
|
|
20
|
-
specification;
|
|
21
|
-
entitlementReport;
|
|
22
|
-
constructor(specification) {
|
|
23
|
-
makeObservable(this, {
|
|
24
|
-
entitlementReport: observable,
|
|
25
|
-
setEntitlementReport: action,
|
|
26
|
-
});
|
|
27
|
-
this.specification = specification;
|
|
28
|
-
}
|
|
29
|
-
setEntitlementReport(val) {
|
|
30
|
-
this.entitlementReport = val;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export class DataSpaceViewerDataAccessState {
|
|
34
|
-
dataSpaceViewerState;
|
|
35
|
-
fetchDatasetSpecificationsState = ActionState.create();
|
|
36
|
-
fetchDatasetEntitlementReportsState = ActionState.create();
|
|
37
|
-
datasets = [];
|
|
38
|
-
constructor(dataSpaceViewerState) {
|
|
39
|
-
makeObservable(this, {
|
|
40
|
-
datasets: observable,
|
|
41
|
-
fetchDatasetSpecifications: flow,
|
|
42
|
-
fetchDatasetEntitlementReports: flow,
|
|
43
|
-
});
|
|
44
|
-
this.dataSpaceViewerState = dataSpaceViewerState;
|
|
45
|
-
}
|
|
46
|
-
*fetchDatasetSpecifications() {
|
|
47
|
-
this.fetchDatasetSpecificationsState.inProgress();
|
|
48
|
-
try {
|
|
49
|
-
const datasets = (yield this.dataSpaceViewerState.graphManagerState.graphManager.surveyDatasets(this.dataSpaceViewerState.currentExecutionContext.mapping, this.dataSpaceViewerState.currentExecutionContext.defaultRuntime, undefined, this.dataSpaceViewerState.retriveGraphData()));
|
|
50
|
-
this.datasets = datasets.map((dataset) => {
|
|
51
|
-
const existingDataset = this.datasets.find((ds) => ds.specification.hashCode === dataset.hashCode);
|
|
52
|
-
if (existingDataset) {
|
|
53
|
-
return existingDataset;
|
|
54
|
-
}
|
|
55
|
-
return new DataSpaceDatasetInfo(dataset);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
assertErrorThrown(error);
|
|
60
|
-
this.dataSpaceViewerState.applicationStore.notificationService.notifyError(error);
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
this.fetchDatasetSpecificationsState.complete();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
*fetchDatasetEntitlementReports() {
|
|
67
|
-
this.fetchDatasetEntitlementReportsState.inProgress();
|
|
68
|
-
try {
|
|
69
|
-
const reports = (yield this.dataSpaceViewerState.graphManagerState.graphManager.checkDatasetEntitlements(this.datasets.map((dataset) => dataset.specification), this.dataSpaceViewerState.currentExecutionContext.mapping, this.dataSpaceViewerState.currentExecutionContext.defaultRuntime, undefined, this.dataSpaceViewerState.retriveGraphData()));
|
|
70
|
-
this.datasets.forEach((dataset) => {
|
|
71
|
-
const matchingReport = reports.find((report) => report.dataset.hashCode === dataset.specification.hashCode);
|
|
72
|
-
if (matchingReport) {
|
|
73
|
-
dataset.setEntitlementReport(matchingReport);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
dataset.setEntitlementReport(undefined);
|
|
77
|
-
});
|
|
78
|
-
const newDatasets = [];
|
|
79
|
-
reports.forEach((report) => {
|
|
80
|
-
const matchingDataset = this.datasets.find((dataset) => dataset.specification.hashCode === report.dataset.hashCode);
|
|
81
|
-
if (!matchingDataset) {
|
|
82
|
-
const newDataset = new DataSpaceDatasetInfo(report.dataset);
|
|
83
|
-
newDataset.setEntitlementReport(report);
|
|
84
|
-
newDatasets.push(newDataset);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
this.datasets = this.datasets.concat(newDatasets);
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
assertErrorThrown(error);
|
|
91
|
-
this.dataSpaceViewerState.applicationStore.notificationService.notifyError(error);
|
|
92
|
-
}
|
|
93
|
-
finally {
|
|
94
|
-
this.fetchDatasetEntitlementReportsState.complete();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=DataSpaceViewerDataAccessState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataSpaceViewerDataAccessState.js","sourceRoot":"","sources":["../../src/stores/DataSpaceViewerDataAccessState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAOhE,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,IAAI,EAAE,CAAC;IACd,aAAa,CAAwB;IAE9C,iBAAiB,CAAwC;IAEzD,YAAY,aAAmC;QAC7C,cAAc,CAAC,IAAI,EAAE;YACnB,iBAAiB,EAAE,UAAU;YAC7B,oBAA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,CAAC,CAAC,MAAM,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CACxC,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,CAAC,aAAa,CAAC,QAAQ,KAAK,MAAM,CAAC,OAAO,CAAC,QAAQ,CAC7D,CAAC;gBACF,IAAI,CAAC,eAAe,EAAE;oBACpB,MAAM,UAAU,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC5D,UAAU,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;oBACxC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;iBAC9B;YACH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CACxE,KAAK,CACN,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,mCAAmC,CAAC,QAAQ,EAAE,CAAC;SACrD;IACH,CAAC;CACF"}
|
|
@@ -1,143 +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 {
|
|
18
|
-
type GeneratorFn,
|
|
19
|
-
ActionState,
|
|
20
|
-
assertErrorThrown,
|
|
21
|
-
uuid,
|
|
22
|
-
} from '@finos/legend-shared';
|
|
23
|
-
import { action, flow, makeObservable, observable } from 'mobx';
|
|
24
|
-
import type { DataSpaceViewerState } from './DataSpaceViewerState.js';
|
|
25
|
-
import type {
|
|
26
|
-
DatasetSpecification,
|
|
27
|
-
DatasetEntitlementReport,
|
|
28
|
-
} from '@finos/legend-graph';
|
|
29
|
-
|
|
30
|
-
export class DataSpaceDatasetInfo {
|
|
31
|
-
readonly uuid = uuid();
|
|
32
|
-
readonly specification!: DatasetSpecification;
|
|
33
|
-
|
|
34
|
-
entitlementReport?: DatasetEntitlementReport | undefined;
|
|
35
|
-
|
|
36
|
-
constructor(specification: DatasetSpecification) {
|
|
37
|
-
makeObservable(this, {
|
|
38
|
-
entitlementReport: observable,
|
|
39
|
-
setEntitlementReport: action,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
this.specification = specification;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setEntitlementReport(val: DatasetEntitlementReport | undefined): void {
|
|
46
|
-
this.entitlementReport = val;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class DataSpaceViewerDataAccessState {
|
|
51
|
-
readonly dataSpaceViewerState: DataSpaceViewerState;
|
|
52
|
-
|
|
53
|
-
readonly fetchDatasetSpecificationsState = ActionState.create();
|
|
54
|
-
readonly fetchDatasetEntitlementReportsState = ActionState.create();
|
|
55
|
-
|
|
56
|
-
datasets: DataSpaceDatasetInfo[] = [];
|
|
57
|
-
|
|
58
|
-
constructor(dataSpaceViewerState: DataSpaceViewerState) {
|
|
59
|
-
makeObservable(this, {
|
|
60
|
-
datasets: observable,
|
|
61
|
-
fetchDatasetSpecifications: flow,
|
|
62
|
-
fetchDatasetEntitlementReports: flow,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
this.dataSpaceViewerState = dataSpaceViewerState;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
*fetchDatasetSpecifications(): GeneratorFn<void> {
|
|
69
|
-
this.fetchDatasetSpecificationsState.inProgress();
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
const datasets =
|
|
73
|
-
(yield this.dataSpaceViewerState.graphManagerState.graphManager.surveyDatasets(
|
|
74
|
-
this.dataSpaceViewerState.currentExecutionContext.mapping,
|
|
75
|
-
this.dataSpaceViewerState.currentExecutionContext.defaultRuntime,
|
|
76
|
-
undefined,
|
|
77
|
-
this.dataSpaceViewerState.retriveGraphData(),
|
|
78
|
-
)) as DatasetSpecification[];
|
|
79
|
-
this.datasets = datasets.map((dataset) => {
|
|
80
|
-
const existingDataset = this.datasets.find(
|
|
81
|
-
(ds) => ds.specification.hashCode === dataset.hashCode,
|
|
82
|
-
);
|
|
83
|
-
if (existingDataset) {
|
|
84
|
-
return existingDataset;
|
|
85
|
-
}
|
|
86
|
-
return new DataSpaceDatasetInfo(dataset);
|
|
87
|
-
});
|
|
88
|
-
} catch (error) {
|
|
89
|
-
assertErrorThrown(error);
|
|
90
|
-
this.dataSpaceViewerState.applicationStore.notificationService.notifyError(
|
|
91
|
-
error,
|
|
92
|
-
);
|
|
93
|
-
} finally {
|
|
94
|
-
this.fetchDatasetSpecificationsState.complete();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
*fetchDatasetEntitlementReports(): GeneratorFn<void> {
|
|
99
|
-
this.fetchDatasetEntitlementReportsState.inProgress();
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
const reports =
|
|
103
|
-
(yield this.dataSpaceViewerState.graphManagerState.graphManager.checkDatasetEntitlements(
|
|
104
|
-
this.datasets.map((dataset) => dataset.specification),
|
|
105
|
-
this.dataSpaceViewerState.currentExecutionContext.mapping,
|
|
106
|
-
this.dataSpaceViewerState.currentExecutionContext.defaultRuntime,
|
|
107
|
-
undefined,
|
|
108
|
-
this.dataSpaceViewerState.retriveGraphData(),
|
|
109
|
-
)) as DatasetEntitlementReport[];
|
|
110
|
-
this.datasets.forEach((dataset) => {
|
|
111
|
-
const matchingReport = reports.find(
|
|
112
|
-
(report) =>
|
|
113
|
-
report.dataset.hashCode === dataset.specification.hashCode,
|
|
114
|
-
);
|
|
115
|
-
if (matchingReport) {
|
|
116
|
-
dataset.setEntitlementReport(matchingReport);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
dataset.setEntitlementReport(undefined);
|
|
120
|
-
});
|
|
121
|
-
const newDatasets: DataSpaceDatasetInfo[] = [];
|
|
122
|
-
reports.forEach((report) => {
|
|
123
|
-
const matchingDataset = this.datasets.find(
|
|
124
|
-
(dataset) =>
|
|
125
|
-
dataset.specification.hashCode === report.dataset.hashCode,
|
|
126
|
-
);
|
|
127
|
-
if (!matchingDataset) {
|
|
128
|
-
const newDataset = new DataSpaceDatasetInfo(report.dataset);
|
|
129
|
-
newDataset.setEntitlementReport(report);
|
|
130
|
-
newDatasets.push(newDataset);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
this.datasets = this.datasets.concat(newDatasets);
|
|
134
|
-
} catch (error) {
|
|
135
|
-
assertErrorThrown(error);
|
|
136
|
-
this.dataSpaceViewerState.applicationStore.notificationService.notifyError(
|
|
137
|
-
error,
|
|
138
|
-
);
|
|
139
|
-
} finally {
|
|
140
|
-
this.fetchDatasetEntitlementReportsState.complete();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|