@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
@@ -14,1111 +14,147 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { useRef, useEffect, forwardRef } from 'react';
18
17
  import { observer } from 'mobx-react-lite';
19
- import {
20
- BlankPanelContent,
21
- ShapesIcon,
22
- PlayIcon,
23
- QuestionCircleIcon,
24
- EnvelopIcon,
25
- clsx,
26
- CustomSelectorInput,
27
- PURE_MappingIcon,
28
- PURE_RuntimeIcon,
29
- CogIcon,
30
- InfoCircleIcon,
31
- ExternalLinkIcon,
32
- useResizeDetector,
33
- ExternalLinkSquareIcon,
34
- DocumentationIcon,
35
- ResizablePanelGroup,
36
- ResizablePanel,
37
- ResizablePanelSplitter,
38
- MarkdownTextViewer,
39
- PencilIcon,
40
- DisplayIcon,
41
- ChevronRightIcon,
42
- ChevronLeftIcon,
43
- CircleIcon,
44
- CaretDownIcon,
45
- CaretRightIcon,
46
- CopyIcon,
47
- MoreHorizontalIcon,
48
- FlaskIcon,
49
- KeyIcon,
50
- ShieldIcon,
51
- } from '@finos/legend-art';
52
- import {
53
- type Diagram,
54
- DiagramRenderer,
55
- } from '@finos/legend-extension-dsl-diagram';
56
- import { DataSpaceSupportEmail } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
57
- import {
58
- extractElementNameFromPath,
59
- type PackageableRuntime,
60
- } from '@finos/legend-graph';
18
+ import { BlankPanelContent, VerifiedIcon, clsx } from '@finos/legend-art';
61
19
  import {
62
20
  type DataSpaceViewerState,
63
21
  DATA_SPACE_VIEWER_ACTIVITY_MODE,
64
22
  } from '../stores/DataSpaceViewerState.js';
