@finos/legend-extension-dsl-data-space 9.1.4 → 9.1.6

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 (168) hide show
  1. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts +1 -1
  2. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts.map +1 -1
  3. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js +15 -2
  4. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js.map +1 -1
  5. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +0 -4
  6. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
  7. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +0 -3
  8. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
  9. package/lib/components/DataSpaceDataAccess.d.ts +23 -0
  10. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -0
  11. package/lib/components/DataSpaceDataAccess.js +34 -0
  12. package/lib/components/DataSpaceDataAccess.js.map +1 -0
  13. package/lib/components/DataSpaceDescription.d.ts +23 -0
  14. package/lib/components/DataSpaceDescription.d.ts.map +1 -0
  15. package/lib/components/DataSpaceDescription.js +26 -0
  16. package/lib/components/DataSpaceDescription.js.map +1 -0
  17. package/lib/components/DataSpaceDiagramViewer.d.ts +23 -0
  18. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -0
  19. package/lib/components/DataSpaceDiagramViewer.js +75 -0
  20. package/lib/components/DataSpaceDiagramViewer.js.map +1 -0
  21. package/lib/components/DataSpaceExecutionContextViewer.d.ts +23 -0
  22. package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -0
  23. package/lib/components/DataSpaceExecutionContextViewer.js +58 -0
  24. package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -0
  25. package/lib/components/DataSpaceInfoPanel.d.ts +23 -0
  26. package/lib/components/DataSpaceInfoPanel.d.ts.map +1 -0
  27. package/lib/components/DataSpaceInfoPanel.js +38 -0
  28. package/lib/components/DataSpaceInfoPanel.js.map +1 -0
  29. package/lib/components/DataSpaceMarkdownTextViewer.d.ts +20 -0
  30. package/lib/components/DataSpaceMarkdownTextViewer.d.ts.map +1 -0
  31. package/lib/components/DataSpaceMarkdownTextViewer.js +25 -0
  32. package/lib/components/DataSpaceMarkdownTextViewer.js.map +1 -0
  33. package/lib/components/DataSpaceModelsDocumentation.d.ts +23 -0
  34. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -0
  35. package/lib/components/DataSpaceModelsDocumentation.js +58 -0
  36. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -0
  37. package/lib/components/{studio/DataSpacePreview.d.ts → DataSpacePlaceholder.d.ts} +4 -4
  38. package/lib/components/DataSpacePlaceholder.d.ts.map +1 -0
  39. package/lib/components/DataSpacePlaceholder.js +18 -0
  40. package/lib/components/DataSpacePlaceholder.js.map +1 -0
  41. package/lib/components/DataSpaceQuickStart.d.ts +23 -0
  42. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -0
  43. package/lib/components/DataSpaceQuickStart.js +108 -0
  44. package/lib/components/DataSpaceQuickStart.js.map +1 -0
  45. package/lib/components/DataSpaceSupportPanel.d.ts +23 -0
  46. package/lib/components/DataSpaceSupportPanel.d.ts.map +1 -0
  47. package/lib/components/DataSpaceSupportPanel.js +40 -0
  48. package/lib/components/DataSpaceSupportPanel.js.map +1 -0
  49. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  50. package/lib/components/DataSpaceViewer.js +40 -276
  51. package/lib/components/DataSpaceViewer.js.map +1 -1
  52. package/lib/components/DataSpaceViewerActivityBar.d.ts +23 -0
  53. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -0
  54. package/lib/components/DataSpaceViewerActivityBar.js +105 -0
  55. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -0
  56. package/lib/components/DataSpaceWiki.d.ts +23 -0
  57. package/lib/components/DataSpaceWiki.d.ts.map +1 -0
  58. package/lib/components/DataSpaceWiki.js +12 -0
  59. package/lib/components/DataSpaceWiki.js.map +1 -0
  60. package/lib/components/query/DataSpaceAdvancedSearchModal.js +1 -1
  61. package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
  62. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +1 -2
  63. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  64. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +0 -13
  65. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  66. package/lib/components/studio/DataSpacePreviewAction.js +1 -1
  67. package/lib/components/studio/DataSpacePreviewAction.js.map +1 -1
  68. package/lib/graph/DSL_DataSpace_HashUtils.d.ts +3 -2
  69. package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
  70. package/lib/graph/DSL_DataSpace_HashUtils.js +3 -2
  71. package/lib/graph/DSL_DataSpace_HashUtils.js.map +1 -1
  72. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +23 -0
  73. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
  74. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +50 -0
  75. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
  76. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts +5 -0
  77. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  78. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js +7 -0
  79. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js.map +1 -1
  80. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +39 -5
  81. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  82. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +40 -8
  83. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  84. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  85. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +70 -11
  86. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  87. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  88. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +62 -10
  89. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  90. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  91. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +39 -0
  92. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  93. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +92 -3
  94. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  95. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +23 -0
  96. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
  97. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +50 -0
  98. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
  99. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts +0 -1
  100. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
  101. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +33 -5
  102. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
  103. package/lib/index.css +2 -2
  104. package/lib/index.css.map +1 -1
  105. package/lib/index.d.ts +2 -1
  106. package/lib/index.d.ts.map +1 -1
  107. package/lib/index.js +2 -1
  108. package/lib/index.js.map +1 -1
  109. package/lib/package.json +10 -6
  110. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts +32 -0
  111. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts.map +1 -0
  112. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js +17 -0
  113. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js.map +1 -0
  114. package/lib/stores/DataSpaceViewerState.d.ts +17 -14
  115. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  116. package/lib/stores/DataSpaceViewerState.js +25 -12
  117. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  118. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
  119. package/lib/stores/studio/DataSpacePreviewState.js +0 -3
  120. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
  121. package/package.json +21 -17
  122. package/src/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts +15 -2
  123. package/src/components/DSL_DataSpace_LegendApplicationPlugin.ts +0 -9
  124. package/src/components/DataSpaceDataAccess.tsx +66 -0
  125. package/src/components/DataSpaceDescription.tsx +55 -0
  126. package/src/components/DataSpaceDiagramViewer.tsx +199 -0
  127. package/src/components/DataSpaceExecutionContextViewer.tsx +167 -0
  128. package/src/components/DataSpaceInfoPanel.tsx +170 -0
  129. package/src/components/DataSpaceMarkdownTextViewer.tsx +33 -0
  130. package/src/components/DataSpaceModelsDocumentation.tsx +99 -0
  131. package/src/components/DataSpacePlaceholder.tsx +21 -0
  132. package/src/components/DataSpaceQuickStart.tsx +381 -0
  133. package/src/components/DataSpaceSupportPanel.tsx +80 -0
  134. package/src/components/DataSpaceViewer.tsx +88 -1052
  135. package/src/components/DataSpaceViewerActivityBar.tsx +215 -0
  136. package/src/components/DataSpaceWiki.tsx +41 -0
  137. package/src/components/query/DataSpaceAdvancedSearchModal.tsx +1 -1
  138. package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +0 -15
  139. package/src/components/studio/DataSpacePreviewAction.tsx +1 -1
  140. package/src/graph/DSL_DataSpace_HashUtils.ts +3 -2
  141. package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +60 -0
  142. package/src/graphManager/DSL_DataSpace_PureGraphManagerPlugin.ts +9 -0
  143. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +54 -15
  144. package/src/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +99 -14
  145. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +86 -17
  146. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  147. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +140 -2
  148. package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +60 -0
  149. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +51 -7
  150. package/src/index.ts +2 -4
  151. package/src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts +41 -0
  152. package/src/stores/DataSpaceViewerState.ts +39 -20
  153. package/src/stores/studio/DataSpacePreviewState.ts +0 -5
  154. package/tsconfig.json +13 -3
  155. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts +0 -28
  156. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts.map +0 -1
  157. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js +0 -30
  158. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js.map +0 -1
  159. package/lib/components/studio/DataSpacePreview.d.ts.map +0 -1
  160. package/lib/components/studio/DataSpacePreview.js +0 -52
  161. package/lib/components/studio/DataSpacePreview.js.map +0 -1
  162. package/lib/stores/studio/DataSpacePreviewStore.d.ts +0 -34
  163. package/lib/stores/studio/DataSpacePreviewStore.d.ts.map +0 -1
  164. package/lib/stores/studio/DataSpacePreviewStore.js +0 -98
  165. package/lib/stores/studio/DataSpacePreviewStore.js.map +0 -1
  166. package/src/application/studio/DSL_DataSpace_LegendStudioNavigation.ts +0 -53
  167. package/src/components/studio/DataSpacePreview.tsx +0 -129
  168. package/src/stores/studio/DataSpacePreviewStore.ts +0 -172
