@finos/legend-extension-dsl-data-space 9.2.0 → 9.2.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.
Files changed (63) hide show
  1. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
  2. package/lib/components/DataSpaceDataAccess.js +71 -3
  3. package/lib/components/DataSpaceDataAccess.js.map +1 -1
  4. package/lib/components/DataSpaceDescription.d.ts.map +1 -1
  5. package/lib/components/DataSpaceDescription.js +6 -1
  6. package/lib/components/DataSpaceDescription.js.map +1 -1
  7. package/lib/components/DataSpaceDiagramViewer.js +3 -3
  8. package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
  9. package/lib/components/DataSpaceViewer.js +2 -2
  10. package/lib/components/DataSpaceViewer.js.map +1 -1
  11. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  12. package/lib/components/DataSpaceViewerActivityBar.js +7 -3
  13. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  14. package/lib/components/DataSpaceWiki.d.ts.map +1 -1
  15. package/lib/components/DataSpaceWiki.js +1 -0
  16. package/lib/components/DataSpaceWiki.js.map +1 -1
  17. package/lib/components/query/DataSpaceQueryCreator.js +1 -1
  18. package/lib/components/query/DataSpaceQueryCreator.js.map +1 -1
  19. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +2 -1
  20. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  21. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +3 -1
  22. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  23. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  24. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +6 -4
  25. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  26. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +7 -3
  27. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  28. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +22 -13
  29. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  30. package/lib/index.css +2 -2
  31. package/lib/index.css.map +1 -1
  32. package/lib/package.json +2 -2
  33. package/lib/stores/DataSpaceViewerDataAccessState.d.ts +35 -0
  34. package/lib/stores/DataSpaceViewerDataAccessState.d.ts.map +1 -0
  35. package/lib/stores/DataSpaceViewerDataAccessState.js +98 -0
  36. package/lib/stores/DataSpaceViewerDataAccessState.js.map +1 -0
  37. package/lib/stores/DataSpaceViewerState.d.ts +34 -21
  38. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  39. package/lib/stores/DataSpaceViewerState.js +100 -30
  40. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  41. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts +1 -1
  42. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
  43. package/lib/stores/query/DataSpaceAdvancedSearchState.js +2 -0
  44. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  45. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
  46. package/lib/stores/studio/DataSpacePreviewState.js +2 -0
  47. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
  48. package/package.json +13 -13
  49. package/src/components/DataSpaceDataAccess.tsx +116 -2
  50. package/src/components/DataSpaceDescription.tsx +7 -1
  51. package/src/components/DataSpaceDiagramViewer.tsx +3 -3
  52. package/src/components/DataSpaceViewer.tsx +2 -2
  53. package/src/components/DataSpaceViewerActivityBar.tsx +6 -5
  54. package/src/components/DataSpaceWiki.tsx +2 -0
  55. package/src/components/query/DataSpaceQueryCreator.tsx +1 -1
  56. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +3 -0
  57. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +27 -7
  58. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +26 -14
  59. package/src/stores/DataSpaceViewerDataAccessState.ts +142 -0
  60. package/src/stores/DataSpaceViewerState.ts +126 -34
  61. package/src/stores/query/DataSpaceAdvancedSearchState.ts +14 -1
  62. package/src/stores/studio/DataSpacePreviewState.ts +3 -0
  63. package/tsconfig.json +1 -0
