@finos/legend-extension-dsl-data-space 4.0.5 → 6.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 (154) hide show
  1. package/lib/DSLDataSpace_Const.d.ts +18 -0
  2. package/lib/DSLDataSpace_Const.d.ts.map +1 -0
  3. package/lib/DSLDataSpace_Const.js +20 -0
  4. package/lib/DSLDataSpace_Const.js.map +1 -0
  5. package/lib/DSLDataSpace_Extension.d.ts +1 -1
  6. package/lib/DSLDataSpace_Extension.d.ts.map +1 -1
  7. package/lib/DSLDataSpace_Extension.js +3 -3
  8. package/lib/DSLDataSpace_Extension.js.map +1 -1
  9. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  10. package/lib/components/DataSpaceViewer.js +39 -33
  11. package/lib/components/DataSpaceViewer.js.map +1 -1
  12. package/lib/components/query/{DSLDataSpace_LegendQueryPlugin.d.ts → DSLDataSpace_LegendQueryApplicationPlugin.d.ts} +6 -3
  13. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -0
  14. package/lib/components/query/{DSLDataSpace_LegendQueryPlugin.js → DSLDataSpace_LegendQueryApplicationPlugin.js} +28 -4
  15. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.js.map +1 -0
  16. package/lib/components/query/DataSpaceQueryEditor.d.ts +20 -0
  17. package/lib/components/query/DataSpaceQueryEditor.d.ts.map +1 -0
  18. package/lib/components/query/DataSpaceQueryEditor.js +43 -0
  19. package/lib/components/query/DataSpaceQueryEditor.js.map +1 -0
  20. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
  21. package/lib/components/query/DataSpaceQuerySetup.js +13 -21
  22. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  23. package/lib/components/studio/{DSLDataSpace_LegendStudioPlugin.d.ts → DSLDataSpace_LegendStudioApplicationPlugin.d.ts} +3 -3
  24. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -0
  25. package/lib/components/studio/{DSLDataSpace_LegendStudioPlugin.js → DSLDataSpace_LegendStudioApplicationPlugin.js} +5 -5
  26. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.js.map +1 -0
  27. package/lib/{models/DSLDataSpace_ModelUtils.d.ts → graph/DSLDataSpace_HashUtils.d.ts} +1 -1
  28. package/lib/graph/DSLDataSpace_HashUtils.d.ts.map +1 -0
  29. package/lib/{models/DSLDataSpace_ModelUtils.js → graph/DSLDataSpace_HashUtils.js} +1 -1
  30. package/lib/graph/DSLDataSpace_HashUtils.js.map +1 -0
  31. package/lib/graph/DSLDataSpace_PureGraphPlugin.js +1 -1
  32. package/lib/graph/DSLDataSpace_PureGraphPlugin.js.map +1 -1
  33. package/lib/{models/metamodels → graph/metamodel}/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts +1 -0
  34. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts.map +1 -0
  35. package/lib/{models/metamodels → graph/metamodel}/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js +3 -1
  36. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js.map +1 -0
  37. package/lib/graphManager/DSLDataSpace_GraphManagerHelper.d.ts +1 -1
  38. package/lib/graphManager/DSLDataSpace_GraphManagerHelper.d.ts.map +1 -1
  39. package/lib/graphManager/DSLDataSpace_GraphManagerHelper.js +1 -1
  40. package/lib/graphManager/DSLDataSpace_GraphManagerHelper.js.map +1 -1
  41. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts +2 -1
  42. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  43. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js +5 -1
  44. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js.map +1 -1
  45. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +51 -0
  46. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -0
  47. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +49 -0
  48. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -0
  49. package/lib/graphManager/action/changeDetection/DSLDataSpace_ObserverHelper.d.ts +1 -1
  50. package/lib/graphManager/action/changeDetection/DSLDataSpace_ObserverHelper.d.ts.map +1 -1
  51. package/lib/graphManager/action/changeDetection/DSLDataSpace_ObserverHelper.js +1 -0
  52. package/lib/graphManager/action/changeDetection/DSLDataSpace_ObserverHelper.js.map +1 -1
  53. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtension.d.ts +23 -0
  54. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtension.d.ts.map +1 -0
  55. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtension.js +21 -0
  56. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtension.js.map +1 -0
  57. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.d.ts +18 -0
  58. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.d.ts.map +1 -0
  59. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.js +20 -0
  60. package/lib/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.js.map +1 -0
  61. package/lib/{models/protocols → graphManager/protocol}/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +0 -0
  62. package/lib/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -0
  63. package/lib/{models/protocols → graphManager/protocol}/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +3 -1
  64. package/lib/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -0
  65. package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.d.ts +26 -0
  66. package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.d.ts.map +1 -0
  67. package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.js +159 -0
  68. package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.js.map +1 -0
  69. package/lib/{models/protocols → graphManager/protocol}/pure/v1/V1_DSLDataSpace_SystemModels.json +0 -0
  70. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +54 -0
  71. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -0
  72. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +80 -0
  73. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -0
  74. package/lib/{models/protocols → graphManager/protocol}/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts +1 -0
  75. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts.map +1 -0
  76. package/lib/{models/protocols → graphManager/protocol}/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js +3 -1
  77. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js.map +1 -0
  78. package/lib/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.d.ts +1 -1
  79. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.d.ts.map +1 -0
  80. package/lib/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js +0 -0
  81. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js.map +1 -0
  82. package/lib/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts +3 -1
  83. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -0
  84. package/lib/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +2 -1
  85. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -0
  86. package/lib/index.css +2 -2
  87. package/lib/index.css.map +1 -1
  88. package/lib/index.d.ts +5 -3
  89. package/lib/index.d.ts.map +1 -1
  90. package/lib/index.js +5 -3
  91. package/lib/index.js.map +1 -1
  92. package/lib/package.json +15 -14
  93. package/lib/stores/DataSpaceViewerState.d.ts +8 -12
  94. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  95. package/lib/stores/DataSpaceViewerState.js +11 -33
  96. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  97. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts +32 -0
  98. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts.map +1 -0
  99. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js +34 -0
  100. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js.map +1 -0
  101. package/lib/stores/query/DataSpaceQueryEditorStore.d.ts +31 -0
  102. package/lib/stores/query/DataSpaceQueryEditorStore.d.ts.map +1 -0
  103. package/lib/stores/query/DataSpaceQueryEditorStore.js +88 -0
  104. package/lib/stores/query/DataSpaceQueryEditorStore.js.map +1 -0
  105. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +6 -5
  106. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
  107. package/lib/stores/query/DataSpaceQuerySetupState.js +41 -46
  108. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
  109. package/package.json +22 -21
  110. package/src/DSLDataSpace_Const.ts +20 -0
  111. package/src/DSLDataSpace_Extension.ts +3 -3
  112. package/src/components/DataSpaceViewer.tsx +142 -89
  113. package/src/components/query/{DSLDataSpace_LegendQueryPlugin.tsx → DSLDataSpace_LegendQueryApplicationPlugin.tsx} +41 -4
  114. package/src/components/query/DataSpaceQueryEditor.tsx +106 -0
  115. package/src/components/query/DataSpaceQuerySetup.tsx +45 -34
  116. package/src/components/studio/{DSLDataSpace_LegendStudioPlugin.tsx → DSLDataSpace_LegendStudioApplicationPlugin.tsx} +11 -11
  117. package/src/{models/DSLDataSpace_ModelUtils.ts → graph/DSLDataSpace_HashUtils.ts} +0 -0
  118. package/src/graph/DSLDataSpace_PureGraphPlugin.ts +1 -1
  119. package/src/{models/metamodels → graph/metamodel}/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.ts +3 -1
  120. package/src/graphManager/DSLDataSpace_GraphManagerHelper.ts +1 -1
  121. package/src/graphManager/DSLDataSpace_PureGraphManagerPlugin.ts +7 -1
  122. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +65 -0
  123. package/src/graphManager/action/changeDetection/DSLDataSpace_ObserverHelper.ts +2 -1
  124. package/src/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtension.ts +42 -0
  125. package/src/graphManager/protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.ts +27 -0
  126. package/src/{models/protocols → graphManager/protocol}/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +3 -1
  127. package/src/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.ts +265 -0
  128. package/src/{models/protocols → graphManager/protocol}/pure/v1/V1_DSLDataSpace_SystemModels.json +0 -0
  129. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +119 -0
  130. package/src/{models/protocols → graphManager/protocol}/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.ts +3 -1
  131. package/src/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.ts +1 -1
  132. package/src/{models/protocols → graphManager/protocol}/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +2 -1
  133. package/src/index.ts +5 -3
  134. package/src/stores/DataSpaceViewerState.ts +24 -55
  135. package/src/stores/query/DSLDataSpace_LegendQueryRouter.ts +69 -0
  136. package/src/stores/query/DataSpaceQueryEditorStore.ts +143 -0
  137. package/src/stores/query/DataSpaceQuerySetupState.ts +74 -75
  138. package/tsconfig.json +18 -9
  139. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts.map +0 -1
  140. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js.map +0 -1
  141. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +0 -1
  142. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +0 -1
  143. package/lib/models/DSLDataSpace_ModelUtils.d.ts.map +0 -1
  144. package/lib/models/DSLDataSpace_ModelUtils.js.map +0 -1
  145. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts.map +0 -1
  146. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js.map +0 -1
  147. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +0 -1
  148. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +0 -1
  149. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts.map +0 -1
  150. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js.map +0 -1
  151. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.d.ts.map +0 -1
  152. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js.map +0 -1
  153. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +0 -1
  154. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +0 -1
