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

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 (128) 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/DataSpaceDiagramViewer.d.ts +23 -0
  6. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -0
  7. package/lib/components/DataSpaceDiagramViewer.js +77 -0
  8. package/lib/components/DataSpaceDiagramViewer.js.map +1 -0
  9. package/lib/components/DataSpaceExecutionContextViewer.d.ts +23 -0
  10. package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -0
  11. package/lib/components/DataSpaceExecutionContextViewer.js +58 -0
  12. package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -0
  13. package/lib/components/DataSpaceInfoPanel.d.ts +23 -0
  14. package/lib/components/DataSpaceInfoPanel.d.ts.map +1 -0
  15. package/lib/components/DataSpaceInfoPanel.js +38 -0
  16. package/lib/components/DataSpaceInfoPanel.js.map +1 -0
  17. package/lib/components/DataSpaceModelsDocumentation.d.ts +23 -0
  18. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -0
  19. package/lib/components/DataSpaceModelsDocumentation.js +60 -0
  20. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -0
  21. package/lib/components/{studio/DataSpacePreview.d.ts → DataSpaceQuickStart.d.ts} +2 -5
  22. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -0
  23. package/lib/components/DataSpaceQuickStart.js +17 -0
  24. package/lib/components/DataSpaceQuickStart.js.map +1 -0
  25. package/lib/components/DataSpaceSupportPanel.d.ts +23 -0
  26. package/lib/components/DataSpaceSupportPanel.d.ts.map +1 -0
  27. package/lib/components/DataSpaceSupportPanel.js +40 -0
  28. package/lib/components/DataSpaceSupportPanel.js.map +1 -0
  29. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  30. package/lib/components/DataSpaceViewer.js +29 -278
  31. package/lib/components/DataSpaceViewer.js.map +1 -1
  32. package/lib/components/DataSpaceViewerActivityBar.d.ts +23 -0
  33. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -0
  34. package/lib/components/DataSpaceViewerActivityBar.js +105 -0
  35. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -0
  36. package/lib/components/DataSpaceWiki.d.ts +23 -0
  37. package/lib/components/DataSpaceWiki.d.ts.map +1 -0
  38. package/lib/components/DataSpaceWiki.js +36 -0
  39. package/lib/components/DataSpaceWiki.js.map +1 -0
  40. package/lib/components/query/DataSpaceAdvancedSearchModal.js +1 -1
  41. package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
  42. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +1 -2
  43. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  44. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +0 -13
  45. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  46. package/lib/components/studio/DataSpacePreviewAction.js +1 -1
  47. package/lib/components/studio/DataSpacePreviewAction.js.map +1 -1
  48. package/lib/graph/DSL_DataSpace_HashUtils.d.ts +3 -2
  49. package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
  50. package/lib/graph/DSL_DataSpace_HashUtils.js +3 -2
  51. package/lib/graph/DSL_DataSpace_HashUtils.js.map +1 -1
  52. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +23 -0
  53. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
  54. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +50 -0
  55. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
  56. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +36 -5
  57. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  58. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +35 -8
  59. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  60. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  61. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +70 -11
  62. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  63. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  64. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +48 -8
  65. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  66. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  67. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +39 -0
  68. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  69. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +92 -3
  70. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  71. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +23 -0
  72. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
  73. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +50 -0
  74. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
  75. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts +0 -1
  76. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
  77. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +33 -5
  78. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
  79. package/lib/index.css +2 -2
  80. package/lib/index.css.map +1 -1
  81. package/lib/package.json +9 -5
  82. package/lib/stores/DataSpaceViewerState.d.ts +16 -14
  83. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  84. package/lib/stores/DataSpaceViewerState.js +19 -12
  85. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  86. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
  87. package/lib/stores/studio/DataSpacePreviewState.js +0 -3
  88. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
  89. package/package.json +20 -16
  90. package/src/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts +15 -2
  91. package/src/components/DataSpaceDiagramViewer.tsx +191 -0
  92. package/src/components/DataSpaceExecutionContextViewer.tsx +173 -0
  93. package/src/components/DataSpaceInfoPanel.tsx +170 -0
  94. package/src/components/DataSpaceModelsDocumentation.tsx +92 -0
  95. package/src/components/DataSpaceQuickStart.tsx +15 -0
  96. package/src/components/DataSpaceSupportPanel.tsx +80 -0
  97. package/src/components/DataSpaceViewer.tsx +73 -1063
  98. package/src/components/DataSpaceViewerActivityBar.tsx +215 -0
  99. package/src/components/DataSpaceWiki.tsx +76 -0
  100. package/src/components/query/DataSpaceAdvancedSearchModal.tsx +1 -1
  101. package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +0 -15
  102. package/src/components/studio/DataSpacePreviewAction.tsx +1 -1
  103. package/src/graph/DSL_DataSpace_HashUtils.ts +3 -2
  104. package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +60 -0
  105. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +46 -15
  106. package/src/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +99 -14
  107. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +65 -15
  108. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  109. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +140 -2
  110. package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +60 -0
  111. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +51 -7
  112. package/src/stores/DataSpaceViewerState.ts +24 -20
  113. package/src/stores/studio/DataSpacePreviewState.ts +0 -5
  114. package/tsconfig.json +8 -3
  115. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts +0 -28
  116. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts.map +0 -1
  117. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js +0 -30
  118. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js.map +0 -1
  119. package/lib/components/studio/DataSpacePreview.d.ts.map +0 -1
  120. package/lib/components/studio/DataSpacePreview.js +0 -52
  121. package/lib/components/studio/DataSpacePreview.js.map +0 -1
  122. package/lib/stores/studio/DataSpacePreviewStore.d.ts +0 -34
  123. package/lib/stores/studio/DataSpacePreviewStore.d.ts.map +0 -1
  124. package/lib/stores/studio/DataSpacePreviewStore.js +0 -98
  125. package/lib/stores/studio/DataSpacePreviewStore.js.map +0 -1
  126. package/src/application/studio/DSL_DataSpace_LegendStudioNavigation.ts +0 -53
  127. package/src/components/studio/DataSpacePreview.tsx +0 -129
  128. package/src/stores/studio/DataSpacePreviewStore.ts +0 -172