@@ -1,53 +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
- generateExtensionUrlPattern,
19
- generatePath,
20
- } from '@finos/legend-application';
21
- import { generateGAVCoordinates } from '@finos/legend-storage';
22
-
23
- export enum DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN {
24
- GAV = 'gav',
25
- DATA_SPACE_PATH = 'dataSpacePath',
26
- }
27
-
28
- export type DataSpacePreviewPathParams = {
29
- [DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.GAV]: string;
30
- [DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH]: string;
31
- };
32
-
33
- export const DATA_SPACE_STUDIO_ROUTE_PATTERN = Object.freeze({
34
- PREVIEW: `/dataspace/preview/:${DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.GAV}/:${DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH}`,
35
- });
36
-
37
- export const generateDataSpacePreviewRoute = (
38
- groupId: string,
39
- artifactId: string,
40
- versionId: string,
41
- dataSpacePath: string,
42
- ): string =>
43
- generatePath(
44
- generateExtensionUrlPattern(DATA_SPACE_STUDIO_ROUTE_PATTERN.PREVIEW),
45
- {
46
- [DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.GAV]: generateGAVCoordinates(
47
- groupId,
48
- artifactId,
49
- versionId,
50
- ),
51
- [DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH]: dataSpacePath,
52
- },
53
- );
@@ -1,129 +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 { observer, useLocalObservable } from 'mobx-react-lite';
18
- import { useApplicationStore, useParams } from '@finos/legend-application';
19
- import { useDepotServerClient } from '@finos/legend-server-depot';
20
- import { parseGAVCoordinates } from '@finos/legend-storage';
21
- import { DataSpacePreviewStore } from '../../stores/studio/DataSpacePreviewStore.js';
22
- import { createContext, useContext, useEffect } from 'react';
23
- import { useLegendStudioApplicationStore } from '@finos/legend-application-studio';
24
- import {
25
- DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN,
26
- type DataSpacePreviewPathParams,
27
- } from '../../application/studio/DSL_DataSpace_LegendStudioNavigation.js';
28
- import { guaranteeNonNullable } from '@finos/legend-shared';
29
- import { flowResult } from 'mobx';
30
- import { DataSpaceViewer } from '../DataSpaceViewer.js';
31
- import {
32
- BlankPanelContent,
33
- PanelLoadingIndicator,
34
- TimesCircleIcon,
35
- } from '@finos/legend-art';
36
-
37
- const DataSpacePreviewStoreContext = createContext<
38
- DataSpacePreviewStore | undefined
39
- >(undefined);
40
-
41
- const DataSpacePreviewStoreProvider: React.FC<{
42
- children: React.ReactNode;
43
- gav: string;
44
- dataSpacePath: string;
45
- }> = ({ children, gav, dataSpacePath }) => {
46
- const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
47
- const applicationStore = useLegendStudioApplicationStore();
48
- const depotServerClient = useDepotServerClient();
49
- const store = useLocalObservable(
50
- () =>
51
- new DataSpacePreviewStore(
52
- applicationStore,
53
- depotServerClient,
54
- groupId,
55
- artifactId,
56
- versionId,
57
- dataSpacePath,
58
- ),
59
- );
60
- return (
61
- <DataSpacePreviewStoreContext.Provider value={store}>
62
- {children}
63
- </DataSpacePreviewStoreContext.Provider>
64
- );
65
- };
66
-
67
- const useDataSpacePreviewStore = (): DataSpacePreviewStore =>
68
- guaranteeNonNullable(
69
- useContext(DataSpacePreviewStoreContext),
70
- `Can't find data space preview store in context`,
71
- );
72
-
73
- const DataSpacePreviewInner = observer(() => {
74
- const previewStore = useDataSpacePreviewStore();
75
- const applicationStore = useApplicationStore();
76
-
77
- useEffect(() => {
78
- flowResult(previewStore.initialize()).catch(
79
- applicationStore.alertUnhandledError,
80
- );
81
- }, [applicationStore, previewStore]);
82
-
83
- return (
84
- <div className="data-space-preview">
85
- <PanelLoadingIndicator
86
- isLoading={previewStore.loadDataSpaceState.isInProgress}
87
- />
88
- {previewStore.dataSpaceViewerState && (
89
- <DataSpaceViewer
90
- dataSpaceViewerState={previewStore.dataSpaceViewerState}
91
- />
92
- )}
93
- {!previewStore.dataSpaceViewerState && (
94
- <>
95
- {previewStore.loadDataSpaceState.isInProgress && (
96
- <BlankPanelContent>
97
- {previewStore.loadDataSpaceState.message}
98
- </BlankPanelContent>
99
- )}
100
- {previewStore.loadDataSpaceState.hasFailed && (
101
- <BlankPanelContent>
102
- <div className="data-space-preview__failure">
103
- <div className="data-space-preview__failure__icon">
104
- <TimesCircleIcon />
105
- </div>
106
- <div className="data-space-preview__failure__text">
107
- Can&apos;t load data space
108
- </div>
109
- </div>
110
- </BlankPanelContent>
111
- )}
112
- </>
113
- )}
114
- </div>
115
- );
116
- });
117
-
118
- export const DataSpacePreview = observer(() => {
119
- const parameters = useParams<DataSpacePreviewPathParams>();
120
- const gav = parameters[DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.GAV];
121
- const dataSpacePath =
122
- parameters[DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH];
123
-
124
- return (
125
- <DataSpacePreviewStoreProvider gav={gav} dataSpacePath={dataSpacePath}>
126
- <DataSpacePreviewInner />
127
- </DataSpacePreviewStoreProvider>
128
- );
129
- });
@@ -1,172 +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
- retrieveProjectEntitiesWithDependencies,
19
- type DepotServerClient,
20
- ProjectData,
21
- } from '@finos/legend-server-depot';
22
- import type { LegendStudioApplicationStore } from '@finos/legend-application-studio';
23
- import {
24
- ActionState,
25
- assertErrorThrown,
26
- type GeneratorFn,
27
- type PlainObject,
28
- } from '@finos/legend-shared';
29
- import { flow, flowResult, makeObservable, observable } from 'mobx';
30
- import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
31
- import { DSL_DataSpace_getGraphManagerExtension } from '../../graphManager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
32
- import { BasicGraphManagerState } from '@finos/legend-graph';
33
- import { retrieveAnalyticsResultCache } from '../../graphManager/action/analytics/DataSpaceAnalysisHelper.js';
34
- import type { DataSpaceAnalysisResult } from '../../graphManager/action/analytics/DataSpaceAnalysis.js';
35
- import type { ClassView } from '@finos/legend-extension-dsl-diagram';
36
- import { TAB_SIZE } from '@finos/legend-application';
37
-
38
- export class DataSpacePreviewStore {
39
- readonly applicationStore: LegendStudioApplicationStore;
40
- readonly depotServerClient: DepotServerClient;
41
- readonly graphManagerState: BasicGraphManagerState;
42
-
43
- readonly groupId: string;
44
- readonly artifactId: string;
45
- readonly versionId: string;
46
- readonly dataSpacePath: string;
47
-
48
- readonly loadDataSpaceState = ActionState.create();
49
- dataSpaceViewerState?: DataSpaceViewerState | undefined;
50
-
51
- constructor(
52
- applicationStore: LegendStudioApplicationStore,
53
- depotServerClient: DepotServerClient,
54
- groupId: string,
55
- artifactId: string,
56
- versionId: string,
57
- dataSpacePath: string,
58
- ) {
59
- makeObservable(this, {
60
- dataSpaceViewerState: observable,
61
- initialize: flow,
62
- });
63
-
64
- this.applicationStore = applicationStore;
65
- this.applicationStore.assistantService.setIsHidden(true);
66
-
67
- this.depotServerClient = depotServerClient;
68
- this.graphManagerState = new BasicGraphManagerState(
69
- applicationStore.pluginManager,
70
- applicationStore.logService,
71
- );
72
-
73
- this.groupId = groupId;
74
- this.artifactId = artifactId;
75
- this.versionId = versionId;
76
- this.dataSpacePath = dataSpacePath;
77
- }
78
-
79
- *initialize(): GeneratorFn<void> {
80
- this.loadDataSpaceState.inProgress();
81
- this.loadDataSpaceState.setMessage(`Initializing...`);
82
-
83
- try {
84
- const groupId = this.groupId;
85
- const artifactId = this.artifactId;
86
- const versionId = this.versionId;
87
-
88
- // initialize
89
- yield this.graphManagerState.graphManager.initialize(
90
- {
91
- env: this.applicationStore.config.env,
92
- tabSize: TAB_SIZE,
93
- clientConfig: {
94
- baseUrl: this.applicationStore.config.engineServerUrl,
95
- queryBaseUrl: this.applicationStore.config.engineQueryServerUrl,
96
- enableCompression: true,
97
- },
98
- },
99
- {
100
- tracerService: this.applicationStore.tracerService,
101
- },
102
- );
103
-
104
- // fetch project
105
- this.loadDataSpaceState.setMessage(`Fetching project...`);
106
- const project = ProjectData.serialization.fromJson(
107
- (yield flowResult(
108
- this.depotServerClient.getProject(groupId, artifactId),
109
- )) as PlainObject<ProjectData>,
110
- );
111
-
112
- // analyze data space
113
- const analysisResult = (yield DSL_DataSpace_getGraphManagerExtension(
114
- this.graphManagerState.graphManager,
115
- ).analyzeDataSpace(
116
- this.dataSpacePath,
117
- () =>
118
- retrieveProjectEntitiesWithDependencies(
119
- project,
120
- versionId,
121
- this.depotServerClient,
122
- ),
123
- () =>
124
- retrieveAnalyticsResultCache(
125
- project,
126
- versionId,
127
- this.dataSpacePath,
128
- this.depotServerClient,
129
- ),
130
- this.loadDataSpaceState,
131
- )) as DataSpaceAnalysisResult;
132
-
133
- this.dataSpaceViewerState = new DataSpaceViewerState(
134
- this.applicationStore,
135
- this.graphManagerState,
136
- groupId,
137
- artifactId,
138
- versionId,
139
- analysisResult,
140
- {
141
- viewProject: () => {
142
- this.applicationStore.notificationService.notifyWarning(
143
- 'This feature is not supported in preview mode',
144
- );
145
- },
146
- viewSDLCProject: async () => {
147
- this.applicationStore.notificationService.notifyWarning(
148
- 'This feature is not supported in preview mode',
149
- );
150
- },
151
- onDiagramClassDoubleClick: (classView: ClassView): void => {
152
- this.applicationStore.notificationService.notifyWarning(
153
- 'This feature is not supported in preview mode',
154
- );
155
- },
156
- },
157
- {
158
- HACKY__previewExperimentalFeatures:
159
- this.applicationStore.config.options
160
- .HACKY__previewExperimentalFeatures,
161
- },
162
- );
163
- this.loadDataSpaceState.pass();
164
- } catch (error) {
165
- assertErrorThrown(error);
166
- this.loadDataSpaceState.fail();
167
- this.applicationStore.notificationService.notifyError(error);
168
- } finally {
169
- this.loadDataSpaceState.setMessage(undefined);
170
- }
171
- }
172
- }