@@ -32,23 +32,25 @@ import {
32
32
  FlaskIcon,
33
33
  ExternalLinkSquareIcon,
34
34
  ShieldIcon,
35
- TagsIcon,
36
35
  LightBulbIcon,
36
+ InfoCircleIcon,
37
+ ExternalLinkIcon,
37
38
  } from '@finos/legend-art';
38
39
  import {
39
40
  type Diagram,
40
41
  DiagramRenderer,
41
42
  } from '@finos/legend-extension-dsl-diagram';
43
+ import { DataSpaceSupportEmail } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
42
44
  import {
43
- DataSpaceSupportEmail,
44
- type DataSpaceExecutionContext,
45
- type DataSpaceSupportInfo,
46
- } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
47
- import type { PackageableRuntime } from '@finos/legend-graph';
45
+ extractElementNameFromPath,
46
+ type PackageableRuntime,
47
+ } from '@finos/legend-graph';
48
48
  import {
49
49
  type DataSpaceViewerState,
50
50
  DATA_SPACE_VIEWER_ACTIVITY_MODE,
51
51
  } from '../stores/DataSpaceViewerState.js';
52
+ import type { DataSpaceExecutionContextAnalysisResult } from '../graphManager/action/analytics/DataSpaceAnalysis.js';
53
+ import { generateGAVCoordinates } from '@finos/legend-server-depot';
52
54
 
