@finos/legend-extension-dsl-data-space 9.0.48 → 9.1.1

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 (142) hide show
  1. package/lib/DSL_DataSpace_Const.d.ts +1 -0
  2. package/lib/DSL_DataSpace_Const.d.ts.map +1 -1
  3. package/lib/DSL_DataSpace_Const.js +2 -1
  4. package/lib/DSL_DataSpace_Const.js.map +1 -1
  5. package/lib/{stores/query/DSL_DataSpace_LegendQueryRouter.d.ts → application/query/DSL_DataSpace_LegendQueryNavigation.d.ts} +12 -11
  6. package/lib/application/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -0
  7. package/lib/{stores/query/DSL_DataSpace_LegendQueryRouter.js → application/query/DSL_DataSpace_LegendQueryNavigation.js} +13 -12
  8. package/lib/application/query/DSL_DataSpace_LegendQueryNavigation.js.map +1 -0
  9. package/lib/{components/studio/DSL_DataSpace_CodeSnippets.d.ts → application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts} +2 -2
  10. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts.map +1 -0
  11. package/lib/{components/studio/DSL_DataSpace_CodeSnippets.js → application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js} +5 -1
  12. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js.map +1 -0
  13. package/lib/application/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts.map +1 -0
  14. package/lib/application/studio/DSL_DataSpace_LegendStudioDocumentation.js.map +1 -0
  15. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts +28 -0
  16. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts.map +1 -0
  17. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js +30 -0
  18. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js.map +1 -0
  19. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +2 -1
  20. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
  21. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  22. package/lib/components/DataSpaceViewer.js +126 -34
  23. package/lib/components/DataSpaceViewer.js.map +1 -1
  24. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
  25. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +3 -3
  26. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +1 -1
  27. package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -1
  28. package/lib/components/query/DataSpaceQueryBuilder.js +6 -4
  29. package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -1
  30. package/lib/components/query/DataSpaceQueryCreator.d.ts.map +1 -1
  31. package/lib/components/query/DataSpaceQueryCreator.js +8 -9
  32. package/lib/components/query/DataSpaceQueryCreator.js.map +1 -1
  33. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
  34. package/lib/components/query/DataSpaceQuerySetup.js +2 -1
  35. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  36. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +5 -1
  37. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  38. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +41 -2
  39. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  40. package/lib/components/studio/DataSpacePreview.d.ts +20 -0
  41. package/lib/components/studio/DataSpacePreview.d.ts.map +1 -0
  42. package/lib/components/studio/DataSpacePreview.js +52 -0
  43. package/lib/components/studio/DataSpacePreview.js.map +1 -0
  44. package/lib/components/studio/DataSpacePreviewAction.d.ts +26 -0
  45. package/lib/components/studio/DataSpacePreviewAction.d.ts.map +1 -0
  46. package/lib/components/studio/DataSpacePreviewAction.js +46 -0
  47. package/lib/components/studio/DataSpacePreviewAction.js.map +1 -0
  48. package/lib/graph/DSL_DataSpace_HashUtils.d.ts +2 -0
  49. package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
  50. package/lib/graph/DSL_DataSpace_HashUtils.js +2 -0
  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 +5 -3
  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 +6 -4
  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 +10 -0
  57. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  58. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +18 -0
  59. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  60. package/lib/graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.d.ts +57 -0
  61. package/lib/graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.d.ts.map +1 -0
  62. package/lib/graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.js +209 -0
  63. package/lib/graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.js.map +1 -0
  64. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  65. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +13 -1
  66. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  67. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  68. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +28 -4
  69. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  70. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +24 -0
  71. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  72. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +79 -3
  73. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  74. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +3 -2
  75. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
  76. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +6 -4
  77. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
  78. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
  79. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +7 -17
  80. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
  81. package/lib/index.css +2 -2
  82. package/lib/index.css.map +1 -1
  83. package/lib/package.json +4 -4
  84. package/lib/stores/DataSpaceViewerState.d.ts +13 -8
  85. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  86. package/lib/stores/DataSpaceViewerState.js +11 -6
  87. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  88. package/lib/stores/query/DataSpaceAdvancedSearchState.js +1 -1
  89. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  90. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts +1 -0
  91. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -1
  92. package/lib/stores/query/DataSpaceQueryCreatorStore.js +10 -2
  93. package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
  94. package/lib/stores/query/DataSpaceQuerySetupStore.js +1 -1
  95. package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
  96. package/lib/stores/studio/DataSpacePreviewState.d.ts +30 -0
  97. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -0
  98. package/lib/stores/studio/DataSpacePreviewState.js +85 -0
  99. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -0
  100. package/lib/stores/studio/DataSpacePreviewStore.d.ts +34 -0
  101. package/lib/stores/studio/DataSpacePreviewStore.d.ts.map +1 -0
  102. package/lib/stores/studio/DataSpacePreviewStore.js +98 -0
  103. package/lib/stores/studio/DataSpacePreviewStore.js.map +1 -0
  104. package/package.json +15 -15
  105. package/src/DSL_DataSpace_Const.ts +2 -1
  106. package/src/{stores/query/DSL_DataSpace_LegendQueryRouter.ts → application/query/DSL_DataSpace_LegendQueryNavigation.ts} +17 -18
  107. package/src/{components/studio/DSL_DataSpace_CodeSnippets.ts → application/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts} +4 -0
  108. package/src/application/studio/DSL_DataSpace_LegendStudioNavigation.ts +53 -0
  109. package/src/components/DataSpaceViewer.tsx +541 -98
  110. package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +5 -4
  111. package/src/components/query/DataSpaceQueryBuilder.tsx +6 -4
  112. package/src/components/query/DataSpaceQueryCreator.tsx +12 -23
  113. package/src/components/query/DataSpaceQuerySetup.tsx +2 -1
  114. package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +52 -2
  115. package/src/components/studio/DataSpacePreview.tsx +129 -0
  116. package/src/components/studio/DataSpacePreviewAction.tsx +127 -0
  117. package/src/graph/DSL_DataSpace_HashUtils.ts +2 -0
  118. package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +15 -4
  119. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +31 -0
  120. package/src/graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.ts +313 -0
  121. package/src/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +25 -0
  122. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +66 -3
  123. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +110 -1
  124. package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +6 -4
  125. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +13 -53
  126. package/src/stores/DataSpaceViewerState.ts +25 -14
  127. package/src/stores/query/DataSpaceAdvancedSearchState.ts +1 -1
  128. package/src/stores/query/DataSpaceQueryCreatorStore.ts +13 -1
  129. package/src/stores/query/DataSpaceQuerySetupStore.ts +1 -1
  130. package/src/stores/studio/DataSpacePreviewState.ts +150 -0
  131. package/src/stores/studio/DataSpacePreviewStore.ts +172 -0
  132. package/tsconfig.json +10 -5
  133. package/tsconfig.package.json +1 -2
  134. package/lib/components/studio/DSL_DataSpace_CodeSnippets.d.ts.map +0 -1
  135. package/lib/components/studio/DSL_DataSpace_CodeSnippets.js.map +0 -1
  136. package/lib/components/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts.map +0 -1
  137. package/lib/components/studio/DSL_DataSpace_LegendStudioDocumentation.js.map +0 -1
  138. package/lib/stores/query/DSL_DataSpace_LegendQueryRouter.d.ts.map +0 -1
  139. package/lib/stores/query/DSL_DataSpace_LegendQueryRouter.js.map +0 -1
  140. /package/lib/{components → application}/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts +0 -0
  141. /package/lib/{components → application}/studio/DSL_DataSpace_LegendStudioDocumentation.js +0 -0
  142. /package/src/{components → application}/studio/DSL_DataSpace_LegendStudioDocumentation.ts +0 -0