@@ -14,1111 +14,121 @@
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, 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"
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
+
29
+ const DataSpaceTitle = observer(
30
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) =>
31
+ // const { dataSpaceViewerState } = props;
32
+
33
+ null,
34
+ /* <div className="data-space__viewer__header">
35
+ <div className="data-space__viewer__title">
36
+ <button
37
+ className="data-space__viewer__title__btn"
38
+ tabIndex={-1}
39
+ title={`View Project (${generateGAVCoordinates(
40
+ dataSpaceViewerState.groupId,
41
+ dataSpaceViewerState.artifactId,
42
+ dataSpaceViewerState.versionId,
43
+ )})`}
44
+ onClick={viewProject}
537
45
  >
538
46
  <div
539
- className="data-space__viewer__info__tagged-value__tag"
540
- title={`${taggedValue.profile}.${taggedValue.tag}`}
541
- >
542
- {`${extractElementNameFromPath(taggedValue.profile)}.${
543
- taggedValue.tag
47
+ className="data-space__viewer__title__label"
48
+ title={`${analysisResult.title ?? analysisResult.name} - ${
49
+ analysisResult.path
544
50
  }`}
51
+ >
52
+ {analysisResult.title ?? analysisResult.name}
545
53
  </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
- }`}
54
+ <div className="data-space__viewer__title__link">
55
+ <ExternalLinkSquareIcon />
572
56
  </div>
573
- </div>
574
- ))}
575
- {analysisResult.stereotypes.length === 0 && (
576
- <div className="data-space__viewer__info__section__placeholder">
577
- (empty)
57
+ </button>
578
58
  </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
- },
59
+ </div> */
609
60
  );
610
61
 
