@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
@@ -21,8 +21,8 @@ import {
21
21
  type ExistingQueryEditorStore,
22
22
  LegendQueryApplicationPlugin,
23
23
  generateExistingQueryEditorRoute,
24
- LegendQueryEventService,
25
24
  LEGEND_QUERY_APP_EVENT,
25
+ LegendQueryEventHelper,
26
26
  createViewProjectHandler,
27
27
  createViewSDLCProjectHandler,
28
28
  } from '@finos/legend-application-query';
@@ -35,7 +35,7 @@ import {
35
35
  import {
36
36
  DATA_SPACE_QUERY_ROUTE_PATTERN,
37
37
  generateDataSpaceQuerySetupRoute,
38
- } from '../../stores/query/DSL_DataSpace_LegendQueryRouter.js';
38
+ } from '../../application/query/DSL_DataSpace_LegendQueryNavigation.js';
39
39
  import { DataSpaceQueryCreator } from './DataSpaceQueryCreator.js';
40
40
  import { createQueryDataSpaceTaggedValue } from '../../stores/query/DataSpaceQueryCreatorStore.js';
41
41
  import { Query, isValidFullPath } from '@finos/legend-graph';
@@ -168,9 +168,10 @@ export class DSL_DataSpace_LegendQueryApplicationPlugin extends LegendQueryAppli
168
168
  editorStore.applicationStore.notificationService.notifySuccess(
169
169
  `Successfully created query!`,
170
170
  );
171
- LegendQueryEventService.create(
171
+ LegendQueryEventHelper.notify_QueryCreateSucceeded(
172
172
  editorStore.applicationStore.eventService,
173
- ).notify_QueryCreated({ queryId: newQuery.id });
173
+ { queryId: newQuery.id },
174
+ );
174
175
  editorStore.applicationStore.navigationService.navigator.goToLocation(
175
176
  generateExistingQueryEditorRoute(newQuery.id),
176
177
  );
@@ -272,7 +272,8 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
272
272
  placeholder="Search for data space..."
273
273
  escapeClearsValue={true}
274
274
  darkMode={
275
- !applicationStore.layoutService.TEMPORARY__isLightThemeEnabled
275
+ !applicationStore.layoutService
276
+ .TEMPORARY__isLightColorThemeEnabled
276
277
  }
277
278
  formatOptionLabel={formatDataSpaceOptionLabel}
278
279
  />
@@ -316,7 +317,8 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
316
317
  onChange={onExecutionContextOptionChange}
317
318
  value={selectedExecutionContextOption}
318
319
  darkMode={
319
- !applicationStore.layoutService.TEMPORARY__isLightThemeEnabled
320
+ !applicationStore.layoutService
321
+ .TEMPORARY__isLightColorThemeEnabled
320
322
  }
321
323
  />
322
324
  </div>
@@ -337,13 +339,13 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
337
339
  value={selectedRuntimeOption}
338
340
  darkMode={
339
341
  !applicationStore.layoutService
340
- .TEMPORARY__isLightThemeEnabled
342
+ .TEMPORARY__isLightColorThemeEnabled
341
343
  }
342
344
  filterOption={runtimeFilterOption}
343
345
  formatOptionLabel={getRuntimeOptionFormatter({
344
346
  darkMode:
345
347
  !applicationStore.layoutService
346
- .TEMPORARY__isLightThemeEnabled,
348
+ .TEMPORARY__isLightColorThemeEnabled,
347
349
  pureModel: queryBuilderState.graphManagerState.graph,
348
350
  })}
349
351
  />
@@ -15,15 +15,9 @@
15
15
  */
16
16
 
17
17
  import { observer, useLocalObservable } from 'mobx-react-lite';
18
- import {
19
- getQueryParameters,
20
- getQueryParameterValue,
21
- sanitizeURL,
22
- } from '@finos/legend-shared';
23
18
  import { useApplicationStore, useParams } from '@finos/legend-application';
24
19
  import { useDepotServerClient } from '@finos/legend-server-depot';