@@ -27,18 +27,27 @@ import {
27
27
  PURE_MappingIcon,
28
28
  PURE_RuntimeIcon,
29
29
  CogIcon,
30
- KeyIcon,
31
- FlaskIcon,
32
- ShieldIcon,
33
- LightBulbIcon,
34
30
  InfoCircleIcon,
35
31
  ExternalLinkIcon,
36
32
  useResizeDetector,
37
- DropdownMenu,
38
- MenuContent,
39
- MenuContentItem,
40
- CaretDownIcon,
41
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,
42
51
  } from '@finos/legend-art';
43
52
  import {
44
53
  type Diagram,
@@ -55,8 +64,22 @@ import {
55
64
  } from '../stores/DataSpaceViewerState.js';
56
65
  import type { DataSpaceExecutionContextAnalysisResult } from '../graphManager/action/analytics/DataSpaceAnalysis.js';
57
66
  import { generateGAVCoordinates } from '@finos/legend-storage';
58
- import { useApplicationStore } from '@finos/legend-application';
67
+ import {
68
+ EDITOR_LANGUAGE,
69
+ TextInputEditor,
70
+ useApplicationStore,
71
+ } from '@finos/legend-application';
59
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';
60
83
 
61
84
  interface DataSpaceViewerActivityConfig {
62
85
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
@@ -108,62 +131,166 @@ const DataSpaceDiagramCanvas = observer(
108
131
  }),
109
132
  );
110
133
 