65
- import type { DataSpaceExecutionContextAnalysisResult } from '../graphManager/action/analytics/DataSpaceAnalysis.js';
66
- import { generateGAVCoordinates } from '@finos/legend-storage';
67
- import {
68
- EDITOR_LANGUAGE,
69
- TextInputEditor,
70
- useApplicationStore,
71
- } from '@finos/legend-application';
72
- import { DSL_DataSpace_LegendApplicationPlugin } from './DSL_DataSpace_LegendApplicationPlugin.js';
73
- import {
74
- getNullableFirstElement,
75
- getNullableLastElement,
76
- guaranteeNonNullable,
77
- } from '@finos/legend-shared';
78
- import {
79
- HACKY__DataSpaceUsageShowcaseTDSOutputDescription,
80
- type HACKY__DataSpaceUsageShowcase,
81
- HACKY__DataSpaceUsageShowcaseTDSSampleOutput,
82
- } from '../graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.js';
83
-
84
- interface DataSpaceViewerActivityConfig {
85
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
86
- title: string;
87
- icon: React.ReactElement;
88
- }
89
-
90
- const DataSpaceDiagramCanvas = observer(
91
- forwardRef<
92
- HTMLDivElement,
93
- {
94
- dataSpaceViewerState: DataSpaceViewerState;
95
- diagram: Diagram;
96
- }
97
- >(function DataSpaceDiagramCanvas(props, ref) {
98
- const { dataSpaceViewerState, diagram } = props;
99
- const diagramCanvasRef = ref as React.MutableRefObject<HTMLDivElement>;
100
-
101
- const { width, height } = useResizeDetector<HTMLDivElement>({
102
- refreshMode: 'debounce',
103
- refreshRate: 50,
104
- targetRef: diagramCanvasRef,
105
- });
106
-
107
- useEffect(() => {
108
- const renderer = new DiagramRenderer(diagramCanvasRef.current, diagram);
109
- dataSpaceViewerState.setRenderer(renderer);
110
- dataSpaceViewerState.setupRenderer();
111
- renderer.render();
112
- renderer.autoRecenter();
113
- }, [diagramCanvasRef, dataSpaceViewerState, diagram]);
114
-
115
- useEffect(() => {
116
- if (dataSpaceViewerState.isDiagramRendererInitialized) {
117
- dataSpaceViewerState.renderer.refresh();
118
- }
119
- }, [dataSpaceViewerState, width, height]);
120
-
121
- return (
122
- <div
123
- ref={diagramCanvasRef}
124
- className={clsx(
125
- 'diagram-canvas ',
126
- dataSpaceViewerState.diagramCursorClass,
127
- )}
128
- tabIndex={0}
129
- />
130
- );
131
- }),
132
- );
133
-
134
- const DataSpaceOverview = observer(
135
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
136
- const { dataSpaceViewerState } = props;
137
- const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
138
-
139
- // diagram selector
140
- const diagramCanvasRef = useRef<HTMLDivElement>(null);
141
-
142
- const showPreviousDiagram = (): void => {
143
- if (!dataSpaceViewerState.currentDiagram) {
144
- return;
145
- }
146
- const idx = analysisResult.featuredDiagrams.indexOf(
147
- dataSpaceViewerState.currentDiagram,
148
- );
149
- if (idx === 0 || idx === -1) {
150
- return;
151
- }
152
- dataSpaceViewerState.setCurrentDiagram(
153
- guaranteeNonNullable(analysisResult.featuredDiagrams[idx - 1]),
154
- );
155
- };
156
- const showNextDiagram = (): void => {
157
- if (!dataSpaceViewerState.currentDiagram) {
158
- return;
159
- }
160
- const idx = analysisResult.featuredDiagrams.indexOf(
161
- dataSpaceViewerState.currentDiagram,
162
- );
163
- if (idx === analysisResult.featuredDiagrams.length - 1 || idx === -1) {
164
- return;
165
- }
166
- dataSpaceViewerState.setCurrentDiagram(
167
- guaranteeNonNullable(analysisResult.featuredDiagrams[idx + 1]),
168
- );
169
- };
170
-
171
- if (analysisResult.featuredDiagrams.length === 0) {
172
- return <BlankPanelContent>No diagrams available</BlankPanelContent>;
173
- }
174
- return (
175
- <div className="data-space__viewer__main-panel__content data-space__viewer__overview">
176
- <ResizablePanelGroup orientation="horizontal">
177
- <ResizablePanel size={250} minSize={100}>
178
- <div className="data-space__viewer__overview__description">
179
- {analysisResult.description !== undefined && (
180
- <div className="data-space__viewer__overview__description__content">
181
- <MarkdownTextViewer
182
- className="data-space__viewer__overview__description__content__markdown-content"
183
- value={{
184
- value: analysisResult.description,
185
- }}
186
- />
187
- </div>
188
- )}
189
- {analysisResult.description === undefined && (
190
- <div className="data-space__viewer__overview__description--empty">
191
- No description
192
- </div>
193
- )}
194
- </div>
195
- </ResizablePanel>
196
- <ResizablePanelSplitter />
197
- <ResizablePanel minSize={100}>
198
- <div className="data-space__viewer__overview__diagrams__carousel">
199
- <div className="data-space__viewer__overview__diagrams__carousel__frame">
200
- <div className="data-space__viewer__overview__diagrams__carousel__frame__display">
201
- {dataSpaceViewerState.currentDiagram && (
202
- <DataSpaceDiagramCanvas
203
- dataSpaceViewerState={dataSpaceViewerState}
204
- diagram={dataSpaceViewerState.currentDiagram}
205
- ref={diagramCanvasRef}
206
- />
207
- )}
208
- </div>
209
- <button
210
- className="data-space__viewer__overview__diagrams__carousel__frame__navigator data-space__viewer__overview__diagrams__carousel__frame__navigator--back"
211
- tabIndex={-1}
212
- title="Previous"
213
- disabled={
214
- getNullableFirstElement(analysisResult.featuredDiagrams) ===
215
- dataSpaceViewerState.currentDiagram
216
- }
217
- onClick={showPreviousDiagram}
218
- >
219
- <ChevronLeftIcon />
220
- </button>
221
- <button
222
- className="data-space__viewer__overview__diagrams__carousel__frame__navigator data-space__viewer__overview__diagrams__carousel__frame__navigator--next"
223
- tabIndex={-1}
224
- title="Previous"
225
- disabled={
226
- getNullableLastElement(analysisResult.featuredDiagrams) ===
227
- dataSpaceViewerState.currentDiagram
228
- }
229
- onClick={showNextDiagram}
230
- >
231
- <ChevronRightIcon />
232
- </button>
233
- <div className="data-space__viewer__overview__diagrams__carousel__frame__indicators">
234
- <div className="data-space__viewer__overview__diagrams__carousel__frame__indicators__notch">
235
- {analysisResult.featuredDiagrams.map((diagram) => (
236
- <button
237
- key={diagram.path}
238
- className={clsx(
239
- 'data-space__viewer__overview__diagrams__carousel__frame__indicator',
240
- {
241
- 'data-space__viewer__overview__diagrams__carousel__frame__indicator--active':
242
- dataSpaceViewerState.currentDiagram === diagram,
243
- },
244
- )}
245
- onClick={() =>
246
- dataSpaceViewerState.setCurrentDiagram(diagram)
247
- }
248
- >
249
- <CircleIcon />
250
- </button>
251
- ))}
252
- </div>
253
- </div>
254
- </div>
255
- </div>
256
- </ResizablePanel>
257
- </ResizablePanelGroup>
258
- </div>
259
- );
260
- },
261
- );
262
-
263
- const DataSpaceDocumentation = observer(
264
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
265
- const { dataSpaceViewerState } = props;
266
- const documentationEntries =
267
- dataSpaceViewerState.dataSpaceAnalysisResult.elementDocs;
268
-
269
- if (documentationEntries.length === 0) {
270
- return <BlankPanelContent>No documentation available</BlankPanelContent>;
271
- }
272
- return (
273
- <div className="data-space__viewer__main-panel__content data-space__viewer__overview">
274
- <table className="table">
275
- <thead>
276
- <tr>
277
- <th className="table__cell--left">Element</th>
278
- <th className="table__cell--left"></th>
279
- <th className="table__cell--left">Documentation</th>
280
- </tr>
281
- </thead>
282
- <tbody>
283
- {documentationEntries.map((entry) => (
284
- <tr key={entry.uuid}>
285
- <td className="table__cell--left">{entry.elementPath}</td>
286
- <td className="table__cell--left">
287
- {entry.subElementText ?? ''}
288
- </td>
289
- <td className="table__cell--left">{entry.doc}</td>
290
- </tr>
291
- ))}
292
- </tbody>
293
- </table>
294
- </div>
295
- );
296
- },
297
- );
298
-
299
- type ExecutionContextOption = {
300
- label: string;
301
- value: DataSpaceExecutionContextAnalysisResult;
302
- };
303
- const buildExecutionContextOption = (
304
- value: DataSpaceExecutionContextAnalysisResult,
305
- ): ExecutionContextOption => ({
306
- label: value.name,
307
- value: value,
308
- });
309
-
310
- type RuntimeOption = {
311
- label: string;
312
- value: PackageableRuntime;
313
- };
314
- const buildRuntimeOption = (value: PackageableRuntime): RuntimeOption => ({
315
- label: value.name,
316
- value: value,
317
- });
318
-
319
- const DataSpaceExecutionViewer = observer(
320
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
321
- const { dataSpaceViewerState } = props;
322
- const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
323
- const executionContexts = Array.from(
324
- dataSpaceViewerState.dataSpaceAnalysisResult.executionContextsIndex.values(),
325
- );
326
-
327
- // execution
328
- const executionContextOptions = executionContexts.map(
329
- buildExecutionContextOption,
330
- );
331
- const selectedExecutionContextOption = buildExecutionContextOption(
332
- dataSpaceViewerState.currentExecutionContext,
333
- );
334
- const onExecutionContextOptionChange = (
335
- option: ExecutionContextOption,
336
- ): void => {
337
- if (option.value !== dataSpaceViewerState.currentExecutionContext) {
338
- dataSpaceViewerState.setCurrentExecutionContext(option.value);
339
- }
340
- };
341
- const formatExecutionContextOptionLabel = (
342
- option: ExecutionContextOption,
343
- ): React.ReactNode => (
344
- <div className="data-space__viewer__execution__entry__content__dropdown__option">
345
- <div className="data-space__viewer__execution__entry__content__dropdown__option__label">
346
- {option.label}
347
- </div>
348
- {option.value === analysisResult.defaultExecutionContext && (
349
- <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
350
- default
351
- </div>
352
- )}
353
- </div>
354
- );
355
-
356
- // runtime
357
- const runtimeOptions =
358
- dataSpaceViewerState.currentExecutionContext.compatibleRuntimes.map(
359
- buildRuntimeOption,
360
- );
361
- const selectedRuntimeOption = buildRuntimeOption(
362
- dataSpaceViewerState.currentRuntime,
363
- );
364
- const onRuntimeOptionChange = (option: RuntimeOption): void => {
365
- if (option.value !== dataSpaceViewerState.currentRuntime) {
366
- dataSpaceViewerState.setCurrentRuntime(option.value);
367
- }
368
- };
369
- const formatRuntimeOptionLabel = (
370
- option: RuntimeOption,
371
- ): React.ReactNode => (
372
- <div className="data-space__viewer__execution__entry__content__dropdown__option">
373
- <div className="data-space__viewer__execution__entry__content__dropdown__option__label">
374
- {option.label}
375
- </div>
376
- {option.value ===
377
- dataSpaceViewerState.currentExecutionContext.defaultRuntime && (
378
- <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
379
- default
380
- </div>
381
- )}
382
- </div>
383
- );
384
-
385
- return (
386
- <div className="data-space__viewer__main-panel__content data-space__viewer__execution">
387
- <div className="data-space__viewer__execution__entry">
388
- <div className="data-space__viewer__execution__entry__icon">
389
- <CogIcon className="data-space__viewer__execution__context-icon" />
390
- </div>
391
- <div className="data-space__viewer__execution__entry__content data-space__viewer__execution__entry__content__dropdown__container">
392
- <CustomSelectorInput
393
- className="data-space__viewer__execution__entry__content__dropdown"
394
- options={executionContextOptions}
395
- onChange={onExecutionContextOptionChange}
396
- value={selectedExecutionContextOption}
397
- darkMode={true}
398
- formatOptionLabel={formatExecutionContextOptionLabel}
399
- />
400
- </div>
401
- </div>
402
- <div
403
- className={clsx('data-space__viewer__execution__description', {
404
- 'data-space__viewer__execution__description--empty':
405
- !dataSpaceViewerState.currentExecutionContext.description,
406
- })}
407
- >
408
- {dataSpaceViewerState.currentExecutionContext.description
409
- ? dataSpaceViewerState.currentExecutionContext.description
410
- : 'No description'}
411
- </div>
412
- <div className="data-space__viewer__execution__entry data-space__viewer__execution__mapping">
413
- <div className="data-space__viewer__execution__entry__icon">
414
- <PURE_MappingIcon />
415
- </div>
416
- <div className="data-space__viewer__execution__entry__content data-space__viewer__execution__entry__content__text">
417
- {dataSpaceViewerState.currentExecutionContext.mapping.path}
418
- </div>
419
- </div>
420
- <div className="data-space__viewer__execution__entry">
421
- <div className="data-space__viewer__execution__entry__icon">
422
- <PURE_RuntimeIcon />
423
- </div>
424
- <div className="data-space__viewer__execution__entry__content data-space__viewer__execution__entry__content__dropdown__container">
425
- <CustomSelectorInput
426
- className="data-space__viewer__execution__entry__content__dropdown"
427
- options={runtimeOptions}
428
- onChange={onRuntimeOptionChange}
429
- value={selectedRuntimeOption}
430
- darkMode={true}
431
- formatOptionLabel={formatRuntimeOptionLabel}
432
- />
433
- </div>
434
- </div>
435
- </div>
436
- );
437
- },
438
- );
439
-
440
- const DataSpaceInfo = observer(
441
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
442
- const { dataSpaceViewerState } = props;
443
- const applicationStore = useApplicationStore();
444
- const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
445
-
446
- const viewProject = (): void =>
447
- dataSpaceViewerState.viewProject(
448
- dataSpaceViewerState.groupId,
449
- dataSpaceViewerState.artifactId,
450
- dataSpaceViewerState.versionId,
451
- undefined,
452
- );
453
- const viewDataSpaceInProject = (): void =>
454
- dataSpaceViewerState.viewProject(
455
- dataSpaceViewerState.groupId,
456
- dataSpaceViewerState.artifactId,
457
- dataSpaceViewerState.versionId,
458
- analysisResult.path,
459
- );
460
- const viewDataSpaceInSDLCProject = (): void => {
461
- dataSpaceViewerState
462
- .viewSDLCProject(
463
- dataSpaceViewerState.groupId,
464
- dataSpaceViewerState.artifactId,
465
- analysisResult.path,
466
- )
467
- .catch(applicationStore.alertUnhandledError);
468
- };
469
-
470
- return (
471
- <div className="data-space__viewer__info">
472
- <div className="data-space__viewer__info__section">
473
- <div className="data-space__viewer__info__section__entry">
474
- <div className="data-space__viewer__info__project-info__label">
475
- Project
476
- </div>
477
- <button
478
- className="data-space__viewer__info__project-info__value"
479
- tabIndex={-1}
480
- title="Click to View Project"
481
- onClick={viewProject}
482
- >
483
- {generateGAVCoordinates(
484
- dataSpaceViewerState.groupId,
485
- dataSpaceViewerState.artifactId,
486
- dataSpaceViewerState.versionId,
487
- )}
488
- </button>
489
- <button
490
- className="data-space__viewer__info__project-info__link"
491
- tabIndex={-1}
492
- title="View Project"
493
- onClick={viewProject}
494
- >
495
- <ExternalLinkIcon />
496
- </button>
497
- </div>
498
- <div className="data-space__viewer__info__section__entry">
499
- <div className="data-space__viewer__info__project-info__label">
500
- Data Space
501
- </div>
502
- <button
503
- className="data-space__viewer__info__project-info__value"
504
- tabIndex={-1}
505
- title="Click to View Data Space"
506
- onClick={viewDataSpaceInProject}
507
- >
508
- {analysisResult.path}
509
- </button>
510
- <button
511
- className="data-space__viewer__info__project-info__link"
512
- tabIndex={-1}
513
- title="Edit Data Space"
514
- onClick={viewDataSpaceInSDLCProject}
515
- >
516
- <PencilIcon />
517
- </button>
518
- <button
519
- className="data-space__viewer__info__project-info__link"
520
- tabIndex={-1}
521
- title="View Data Space"
522
- onClick={viewDataSpaceInProject}
523
- >
524
- <ExternalLinkIcon />
525
- </button>
526
- </div>
527
- </div>
528
- <div className="data-space__viewer__info__section">
529
- <div className="data-space__viewer__info__section__title">
530
- Tagged Values
531
- </div>
532
- {analysisResult.taggedValues.length !== 0 &&
533
- analysisResult.taggedValues.map((taggedValue) => (
534
- <div
535
- key={taggedValue._UUID}
536
- className="data-space__viewer__info__section__entry"
537
- >
538
- <div
539
- className="data-space__viewer__info__tagged-value__tag"
540
- title={`${taggedValue.profile}.${taggedValue.tag}`}
541
- >
542
- {`${extractElementNameFromPath(taggedValue.profile)}.${
543
- taggedValue.tag
544
- }`}
545
- </div>
546
- <div className="data-space__viewer__info__tagged-value__value">
547
- {taggedValue.value}
548
- </div>
549
- </div>
550
- ))}
551
- {analysisResult.taggedValues.length === 0 && (
552
- <div className="data-space__viewer__info__section__placeholder">
553
- (empty)
554
- </div>
555
- )}
556
- </div>
557
- <div className="data-space__viewer__info__section">
558
- <div className="data-space__viewer__info__section__title">
559
- Stereotypes
560
- </div>
561
- {analysisResult.stereotypes.length !== 0 &&
562
- analysisResult.stereotypes.map((stereotype) => (
563
- <div
564
- key={stereotype._UUID}
565
- className="data-space__viewer__info__section__entry"
566
- title={`${stereotype.profile}.${stereotype.value}`}
567
- >
568
- <div className="data-space__viewer__info__steoreotype">
569
- {`${extractElementNameFromPath(stereotype.profile)}.${
570
- stereotype.value
571
- }`}
572
- </div>
573
- </div>
574
- ))}
575
- {analysisResult.stereotypes.length === 0 && (
576
- <div className="data-space__viewer__info__section__placeholder">
577
- (empty)
578
- </div>
579
- )}
580
- </div>
581
- </div>
582
- );
583
- },
584
- );
585
-
586
- const DataSpaceSupportEmailViewer = observer(
587
- (props: {
588
- dataSpaceViewerState: DataSpaceViewerState;
589
- dataSpaceSupportEmail: DataSpaceSupportEmail;
590
- }) => {
591
- const { dataSpaceSupportEmail } = props;
592
-
593
- return (
594
- <div className="data-space__viewer__support-email">
595
- <div className="data-space__viewer__support-email__entry">
596
- <div className="data-space__viewer__support-email__entry__icon">
597
- <EnvelopIcon />
598
- </div>
599
- <a
600
- href={`mailto:${dataSpaceSupportEmail.address}`}
601
- className="data-space__viewer__support-email__entry__content"
602
- >
603
- {dataSpaceSupportEmail.address}
604
- </a>
605
- </div>
606
- </div>
607
- );
608
- },
609
- );
610
-
611
- const DataSpaceSupportInfoViewerInner = observer(
612
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
613
- const { dataSpaceViewerState } = props;
614
- const supportInfo =
615
- dataSpaceViewerState.dataSpaceAnalysisResult.supportInfo;
616
-
617
- if (supportInfo === undefined) {
618
- return <BlankPanelContent>No support info available</BlankPanelContent>;
619
- } else if (supportInfo instanceof DataSpaceSupportEmail) {
620
- return (
621
- <DataSpaceSupportEmailViewer
622
- dataSpaceViewerState={dataSpaceViewerState}
623
- dataSpaceSupportEmail={supportInfo}
624
- />
625
- );
626
- }
627
- return (
628
- <BlankPanelContent>Can&apos;t display support info</BlankPanelContent>
629
- );
630
- },
631
- );
632
-
633
- const renderDataSpaceCheckEntitlementsEditor = (
634
- dataSpaceViewerState: DataSpaceViewerState,
635
- plugins: DSL_DataSpace_LegendApplicationPlugin[],
636
- ): React.ReactNode => {
637
- const checkEntitlementsEditorRenderers = plugins.flatMap(
638
- (plugin) => plugin.getCheckEntitlementsEditorRender() ?? [],
639
- );
640
- for (const editorRenderer of checkEntitlementsEditorRenderers) {
641
- const editor = editorRenderer(dataSpaceViewerState);
642
- if (editor) {
643
- return editor;
644
- }
645
- }
646
- return (
647
- <BlankPanelContent>
648
- Check entitlement(s) (Work in Progress)
649
- </BlankPanelContent>
650
- );
651
- };
652
-
653
- const DataSpaceUsageShowcaseTDSSampleOutputViewer = observer(
654
- (props: {
655
- dataSpaceViewerState: DataSpaceViewerState;
656
- showcase: HACKY__DataSpaceUsageShowcase;
657
- sampleOutput: HACKY__DataSpaceUsageShowcaseTDSSampleOutput;
658
- }) => {
659
- const { showcase, sampleOutput: sampleOutput } = props;
660
-
661
- const toggleShowSampleOutput = (): void =>
662
- showcase.setShowSampleOutput(!showcase.showSampleOutput);
663
-
664
- return (
665
- <div
666
- className={clsx('data-space__viewer__usage__block', {
667
- 'data-space__viewer__usage__block--collapsed':
668
- !showcase.showSampleOutput,
669
- })}
670
- >
671
- <div
672
- className="data-space__viewer__usage__block__header"
673
- onClick={toggleShowSampleOutput}
674
- >
675
- <div className="data-space__viewer__usage__block__header__toggler">
676
- {showcase.showSampleOutput ? <CaretDownIcon /> : <CaretRightIcon />}
677
- </div>
678
- <div className="data-space__viewer__usage__block__header__title">
679
- Sample Output
680
- </div>
681
- </div>
682
- {showcase.showSampleOutput && (
683
- <div className="data-space__viewer__usage__block__content">
684
- <table className="table data-space__viewer__usage__block__content__table">
685
- <thead>
686
- <tr>
687
- {sampleOutput.headers.map((header, idx) => (
688
- // eslint-disable-next-line react/no-array-index-key
689
- <th key={idx} className="table__cell--left">
690
- {header}
691
- </th>
692
- ))}
693
- </tr>
694
- </thead>
695
- <tbody>
696
- {sampleOutput.rows.map((row, idx) => (
697
- // eslint-disable-next-line react/no-array-index-key
698
- <tr key={idx}>
699
- {row.map((cell, rowIdx) => (
700
- // eslint-disable-next-line react/no-array-index-key
701
- <td key={rowIdx} className="table__cell--left">
702
- {cell}
703
- </td>
704
- ))}
705
- </tr>
706
- ))}
707
- </tbody>
708
- </table>
709
- </div>
710
- )}
711
- </div>
712
- );
713
- },
714
- );
715
-
716
- const DataSpaceUsageShowcaseSampleOutputViewer = observer(
717
- (props: {
718
- dataSpaceViewerState: DataSpaceViewerState;
719
- showcase: HACKY__DataSpaceUsageShowcase;
720
- }) => {
721
- const { dataSpaceViewerState, showcase } = props;
722
- if (
723
- showcase.outputDescription.sampleOutput instanceof
724
- HACKY__DataSpaceUsageShowcaseTDSSampleOutput
725
- ) {
726
- return (
727
- <DataSpaceUsageShowcaseTDSSampleOutputViewer
728
- dataSpaceViewerState={dataSpaceViewerState}
729
- showcase={showcase}
730
- sampleOutput={showcase.outputDescription.sampleOutput}
731
- />
732
- );
733
- }
734
- return (
735
- <BlankPanelContent>Can&apos;t display sample output</BlankPanelContent>
736
- );
737
- },
738
- );
739
-
740
- const DataSpaceUsageShowcaseTDSOutputDescriptionViewer = observer(
23
+ import { DataSpaceExecutionContextViewer } from './DataSpaceExecutionContextViewer.js';
24
+ import { DataSpaceInfoPanel } from './DataSpaceInfoPanel.js';
25
+ import { DataSpaceSupportPanel } from './DataSpaceSupportPanel.js';
26
+ import { DataSpaceWiki } from './DataSpaceWiki.js';
27
+ import { DataSpaceViewerActivityBar } from './DataSpaceViewerActivityBar.js';
28
+ import { useRef, useState } from 'react';
29
+
30
+ const DataSpaceHeader = observer(
741
31
  (props: {
742
32
  dataSpaceViewerState: DataSpaceViewerState;
743
- showcase: HACKY__DataSpaceUsageShowcase;
744
- description: HACKY__DataSpaceUsageShowcaseTDSOutputDescription;
33
+ showFullHeader: boolean;
745
34
  }) => {
746
- const { showcase, description: description } = props;
747
-
748
- const toggleShowOutputDescription = (): void =>
749
- showcase.setShowOutputDescription(!showcase.showOutputDescription);
35
+ const { dataSpaceViewerState, showFullHeader } = props;
36
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
750
37
 
751
38
  return (
752
39
  <div
753
- className={clsx('data-space__viewer__usage__block', {
754
- 'data-space__viewer__usage__block--collapsed':
755
- !showcase.showOutputDescription,
40
+ className={clsx('data-space__viewer__header', {
41
+ 'data-space__viewer__header--floating': showFullHeader,
756
42
  })}
757
43
  >
758
44
  <div
759
- className="data-space__viewer__usage__block__header"
760
- onClick={toggleShowOutputDescription}
761
- >
762
- <div className="data-space__viewer__usage__block__header__toggler">
763
- {showcase.showOutputDescription ? (
764
- <CaretDownIcon />
765
- ) : (
766
- <CaretRightIcon />
767
- )}
768
- </div>
769
- <div className="data-space__viewer__usage__block__header__title">
770
- Output Description
771
- </div>
772
- </div>
773
- {showcase.showOutputDescription && (
774
- <div className="data-space__viewer__usage__block__content">
775
- <table className="table data-space__viewer__usage__block__content__table">
776
- <thead>
777
- <tr>
778
- <th className="table__cell--left">Column Name</th>
779
- <th className="table__cell--left">Description</th>
780
- <th className="table__cell--left">Sample Values</th>
781
- </tr>
782
- </thead>
783
- <tbody>
784
- {description.columns.map((column) => (
785
- <tr key={column.uuid}>
786
- <td className="table__cell--left">{column.name}</td>
787
- <td className="table__cell--left">{column.description}</td>
788
- <td className="table__cell--left">
789
- {column.sampleValues.join(', ')}
790
- </td>
791
- </tr>
792
- ))}
793
- </tbody>
794
- </table>
795
- </div>
796
- )}
797
- </div>
798
- );
799
- },
800
- );
801
-
802
- const DataSpaceUsageShowcaseOutputDescriptionViewer = observer(
803
- (props: {
804
- dataSpaceViewerState: DataSpaceViewerState;
805
- showcase: HACKY__DataSpaceUsageShowcase;
806
- }) => {
807
- const { dataSpaceViewerState, showcase } = props;
808
- if (
809
- showcase.outputDescription instanceof
810
- HACKY__DataSpaceUsageShowcaseTDSOutputDescription
811
- ) {
812
- return (
813
- <DataSpaceUsageShowcaseTDSOutputDescriptionViewer
814
- dataSpaceViewerState={dataSpaceViewerState}
815
- showcase={showcase}
816
- description={showcase.outputDescription}
817
- />
818
- );
819
- }
820
- return (
821
- <BlankPanelContent>
822
- Can&apos;t display output description
823
- </BlankPanelContent>
824
- );
825
- },
826
- );
827
-
828
- const DataSpaceUsageShowcaseViewer = observer(
829
- (props: {
830
- dataSpaceViewerState: DataSpaceViewerState;
831
- showcase: HACKY__DataSpaceUsageShowcase;
832
- }) => {
833
- const { dataSpaceViewerState, showcase } = props;
834
- const applicationStore = useApplicationStore();
835
-
836
- const toggleShowQuery = (): void =>
837
- showcase.setShowQuery(!showcase.showQuery);
838
- const copyQuery: React.MouseEventHandler<HTMLButtonElement> = (
839
- event,
840
- ): void => {
841
- event.preventDefault();
842
- event.stopPropagation();
843
-
844
- applicationStore.clipboardService
845
- .copyTextToClipboard(showcase.query)
846
- .catch(applicationStore.alertUnhandledError);
847
- };
848
-
849
- return (
850
- <div className="data-space__viewer__usage">
851
- <div className="data-space__viewer__usage__title">{showcase.title}</div>
852
- {showcase.description !== undefined && (
853
- <div className="data-data-space__viewer__usage__description">
854
- <MarkdownTextViewer
855
- className="data-space__viewer__usage__description__markdown-content"
856
- value={{
857
- value: showcase.description,
858
- }}
859
- />
860
- </div>
861
- )}
862
- <div
863
- className={clsx(
864
- 'data-space__viewer__usage__block data-space__viewer__usage__query',
865
- {
866
- 'data-space__viewer__usage__block--collapsed':
867
- !showcase.showQuery,
868
- },
869
- )}
45
+ className={clsx('data-space__viewer__header__content', {
46
+ 'data-space__viewer__header__content--expanded':
47
+ dataSpaceViewerState.isExpandedModeEnabled,
48
+ })}
870
49
  >
871
50
  <div
872
- className="data-space__viewer__usage__block__header"
873
- onClick={toggleShowQuery}
51
+ className="data-space__viewer__header__title"
52
+ title={`${analysisResult.title ?? analysisResult.name} - ${
53
+ analysisResult.path
54
+ }`}
874
55
  >
875
- <div className="data-space__viewer__usage__block__header__toggler">
876
- {showcase.showQuery ? <CaretDownIcon /> : <CaretRightIcon />}
877
- </div>
878
- <div className="data-space__viewer__usage__block__header__title">
879
- Query
880
- </div>
881
- <div className="data-space__viewer__usage__block__header__actions">
882
- <button
883
- className="data-space__viewer__usage__block__header__action"
884
- tabIndex={-1}
885
- onClick={copyQuery}
886
- >
887
- <CopyIcon />
888
- </button>
889
- <button
890
- className="data-space__viewer__usage__block__header__action"
891
- tabIndex={-1}
892
- >
893
- <MoreHorizontalIcon />
894
- </button>
56
+ <div className="data-space__viewer__header__title__label">
57
+ {analysisResult.title ?? analysisResult.name}
895
58
  </div>
896
- </div>
897
- {showcase.showQuery && (
898
- <div className="data-space__viewer__usage__block__content">
899
- <TextInputEditor
900
- inputValue={showcase.query}
901
- isReadOnly={true}
902
- language={EDITOR_LANGUAGE.PURE}
903
- hideGutter={true}
904
- showMiniMap={false}
59
+ {dataSpaceViewerState.isVerified && (
60
+ <VerifiedIcon
61
+ className="data-space__viewer__header__title__verified-badge"
62
+ title="Verified Data Space"
905
63
  />
906
- </div>
907
- )}
64
+ )}
65
+ </div>
908
66
  </div>
909
- <DataSpaceUsageShowcaseOutputDescriptionViewer
910
- dataSpaceViewerState={dataSpaceViewerState}
911
- showcase={showcase}
912
- />
913
- <DataSpaceUsageShowcaseSampleOutputViewer
914
- dataSpaceViewerState={dataSpaceViewerState}
915
- showcase={showcase}
916
- />
917
67
  </div>
918
68
  );
919
69
  },
920
70
  );
921
71
 
922
- const DataSpaceUsageShowcasesPanel = observer(
923
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
924
- const { dataSpaceViewerState } = props;
72
+ const DataSpacePlaceholderPanel: React.FC<{ message: string }> = (props) => {
73
+ const { message } = props;
925
74
 
926
- if (!dataSpaceViewerState.HACKY__previewExperimentalFeatures) {
927
- return (
928
- <BlankPanelContent>
929
- Usage Showcases (Work in Progress)
930
- </BlankPanelContent>
931
- );
932
- }
933
- return (
934
- <div className="data-space__viewer__main-panel__content data-space__viewer__usages">
935
- {dataSpaceViewerState.dataSpaceAnalysisResult.HACKY__usageShowcases.map(
936
- (showcase) => (
937
- <DataSpaceUsageShowcaseViewer
938
- key={showcase.uuid}
939
- dataSpaceViewerState={dataSpaceViewerState}
940
- showcase={showcase}
941
- />
942
- ),
943
- )}
944
- </div>
945
- );
946
- },
947
- );
75
+ return (
76
+ <div className="data-space__viewer__panel">
77
+ <BlankPanelContent>{message}</BlankPanelContent>
78
+ </div>
79
+ );
80
+ };
948
81
 
949
82
  export const DataSpaceViewer = observer(
950
83
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
951
84
  const { dataSpaceViewerState } = props;
952
- const applicationStore = useApplicationStore();
953
- const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
954
- const changeActivity =
955
- (activity: DATA_SPACE_VIEWER_ACTIVITY_MODE): (() => void) =>
956
- (): void =>
957
- dataSpaceViewerState.setCurrentActivity(activity);
85
+ const bodyElement = useRef<HTMLDivElement>(null);
86
+ const [showFullHeader, setShowFullHeader] = useState(false);
958
87
 
959
- const activities: DataSpaceViewerActivityConfig[] = [
960
- {
961
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.OVERVIEW,
962
- title: 'Overview',
963
- icon: <ShapesIcon />,
964
- },
965
- {
966
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.DOCUMENTATION,
967
- title: 'Documentation',
968
- icon: <DocumentationIcon />,
969
- },
970
- {
971
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.USAGE_SHOWCASE,
972
- title: 'Usage Showcase',
973
- icon: <DisplayIcon />,
974
- },
975
- {
976
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION,
977
- title: 'Execution Context',
978
- icon: <PlayIcon />,
979
- },
980
- {
981
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_DATA,
982
- title: 'Test Data',
983
- icon: <FlaskIcon />,
984
- },
985
- {
986
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT,
987
- title: 'Entitlement',
988
- icon: <KeyIcon />,
989
- },
990
- {
991
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_COVERAGE,
992
- title: 'Test Coverage',
993
- icon: <ShieldIcon />,
994
- },
995
- {
996
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO,
997
- title: 'Info',
998
- icon: <InfoCircleIcon />,
999
- },
1000
- {
1001
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT,
1002
- title: 'Support',
1003
- icon: <QuestionCircleIcon />,
1004
- },
1005
- ];
88
+ const onScroll: React.UIEventHandler<HTMLDivElement> = (event) => {
89
+ setShowFullHeader(event.currentTarget.scrollTop > 0);
90
+ };
1006
91
 
1007
- const viewProject = (): void =>
1008
- dataSpaceViewerState.viewProject(
1009
- dataSpaceViewerState.groupId,
1010
- dataSpaceViewerState.artifactId,
1011
- dataSpaceViewerState.versionId,
1012
- analysisResult.path,
1013
- );
92
+ const isShowingWiki = [
93
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION,
94
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
95
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION,
96
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START,
97
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS,
98
+ ].includes(dataSpaceViewerState.currentActivity);
1014
99
 
1015
100
  return (
1016
101
  <div className="data-space__viewer">
1017
- <div className="data-space__viewer__header">
1018
- <div className="data-space__viewer__title">
1019
- <button
1020
- className="data-space__viewer__title__btn"
1021
- tabIndex={-1}
1022
- title={`View Project (${generateGAVCoordinates(
1023
- dataSpaceViewerState.groupId,
1024
- dataSpaceViewerState.artifactId,
1025
- dataSpaceViewerState.versionId,
1026
- )})`}
1027
- onClick={viewProject}
1028
- >
1029
- <div
1030
- className="data-space__viewer__title__label"
1031
- title={`${analysisResult.title ?? analysisResult.name} - ${
1032
- analysisResult.path
1033
- }`}
1034
- >
1035
- {analysisResult.title ?? analysisResult.name}
1036
- </div>
1037
- <div className="data-space__viewer__title__link">
1038
- <ExternalLinkSquareIcon />
1039
- </div>
1040
- </button>
1041
- </div>
1042
- </div>
1043
- <div className="data-space__viewer__content">
1044
- <div className="data-space__viewer__body">
1045
- <div className="data-space__viewer__activity-bar">
1046
- <div className="data-space__viewer__activity-bar__items">
1047
- {activities.map((activity) => (
1048
- <button
1049
- key={activity.mode}
1050
- className={clsx('data-space__viewer__activity-bar__item', {
1051
- 'data-space__viewer__activity-bar__item--active':
1052
- dataSpaceViewerState.currentActivity === activity.mode,
1053
- })}
1054
- onClick={changeActivity(activity.mode)}
1055
- tabIndex={-1}
1056
- title={activity.title}
1057
- >
1058
- {activity.icon}
1059
- </button>
1060
- ))}
1061
- </div>
1062
- </div>
1063
- <div className="data-space__viewer__main-panel">
1064
- {dataSpaceViewerState.currentActivity ===
1065
- DATA_SPACE_VIEWER_ACTIVITY_MODE.OVERVIEW && (
1066
- <DataSpaceOverview
1067
- dataSpaceViewerState={dataSpaceViewerState}
1068
- />
102
+ <DataSpaceViewerActivityBar
103
+ dataSpaceViewerState={dataSpaceViewerState}
104
+ />
105
+ <div
106
+ ref={bodyElement}
107
+ className="data-space__viewer__body"
108
+ onScroll={onScroll}
109
+ >
110
+ <DataSpaceHeader
111
+ dataSpaceViewerState={dataSpaceViewerState}
112
+ showFullHeader={showFullHeader}
113
+ />
114
+ <div
115
+ className={clsx('data-space__viewer__frame', {
116
+ 'data-space__viewer__frame--boundless': isShowingWiki,
117
+ 'data-space__viewer__frame--expanded':
118
+ dataSpaceViewerState.isExpandedModeEnabled,
119
+ })}
120
+ >
121
+ <div className="data-space__viewer__content">
122
+ {isShowingWiki && (
123
+ <DataSpaceWiki dataSpaceViewerState={dataSpaceViewerState} />
1069
124
  )}
1070
125
  {dataSpaceViewerState.currentActivity ===
1071
- DATA_SPACE_VIEWER_ACTIVITY_MODE.DOCUMENTATION && (
1072
- <DataSpaceDocumentation
126
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT && (
127
+ <DataSpaceExecutionContextViewer
1073
128
  dataSpaceViewerState={dataSpaceViewerState}
1074
129
  />
1075
130
  )}
1076
131
  {dataSpaceViewerState.currentActivity ===
1077
- DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION && (
1078
- <DataSpaceExecutionViewer
1079
- dataSpaceViewerState={dataSpaceViewerState}
1080
- />
132
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES && (
133
+ <DataSpacePlaceholderPanel message="View all data stores (Work in Progress)" />
1081
134
  )}
1082
135
  {dataSpaceViewerState.currentActivity ===
1083
- DATA_SPACE_VIEWER_ACTIVITY_MODE.USAGE_SHOWCASE && (
1084
- <DataSpaceUsageShowcasesPanel
1085
- dataSpaceViewerState={dataSpaceViewerState}
1086
- />
136
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY && (
137
+ <DataSpacePlaceholderPanel message="View data availability (Work in Progress)" />
1087
138
  )}
1088
139
  {dataSpaceViewerState.currentActivity ===
1089
- DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT &&
1090
- renderDataSpaceCheckEntitlementsEditor(
1091
- dataSpaceViewerState,
1092
- applicationStore.pluginManager
1093
- .getApplicationPlugins()
1094
- .filter(
1095
- (plugin) =>
1096
- plugin instanceof DSL_DataSpace_LegendApplicationPlugin,
1097
- ) as DSL_DataSpace_LegendApplicationPlugin[],
1098
- )}
1099
- {dataSpaceViewerState.currentActivity ===
1100
- DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_DATA && (
1101
- <BlankPanelContent>
1102
- View test data (Work in Progress)
1103
- </BlankPanelContent>
140
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST && (
141
+ <DataSpacePlaceholderPanel message="View data cost (Work in Progress)" />
1104
142
  )}
1105
143
  {dataSpaceViewerState.currentActivity ===
1106
- DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_COVERAGE && (
1107
- <BlankPanelContent>
1108
- View test coverage (Work in Progress)
1109
- </BlankPanelContent>
144
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE && (
145
+ <DataSpacePlaceholderPanel message="View data ownership and governance (Work in Progress)" />
1110
146
  )}
1111
147
  {dataSpaceViewerState.currentActivity ===
1112
148
  DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO && (
1113
- <DataSpaceInfo dataSpaceViewerState={dataSpaceViewerState} />
149
+ <DataSpaceInfoPanel
150
+ dataSpaceViewerState={dataSpaceViewerState}
151
+ />
1114
152
  )}
1115
153
  {dataSpaceViewerState.currentActivity ===
1116
154
  DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT && (
1117
- <div className="data-space__viewer__main-panel__content data-space__viewer__support-info">
1118
- <DataSpaceSupportInfoViewerInner
1119
- dataSpaceViewerState={dataSpaceViewerState}
1120
- />
1121
- </div>
155
+ <DataSpaceSupportPanel
156
+ dataSpaceViewerState={dataSpaceViewerState}
157
+ />
1122
158
  )}
1123
159
  </div>
1124
160
  </div>