@finos/legend-extension-dsl-data-space 9.0.47 → 9.1.0

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 → application}/studio/DSL_DataSpace_CodeSnippets.d.ts +1 -1
  10. package/lib/application/studio/DSL_DataSpace_CodeSnippets.d.ts.map +1 -0
  11. package/lib/{components → application}/studio/DSL_DataSpace_CodeSnippets.js +4 -0
  12. package/lib/application/studio/DSL_DataSpace_CodeSnippets.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 +135 -45
  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 → application}/studio/DSL_DataSpace_CodeSnippets.ts +4 -0
  108. package/src/application/studio/DSL_DataSpace_LegendStudioNavigation.ts +53 -0
  109. package/src/components/DataSpaceViewer.tsx +552 -109
  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,24 @@ 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,
42
48
  } from '@finos/legend-art';
43
49
  import {
44
50
  type Diagram,
@@ -55,8 +61,22 @@ import {
55
61
  } from '../stores/DataSpaceViewerState.js';
56
62
  import type { DataSpaceExecutionContextAnalysisResult } from '../graphManager/action/analytics/DataSpaceAnalysis.js';
57
63
  import { generateGAVCoordinates } from '@finos/legend-storage';
58
- import { useApplicationStore } from '@finos/legend-application';
64
+ import {
65
+ EDITOR_LANGUAGE,
66
+ TextInputEditor,
67
+ useApplicationStore,
68
+ } from '@finos/legend-application';
59
69
  import { DSL_DataSpace_LegendApplicationPlugin } from './DSL_DataSpace_LegendApplicationPlugin.js';
70
+ import {
71
+ getNullableFirstElement,
72
+ getNullableLastElement,
73
+ guaranteeNonNullable,
74
+ } from '@finos/legend-shared';
75
+ import {
76
+ HACKY__DataSpaceUsageShowcaseTDSOutputDescription,
77
+ type HACKY__DataSpaceUsageShowcase,
78
+ HACKY__DataSpaceUsageShowcaseTDSSampleOutput,
79
+ } from '../graphManager/action/analytics/HACKY__DataSpaceUsageShowcase.js';
60
80
 
61
81
  interface DataSpaceViewerActivityConfig {
62
82
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
@@ -108,62 +128,166 @@ const DataSpaceDiagramCanvas = observer(
108
128
  }),
109
129
  );