611
- const DataSpaceSupportInfoViewerInner = observer(
612
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
613
- const { dataSpaceViewerState } = props;
614
- const supportInfo =
615
- dataSpaceViewerState.dataSpaceAnalysisResult.supportInfo;
62
+ const DataSpacePlaceholderPanel: React.FC<{ message: string }> = (props) => {
63
+ const { message } = props;
616
64
 
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
65
  return (
647
- <BlankPanelContent>
648
- Check entitlement(s) (Work in Progress)
649
- </BlankPanelContent>
66
+ <div className="data-space__viewer__panel">
67
+ <BlankPanelContent>{message}</BlankPanelContent>
68
+ </div>
650
69
  );
651
70
  };
652
71
 
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(
741
- (props: {
742
- dataSpaceViewerState: DataSpaceViewerState;
743
- showcase: HACKY__DataSpaceUsageShowcase;
744
- description: HACKY__DataSpaceUsageShowcaseTDSOutputDescription;
745
- }) => {
746
- const { showcase, description: description } = props;
747
-
748
- const toggleShowOutputDescription = (): void =>
749
- showcase.setShowOutputDescription(!showcase.showOutputDescription);
750
-
751
- return (
752
- <div
753
- className={clsx('data-space__viewer__usage__block', {
754
- 'data-space__viewer__usage__block--collapsed':
755
- !showcase.showOutputDescription,
756
- })}
757
- >
758
- <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
- )}
870
- >
871
- <div
872
- className="data-space__viewer__usage__block__header"
873
- onClick={toggleShowQuery}
874
- >
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>
895
- </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}
905
- />
906
- </div>
907
- )}
908
- </div>
909
- <DataSpaceUsageShowcaseOutputDescriptionViewer
910
- dataSpaceViewerState={dataSpaceViewerState}
911
- showcase={showcase}
912
- />
913
- <DataSpaceUsageShowcaseSampleOutputViewer
914
- dataSpaceViewerState={dataSpaceViewerState}
915
- showcase={showcase}
916
- />
917
- </div>
918
- );
919
- },
920
- );
921
-
922
- const DataSpaceUsageShowcasesPanel = observer(
923
- (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
924
- const { dataSpaceViewerState } = props;
925
-
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
- );
948
-
949
72
  export const DataSpaceViewer = observer(
950
73
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
951
74
  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);
958
-
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
- ];
1006
-
1007
- const viewProject = (): void =>
1008
- dataSpaceViewerState.viewProject(
1009
- dataSpaceViewerState.groupId,
1010
- dataSpaceViewerState.artifactId,
1011
- dataSpaceViewerState.versionId,
1012
- analysisResult.path,
1013
- );
75
+ const isShowingWiki = [
76
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION,
77
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
78
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION,
79
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START,
80
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS,
81
+ ].includes(dataSpaceViewerState.currentActivity);
1014
82
 
1015
83
  return (
1016
84
  <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
- />
85
+ <DataSpaceViewerActivityBar
86
+ dataSpaceViewerState={dataSpaceViewerState}
87
+ />
88
+ <div className="data-space__viewer__body">
89
+ <div
90
+ className={clsx('data-space__viewer__frame', {
91
+ 'data-space__viewer__frame--boundless': isShowingWiki,
92
+ })}
93
+ >
94
+ <DataSpaceTitle dataSpaceViewerState={dataSpaceViewerState} />
95
+ <div className="data-space__viewer__content">
96
+ {isShowingWiki && (
97
+ <DataSpaceWiki dataSpaceViewerState={dataSpaceViewerState} />
1069
98
  )}
1070
99
  {dataSpaceViewerState.currentActivity ===
1071
- DATA_SPACE_VIEWER_ACTIVITY_MODE.DOCUMENTATION && (
1072
- <DataSpaceDocumentation
100
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT && (
101
+ <DataSpaceExecutionContextViewer
1073
102
  dataSpaceViewerState={dataSpaceViewerState}
1074
103
  />
1075
104
  )}
1076
105
  {dataSpaceViewerState.currentActivity ===
1077
- DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION && (
1078
- <DataSpaceExecutionViewer
1079
- dataSpaceViewerState={dataSpaceViewerState}
1080
- />
106
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES && (
107
+ <DataSpacePlaceholderPanel message="View all data stores (Work in Progress)" />
1081
108
  )}
1082
109
  {dataSpaceViewerState.currentActivity ===
1083
- DATA_SPACE_VIEWER_ACTIVITY_MODE.USAGE_SHOWCASE && (
1084
- <DataSpaceUsageShowcasesPanel
1085
- dataSpaceViewerState={dataSpaceViewerState}
1086
- />
110
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY && (
111
+ <DataSpacePlaceholderPanel message="View data availability (Work in Progress)" />
1087
112
  )}
1088
113
  {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>
114
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST && (
115
+ <DataSpacePlaceholderPanel message="View data cost (Work in Progress)" />
1104
116
  )}
1105
117
  {dataSpaceViewerState.currentActivity ===
1106
- DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_COVERAGE && (
1107
- <BlankPanelContent>
1108
- View test coverage (Work in Progress)
1109
- </BlankPanelContent>
118
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE && (
119
+ <DataSpacePlaceholderPanel message="View data ownership and governance (Work in Progress)" />
1110
120
  )}
1111
121
  {dataSpaceViewerState.currentActivity ===
1112
122
  DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO && (
1113
- <DataSpaceInfo dataSpaceViewerState={dataSpaceViewerState} />
123
+ <DataSpaceInfoPanel
124
+ dataSpaceViewerState={dataSpaceViewerState}
125
+ />
1114
126
  )}
1115
127
  {dataSpaceViewerState.currentActivity ===
1116
128
  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>
129
+ <DataSpaceSupportPanel
130
+ dataSpaceViewerState={dataSpaceViewerState}
131
+ />
1122
132
  )}
1123
133
  </div>
1124
134
  </div>