111
- type DiagramOption = { label: string; value: Diagram };
112
- const buildDiagramOption = (diagram: Diagram): DiagramOption => ({
113
- label: diagram.name,
114
- value: diagram,
115
- });
116
-
117
- const DataSpaceModelsOverview = observer(
134
+ const DataSpaceOverview = observer(
118
135
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
119
136
  const { dataSpaceViewerState } = props;
120
137
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
121
138
 
122
139
  // diagram selector
123
140
  const diagramCanvasRef = useRef<HTMLDivElement>(null);
124
- const diagramOptions =
125
- analysisResult.featuredDiagrams.map(buildDiagramOption);
126
- const selectedDiagramOption = dataSpaceViewerState.currentDiagram
127
- ? buildDiagramOption(dataSpaceViewerState.currentDiagram)
128
- : null;
129
- const onDiagramOptionChange = (option: DiagramOption): void => {
130
- if (option.value !== dataSpaceViewerState.currentDiagram) {
131
- dataSpaceViewerState.setCurrentDiagram(option.value);
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;
132
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
+ );
133
169
  };
134
170
 
135
171
  if (analysisResult.featuredDiagrams.length === 0) {
136
172
  return <BlankPanelContent>No diagrams available</BlankPanelContent>;
137
173
  }
138
174
  return (
139
- <div className="data-space__viewer__main-panel__content data-space__viewer__diagrams">
140
- <div className="data-space__viewer__diagrams__header">
141
- <CustomSelectorInput
142
- className="data-space__viewer__diagrams__diagram-selector"
143
- options={diagramOptions}
144
- onChange={onDiagramOptionChange}
145
- value={selectedDiagramOption}
146
- placeholder="Search for a diagram"
147
- darkMode={true}
148
- />
149
- </div>
150
- <div className="data-space__viewer__diagrams__content">
151
- {dataSpaceViewerState.currentDiagram && (
152
- <DataSpaceDiagramCanvas
153
- dataSpaceViewerState={dataSpaceViewerState}
154
- diagram={dataSpaceViewerState.currentDiagram}
155
- ref={diagramCanvasRef}
156
- />
157
- )}
158
- </div>
159
- <div className="data-space__viewer__diagrams__footer">
160
- <div className="data-space__viewer__diagrams__footer__icon">
161
- <LightBulbIcon />
162
- </div>
163
- <div className="data-space__viewer__diagrams__footer__text">
164
- Double-click a class to start a query for that class
165
- </div>
166
- </div>
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>
167
294
  </div>
168
295
  );
169
296
  },
@@ -313,7 +440,9 @@ const DataSpaceExecutionViewer = observer(
313
440
  const DataSpaceInfo = observer(
314
441
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
315
442
  const { dataSpaceViewerState } = props;
443
+ const applicationStore = useApplicationStore();
316
444
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
445
+
317
446
  const viewProject = (): void =>
318
447
  dataSpaceViewerState.viewProject(
319
448
  dataSpaceViewerState.groupId,
@@ -328,6 +457,15 @@ const DataSpaceInfo = observer(
328
457
  dataSpaceViewerState.versionId,
329
458
  analysisResult.path,
330
459
  );
460
+ const viewDataSpaceInSDLCProject = (): void => {
461
+ dataSpaceViewerState
462
+ .viewSDLCProject(
463
+ dataSpaceViewerState.groupId,
464
+ dataSpaceViewerState.artifactId,
465
+ analysisResult.path,
466
+ )
467
+ .catch(applicationStore.alertUnhandledError);
468
+ };
331
469
 
332
470
  return (
333
471
  <div className="data-space__viewer__info">
@@ -339,7 +477,7 @@ const DataSpaceInfo = observer(
339
477
  <button
340
478
  className="data-space__viewer__info__project-info__value"
341
479
  tabIndex={-1}
342
- title="View Project"
480
+ title="Click to View Project"
343
481
  onClick={viewProject}
344
482
  >
345
483
  {generateGAVCoordinates(
@@ -348,9 +486,14 @@ const DataSpaceInfo = observer(
348
486
  dataSpaceViewerState.versionId,
349
487
  )}
350
488
  </button>
351
- <div className="data-space__viewer__info__project-info__link">
489
+ <button
490
+ className="data-space__viewer__info__project-info__link"
491
+ tabIndex={-1}
492
+ title="View Project"
493
+ onClick={viewProject}
494
+ >
352
495
  <ExternalLinkIcon />
353
- </div>
496
+ </button>
354
497
  </div>
355
498
  <div className="data-space__viewer__info__section__entry">
356
499
  <div className="data-space__viewer__info__project-info__label">
@@ -359,14 +502,27 @@ const DataSpaceInfo = observer(
359
502
  <button
360
503
  className="data-space__viewer__info__project-info__value"
361
504
  tabIndex={-1}
362
- title="View Data Space"
505
+ title="Click to View Data Space"
363
506
  onClick={viewDataSpaceInProject}
364
507
  >
365
508
  {analysisResult.path}
366
509
  </button>
367
- <div className="data-space__viewer__info__project-info__link">
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
+ >
368
524
  <ExternalLinkIcon />
369
- </div>
525
+ </button>
370
526
  </div>
371
527
  </div>
372
528
  <div className="data-space__viewer__info__section">
@@ -494,6 +650,302 @@ const renderDataSpaceCheckEntitlementsEditor = (
494
650
  );
495
651
  };
496
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(
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
+
497
949
  export const DataSpaceViewer = observer(
498
950
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
499
951
  const { dataSpaceViewerState } = props;
@@ -506,25 +958,35 @@ export const DataSpaceViewer = observer(
506
958
 
507
959
  const activities: DataSpaceViewerActivityConfig[] = [
508
960
  {
509
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_OVERVIEW,
510
- title: 'Models Overview',
961
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.OVERVIEW,
962
+ title: 'Overview',
511
963
  icon: <ShapesIcon />,
512
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
+ },
513
975
  {
514
976
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION,
515
977
  title: 'Execution Context',
516
978
  icon: <PlayIcon />,
517
979
  },
518
- {
519
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT,
520
- title: 'Entitlement',
521
- icon: <KeyIcon />,
522
- },
523
980
  {
524
981
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_DATA,
525
982
  title: 'Test Data',
526
983
  icon: <FlaskIcon />,
527
984
  },
985
+ {
986
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT,
987
+ title: 'Entitlement',
988
+ icon: <KeyIcon />,
989
+ },
528
990
  {
529
991
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_COVERAGE,
530
992
  title: 'Test Coverage',
@@ -549,15 +1011,6 @@ export const DataSpaceViewer = observer(
549
1011
  dataSpaceViewerState.versionId,
550
1012
  analysisResult.path,
551
1013
  );
552
- const viewSDLCProject = (): void => {
553
- dataSpaceViewerState
554
- .viewSDLCProject(
555
- dataSpaceViewerState.groupId,
556
- dataSpaceViewerState.artifactId,
557
- analysisResult.path,
558
- )
559
- .catch(applicationStore.alertUnhandledError);
560
- };
561
1014
 
562
1015
  return (
563
1016
  <div className="data-space__viewer">
@@ -585,28 +1038,6 @@ export const DataSpaceViewer = observer(
585
1038
  <ExternalLinkSquareIcon />
586
1039
  </div>
587
1040
  </button>
588
- <DropdownMenu
589
- className="data-space__viewer__title__dropdown-trigger"
590
- content={
591
- <MenuContent>
592
- <MenuContentItem onClick={viewSDLCProject}>
593
- View SDLC project
594
- </MenuContentItem>
595
- </MenuContent>
596
- }
597
- >
598
- <CaretDownIcon title="Show more options..." />
599
- </DropdownMenu>
600
- </div>
601
- <div
602
- className={clsx('data-space__viewer__description', {
603
- 'data-space__viewer__description--empty':
604
- !analysisResult.description,
605
- })}
606
- >
607
- {analysisResult.description
608
- ? analysisResult.description
609
- : 'No description'}
610
1041
  </div>
611
1042
  </div>
612
1043
  <div className="data-space__viewer__content">
@@ -631,8 +1062,14 @@ export const DataSpaceViewer = observer(
631
1062
  </div>
632
1063
  <div className="data-space__viewer__main-panel">
633
1064
  {dataSpaceViewerState.currentActivity ===
634
- DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_OVERVIEW && (
635
- <DataSpaceModelsOverview
1065
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.OVERVIEW && (
1066
+ <DataSpaceOverview
1067
+ dataSpaceViewerState={dataSpaceViewerState}
1068
+ />
1069
+ )}
1070
+ {dataSpaceViewerState.currentActivity ===
1071
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DOCUMENTATION && (
1072
+ <DataSpaceDocumentation
636
1073
  dataSpaceViewerState={dataSpaceViewerState}
637
1074
  />
638
1075
  )}
@@ -642,6 +1079,12 @@ export const DataSpaceViewer = observer(
642
1079
  dataSpaceViewerState={dataSpaceViewerState}
643
1080
  />
644
1081
  )}
1082
+ {dataSpaceViewerState.currentActivity ===
1083
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.USAGE_SHOWCASE && (
1084
+ <DataSpaceUsageShowcasesPanel
1085
+ dataSpaceViewerState={dataSpaceViewerState}
1086
+ />
1087
+ )}
645
1088
  {dataSpaceViewerState.currentActivity ===
646
1089
  DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT &&
647
1090
  renderDataSpaceCheckEntitlementsEditor(