110
130
 
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(
131
+ const DataSpaceOverview = observer(
118
132
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
119
133
  const { dataSpaceViewerState } = props;
120
134
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
121
135
 
122
136
  // diagram selector
123
137
  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);
138
+
139
+ const showPreviousDiagram = (): void => {
140
+ if (!dataSpaceViewerState.currentDiagram) {
141
+ return;
142
+ }
143
+ const idx = analysisResult.featuredDiagrams.indexOf(
144
+ dataSpaceViewerState.currentDiagram,
145
+ );
146
+ if (idx === 0 || idx === -1) {
147
+ return;
148
+ }
149
+ dataSpaceViewerState.setCurrentDiagram(
150
+ guaranteeNonNullable(analysisResult.featuredDiagrams[idx - 1]),
151
+ );
152
+ };
153
+ const showNextDiagram = (): void => {
154
+ if (!dataSpaceViewerState.currentDiagram) {
155
+ return;
156
+ }
157
+ const idx = analysisResult.featuredDiagrams.indexOf(
158
+ dataSpaceViewerState.currentDiagram,
159
+ );
160
+ if (idx === analysisResult.featuredDiagrams.length - 1 || idx === -1) {
161
+ return;
132
162
  }
163
+ dataSpaceViewerState.setCurrentDiagram(
164
+ guaranteeNonNullable(analysisResult.featuredDiagrams[idx + 1]),
165
+ );
133
166
  };
134
167
 
135
168
  if (analysisResult.featuredDiagrams.length === 0) {
136
169
  return <BlankPanelContent>No diagrams available</BlankPanelContent>;
137
170
  }
138
171
  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>
172
+ <div className="data-space__viewer__main-panel__content data-space__viewer__overview">
173
+ <ResizablePanelGroup orientation="horizontal">
174
+ <ResizablePanel size={250} minSize={100}>
175
+ <div className="data-space__viewer__overview__description">
176
+ {analysisResult.description !== undefined && (
177
+ <div className="data-space__viewer__overview__description__content">
178
+ <MarkdownTextViewer
179
+ className="data-space__viewer__overview__description__content__markdown-content"
180
+ value={{
181
+ value: analysisResult.description,
182
+ }}
183
+ />
184
+ </div>
185
+ )}
186
+ {analysisResult.description === undefined && (
187
+ <div className="data-space__viewer__overview__description--empty">
188
+ No description
189
+ </div>
190
+ )}
191
+ </div>
192
+ </ResizablePanel>
193
+ <ResizablePanelSplitter />
194
+ <ResizablePanel minSize={100}>
195
+ <div className="data-space__viewer__overview__diagrams__carousel">
196
+ <div className="data-space__viewer__overview__diagrams__carousel__frame">
197
+ <div className="data-space__viewer__overview__diagrams__carousel__frame__display">
198
+ {dataSpaceViewerState.currentDiagram && (
199
+ <DataSpaceDiagramCanvas
200
+ dataSpaceViewerState={dataSpaceViewerState}
201
+ diagram={dataSpaceViewerState.currentDiagram}
202
+ ref={diagramCanvasRef}
203
+ />
204
+ )}
205
+ </div>
206
+ <button
207
+ className="data-space__viewer__overview__diagrams__carousel__frame__navigator data-space__viewer__overview__diagrams__carousel__frame__navigator--back"
208
+ tabIndex={-1}
209
+ title="Previous"
210
+ disabled={
211
+ getNullableFirstElement(analysisResult.featuredDiagrams) ===
212
+ dataSpaceViewerState.currentDiagram
213
+ }
214
+ onClick={showPreviousDiagram}
215
+ >
216
+ <ChevronLeftIcon />
217
+ </button>
218
+ <button
219
+ className="data-space__viewer__overview__diagrams__carousel__frame__navigator data-space__viewer__overview__diagrams__carousel__frame__navigator--next"
220
+ tabIndex={-1}
221
+ title="Previous"
222
+ disabled={
223
+ getNullableLastElement(analysisResult.featuredDiagrams) ===
224
+ dataSpaceViewerState.currentDiagram
225
+ }
226
+ onClick={showNextDiagram}
227
+ >
228
+ <ChevronRightIcon />
229
+ </button>
230
+ <div className="data-space__viewer__overview__diagrams__carousel__frame__indicators">
231
+ <div className="data-space__viewer__overview__diagrams__carousel__frame__indicators__notch">
232
+ {analysisResult.featuredDiagrams.map((diagram) => (
233
+ <button
234
+ key={diagram.path}
235
+ className={clsx(
236
+ 'data-space__viewer__overview__diagrams__carousel__frame__indicator',
237
+ {
238
+ 'data-space__viewer__overview__diagrams__carousel__frame__indicator--active':
239
+ dataSpaceViewerState.currentDiagram === diagram,
240
+ },
241
+ )}
242
+ onClick={() =>
243
+ dataSpaceViewerState.setCurrentDiagram(diagram)
244
+ }
245
+ >
246
+ <CircleIcon />
247
+ </button>
248
+ ))}
249
+ </div>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </ResizablePanel>
254
+ </ResizablePanelGroup>
255
+ </div>
256
+ );
257
+ },
258
+ );
259
+
260
+ const DataSpaceDocumentation = observer(
261
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
262
+ const { dataSpaceViewerState } = props;
263
+ const documentationEntries =
264
+ dataSpaceViewerState.dataSpaceAnalysisResult.elementDocs;
265
+
266
+ if (documentationEntries.length === 0) {
267
+ return <BlankPanelContent>No documentation available</BlankPanelContent>;
268
+ }
269
+ return (
270
+ <div className="data-space__viewer__main-panel__content data-space__viewer__overview">
271
+ <table className="table">
272
+ <thead>
273
+ <tr>
274
+ <th className="table__cell--left">Element</th>
275
+ <th className="table__cell--left"></th>
276
+ <th className="table__cell--left">Documentation</th>
277
+ </tr>
278
+ </thead>
279
+ <tbody>
280
+ {documentationEntries.map((entry) => (
281
+ <tr key={entry.uuid}>
282
+ <td className="table__cell--left">{entry.elementPath}</td>
283
+ <td className="table__cell--left">
284
+ {entry.subElementText ?? ''}
285
+ </td>
286
+ <td className="table__cell--left">{entry.doc}</td>
287
+ </tr>
288
+ ))}
289
+ </tbody>
290
+ </table>
167
291
  </div>
168
292
  );
169
293
  },