53
55
  interface DataSpaceViewerActivityConfig {
54
56
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
@@ -113,16 +115,12 @@ const buildDiagramOption = (diagram: Diagram): DiagramOption => ({
113
115
  const DataSpaceModelsOverview = observer(
114
116
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
115
117
  const { dataSpaceViewerState } = props;
118
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
116
119
 
117
120
  // diagram selector
118
121
  const diagramCanvasRef = useRef<HTMLDivElement>(null);
119
- const diagramOptions = dataSpaceViewerState.featuredDiagrams
120
- .concat(
121
- dataSpaceViewerState.diagrams.filter(
122
- (diagram) => !dataSpaceViewerState.featuredDiagrams.includes(diagram),
123
- ),
124
- )
125
- .map(buildDiagramOption);
122
+ const diagramOptions =
123
+ analysisResult.featuredDiagrams.map(buildDiagramOption);
126
124
  const selectedDiagramOption = dataSpaceViewerState.currentDiagram
127
125
  ? buildDiagramOption(dataSpaceViewerState.currentDiagram)
128
126
  : null;
@@ -131,22 +129,8 @@ const DataSpaceModelsOverview = observer(
131
129
  dataSpaceViewerState.setCurrentDiagram(option.value);
132
130
  }
133
131
  };
134
- const formatDiagramOptionLabel = (
135
- option: DiagramOption,
136
- ): React.ReactNode => (
137
- <div className="data-space__viewer__diagrams__dropdown__option">
138
- <div className="data-space__viewer__diagrams__dropdown__option__label">
139
- {option.label}
140
- </div>
141
- {dataSpaceViewerState.featuredDiagrams.includes(option.value) && (
142
- <div className="data-space__viewer__diagrams__dropdown__option__tag">
143
- featured
144
- </div>
145
- )}
146
- </div>
147
- );
148
132
 
149
- if (dataSpaceViewerState.diagrams.length === 0) {
133
+ if (analysisResult.featuredDiagrams.length === 0) {
150
134
  return <BlankPanelContent>No diagrams available</BlankPanelContent>;
151
135
  }
152
136
  return (
@@ -159,7 +143,6 @@ const DataSpaceModelsOverview = observer(
159
143
  value={selectedDiagramOption}
160
144
  placeholder="Search for a diagram"
161
145
  darkMode={true}
162
- formatOptionLabel={formatDiagramOptionLabel}
163
146
  />
164
147
  </div>
165
148
  <div className="data-space__viewer__diagrams__content">
@@ -186,10 +169,10 @@ const DataSpaceModelsOverview = observer(
186
169
 
187
170
  type ExecutionContextOption = {
188
171
  label: string;
189
- value: DataSpaceExecutionContext;
172
+ value: DataSpaceExecutionContextAnalysisResult;
190
173
  };
191
174
  const buildExecutionContextOption = (
192
- value: DataSpaceExecutionContext,
175
+ value: DataSpaceExecutionContextAnalysisResult,
193
176
  ): ExecutionContextOption => ({
194
177
  label: value.name,
195
178
  value: value,
@@ -207,12 +190,15 @@ const buildRuntimeOption = (value: PackageableRuntime): RuntimeOption => ({
207
190
  const DataSpaceExecutionViewer = observer(
208
191
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
209
192
  const { dataSpaceViewerState } = props;
193
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
194
+ const executionContexts = Array.from(
195
+ dataSpaceViewerState.dataSpaceAnalysisResult.executionContextsIndex.values(),
196
+ );
210
197
 
211
198
  // execution
212
- const executionContextOptions =
213
- dataSpaceViewerState.dataSpace.executionContexts.map(
214
- buildExecutionContextOption,
215
- );
199
+ const executionContextOptions = executionContexts.map(
200
+ buildExecutionContextOption,
201
+ );
216
202
  const selectedExecutionContextOption = buildExecutionContextOption(
217
203
  dataSpaceViewerState.currentExecutionContext,
218
204
  );
@@ -230,8 +216,7 @@ const DataSpaceExecutionViewer = observer(
230
216
  <div className="data-space__viewer__execution__entry__content__dropdown__option__label">
231
217
  {option.label}
232
218
  </div>
233
- {option.value ===
234
- dataSpaceViewerState.dataSpace.defaultExecutionContext && (
219
+ {option.value === analysisResult.defaultExecutionContext && (
235
220
  <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
236
221
  default
237
222
  </div>
@@ -241,7 +226,9 @@ const DataSpaceExecutionViewer = observer(
241
226
 
242
227
  // runtime
243
228
  const runtimeOptions =
244
- dataSpaceViewerState.runtimes.map(buildRuntimeOption);
229
+ dataSpaceViewerState.currentExecutionContext.compatibleRuntimes.map(
230
+ buildRuntimeOption,
231
+ );
245
232
  const selectedRuntimeOption = buildRuntimeOption(
246
233
  dataSpaceViewerState.currentRuntime,
247
234
  );
@@ -258,7 +245,7 @@ const DataSpaceExecutionViewer = observer(
258
245
  {option.label}
259
246
  </div>
260
247
  {option.value ===
261
- dataSpaceViewerState.currentExecutionContext.defaultRuntime.value && (
248
+ dataSpaceViewerState.currentExecutionContext.defaultRuntime && (
262
249
  <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
263
250
  default
264
251
  </div>
@@ -298,7 +285,7 @@ const DataSpaceExecutionViewer = observer(
298
285
  <PURE_MappingIcon />
299
286
  </div>
300
287
  <div className="data-space__viewer__execution__entry__content data-space__viewer__execution__entry__content__text">
301
- {dataSpaceViewerState.currentExecutionContext.mapping.value.path}
288
+ {dataSpaceViewerState.currentExecutionContext.mapping.path}
302
289
  </div>
303
290
  </div>
304
291
  <div className="data-space__viewer__execution__entry">
@@ -321,59 +308,114 @@ const DataSpaceExecutionViewer = observer(
321
308
  },
322
309
  );
323
310
 
324
- const DataSpaceTags = observer(
311
+ const DataSpaceInfo = observer(
325
312
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
326
313
  const { dataSpaceViewerState } = props;
327
-
328
- const dataSpace = dataSpaceViewerState.dataSpace;
314
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
315
+ const viewProject = (): void =>
316
+ dataSpaceViewerState.viewProject?.(
317
+ dataSpaceViewerState.groupId,
318
+ dataSpaceViewerState.artifactId,
319
+ dataSpaceViewerState.versionId,
320
+ undefined,
321
+ );
322
+ const viewDataSpaceInProject = (): void =>
323
+ dataSpaceViewerState.viewProject?.(
324
+ dataSpaceViewerState.groupId,
325
+ dataSpaceViewerState.artifactId,
326
+ dataSpaceViewerState.versionId,
327
+ analysisResult.path,
328
+ );
329
329
 
330
330
  return (
331
- <div className="data-space__viewer__tags">
332
- <div className="data-space__viewer__tags__section">
333
- <div className="data-space__viewer__tags__section__title">
331
+ <div className="data-space__viewer__info">
332
+ <div className="data-space__viewer__info__section">
333
+ <div className="data-space__viewer__info__section__entry">
334
+ <div className="data-space__viewer__info__project-info__label">
335
+ Project
336
+ </div>
337
+ <button
338
+ className="data-space__viewer__info__project-info__value"
339
+ tabIndex={-1}
340
+ title="View Project"
341
+ onClick={viewProject}
342
+ >
343
+ {generateGAVCoordinates(
344
+ dataSpaceViewerState.groupId,
345
+ dataSpaceViewerState.artifactId,
346
+ dataSpaceViewerState.versionId,
347
+ )}
348
+ </button>
349
+ <div className="data-space__viewer__info__project-info__link">
350
+ <ExternalLinkIcon />
351
+ </div>
352
+ </div>
353
+ <div className="data-space__viewer__info__section__entry">
354
+ <div className="data-space__viewer__info__project-info__label">
355
+ Data Space
356
+ </div>
357
+ <button
358
+ className="data-space__viewer__info__project-info__value"
359
+ tabIndex={-1}
360
+ title="View Data Space"
361
+ onClick={viewDataSpaceInProject}
362
+ >
363
+ {analysisResult.path}
364
+ </button>
365
+ <div className="data-space__viewer__info__project-info__link">
366
+ <ExternalLinkIcon />
367
+ </div>
368
+ </div>
369
+ </div>
370
+ <div className="data-space__viewer__info__section">
371
+ <div className="data-space__viewer__info__section__title">
334
372
  Tagged Values
335
373
  </div>
336
- {dataSpace.taggedValues.length !== 0 &&
337
- dataSpace.taggedValues.map((taggedValue) => (
374
+ {analysisResult.taggedValues.length !== 0 &&
375
+ analysisResult.taggedValues.map((taggedValue) => (
338
376
  <div
339
377
  key={taggedValue._UUID}
340
- className="data-space__viewer__tags__section__entry"
378
+ className="data-space__viewer__info__section__entry"
341
379
  >
342
380
  <div
343
- className="data-space__viewer__tags__tagged-value__tag"
344
- title={`${taggedValue.tag.ownerReference.value.name}.${taggedValue.tag.value.value}`}
381
+ className="data-space__viewer__info__tagged-value__tag"
382
+ title={`${taggedValue.profile}.${taggedValue.tag}`}
345
383
  >
346
- {taggedValue.tag.value.value}
384
+ {`${extractElementNameFromPath(taggedValue.profile)}.${
385
+ taggedValue.tag
386
+ }`}
347
387
  </div>
348
- <div className="data-space__viewer__tags__tagged-value__value">
388
+ <div className="data-space__viewer__info__tagged-value__value">
349
389
  {taggedValue.value}
350
390
  </div>
351
391
  </div>
352
392
  ))}
353
- {dataSpace.taggedValues.length === 0 && (
354
- <div className="data-space__viewer__tags__section__placeholder">
393
+ {analysisResult.taggedValues.length === 0 && (
394
+ <div className="data-space__viewer__info__section__placeholder">
355
395
  (empty)
356
396
  </div>
357
397
  )}
358
398
  </div>
359
- <div className="data-space__viewer__tags__section">
360
- <div className="data-space__viewer__tags__section__title">
399
+ <div className="data-space__viewer__info__section">
400
+ <div className="data-space__viewer__info__section__title">
361
401
  Stereotypes
362
402
  </div>
363
- {dataSpace.stereotypes.length !== 0 &&
364
- dataSpace.stereotypes.map((stereotype) => (
403
+ {analysisResult.stereotypes.length !== 0 &&
404
+ analysisResult.stereotypes.map((stereotype) => (
365
405
  <div
366
- key={stereotype.value._UUID}
367
- className="data-space__viewer__tags__section__entry"
368
- title={`${stereotype.ownerReference.value.name}.${stereotype.value.value}`}
406
+ key={stereotype._UUID}
407
+ className="data-space__viewer__info__section__entry"
408
+ title={`${stereotype.profile}.${stereotype.value}`}
369
409
  >
370
- <div className="data-space__viewer__tags__steoreotype">
371
- {stereotype.value.value}
410
+ <div className="data-space__viewer__info__steoreotype">
411
+ {`${extractElementNameFromPath(stereotype.profile)}.${
412
+ stereotype.value
413
+ }`}
372
414
  </div>
373
415
  </div>
374
416
  ))}
375
- {dataSpace.stereotypes.length === 0 && (
376
- <div className="data-space__viewer__tags__section__placeholder">
417
+ {analysisResult.stereotypes.length === 0 && (
418
+ <div className="data-space__viewer__info__section__placeholder">
377
419
  (empty)
378
420
  </div>
379
421
  )}
@@ -409,18 +451,18 @@ const DataSpaceSupportEmailViewer = observer(
409
451
  );
410
452
 
411
453
  const DataSpaceSupportInfoViewerInner = observer(
412
- (props: {
413
- dataSpaceViewerState: DataSpaceViewerState;
414
- dataSpaceSupportInfo: DataSpaceSupportInfo | undefined;
415
- }) => {
416
- const { dataSpaceViewerState, dataSpaceSupportInfo } = props;
417
- if (dataSpaceSupportInfo === undefined) {
454
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
455
+ const { dataSpaceViewerState } = props;
456
+ const supportInfo =
457
+ dataSpaceViewerState.dataSpaceAnalysisResult.supportInfo;
458
+
459
+ if (supportInfo === undefined) {
418
460
  return <BlankPanelContent>No support info available</BlankPanelContent>;
419
- } else if (dataSpaceSupportInfo instanceof DataSpaceSupportEmail) {
461
+ } else if (supportInfo instanceof DataSpaceSupportEmail) {
420
462
  return (
421
463
  <DataSpaceSupportEmailViewer
422
464
  dataSpaceViewerState={dataSpaceViewerState}
423
- dataSpaceSupportEmail={dataSpaceSupportInfo}
465
+ dataSpaceSupportEmail={supportInfo}
424
466
  />
425
467
  );
426
468
  }
@@ -433,7 +475,7 @@ const DataSpaceSupportInfoViewerInner = observer(
433
475
  export const DataSpaceViewer = observer(
434
476
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
435
477
  const { dataSpaceViewerState } = props;
436
- const dataSpace = dataSpaceViewerState.dataSpace;
478
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
437
479
  const changeActivity =
438
480
  (activity: DATA_SPACE_VIEWER_ACTIVITY_MODE): (() => void) =>
439
481
  (): void =>
@@ -466,9 +508,9 @@ export const DataSpaceViewer = observer(
466
508
  icon: <ShieldIcon />,
467
509
  },
468
510
  {
469
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.TAGS,
470
- title: 'Tags',
471
- icon: <TagsIcon />,
511
+ mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO,
512
+ title: 'Info',
513
+ icon: <InfoCircleIcon />,
472
514
  },
473
515
  {
474
516
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT,
@@ -482,31 +524,43 @@ export const DataSpaceViewer = observer(
482
524
  dataSpaceViewerState.groupId,
483
525
  dataSpaceViewerState.artifactId,
484
526
  dataSpaceViewerState.versionId,
485
- dataSpace.path,
527
+ analysisResult.path,
486
528
  );
487
529
 
488
530
  return (
489
531
  <div className="data-space__viewer">
490
532
  <div className="data-space__viewer__header">
491
533
  <button
492
- className="data-space__viewer__path"
534
+ className="data-space__viewer__title"
493
535
  tabIndex={-1}
494
- title="View Project"
536
+ title={`View Project (${generateGAVCoordinates(
537
+ dataSpaceViewerState.groupId,
538
+ dataSpaceViewerState.artifactId,
539
+ dataSpaceViewerState.versionId,
540
+ )})`}
495
541
  onClick={viewProject}
496
542
  >
497
- <div className="data-space__viewer__path__label">
498
- {dataSpace.path}
543
+ <div
544
+ className="data-space__viewer__title__label"
545
+ title={`${analysisResult.title ?? analysisResult.name} - ${
546
+ analysisResult.path
547
+ }`}
548
+ >
549
+ {analysisResult.title ?? analysisResult.name}
499
550
  </div>
500
- <div className="data-space__viewer__path__link">
551
+ <div className="data-space__viewer__title__link">
501
552
  <ExternalLinkSquareIcon />
502
553
  </div>
503
554
  </button>
504
555
  <div
505
556
  className={clsx('data-space__viewer__description', {
506
- 'data-space__viewer__description--empty': !dataSpace.description,
557
+ 'data-space__viewer__description--empty':
558
+ !analysisResult.description,
507
559
  })}
508
560
  >
509
- {dataSpace.description ? dataSpace.description : 'No description'}
561
+ {analysisResult.description
562
+ ? analysisResult.description
563
+ : 'No description'}
510
564
  </div>
511
565
  </div>
512
566
  <div className="data-space__viewer__content">
@@ -561,15 +615,14 @@ export const DataSpaceViewer = observer(
561
615
  </BlankPanelContent>
562
616
  )}
563
617
  {dataSpaceViewerState.currentActivity ===
564
- DATA_SPACE_VIEWER_ACTIVITY_MODE.TAGS && (
565
- <DataSpaceTags dataSpaceViewerState={dataSpaceViewerState} />
618
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO && (
619
+ <DataSpaceInfo dataSpaceViewerState={dataSpaceViewerState} />
566
620
  )}
567
621
  {dataSpaceViewerState.currentActivity ===
568
622
  DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT && (
569
623
  <div className="data-space__viewer__main-panel__content data-space__viewer__support-info">
570
624
  <DataSpaceSupportInfoViewerInner
571
625
  dataSpaceViewerState={dataSpaceViewerState}
572
- dataSpaceSupportInfo={dataSpace.supportInfo}
573
626
  />
574
627
  </div>
575
628
  )}
@@ -16,19 +16,37 @@
16
16
 
17
17
  import packageJson from '../../../package.json';
18
18
  import {
19
- LegendQueryPlugin,
19
+ type QueryEditorStore,
20
+ type QueryEditorHeaderLabeler,
20
21
  type QuerySetupOptionRendererConfiguration,
21
22
  type QuerySetupRenderer,
22
23
  type QuerySetupState,
23
24
  type QuerySetupStore,
24
- } from '@finos/legend-query';
25
+ LegendQueryApplicationPlugin,
26
+ } from '@finos/legend-application-query';
25
27
  import { SquareIcon } from '@finos/legend-art';
26
28
  import { DataSpaceQuerySetupState } from '../../stores/query/DataSpaceQuerySetupState.js';
27
29
  import { DataspaceQuerySetup } from './DataSpaceQuerySetup.js';
30
+ import type { ApplicationPageEntry } from '@finos/legend-application';
31
+ import { DATA_SPACE_QUERY_EDITOR_ROUTE_PATTERN } from '../../stores/query/DSLDataSpace_LegendQueryRouter.js';
32
+ import { DataSpaceQueryEditor } from './DataSpaceQueryEditor.js';
33
+ import { DataSpaceQueryEditorStore } from '../../stores/query/DataSpaceQueryEditorStore.js';
34
+ import { extractElementNameFromPath } from '@finos/legend-graph';
28
35
 
29
- export class DSLDataSpace_LegendQueryPlugin extends LegendQueryPlugin {
36
+ export class DSLDataSpace_LegendQueryApplicationPlugin extends LegendQueryApplicationPlugin {
30
37
  constructor() {
31
- super(packageJson.extensions.queryPlugin, packageJson.version);
38
+ super(packageJson.extensions.queryApplicationPlugin, packageJson.version);
39
+ }
40
+
41
+ override getExtraApplicationPageEntries(): ApplicationPageEntry[] {
42
+ return [
43
+ // data space query editor
44
+ {
45
+ key: 'data-space-query-editor-application-page',
46
+ urlPatterns: [DATA_SPACE_QUERY_EDITOR_ROUTE_PATTERN],
47
+ renderer: DataSpaceQueryEditor,
48
+ },
49
+ ];
32
50
  }
33
51
 
34
52
  override getExtraQuerySetupOptionRendererConfigurations(): QuerySetupOptionRendererConfiguration[] {
@@ -68,4 +86,23 @@ export class DSLDataSpace_LegendQueryPlugin extends LegendQueryPlugin {
68
86
  },
69
87
  ];
70
88
  }
89
+
90
+ override getExtraQueryEditorHeaderLabelers(): QueryEditorHeaderLabeler[] {
91
+ return [
92
+ (editorStore: QueryEditorStore): React.ReactNode | undefined => {
93
+ if (editorStore instanceof DataSpaceQueryEditorStore) {
94
+ return (
95
+ <div className="query-editor__header__label">
96
+ <SquareIcon className="query-editor__header__label__icon icon--data-space" />
97
+ {extractElementNameFromPath(editorStore.dataSpacePath)}
98
+ <div className="query-editor__header__label__tag">
99
+ {editorStore.executionContext}
100
+ </div>
101
+ </div>
102
+ );
103
+ }
104
+ return undefined;
105
+ },
106
+ ];
107
+ }
71
108
  }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { observer, useLocalObservable } from 'mobx-react-lite';
18
+ import { getQueryParameters } from '@finos/legend-shared';
19
+ import { useApplicationStore } from '@finos/legend-application';
20
+ import {
21
+ parseGAVCoordinates,
22
+ useDepotServerClient,
23
+ } from '@finos/legend-server-depot';
24
+ import {
25
+ LEGEND_QUERY_PATH_PARAM_TOKEN,
26
+ LEGEND_QUERY_QUERY_PARAM_TOKEN,
27
+ QueryEditor,
28
+ QueryEditorStoreContext,
29
+ useLegendQueryApplicationStore,
30
+ useLegendQueryBaseStore,
31
+ } from '@finos/legend-application-query';
32
+ import { useParams } from 'react-router';
33
+ import { DataSpaceQueryEditorStore } from '../../stores/query/DataSpaceQueryEditorStore.js';
34
+ import {
35
+ type DataSpaceQueryEditorPathParams,
36
+ type DataSpaceQueryEditorQueryParams,
37
+ DATA_SPACE_QUERY_EDITOR_PATH_PARAM_TOKEN,
38
+ } from '../../stores/query/DSLDataSpace_LegendQueryRouter.js';
39
+
40
+ const DataSpaceQueryEditorStoreProvider: React.FC<{
41
+ children: React.ReactNode;
42
+ gav: string;
43
+ dataSpacePath: string;
44
+ executionContext: string;
45
+ runtimePath: string | undefined;
46
+ classPath: string | undefined;
47
+ }> = ({
48
+ children,
49
+ gav,
50
+ dataSpacePath,
51
+ executionContext,
52
+ runtimePath,
53
+ classPath,
54
+ }) => {
55
+ const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
56
+ const applicationStore = useLegendQueryApplicationStore();
57
+ const depotServerClient = useDepotServerClient();
58
+ const baseStore = useLegendQueryBaseStore();
59
+ const store = useLocalObservable(
60
+ () =>
61
+ new DataSpaceQueryEditorStore(
62
+ applicationStore,
63
+ depotServerClient,
64
+ baseStore.pluginManager,
65
+ groupId,
66
+ artifactId,
67
+ versionId,
68
+ dataSpacePath,
69
+ executionContext,
70
+ runtimePath,
71
+ classPath,
72
+ ),
73
+ );
74
+ return (
75
+ <QueryEditorStoreContext.Provider value={store}>
76
+ {children}
77
+ </QueryEditorStoreContext.Provider>
78
+ );
79
+ };
80
+
81
+ export const DataSpaceQueryEditor = observer(() => {
82
+ const applicationStore = useApplicationStore();
83
+ const params = useParams<DataSpaceQueryEditorPathParams>();
84
+ const gav = params[LEGEND_QUERY_PATH_PARAM_TOKEN.GAV];
85
+ const dataSpacePath =
86
+ params[DATA_SPACE_QUERY_EDITOR_PATH_PARAM_TOKEN.DATA_SPACE_PATH];
87
+ const executionContext =
88
+ params[DATA_SPACE_QUERY_EDITOR_PATH_PARAM_TOKEN.EXECUTION_CONTEXT];
89
+ const runtimePath = params[LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH];
90
+ const classPath = getQueryParameters<DataSpaceQueryEditorQueryParams>(
91
+ applicationStore.navigator.getCurrentLocation(),
92
+ true,
93
+ )[LEGEND_QUERY_QUERY_PARAM_TOKEN.CLASS_PATH];
94
+
95
+ return (
96
+ <DataSpaceQueryEditorStoreProvider
97
+ gav={gav}
98
+ dataSpacePath={dataSpacePath}
99
+ executionContext={executionContext}
100
+ runtimePath={runtimePath}
101
+ classPath={classPath}
102
+ >
103
+ <QueryEditor />
104
+ </DataSpaceQueryEditorStoreProvider>
105
+ );
106
+ });