25
20
  import {
26
- LEGEND_QUERY_PATH_PARAM_TOKEN,
27
21
  QueryEditor,
28
22
  QueryEditorStoreContext,
29
23
  useLegendQueryApplicationStore,
@@ -31,10 +25,9 @@ import {
31
25
  import { DataSpaceQueryCreatorStore } from '../../stores/query/DataSpaceQueryCreatorStore.js';
32
26
  import {
33
27
  type DataSpaceQueryCreatorPathParams,
34
- type DataSpaceQueryEditorQueryParams,
35
- DATA_SPACE_QUERY_CREATOR_PATH_PARAM_TOKEN,
28
+ DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN,
36
29
  DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN,
37
- } from '../../stores/query/DSL_DataSpace_LegendQueryRouter.js';
30
+ } from '../../application/query/DSL_DataSpace_LegendQueryNavigation.js';
38
31
  import { parseGAVCoordinates } from '@finos/legend-storage';
39
32
 
40
33
  const DataSpaceQueryCreatorStoreProvider: React.FC<{
@@ -78,22 +71,18 @@ const DataSpaceQueryCreatorStoreProvider: React.FC<{
78
71
 
79
72
  export const DataSpaceQueryCreator = observer(() => {
80
73
  const applicationStore = useApplicationStore();
81
- const params = useParams<DataSpaceQueryCreatorPathParams>();
82
- const gav = params[LEGEND_QUERY_PATH_PARAM_TOKEN.GAV];
74
+ const parameters = useParams<DataSpaceQueryCreatorPathParams>();
75
+ const gav = parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV];
83
76
  const dataSpacePath =
84
- params[DATA_SPACE_QUERY_CREATOR_PATH_PARAM_TOKEN.DATA_SPACE_PATH];
77
+ parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH];
85
78
  const executionContext =
86
- params[DATA_SPACE_QUERY_CREATOR_PATH_PARAM_TOKEN.EXECUTION_CONTEXT];
87
- const runtimePath = params[LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH];
88
- const classPath = getQueryParameterValue(
89
- getQueryParameters<DataSpaceQueryEditorQueryParams>(
90
- sanitizeURL(
91
- applicationStore.navigationService.navigator.getCurrentAddress(),
92
- ),
93
- true,
94
- ),
95
- DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN.CLASS_PATH,
96
- );
79
+ parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.EXECUTION_CONTEXT];
80
+ const runtimePath =
81
+ parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.RUNTIME_PATH];
82
+ const classPath =
83
+ applicationStore.navigationService.navigator.getAddressParameterValue(
84
+ DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN.CLASS_PATH,
85
+ );
97
86
 
98
87
  return (
99
88
  <DataSpaceQueryCreatorStoreProvider
@@ -144,7 +144,8 @@ const DataSpaceQuerySetupSetupPanelContent = observer(
144
144
  placeholder="Search for data space..."
145
145
  escapeClearsValue={true}
146
146
  darkMode={
147
- !applicationStore.layoutService.TEMPORARY__isLightThemeEnabled
147
+ !applicationStore.layoutService
148
+ .TEMPORARY__isLightColorThemeEnabled
148
149
  }
149
150
  formatOptionLabel={formatDataSpaceOptionLabel}
150
151
  />
@@ -31,6 +31,10 @@ import {
31
31
  type PureGrammarParserElementSnippetSuggestionsGetter,
32
32
  UnsupportedElementEditorState,
33
33
  LegendStudioApplicationPlugin,
34
+ type ExplorerContextMenuItemRendererConfiguration,
35
+ type EditorExtensionStateCreator,
36
+ type EditorExtensionComponentRendererConfiguration,
37
+ type LegendStudioApplicationPageEntry,
34
38
  } from '@finos/legend-application-studio';
35
39
  import {
36
40
  PackageableElementExplicitReference,
@@ -42,17 +46,24 @@ import {
42
46
  DataSpace,
43
47
  DataSpaceExecutionContext,
44
48
  } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
45
- import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from './DSL_DataSpace_LegendStudioDocumentation.js';
49
+ import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../application/studio/DSL_DataSpace_LegendStudioDocumentation.js';
46
50
  import {
47
51
  PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL,
48
52
  PURE_GRAMMAR_DATA_SPACE_PARSER_NAME,
49
53
  } from '../../graphManager/DSL_DataSpace_PureGraphManagerPlugin.js';
50
- import { SIMPLE_DATA_SPACE_SNIPPET } from './DSL_DataSpace_CodeSnippets.js';
54
+ import { SIMPLE_DATA_SPACE_SNIPPET } from '../../application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js';
51
55
  import type {
52
56
  DocumentationEntry,
53
57
  PureGrammarTextSuggestion,
54
58
  } from '@finos/legend-application';
55
59
  import { DataSpaceIcon } from '../DSL_DataSpace_Icon.js';
60
+ import { DataSpacePreviewState } from '../../stores/studio/DataSpacePreviewState.js';
61
+ import {
62
+ DataSpacePreviewDialog,
63
+ DataSpacePreviewAction,
64
+ } from './DataSpacePreviewAction.js';
65
+ import { DATA_SPACE_STUDIO_ROUTE_PATTERN } from '../../application/studio/DSL_DataSpace_LegendStudioNavigation.js';
66
+ import { DataSpacePreview } from './DataSpacePreview.js';
56
67
 
57
68
  const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
58
69
  const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
@@ -66,6 +77,18 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin
66
77
  super(packageJson.extensions.applicationStudioPlugin, packageJson.version);
67
78
  }
68
79
 
80
+ override getExtraApplicationPageEntries(): LegendStudioApplicationPageEntry[] {
81
+ return [
82
+ // data space preview
83
+ {
84
+ key: 'data-space-preview',
85
+ urlPatterns: [DATA_SPACE_STUDIO_ROUTE_PATTERN.PREVIEW],
86
+ renderer: DataSpacePreview,
87
+ bypassSDLC: true,
88
+ },
89
+ ];
90
+ }
91
+
69
92
  override getExtraRequiredDocumentationKeys(): string[] {
70
93
  return [
71
94
  DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.CONCEPT_ELEMENT_DATA_SPACE,
@@ -73,6 +96,33 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin
73
96
  ];
74
97
  }
75
98
 
99
+ override getExtraExplorerContextMenuItemRendererConfigurations(): ExplorerContextMenuItemRendererConfiguration[] {
100
+ return [
101
+ {
102
+ key: 'data-space-preview',
103
+ renderer: (editorStore, element) => {
104
+ if (element instanceof DataSpace) {
105
+ return <DataSpacePreviewAction dataSpace={element} />;
106
+ }
107
+ return undefined;
108
+ },
109
+ },
110
+ ];
111
+ }
112
+
113
+ override getExtraEditorExtensionStateCreators(): EditorExtensionStateCreator[] {
114
+ return [(editorStore) => new DataSpacePreviewState(editorStore)];
115
+ }
116
+
117
+ override getExtraEditorExtensionComponentRendererConfigurations(): EditorExtensionComponentRendererConfiguration[] {
118
+ return [
119
+ {
120
+ key: 'data-space-preview',
121
+ renderer: (editorStore) => <DataSpacePreviewDialog />,
122
+ },
123
+ ];
124
+ }
125
+
76
126
  getExtraSupportedElementTypes(): string[] {
77
127
  return [DATA_SPACE_ELEMENT_TYPE];
78
128
  }
@@ -0,0 +1,129 @@
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 { useApplicationStore, useParams } from '@finos/legend-application';
19
+ import { useDepotServerClient } from '@finos/legend-server-depot';
20
+ import { parseGAVCoordinates } from '@finos/legend-storage';
21
+ import { DataSpacePreviewStore } from '../../stores/studio/DataSpacePreviewStore.js';
22
+ import { createContext, useContext, useEffect } from 'react';
23
+ import { useLegendStudioApplicationStore } from '@finos/legend-application-studio';
24
+ import {
25
+ DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN,
26
+ type DataSpacePreviewPathParams,
27
+ } from '../../application/studio/DSL_DataSpace_LegendStudioNavigation.js';
28
+ import { guaranteeNonNullable } from '@finos/legend-shared';
29
+ import { flowResult } from 'mobx';
30
+ import { DataSpaceViewer } from '../DataSpaceViewer.js';
31
+ import {
32
+ BlankPanelContent,
33
+ PanelLoadingIndicator,
34
+ TimesCircleIcon,
35
+ } from '@finos/legend-art';
36
+
37
+ const DataSpacePreviewStoreContext = createContext<
38
+ DataSpacePreviewStore | undefined
39
+ >(undefined);
40
+
41
+ const DataSpacePreviewStoreProvider: React.FC<{
42
+ children: React.ReactNode;
43
+ gav: string;
44
+ dataSpacePath: string;
45
+ }> = ({ children, gav, dataSpacePath }) => {
46
+ const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
47
+ const applicationStore = useLegendStudioApplicationStore();
48
+ const depotServerClient = useDepotServerClient();
49
+ const store = useLocalObservable(
50
+ () =>
51
+ new DataSpacePreviewStore(
52
+ applicationStore,
53
+ depotServerClient,
54
+ groupId,
55
+ artifactId,
56
+ versionId,
57
+ dataSpacePath,
58
+ ),
59
+ );
60
+ return (
61
+ <DataSpacePreviewStoreContext.Provider value={store}>
62
+ {children}
63
+ </DataSpacePreviewStoreContext.Provider>
64
+ );
65
+ };
66
+
67
+ const useDataSpacePreviewStore = (): DataSpacePreviewStore =>
68
+ guaranteeNonNullable(
69
+ useContext(DataSpacePreviewStoreContext),
70
+ `Can't find data space preview store in context`,
71
+ );
72
+
73
+ const DataSpacePreviewInner = observer(() => {
74
+ const previewStore = useDataSpacePreviewStore();
75
+ const applicationStore = useApplicationStore();
76
+
77
+ useEffect(() => {
78
+ flowResult(previewStore.initialize()).catch(
79
+ applicationStore.alertUnhandledError,
80
+ );
81
+ }, [applicationStore, previewStore]);
82
+
83
+ return (
84
+ <div className="data-space-preview">
85
+ <PanelLoadingIndicator
86
+ isLoading={previewStore.loadDataSpaceState.isInProgress}
87
+ />
88
+ {previewStore.dataSpaceViewerState && (
89
+ <DataSpaceViewer
90
+ dataSpaceViewerState={previewStore.dataSpaceViewerState}
91
+ />
92
+ )}
93
+ {!previewStore.dataSpaceViewerState && (
94
+ <>
95
+ {previewStore.loadDataSpaceState.isInProgress && (
96
+ <BlankPanelContent>
97
+ {previewStore.loadDataSpaceState.message}
98
+ </BlankPanelContent>
99
+ )}
100
+ {previewStore.loadDataSpaceState.hasFailed && (
101
+ <BlankPanelContent>
102
+ <div className="data-space-preview__failure">
103
+ <div className="data-space-preview__failure__icon">
104
+ <TimesCircleIcon />
105
+ </div>
106
+ <div className="data-space-preview__failure__text">
107
+ Can&apos;t load data space
108
+ </div>
109
+ </div>
110
+ </BlankPanelContent>
111
+ )}
112
+ </>
113
+ )}
114
+ </div>
115
+ );
116
+ });
117
+
118
+ export const DataSpacePreview = observer(() => {
119
+ const parameters = useParams<DataSpacePreviewPathParams>();
120
+ const gav = parameters[DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.GAV];
121
+ const dataSpacePath =
122
+ parameters[DATA_SPACE_STUDIO_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH];
123
+
124
+ return (
125
+ <DataSpacePreviewStoreProvider gav={gav} dataSpacePath={dataSpacePath}>
126
+ <DataSpacePreviewInner />
127
+ </DataSpacePreviewStoreProvider>
128
+ );
129
+ });
@@ -0,0 +1,127 @@
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 { useApplicationStore } from '@finos/legend-application';
18
+ import {
19
+ MenuContentItem,
20
+ BlankPanelContent,
21
+ TimesCircleIcon,
22
+ PanelLoadingIndicator,
23
+ Dialog,
24
+ TimesIcon,
25
+ Modal,
26
+ ModalHeader,
27
+ ModalTitle,
28
+ ModalHeaderActions,
29
+ } from '@finos/legend-art';
30
+ import { flowResult } from 'mobx';
31
+ import { observer } from 'mobx-react-lite';
32
+ import { DataSpaceViewer } from '../DataSpaceViewer.js';
33
+ import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
34
+ import { useEditorStore } from '@finos/legend-application-studio';
35
+ import { DataSpacePreviewState } from '../../stores/studio/DataSpacePreviewState.js';
36
+
37
+ export const DataSpacePreviewAction = observer(
38
+ (props: { dataSpace: DataSpace }) => {
39
+ const { dataSpace } = props;
40
+ const editorStore = useEditorStore();
41
+ const applicationStore = useApplicationStore();
42
+ const dataSpacePreviewState =
43
+ DataSpacePreviewState.retrieveState(editorStore);
44
+
45
+ const previewDataSpace = (): void => {
46
+ flowResult(dataSpacePreviewState.previewDataSpace(dataSpace)).catch(
47
+ applicationStore.alertUnhandledError,
48
+ );
49
+ };
50
+
51
+ return (
52
+ <MenuContentItem onClick={previewDataSpace}>Preview</MenuContentItem>
53
+ );
54
+ },
55
+ );
56
+
57
+ export const DataSpacePreviewDialog = observer(() => {
58
+ const editorStore = useEditorStore();
59
+ const dataSpacePreviewState =
60
+ DataSpacePreviewState.retrieveState(editorStore);
61
+
62
+ const onClose = (): void => {
63
+ dataSpacePreviewState.setDataSpace(undefined);
64
+ };
65
+
66
+ return (
67
+ <Dialog
68
+ open={Boolean(dataSpacePreviewState.dataSpace)}
69
+ onClose={onClose}
70
+ classes={{
71
+ root: 'editor-modal__root-container',
72
+ container: 'editor-modal__container',
73
+ paper:
74
+ 'editor-modal__content data-space-preview__dialog__container__content',
75
+ }}
76
+ >
77
+ <Modal
78
+ darkMode={true}
79
+ className="editor-modal data-space-preview__dialog"
80
+ >
81
+ <ModalHeader className="data-space-preview__dialog__header">
82
+ <ModalTitle title="Preview Data Space" />
83
+ <ModalHeaderActions>
84
+ <button
85
+ className="modal__header__action"
86
+ title="Close"
87
+ onClick={onClose}
88
+ >
89
+ <TimesIcon />
90
+ </button>
91
+ </ModalHeaderActions>
92
+ </ModalHeader>
93
+ <div className="data-space-preview__dialog__content">
94
+ <PanelLoadingIndicator
95
+ isLoading={dataSpacePreviewState.loadDataSpaceState.isInProgress}
96
+ />
97
+ {dataSpacePreviewState.dataSpaceViewerState && (
98
+ <DataSpaceViewer
99
+ dataSpaceViewerState={dataSpacePreviewState.dataSpaceViewerState}
100
+ />
101
+ )}
102
+ {!dataSpacePreviewState.dataSpaceViewerState && (
103
+ <>
104
+ {dataSpacePreviewState.loadDataSpaceState.isInProgress && (
105
+ <BlankPanelContent>
106
+ {dataSpacePreviewState.loadDataSpaceState.message}
107
+ </BlankPanelContent>
108
+ )}
109
+ {dataSpacePreviewState.loadDataSpaceState.hasFailed && (
110
+ <BlankPanelContent>
111
+ <div className="data-space-preview__dialog__content--failed">
112
+ <div className="data-space-preview__dialog__content--failed__icon">
113
+ <TimesCircleIcon />
114
+ </div>
115
+ <div className="data-space-preview__dialog__content--failed__text">
116
+ Can&apos;t load data space
117
+ </div>
118
+ </div>
119
+ </BlankPanelContent>
120
+ )}
121
+ </>
122
+ )}
123
+ </div>
124
+ </Modal>
125
+ </Dialog>
126
+ );
127
+ });
@@ -17,5 +17,7 @@
17
17
  export enum DATA_SPACE_HASH_STRUCTURE {
18
18
  DATA_SPACE = 'DATA_SPACE',
19
19
  DATA_SPACE_EXECUTION_CONTEXT = 'DATA_SPACE_EXECUTION_CONTEXT',
20
+ DATA_SPACE_SAMPLE_TDS_QUERY = 'DATA_SPACE_SAMPLE_TDS_QUERY',
21
+ DATA_SPACE_SAMPLE_TDS_QUERY_COLUMN = 'DATA_SPACE_SAMPLE_TDS_QUERY_COLUMN',
20
22
  DATA_SPACE_SUPPORT_EMAIL = 'DATA_SPACE_SUPPORT_EMAIL',
21
23
  }
@@ -21,6 +21,9 @@ import {
21
21
  type Mapping,
22
22
  type PackageableRuntime,
23
23
  type PackageableElementVisitor,
24
+ type Class,
25
+ type Enumeration,
26
+ type Association,
24
27
  } from '@finos/legend-graph';
25
28
  import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../DSL_DataSpace_HashUtils.js';
26
29
  import type { Diagram } from '@finos/legend-extension-dsl-diagram';
@@ -60,12 +63,15 @@ export class DataSpaceExecutionContext implements Hashable {
60
63
  }
61
64
  }
62
65
 
66
+ export type DataSpaceElement = Class | Enumeration | Association;
67
+
63
68
  export class DataSpace extends PackageableElement implements Hashable {
69
+ title?: string | undefined;
70
+ description?: string | undefined;
64
71
  executionContexts: DataSpaceExecutionContext[] = [];
65
72
  defaultExecutionContext!: DataSpaceExecutionContext;
66
73
  featuredDiagrams?: PackageableElementReference<Diagram>[] | undefined;
67
- title?: string | undefined;
68
- description?: string | undefined;
74
+ elements?: PackageableElementReference<DataSpaceElement>[] | undefined;
69
75
  supportInfo?: DataSpaceSupportInfo | undefined;
70
76
 
71
77
  protected override get _elementHashCode(): string {
@@ -75,6 +81,8 @@ export class DataSpace extends PackageableElement implements Hashable {
75
81
  this.stereotypes.map((stereotype) => stereotype.pointerHashCode),
76
82
  ),
77
83
  hashArray(this.taggedValues),
84
+ this.title ?? '',
85
+ this.description ?? '',
78
86
  hashArray(this.executionContexts),
79
87
  this.defaultExecutionContext.name,
80
88
  hashArray(
@@ -82,8 +90,11 @@ export class DataSpace extends PackageableElement implements Hashable {
82
90
  (diagram) => diagram.valueForSerialization ?? '',
83
91
  ),
84
92
  ),
85
- this.title ?? '',
86
- this.description ?? '',
93
+ hashArray(
94
+ (this.elements ?? []).map(
95
+ (element) => element.valueForSerialization ?? '',
96
+ ),
97
+ ),
87
98
  this.supportInfo ?? '',
88
99
  ]);
89
100
  }
@@ -22,6 +22,12 @@ import type {
22
22
  } from '@finos/legend-graph';
23
23
  import { uuid } from '@finos/legend-shared';
24
24
  import type { DataSpaceSupportInfo } from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
25
+ import {
26
+ HACKY__SHOWCASE1,
27
+ type HACKY__DataSpaceUsageShowcase,
28
+ HACKY__SHOWCASE2,
29
+ HACKY__SHOWCASE3,
30
+ } from './HACKY__DataSpaceUsageShowcase.js';
25
31
 
26
32
  export class DataSpaceExecutionContextAnalysisResult {
27
33
  name!: string;
@@ -46,6 +52,23 @@ export class DataSpaceStereotypeInfo {
46
52
  value!: string;
47
53
  }
48
54
 
55
+ export class DataSpaceDocumentationEntry {
56
+ readonly uuid = uuid();
57
+ readonly elementPath: string;
58
+ readonly subElementText?: string | undefined;
59
+ readonly doc: string;
60
+
61
+ constructor(
62
+ elementPath: string,
63
+ subElementText: string | undefined,
64
+ documentation: string,
65
+ ) {
66
+ this.elementPath = elementPath;
67
+ this.subElementText = subElementText;
68
+ this.doc = documentation;
69
+ }
70
+ }
71
+
49
72
  export class DataSpaceAnalysisResult {
50
73
  name!: string;
51
74
  package!: string;
@@ -62,4 +85,12 @@ export class DataSpaceAnalysisResult {
62
85
  defaultExecutionContext!: DataSpaceExecutionContextAnalysisResult;
63
86
 
64
87
  featuredDiagrams: Diagram[] = [];
88
+
89
+ elementDocs: DataSpaceDocumentationEntry[] = [];
90
+
91
+ HACKY__usageShowcases: HACKY__DataSpaceUsageShowcase[] = [
92
+ HACKY__SHOWCASE1,
93
+ HACKY__SHOWCASE2,
94
+ HACKY__SHOWCASE3,
95
+ ];
65
96
  }