@@ -313,7 +437,9 @@ const DataSpaceExecutionViewer = observer(
313
437
  const DataSpaceInfo = observer(
314
438
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
315
439
  const { dataSpaceViewerState } = props;
440
+ const applicationStore = useApplicationStore();
316
441
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
442
+
317
443
  const viewProject = (): void =>
318
444
  dataSpaceViewerState.viewProject(
319
445
  dataSpaceViewerState.groupId,
@@ -328,6 +454,15 @@ const DataSpaceInfo = observer(
328
454
  dataSpaceViewerState.versionId,
329
455
  analysisResult.path,
330
456
  );
457
+ const viewDataSpaceInSDLCProject = (): void => {
458
+ dataSpaceViewerState
459
+ .viewSDLCProject(
460
+ dataSpaceViewerState.groupId,
461
+ dataSpaceViewerState.artifactId,
462
+ analysisResult.path,
463
+ )
464
+ .catch(applicationStore.alertUnhandledError);
465
+ };
331
466
 
332
467
  return (
333
468
  <div className="data-space__viewer__info">
@@ -339,7 +474,7 @@ const DataSpaceInfo = observer(
339
474
  <button
340
475
  className="data-space__viewer__info__project-info__value"
341
476
  tabIndex={-1}
342
- title="View Project"
477
+ title="Click to View Project"
343
478
  onClick={viewProject}
344
479
  >
345
480
  {generateGAVCoordinates(
@@ -348,9 +483,14 @@ const DataSpaceInfo = observer(
348
483
  dataSpaceViewerState.versionId,
349
484
  )}
350
485
  </button>
351
- <div className="data-space__viewer__info__project-info__link">
486
+ <button
487
+ className="data-space__viewer__info__project-info__link"
488
+ tabIndex={-1}
489
+ title="View Project"
490
+ onClick={viewProject}
491
+ >
352
492
  <ExternalLinkIcon />
353
- </div>
493
+ </button>
354
494
  </div>
355
495
  <div className="data-space__viewer__info__section__entry">
356
496
  <div className="data-space__viewer__info__project-info__label">
@@ -359,14 +499,27 @@ const DataSpaceInfo = observer(
359
499
  <button
360
500
  className="data-space__viewer__info__project-info__value"
361
501
  tabIndex={-1}
362
- title="View Data Space"
502
+ title="Click to View Data Space"
363
503
  onClick={viewDataSpaceInProject}
364
504
  >
365
505
  {analysisResult.path}
366
506
  </button>
367
- <div className="data-space__viewer__info__project-info__link">
507
+ <button
508
+ className="data-space__viewer__info__project-info__link"
509
+ tabIndex={-1}
510
+ title="Edit Data Space"
511
+ onClick={viewDataSpaceInSDLCProject}
512
+ >
513
+ <PencilIcon />
514
+ </button>
515
+ <button
516
+ className="data-space__viewer__info__project-info__link"
517
+ tabIndex={-1}
518
+ title="View Data Space"
519
+ onClick={viewDataSpaceInProject}
520
+ >
368
521
  <ExternalLinkIcon />
369
- </div>
522
+ </button>
370
523
  </div>
371
524
  </div>
372
525
  <div className="data-space__viewer__info__section">
@@ -494,6 +647,305 @@ const renderDataSpaceCheckEntitlementsEditor = (
494
647
  );
495
648
  };
496
649
 
650
+ const DataSpaceUsageShowcaseTDSSampleOutputViewer = observer(
651
+ (props: {
652
+ dataSpaceViewerState: DataSpaceViewerState;
653
+ showcase: HACKY__DataSpaceUsageShowcase;
654
+ sampleOutput: HACKY__DataSpaceUsageShowcaseTDSSampleOutput;
655
+ }) => {
656
+ const { showcase, sampleOutput: sampleOutput } = props;
657
+
658
+ const toggleShowSampleOutput = (): void =>
659
+ showcase.setShowSampleOutput(!showcase.showSampleOutput);
660
+
661
+ return (
662
+ <div
663
+ className={clsx('data-space__viewer__usage__block', {
664
+ 'data-space__viewer__usage__block--collapsed':
665
+ !showcase.showSampleOutput,
666
+ })}
667
+ >
668
+ <button
669
+ className="data-space__viewer__usage__block__header"
670
+ tabIndex={-1}
671
+ onClick={toggleShowSampleOutput}
672
+ >
673
+ <div className="data-space__viewer__usage__block__header__toggler">
674
+ {showcase.showSampleOutput ? <CaretDownIcon /> : <CaretRightIcon />}
675
+ </div>
676
+ <div className="data-space__viewer__usage__block__header__title">
677
+ Sample Output
678
+ </div>
679
+ </button>
680
+ {showcase.showSampleOutput && (
681
+ <div className="data-space__viewer__usage__block__content">
682
+ <table className="table data-space__viewer__usage__block__content__table">
683
+ <thead>
684
+ <tr>
685
+ {sampleOutput.headers.map((header, idx) => (
686
+ // eslint-disable-next-line react/no-array-index-key
687
+ <th key={idx} className="table__cell--left">
688
+ {header}
689
+ </th>
690
+ ))}
691
+ </tr>
692
+ </thead>
693
+ <tbody>
694
+ {sampleOutput.rows.map((row, idx) => (
695
+ // eslint-disable-next-line react/no-array-index-key
696
+ <tr key={idx}>
697
+ {row.map((cell, rowIdx) => (
698
+ // eslint-disable-next-line react/no-array-index-key
699
+ <td key={rowIdx} className="table__cell--left">
700
+ {cell}
701
+ </td>
702
+ ))}
703
+ </tr>
704
+ ))}
705
+ </tbody>
706
+ </table>
707
+ </div>
708
+ )}
709
+ </div>
710
+ );
711
+ },
712
+ );
713
+
714
+ const DataSpaceUsageShowcaseSampleOutputViewer = observer(
715
+ (props: {
716
+ dataSpaceViewerState: DataSpaceViewerState;
717
+ showcase: HACKY__DataSpaceUsageShowcase;
718
+ }) => {
719
+ const { dataSpaceViewerState, showcase } = props;
720
+ if (
721
+ showcase.outputDescription.sampleOutput instanceof
722
+ HACKY__DataSpaceUsageShowcaseTDSSampleOutput
723
+ ) {
724
+ return (
725
+ <DataSpaceUsageShowcaseTDSSampleOutputViewer
726
+ dataSpaceViewerState={dataSpaceViewerState}
727
+ showcase={showcase}
728
+ sampleOutput={showcase.outputDescription.sampleOutput}
729
+ />
730
+ );
731
+ }
732
+ return (
733
+ <BlankPanelContent>Can&apos;t display sample output</BlankPanelContent>
734
+ );
735
+ },
736
+ );
737
+
738
+ const DataSpaceUsageShowcaseTDSOutputDescriptionViewer = observer(
739
+ (props: {
740
+ dataSpaceViewerState: DataSpaceViewerState;
741
+ showcase: HACKY__DataSpaceUsageShowcase;
742
+ description: HACKY__DataSpaceUsageShowcaseTDSOutputDescription;
743
+ }) => {
744
+ const { showcase, description: description } = props;
745
+
746
+ const toggleShowOutputDescription = (): void =>
747
+ showcase.setShowOutputDescription(!showcase.showOutputDescription);
748
+
749
+ return (
750
+ <div
751
+ className={clsx('data-space__viewer__usage__block', {
752
+ 'data-space__viewer__usage__block--collapsed':
753
+ !showcase.showOutputDescription,
754
+ })}
755
+ >
756
+ <button
757
+ className="data-space__viewer__usage__block__header"
758
+ tabIndex={-1}
759
+ onClick={toggleShowOutputDescription}
760
+ >
761
+ <div className="data-space__viewer__usage__block__header__toggler">
762
+ {showcase.showOutputDescription ? (
763
+ <CaretDownIcon />
764
+ ) : (
765
+ <CaretRightIcon />
766
+ )}
767
+ </div>
768
+ <div className="data-space__viewer__usage__block__header__title">
769
+ Output Description
770
+ </div>
771
+ </button>
772
+ {showcase.showOutputDescription && (
773
+ <div className="data-space__viewer__usage__block__content">
774
+ <table className="table data-space__viewer__usage__block__content__table">
775
+ <thead>
776
+ <tr>
777
+ <th className="table__cell--left">Column Name</th>
778
+ <th className="table__cell--left">Description</th>
779
+ <th className="table__cell--left">Sample Values</th>
780
+ </tr>
781
+ </thead>
782
+ <tbody>
783
+ {description.columns.map((column) => (
784
+ <tr key={column.uuid}>
785
+ <td className="table__cell--left">{column.name}</td>
786
+ <td className="table__cell--left">{column.description}</td>
787
+ <td className="table__cell--left">
788
+ {column.sampleValues.join(', ')}
789
+ </td>
790
+ </tr>
791
+ ))}
792
+ </tbody>
793
+ </table>
794
+ </div>
795
+ )}
796
+ </div>
797
+ );
798
+ },
799
+ );
800
+
801
+ const DataSpaceUsageShowcaseOutputDescriptionViewer = observer(
802
+ (props: {
803
+ dataSpaceViewerState: DataSpaceViewerState;
804
+ showcase: HACKY__DataSpaceUsageShowcase;
805
+ }) => {
806
+ const { dataSpaceViewerState, showcase } = props;
807
+ if (
808
+ showcase.outputDescription instanceof
809
+ HACKY__DataSpaceUsageShowcaseTDSOutputDescription
810
+ ) {
811
+ return (
812
+ <DataSpaceUsageShowcaseTDSOutputDescriptionViewer
813
+ dataSpaceViewerState={dataSpaceViewerState}
814
+ showcase={showcase}
815
+ description={showcase.outputDescription}
816
+ />
817
+ );
818
+ }
819
+ return (
820
+ <BlankPanelContent>
821
+ Can&apos;t display output description
822
+ </BlankPanelContent>
823
+ );
824
+ },
825
+ );
826
+
827
+ const DataSpaceUsageShowcaseViewer = observer(
828
+ (props: {
829
+ dataSpaceViewerState: DataSpaceViewerState;
830
+ showcase: HACKY__DataSpaceUsageShowcase;
831
+ }) => {
832
+ const { dataSpaceViewerState, showcase } = props;
833
+ const applicationStore = useApplicationStore();
834
+
835
+ const toggleShowQuery = (): void =>
836
+ showcase.setShowQuery(!showcase.showQuery);
837
+ const copyQuery: React.MouseEventHandler<HTMLButtonElement> = (
838
+ event,
839
+ ): void => {
840
+ event.preventDefault();
841
+ event.stopPropagation();
842
+
843
+ applicationStore.clipboardService
844
+ .copyTextToClipboard(showcase.query)
845
+ .catch(applicationStore.alertUnhandledError);
846
+ };
847
+
848
+ return (
849
+ <div className="data-space__viewer__usage">
850
+ <div className="data-space__viewer__usage__title">{showcase.title}</div>
851
+ {showcase.description !== undefined && (
852
+ <div className="data-data-space__viewer__usage__description">
853
+ <MarkdownTextViewer
854
+ className="data-space__viewer__usage__description__markdown-content"
855
+ value={{
856
+ value: showcase.description,
857
+ }}
858
+ />
859
+ </div>
860
+ )}
861
+ <div
862
+ className={clsx(
863
+ 'data-space__viewer__usage__block data-space__viewer__usage__query',
864
+ {
865
+ 'data-space__viewer__usage__block--collapsed':
866
+ !showcase.showQuery,
867
+ },
868
+ )}
869
+ >
870
+ <button
871
+ className="data-space__viewer__usage__block__header"
872
+ tabIndex={-1}
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
+ </button>
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,30 +958,40 @@ 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
  },
513
965
  {
514
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION,
515
- title: 'Execution Context',
516
- icon: <PlayIcon />,
517
- },
518
- {
519
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT,
520
- title: 'Entitlement',
521
- icon: <KeyIcon />,
966
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.DOCUMENTATION,
967
+ title: 'Documentation',
968
+ icon: <DocumentationIcon />,
522
969
  },
523
970
  {
524
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_DATA,
525
- title: 'Test Data',
526
- icon: <FlaskIcon />,
971
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.USAGE_SHOWCASE,
972
+ title: 'Usage Showcase',
973
+ icon: <DisplayIcon />,
527
974
  },
528
975
  {
529
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_COVERAGE,
530
- title: 'Test Coverage',
531
- icon: <ShieldIcon />,
976
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION,
977
+ title: 'Execution Context',
978
+ icon: <PlayIcon />,
532
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
+ // },
533
995
  {
534
996
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO,
535
997
  title: 'Info',
@@ -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(
@@ -653,7 +1096,7 @@ export const DataSpaceViewer = observer(
653
1096
  plugin instanceof DSL_DataSpace_LegendApplicationPlugin,
654
1097
  ) as DSL_DataSpace_LegendApplicationPlugin[],
655
1098
  )}
656
- {dataSpaceViewerState.currentActivity ===
1099
+ {/* {dataSpaceViewerState.currentActivity ===
657
1100
  DATA_SPACE_VIEWER_ACTIVITY_MODE.TEST_DATA && (
658
1101
  <BlankPanelContent>
659
1102
  View test data (Work in Progress)
@@ -664,7 +1107,7 @@ export const DataSpaceViewer = observer(
664
1107
  <BlankPanelContent>
665
1108
  View test coverage (Work in Progress)
666
1109
  </BlankPanelContent>
667
- )}
1110
+ )} */}
668
1111
  {dataSpaceViewerState.currentActivity ===
669
1112
  DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO && (
670
1113
  <DataSpaceInfo dataSpaceViewerState={dataSpaceViewerState} />