@@ -80,7 +80,7 @@ export const DataSpaceQueryCreator = observer(() => {
80
80
  const runtimePath =
81
81
  parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.RUNTIME_PATH];
82
82
  const classPath =
83
- applicationStore.navigationService.navigator.getAddressParameterValue(
83
+ applicationStore.navigationService.navigator.getCurrentLocationParameterValue(
84
84
  DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN.CLASS_PATH,
85
85
  );
86
86
 
@@ -52,15 +52,18 @@ export class DataSpaceDocumentationEntry {
52
52
  readonly elementPath: string;
53
53
  readonly subElementText?: string | undefined;
54
54
  readonly doc: string;
55
+ readonly milestoning?: string | undefined;
55
56
 
56
57
  constructor(
57
58
  elementPath: string,
58
59
  subElementText: string | undefined,
59
60
  documentation: string,
61
+ milestoning: string | undefined,
60
62
  ) {
61
63
  this.elementPath = elementPath;
62
64
  this.subElementText = subElementText;
63
65
  this.doc = documentation;
66
+ this.milestoning = milestoning;
64
67
  }
65
68
  }
66
69
 
@@ -316,20 +316,22 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
316
316
  // elements documentation
317
317
  result.elementDocs = analysisResult.elementDocs.flatMap((docEntry) => {
318
318
  const entries: DataSpaceDocumentationEntry[] = [];
319
- entries.push(
320
- new DataSpaceDocumentationEntry(
321
- docEntry.path,
322
- undefined,
323
- docEntry.docs.join('\n'),
324
- ),
325
- );
326
319
  if (docEntry instanceof V1_DataSpaceClassDocumentationEntry) {
320
+ entries.push(
321
+ new DataSpaceDocumentationEntry(
322
+ docEntry.path,
323
+ undefined,
324
+ docEntry.docs.join('\n'),
325
+ docEntry.milestoning,
326
+ ),
327
+ );
327
328
  docEntry.properties.forEach((property) => {
328
329
  entries.push(
329
330
  new DataSpaceDocumentationEntry(
330
331
  docEntry.path,
331
332
  property.name,
332
333
  property.docs.join('\n'),
334
+ property.milestoning,
333
335
  ),
334
336
  );
335
337
  });
@@ -337,24 +339,42 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
337
339
  } else if (
338
340
  docEntry instanceof V1_DataSpaceEnumerationDocumentationEntry
339
341
  ) {
342
+ entries.push(
343
+ new DataSpaceDocumentationEntry(
344
+ docEntry.path,
345
+ undefined,
346
+ docEntry.docs.join('\n'),
347
+ undefined,
348
+ ),
349
+ );
340
350
  docEntry.enumValues.forEach((enumValue) => {
341
351
  entries.push(
342
352
  new DataSpaceDocumentationEntry(
343
353
  docEntry.path,
344
354
  enumValue.name,
345
355
  enumValue.docs.join('\n'),
356
+ undefined,
346
357
  ),
347
358
  );
348
359
  });
349
360
  } else if (
350
361
  docEntry instanceof V1_DataSpaceAssociationDocumentationEntry
351
362
  ) {
363
+ entries.push(
364
+ new DataSpaceDocumentationEntry(
365
+ docEntry.path,
366
+ undefined,
367
+ docEntry.docs.join('\n'),
368
+ undefined,
369
+ ),
370
+ );
352
371
  docEntry.properties.forEach((property) => {
353
372
  entries.push(
354
373
  new DataSpaceDocumentationEntry(
355
374
  docEntry.path,
356
375
  property.name,
357
376
  property.docs.join('\n'),
377
+ property.milestoning,
358
378
  ),
359
379
  );
360
380
  });
@@ -74,11 +74,11 @@ class V1_DataSpaceExecutionContextAnalysisResult {
74
74
 
75
75
  static readonly serialization = new SerializationFactory(
76
76
  createModelSchema(V1_DataSpaceExecutionContextAnalysisResult, {
77
- name: primitive(),
77
+ compatibleRuntimes: list(primitive()),
78
+ defaultRuntime: primitive(),
78
79
  description: optional(primitive()),
79
80
  mapping: primitive(),
80
- defaultRuntime: primitive(),
81
- compatibleRuntimes: list(primitive()),
81
+ name: primitive(),
82
82
  title: optional(primitive()),
83
83
  }),
84
84
  );
@@ -90,8 +90,20 @@ export class V1_DataSpaceBasicDocumentationEntry {
90
90
 
91
91
  static readonly serialization = new SerializationFactory(
92
92
  createModelSchema(V1_DataSpaceBasicDocumentationEntry, {
93
+ docs: list(primitive()),
93
94
  name: primitive(),
95
+ }),
96
+ );
97
+ }
98
+
99
+ export class V1_DataSpacePropertyDocumentationEntry extends V1_DataSpaceBasicDocumentationEntry {
100
+ milestoning?: string;
101
+
102
+ static override readonly serialization = new SerializationFactory(
103
+ createModelSchema(V1_DataSpacePropertyDocumentationEntry, {
94
104
  docs: list(primitive()),
105
+ milestoning: optional(primitive()),
106
+ name: primitive(),
95
107
  }),
96
108
  );
97
109
  }
@@ -101,24 +113,24 @@ export class V1_DataSpaceModelDocumentationEntry extends V1_DataSpaceBasicDocume
101
113
 
102
114
  static override readonly serialization = new SerializationFactory(
103
115
  createModelSchema(V1_DataSpaceModelDocumentationEntry, {
104
- name: primitive(),
105
116
  docs: list(primitive()),
117
+ name: primitive(),
106
118
  path: primitive(),
107
119
  }),
108
120
  );
109
121
  }
110
122
 
111
123
  export class V1_DataSpaceClassDocumentationEntry extends V1_DataSpaceModelDocumentationEntry {
112
- inheritedProperties: V1_DataSpaceBasicDocumentationEntry[] = [];
113
- properties: V1_DataSpaceBasicDocumentationEntry[] = [];
124
+ properties: V1_DataSpacePropertyDocumentationEntry[] = [];
125
+ milestoning?: string;
114
126
 
115
127
  static override readonly serialization = new SerializationFactory(
116
128
  createModelSchema(V1_DataSpaceClassDocumentationEntry, {
117
- name: primitive(),
118
129
  docs: list(primitive()),
130
+ milestoning: optional(primitive()),
131
+ name: primitive(),
119
132
  path: primitive(),
120
- inheritedProperties: list(object(V1_DataSpaceBasicDocumentationEntry)),
121
- properties: list(object(V1_DataSpaceBasicDocumentationEntry)),
133
+ properties: list(object(V1_DataSpacePropertyDocumentationEntry)),
122
134
  }),
123
135
  );
124
136
  }
@@ -128,23 +140,23 @@ export class V1_DataSpaceEnumerationDocumentationEntry extends V1_DataSpaceModel
128
140
 
129
141
  static override readonly serialization = new SerializationFactory(
130
142
  createModelSchema(V1_DataSpaceEnumerationDocumentationEntry, {
131
- name: primitive(),
132
- docs: list(primitive()),
133
143
  enumValues: list(object(V1_DataSpaceBasicDocumentationEntry)),
144
+ docs: list(primitive()),
145
+ name: primitive(),
134
146
  path: primitive(),
135
147
  }),
136
148
  );
137
149
  }
138
150
 
139
151
  export class V1_DataSpaceAssociationDocumentationEntry extends V1_DataSpaceModelDocumentationEntry {
140
- properties: V1_DataSpaceBasicDocumentationEntry[] = [];
152
+ properties: V1_DataSpacePropertyDocumentationEntry[] = [];
141
153
 
142
154
  static override readonly serialization = new SerializationFactory(
143
155
  createModelSchema(V1_DataSpaceAssociationDocumentationEntry, {
144
- name: primitive(),
145
156
  docs: list(primitive()),
157
+ name: primitive(),
146
158
  path: primitive(),
147
- properties: list(object(V1_DataSpaceBasicDocumentationEntry)),
159
+ properties: list(object(V1_DataSpacePropertyDocumentationEntry)),
148
160
  }),
149
161
  );
150
162
  }
@@ -0,0 +1,142 @@
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.checkEntitlements(
104
+ this.dataSpaceViewerState.currentExecutionContext.mapping,
105
+ this.dataSpaceViewerState.currentExecutionContext.defaultRuntime,
106
+ undefined,
107
+ this.dataSpaceViewerState.retriveGraphData(),
108
+ )) as DatasetEntitlementReport[];
109
+ this.datasets.forEach((dataset) => {
110
+ const matchingReport = reports.find(
111
+ (report) =>
112
+ report.dataset.hashCode === dataset.specification.hashCode,
113
+ );
114
+ if (matchingReport) {
115
+ dataset.setEntitlementReport(matchingReport);
116
+ return;
117
+ }
118
+ dataset.setEntitlementReport(undefined);
119
+ });
120
+ const newDatasets: DataSpaceDatasetInfo[] = [];
121
+ reports.forEach((report) => {
122
+ const matchingDataset = this.datasets.find(
123
+ (dataset) =>
124
+ dataset.specification.hashCode === report.dataset.hashCode,
125
+ );
126
+ if (!matchingDataset) {
127
+ const newDataset = new DataSpaceDatasetInfo(report.dataset);
128
+ newDataset.setEntitlementReport(report);
129
+ newDatasets.push(newDataset);
130
+ }
131
+ });
132
+ this.datasets = this.datasets.concat(newDatasets);
133
+ } catch (error) {
134
+ assertErrorThrown(error);
135
+ this.dataSpaceViewerState.applicationStore.notificationService.notifyError(
136
+ error,
137
+ );
138
+ } finally {
139
+ this.fetchDatasetEntitlementReportsState.complete();
140
+ }
141
+ }
142
+ }
@@ -14,7 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { GenericLegendApplicationStore } from '@finos/legend-application';
17
+ import type {
18
+ GenericLegendApplicationStore,
19
+ NavigationZone,
20
+ } from '@finos/legend-application';
18
21
  import {
19
22
  type ClassView,
20
23
  type DiagramRenderer,
@@ -22,6 +25,7 @@ import {
22
25
  } from '@finos/legend-extension-dsl-diagram';
23
26
  import type {
24
27
  BasicGraphManagerState,
28
+ GraphData,
25
29
  PackageableRuntime,
26
30
  } from '@finos/legend-graph';
27
31
  import {
@@ -38,32 +42,54 @@ import {
38
42
  PURE_DATA_SPACE_INFO_PROFILE_PATH,
39
43
  PURE_DATA_SPACE_INFO_PROFILE_VERIFIED_STEREOTYPE,
40
44
  } from '../graphManager/DSL_DataSpace_PureGraphManagerPlugin.js';
45
+ import { DataSpaceViewerDataAccessState } from './DataSpaceViewerDataAccessState.js';
41
46
 
42
47
  export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
43
- DESCRIPTION = 'DESCRIPTION',
44
- DIAGRAM_VIEWER = 'DIAGRAM_VIEWER',
45
- MODELS_DOCUMENTATION = 'MODELS_DOCUMENTATION',
46
- QUICK_START = 'QUICK_START',
47
- EXECUTION_CONTEXT = 'EXECUTION_CONTEXT',
48
- DATA_ACCESS = 'DATA_ACCESS',
49
-
50
- DATA_STORES = 'DATA_STORES', // TODO: with test-data, also let user call TDS query on top of these
51
- DATA_AVAILABILITY = 'DATA_AVAILABILITY',
52
- DATA_READINESS = 'DATA_READINESS',
53
- DATA_COST = 'DATA_COST',
54
- DATA_GOVERNANCE = 'DATA_GOVERNANCE',
55
- INFO = 'INFO', // TODO: test coverage? (or maybe this should be done in elements/diagrams/data-quality section)
56
- SUPPORT = 'SUPPORT',
48
+ DESCRIPTION = 'description',
49
+ DIAGRAM_VIEWER = 'diagram_viewer',
50
+ MODELS_DOCUMENTATION = 'models_documentation',
51
+ QUICK_START = 'quick_start',
52
+ EXECUTION_CONTEXT = 'execution_context',
53
+ DATA_ACCESS = 'data_access',
54
+
55
+ DATA_STORES = 'data_stores', // TODO: with test-data, also let user call TDS query on top of these
56
+ DATA_AVAILABILITY = 'data_availability',
57
+ DATA_READINESS = 'data_readiness',
58
+ DATA_COST = 'data_cost',
59
+ DATA_GOVERNANCE = 'data_governance',
60
+ INFO = 'info', // TODO: test coverage? (or maybe this should be done in elements/diagrams/data-quality section)
61
+ SUPPORT = 'support',
62
+ }
63
+
64
+ class DataSpaceLayoutState {
65
+ readonly dataSpaceViewerState: DataSpaceViewerState;
66
+
67
+ isExpandedModeEnabled = false;
68
+
69
+ constructor(dataSpaceViewerState: DataSpaceViewerState) {
70
+ makeObservable(this, {
71
+ isExpandedModeEnabled: observable,
72
+ enableExpandedMode: action,
73
+ });
74
+
75
+ this.dataSpaceViewerState = dataSpaceViewerState;
76
+ }
77
+
78
+ enableExpandedMode(val: boolean): void {
79
+ this.isExpandedModeEnabled = val;
80
+ }
57
81
  }
58
82
 
59
83
  export class DataSpaceViewerState {
60
84
  readonly applicationStore: GenericLegendApplicationStore;
61
85
  readonly graphManagerState: BasicGraphManagerState;
86
+ readonly layoutState: DataSpaceLayoutState;
62
87
 
88
+ readonly dataSpaceAnalysisResult: DataSpaceAnalysisResult;
63
89
  readonly groupId: string;
64
90
  readonly artifactId: string;
65
91
  readonly versionId: string;
66
- readonly dataSpaceAnalysisResult: DataSpaceAnalysisResult;
92
+ readonly retriveGraphData: () => GraphData;
67
93
  readonly viewProject: (
68
94
  groupId: string,
69
95
  artifactId: string,
@@ -76,6 +102,11 @@ export class DataSpaceViewerState {
76
102
  entityPath: string | undefined,
77
103
  ) => Promise<void>;
78
104
  readonly onDiagramClassDoubleClick: (classView: ClassView) => void;
105
+ readonly onZoneChange?:
106
+ | ((zone: NavigationZone | undefined) => void)
107
+ | undefined;
108
+
109
+ readonly dataAccessState: DataSpaceViewerDataAccessState;
79
110
 
80
111
  _renderer?: DiagramRenderer | undefined;
81
112
  currentDiagram?: DataSpaceDiagramAnalysisResult | undefined;
@@ -83,8 +114,6 @@ export class DataSpaceViewerState {
83
114
  currentExecutionContext: DataSpaceExecutionContextAnalysisResult;
84
115
  currentRuntime: PackageableRuntime;
85
116
 
86
- isExpandedModeEnabled = false;
87
-
88
117
  constructor(
89
118
  applicationStore: GenericLegendApplicationStore,
90
119
  graphManagerState: BasicGraphManagerState,
@@ -93,6 +122,7 @@ export class DataSpaceViewerState {
93
122
  versionId: string,
94
123
  dataSpaceAnalysisResult: DataSpaceAnalysisResult,
95
124
  actions: {
125
+ retriveGraphData: () => GraphData;
96
126
  viewProject: (
97
127
  groupId: string,
98
128
  artifactId: string,
@@ -105,6 +135,7 @@ export class DataSpaceViewerState {
105
135
  entityPath: string | undefined,
106
136
  ) => Promise<void>;
107
137
  onDiagramClassDoubleClick: (classView: ClassView) => void;
138
+ onZoneChange?: ((zone: NavigationZone | undefined) => void) | undefined;
108
139
  },
109
140
  ) {
110
141
  makeObservable(this, {
@@ -113,19 +144,19 @@ export class DataSpaceViewerState {
113
144
  currentActivity: observable,
114
145
  currentExecutionContext: observable,
115
146
  currentRuntime: observable,
116
- isExpandedModeEnabled: observable,
117
147
  isVerified: computed,
118
- renderer: computed,
119
- setRenderer: action,
148
+ diagramRenderer: computed,
149
+ setDiagramRenderer: action,
120
150
  setCurrentDiagram: action,
121
151
  setCurrentActivity: action,
122
152
  setCurrentExecutionContext: action,
123
153
  setCurrentRuntime: action,
124
- enableExpandedMode: action,
125
154
  });
126
155
 
127
156
  this.applicationStore = applicationStore;
128
157
  this.graphManagerState = graphManagerState;
158
+ this.layoutState = new DataSpaceLayoutState(this);
159
+
129
160
  this.dataSpaceAnalysisResult = dataSpaceAnalysisResult;
130
161
  this.groupId = groupId;
131
162
  this.artifactId = artifactId;
@@ -136,12 +167,16 @@ export class DataSpaceViewerState {
136
167
  this.currentDiagram = getNullableFirstElement(
137
168
  this.dataSpaceAnalysisResult.diagrams,
138
169
  );
170
+ this.retriveGraphData = actions.retriveGraphData;
139
171
  this.viewProject = actions.viewProject;
140
172
  this.viewSDLCProject = actions.viewSDLCProject;
141
173
  this.onDiagramClassDoubleClick = actions.onDiagramClassDoubleClick;
174
+ this.onZoneChange = actions.onZoneChange;
175
+
176
+ this.dataAccessState = new DataSpaceViewerDataAccessState(this);
142
177
  }
143
178
 
144
- get renderer(): DiagramRenderer {
179
+ get diagramRenderer(): DiagramRenderer {
145
180
  return guaranteeNonNullable(
146
181
  this._renderer,
147
182
  `Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)`,
@@ -160,12 +195,12 @@ export class DataSpaceViewerState {
160
195
  if (!this.isDiagramRendererInitialized) {
161
196
  return '';
162
197
  }
163
- if (this.renderer.middleClick || this.renderer.rightClick) {
198
+ if (this.diagramRenderer.middleClick || this.diagramRenderer.rightClick) {
164
199
  return 'diagram-editor__cursor--grabbing';
165
200
  }
166
- switch (this.renderer.interactionMode) {
201
+ switch (this.diagramRenderer.interactionMode) {
167
202
  case DIAGRAM_INTERACTION_MODE.LAYOUT: {
168
- if (this.renderer.mouseOverClassView) {
203
+ if (this.diagramRenderer.mouseOverClassView) {
169
204
  return 'diagram-editor__cursor--pointer';
170
205
  }
171
206
  return '';
@@ -185,7 +220,7 @@ export class DataSpaceViewerState {
185
220
  );
186
221
  }
187
222
 
188
- setRenderer(val: DiagramRenderer): void {
223
+ setDiagramRenderer(val: DiagramRenderer): void {
189
224
  this._renderer = val;
190
225
  }
191
226
 
@@ -208,14 +243,71 @@ export class DataSpaceViewerState {
208
243
  this.currentRuntime = val;
209
244
  }
210
245
 
211
- setupRenderer(): void {
212
- this.renderer.setIsReadOnly(true);
213
- this.renderer.setEnableLayoutAutoAdjustment(true);
214
- this.renderer.onClassViewDoubleClick = (classView: ClassView): void =>
215
- this.onDiagramClassDoubleClick(classView);
246
+ setupDiagramRenderer(): void {
247
+ this.diagramRenderer.setIsReadOnly(true);
248
+ this.diagramRenderer.setEnableLayoutAutoAdjustment(true);
249
+ this.diagramRenderer.onClassViewDoubleClick = (
250
+ classView: ClassView,
251
+ ): void => this.onDiagramClassDoubleClick(classView);
216
252
  }
217
253
 
218
- enableExpandedMode(val: boolean): void {
219
- this.isExpandedModeEnabled = val;
254
+ changeZone(zone: NavigationZone): void {
255
+ switch (zone) {
256
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION:
257
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER:
258
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION:
259
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START: {
260
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION);
261
+ break;
262
+ }
263
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT: {
264
+ this.setCurrentActivity(
265
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT,
266
+ );
267
+ break;
268
+ }
269
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS: {
270
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS);
271
+ break;
272
+ }
273
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES: {
274
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES);
275
+ break;
276
+ }
277
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY: {
278
+ this.setCurrentActivity(
279
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY,
280
+ );
281
+ break;
282
+ }
283
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_READINESS: {
284
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_READINESS);
285
+ break;
286
+ }
287
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST: {
288
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST);
289
+ break;
290
+ }
291
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE: {
292
+ this.setCurrentActivity(
293
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE,
294
+ );
295
+ break;
296
+ }
297
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO: {
298
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO);
299
+ break;
300
+ }
301
+ case DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT: {
302
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT);
303
+ break;
304
+ }
305
+ default: {
306
+ // unknown
307
+ this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION);
308
+ this.onZoneChange?.(undefined);
309
+ break;
310
+ }
311
+ }
220
312
  }
221
313
  }
@@ -15,7 +15,12 @@
15
15
  */
16
16
 
17
17
  import type { ClassView } from '@finos/legend-extension-dsl-diagram';
18
- import type { Class, GraphManagerState } from '@finos/legend-graph';
18
+ import {
19
+ GraphDataWithOrigin,
20
+ type Class,
21
+ type GraphManagerState,
22
+ LegendSDLC,
23
+ } from '@finos/legend-graph';
19
24
  import {
20
25
  type StoredEntity,
21
26
  type DepotServerClient,
@@ -192,6 +197,14 @@ export class DataSpaceAdvancedSearchState {
192
197
  dataSpace.versionId,
193
198
  analysisResult,
194
199
  {
200
+ retriveGraphData: () =>
201
+ new GraphDataWithOrigin(
202
+ new LegendSDLC(
203
+ dataSpace.groupId,
204
+ dataSpace.artifactId,
205
+ dataSpace.versionId,
206
+ ),
207
+ ),
195
208
  viewProject: this.viewProject,
196
209
  viewSDLCProject: this.viewSDLCProject,
197
210
  onDiagramClassDoubleClick: (classView: ClassView): void => {
@@ -31,6 +31,7 @@ import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElem
31
31
  import type { DataSpaceAnalysisResult } from '../../graphManager/action/analytics/DataSpaceAnalysis.js';
32
32
  import { DSL_DataSpace_getGraphManagerExtension } from '../../graphManager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
33
33
  import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
34
+ import { LiveGraphData } from '@finos/legend-graph';
34
35
 
35
36
  export class DataSpacePreviewState extends EditorExtensionState {
36
37
  readonly editorStore: EditorStore;
@@ -116,6 +117,8 @@ export class DataSpacePreviewState extends EditorExtensionState {
116
117
  versionId,
117
118
  analysisResult,
118
119
  {
120
+ retriveGraphData: () =>
121
+ new LiveGraphData(this.editorStore.graphManagerState.graph),
119
122
  viewProject: () => {
120
123
  this.editorStore.applicationStore.notificationService.notifyWarning(
121
124
  'This feature is not supported in preview mode',
package/tsconfig.json CHANGED
@@ -57,6 +57,7 @@
57
57
  "./src/graphManager/protocol/pure/v1/transformation/pureGraph/V1_DSL_DataSpace_GraphBuilderHelper.ts",
58
58
  "./src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts",
59
59
  "./src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts",
60
+ "./src/stores/DataSpaceViewerDataAccessState.ts",
60
61
  "./src/stores/DataSpaceViewerState.ts",
61
62
  "./src/stores/query/DataSpaceAdvancedSearchState.ts",
62
63
  "./src/stores/query/DataSpaceInfo.ts",