@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
@@ -26,8 +26,9 @@ import {
26
26
  ArrowLeftIcon,
27
27
  CustomSelectorInput,
28
28
  SearchIcon,
29
+ createFilter,
29
30
  } from '@finos/legend-art';
30
- import { useQuerySetupStore, useLegendQueryStore } from '@finos/legend-query';
31
+ import { useQuerySetupStore } from '@finos/legend-application-query';
31
32
  import { generateGAVCoordinates } from '@finos/legend-server-depot';
32
33
  import { debounce } from '@finos/legend-shared';
33
34
  import { flowResult } from 'mobx';
@@ -41,7 +42,7 @@ import { DataSpaceViewer } from '../DataSpaceViewer.js';
41
42
 
42
43
  type DataSpaceOption = { label: string; value: DataSpaceContext };
43
44
  const buildDataSpaceOption = (value: DataSpaceContext): DataSpaceOption => ({
44
- label: value.path,
45
+ label: value.title ?? value.name,
45
46
  value: value,
46
47
  });
47
48
 
@@ -50,7 +51,6 @@ export const DataspaceQuerySetup = observer(
50
51
  const { querySetupState } = props;
51
52
  const applicationStore = useApplicationStore();
52
53
  const setupStore = useQuerySetupStore();
53
- const queryStore = useLegendQueryStore();
54
54
  const dataSpaceSearchRef = useRef<SelectComponent>(null);
55
55
  const [searchText, setSearchText] = useState('');
56
56
 
@@ -73,7 +73,6 @@ export const DataspaceQuerySetup = observer(
73
73
  const back = (): void => {
74
74
  setupStore.setSetupState(undefined);
75
75
  querySetupState.setCurrentDataSpace(undefined);
76
- queryStore.graphManagerState.resetGraph();
77
76
  };
78
77
 
79
78
  // query
@@ -84,18 +83,35 @@ export const DataspaceQuerySetup = observer(
84
83
  : null;
85
84
  const onDataSpaceOptionChange = (option: DataSpaceOption | null): void => {
86
85
  if (option?.value !== querySetupState.currentDataSpace) {
87
- queryStore.graphManagerState.resetGraph();
88
86
  querySetupState.setCurrentDataSpace(option?.value);
89
87
  querySetupState.setDataSpaceViewerState(undefined);
90
88
  }
91
89
  };
90
+ const filterOption = createFilter({
91
+ ignoreCase: true,
92
+ ignoreAccents: false,
93
+ stringify: (option: DataSpaceOption): string =>
94
+ `${option.label} - ${option.value.path}`,
95
+ });
92
96
  const formatQueryOptionLabel = (
93
97
  option: DataSpaceOption,
94
98
  ): React.ReactNode => (
95
- <div className="query-setup__data-space__option">
99
+ <div
100
+ className="query-setup__data-space__option"
101
+ title={`${option.label} - ${
102
+ option.value.path
103
+ } - ${generateGAVCoordinates(
104
+ option.value.groupId,
105
+ option.value.artifactId,
106
+ option.value.versionId,
107
+ )}`}
108
+ >
96
109
  <div className="query-setup__data-space__option__label">
97
110
  {option.label}
98
111
  </div>
112
+ <div className="query-setup__data-space__option__path">
113
+ {option.value.path}
114
+ </div>
99
115
  <div className="query-setup__data-space__option__gav">
100
116
  {generateGAVCoordinates(
101
117
  option.value.groupId,
@@ -133,7 +149,7 @@ export const DataspaceQuerySetup = observer(
133
149
  useEffect(() => {
134
150
  if (querySetupState.currentDataSpace) {
135
151
  flowResult(
136
- querySetupState.setUpDataSpace(querySetupState.currentDataSpace),
152
+ querySetupState.loadDataSpace(querySetupState.currentDataSpace),
137
153
  ).catch(applicationStore.alertUnhandledError);
138
154
  }
139
155
  }, [querySetupState, applicationStore, querySetupState.currentDataSpace]);
@@ -184,6 +200,7 @@ export const DataspaceQuerySetup = observer(
184
200
  isClearable={true}
185
201
  escapeClearsValue={true}
186
202
  darkMode={true}
203
+ filterOption={filterOption}
187
204
  formatOptionLabel={formatQueryOptionLabel}
188
205
  />
189
206
  <button
@@ -202,40 +219,34 @@ export const DataspaceQuerySetup = observer(
202
219
  </div>
203
220
  <div className="query-setup__data-space__view">
204
221
  <PanelLoadingIndicator
205
- isLoading={querySetupState.setUpDataSpaceState.isInProgress}
222
+ isLoading={querySetupState.loadDataSpaceState.isInProgress}
206
223
  />
207
224
  {querySetupState.dataSpaceViewerState && (
208
225
  <DataSpaceViewer
209
226
  dataSpaceViewerState={querySetupState.dataSpaceViewerState}
210
227
  />
211
228
  )}
212
- {!querySetupState.dataSpaceViewerState &&
213
- querySetupState.setUpDataSpaceState.isInProgress && (
214
- <BlankPanelContent>
215
- {querySetupState.queryStore.buildGraphState.message ??
216
- querySetupState.queryStore.graphManagerState
217
- .systemBuildState.message ??
218
- querySetupState.queryStore.graphManagerState
219
- .dependenciesBuildState.message ??
220
- querySetupState.queryStore.graphManagerState
221
- .generationsBuildState.message ??
222
- querySetupState.queryStore.graphManagerState.graphBuildState
223
- .message}
224
- </BlankPanelContent>
225
- )}
226
- {!querySetupState.dataSpaceViewerState &&
227
- querySetupState.setUpDataSpaceState.hasFailed && (
228
- <BlankPanelContent>
229
- <div className="query-setup__data-space__view--failed">
230
- <div className="query-setup__data-space__view--failed__icon">
231
- <TimesCircleIcon />
232
- </div>
233
- <div className="query-setup__data-space__view--failed__text">
234
- Can&apos;t load data space
229
+ {!querySetupState.dataSpaceViewerState && (
230
+ <>
231
+ {querySetupState.loadDataSpaceState.isInProgress && (
232
+ <BlankPanelContent>
233
+ {querySetupState.loadDataSpaceState.message}
234
+ </BlankPanelContent>
235
+ )}
236
+ {querySetupState.loadDataSpaceState.hasFailed && (
237
+ <BlankPanelContent>
238
+ <div className="query-setup__data-space__view--failed">
239
+ <div className="query-setup__data-space__view--failed__icon">
240
+ <TimesCircleIcon />
241
+ </div>
242
+ <div className="query-setup__data-space__view--failed__text">
243
+ Can&apos;t load data space
244
+ </div>
235
245
  </div>
236
- </div>
237
- </BlankPanelContent>
238
- )}
246
+ </BlankPanelContent>
247
+ )}
248
+ </>
249
+ )}
239
250
  </div>
240
251
  </div>
241
252
  </div>
@@ -20,7 +20,7 @@ import {
20
20
  type ElementTypeGetter,
21
21
  type ElementProjectExplorerDnDTypeGetter,
22
22
  type ElementIconGetter,
23
- type DSL_LegendStudioPlugin_Extension,
23
+ type DSL_LegendStudioApplicationPlugin_Extension,
24
24
  type NewElementState,
25
25
  type ElementEditorStateCreator,
26
26
  type EditorStore,
@@ -31,8 +31,8 @@ import {
31
31
  type PureGrammarTextSuggestion,
32
32
  type PureGrammarParserElementSnippetSuggestionsGetter,
33
33
  UnsupportedElementEditorState,
34
- LegendStudioPlugin,
35
- } from '@finos/legend-studio';
34
+ LegendStudioApplicationPlugin,
35
+ } from '@finos/legend-application-studio';
36
36
  import { SquareIcon } from '@finos/legend-art';
37
37
  import {
38
38
  PackageableElementExplicitReference,
@@ -43,25 +43,25 @@ import {
43
43
  import {
44
44
  DataSpace,
45
45
  DataSpaceExecutionContext,
46
- } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
46
+ } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
47
47
  import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from './DSLDataSpace_LegendStudioDocumentation.js';
48
48
  import {
49
49
  PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL,
50
50
  PURE_GRAMMAR_DATA_SPACE_PARSER_NAME,
51
51
  } from '../../graphManager/DSLDataSpace_PureGraphManagerPlugin.js';
52
52
  import { SIMPLE_DATA_SPACE_SNIPPET } from './DSLDataSpace_CodeSnippets.js';
53
- import type { LegendApplicationDocumentationEntry } from '@finos/legend-application';
53
+ import type { DocumentationEntry } from '@finos/legend-application';
54
54
 
55
55
  const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
56
56
  const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
57
57
  'PROJECT_EXPLORER_DATA_SPACE';
58
58
 
59
- export class DSLDataSpace_LegendStudioPlugin
60
- extends LegendStudioPlugin
61
- implements DSL_LegendStudioPlugin_Extension
59
+ export class DSLDataSpace_LegendStudioApplicationPlugin
60
+ extends LegendStudioApplicationPlugin
61
+ implements DSL_LegendStudioApplicationPlugin_Extension
62
62
  {
63
63
  constructor() {
64
- super(packageJson.extensions.studioPlugin, packageJson.version);
64
+ super(packageJson.extensions.applicationStudioPlugin, packageJson.version);
65
65
  }
66
66
 
67
67
  override getExtraRequiredDocumentationKeys(): string[] {
@@ -162,7 +162,7 @@ export class DSLDataSpace_LegendStudioPlugin
162
162
  editorStore: EditorStore,
163
163
  parserKeyword: string,
164
164
  elementKeyword: string,
165
- ): LegendApplicationDocumentationEntry | undefined => {
165
+ ): DocumentationEntry | undefined => {
166
166
  if (parserKeyword === PURE_GRAMMAR_DATA_SPACE_PARSER_NAME) {
167
167
  if (elementKeyword === PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL) {
168
168
  return editorStore.applicationStore.documentationService.getDocEntry(
@@ -180,7 +180,7 @@ export class DSLDataSpace_LegendStudioPlugin
180
180
  (
181
181
  editorStore: EditorStore,
182
182
  parserKeyword: string,
183
- ): LegendApplicationDocumentationEntry | undefined => {
183
+ ): DocumentationEntry | undefined => {
184
184
  if (parserKeyword === PURE_GRAMMAR_DATA_SPACE_PARSER_NAME) {
185
185
  return editorStore.applicationStore.documentationService.getDocEntry(
186
186
  DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import packageJson from '../../package.json';
18
- import { DataSpace } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
18
+ import { DataSpace } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
19
19
  import type { Clazz } from '@finos/legend-shared';
20
20
  import { type PackageableElement, PureGraphPlugin } from '@finos/legend-graph';
21
21
 
@@ -22,7 +22,7 @@ import {
22
22
  type PackageableRuntime,
23
23
  type PackageableElementVisitor,
24
24
  } from '@finos/legend-graph';
25
- import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../DSLDataSpace_ModelUtils.js';
25
+ import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../DSLDataSpace_HashUtils.js';
26
26
  import type { Diagram } from '@finos/legend-extension-dsl-diagram';
27
27
 
28
28
  export abstract class DataSpaceSupportInfo implements Hashable {
@@ -64,6 +64,7 @@ export class DataSpace extends PackageableElement implements Hashable {
64
64
  executionContexts: DataSpaceExecutionContext[] = [];
65
65
  defaultExecutionContext!: DataSpaceExecutionContext;
66
66
  featuredDiagrams?: PackageableElementReference<Diagram>[] | undefined;
67
+ title?: string | undefined;
67
68
  description?: string | undefined;
68
69
  supportInfo?: DataSpaceSupportInfo | undefined;
69
70
 
@@ -81,6 +82,7 @@ export class DataSpace extends PackageableElement implements Hashable {
81
82
  (diagram) => diagram.valueForSerialization ?? '',
82
83
  ),
83
84
  ),
85
+ this.title ?? '',
84
86
  this.description ?? '',
85
87
  this.supportInfo ?? '',
86
88
  ]);
@@ -16,7 +16,7 @@
16
16
 
17
17
  import type { BasicModel, PureModel } from '@finos/legend-graph';
18
18
  import { guaranteeNonNullable } from '@finos/legend-shared';
19
- import { DataSpace } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
19
+ import { DataSpace } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
20
20
 
21
21
  export const getDataSpace = (path: string, graph: PureModel): DataSpace =>
22
22
  graph.getExtensionElement(path, DataSpace, `Can't find data space '${path}'`);
@@ -15,15 +15,17 @@
15
15
  */
16
16
 
17
17
  import packageJson from '../../package.json';
18
- import { DataSpace } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
18
+ import { DataSpace } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
19
19
  import {
20
20
  PureGraphManagerPlugin,
21
21
  type ObserverContext,
22
22
  type ElementObserver,
23
23
  type PackageableElement,
24
24
  type PureGrammarElementLabeler,
25
+ type PureGraphManagerExtensionBuilder,
25
26
  } from '@finos/legend-graph';
26
27
  import { observe_DataSpace } from './action/changeDetection/DSLDataSpace_ObserverHelper.js';
28
+ import { DSLDataSpace_buildGraphManagerExtension } from './protocol/pure/DSLDataSpace_PureGraphManagerExtensionBuilder.js';
27
29
 
28
30
  export const PURE_GRAMMAR_DATA_SPACE_PARSER_NAME = 'DataSpace';
29
31
  export const PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL = 'DataSpace';
@@ -33,6 +35,10 @@ export class DSLDataSpace_PureGraphManagerPlugin extends PureGraphManagerPlugin
33
35
  super(packageJson.extensions.pureGraphManagerPlugin, packageJson.version);
34
36
  }
35
37
 
38
+ override getExtraPureGraphManagerExtensionBuilders(): PureGraphManagerExtensionBuilder[] {
39
+ return [DSLDataSpace_buildGraphManagerExtension];
40
+ }
41
+
36
42
  override getExtraPureGrammarParserNames(): string[] {
37
43
  return [PURE_GRAMMAR_DATA_SPACE_PARSER_NAME];
38
44
  }
@@ -0,0 +1,65 @@
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 type { Diagram } from '@finos/legend-extension-dsl-diagram';
18
+ import type {
19
+ Mapping,
20
+ PackageableRuntime,
21
+ PureModel,
22
+ } from '@finos/legend-graph';
23
+ import { uuid } from '@finos/legend-shared';
24
+ import type { DataSpaceSupportInfo } from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
25
+
26
+ export class DataSpaceExecutionContextAnalysisResult {
27
+ name!: string;
28
+ description?: string | undefined;
29
+ mapping!: Mapping;
30
+ defaultRuntime!: PackageableRuntime;
31
+ compatibleRuntimes!: PackageableRuntime[];
32
+ }
33
+
34
+ export class DataSpaceTaggedValueInfo {
35
+ readonly _UUID = uuid();
36
+
37
+ profile!: string;
38
+ tag!: string;
39
+ value!: string;
40
+ }
41
+
42
+ export class DataSpaceStereotypeInfo {
43
+ readonly _UUID = uuid();
44
+
45
+ profile!: string;
46
+ value!: string;
47
+ }
48
+
49
+ export class DataSpaceAnalysisResult {
50
+ name!: string;
51
+ package!: string;
52
+ path!: string;
53
+ taggedValues: DataSpaceTaggedValueInfo[] = [];
54
+ stereotypes: DataSpaceStereotypeInfo[] = [];
55
+ title?: string | undefined;
56
+ description?: string | undefined;
57
+ supportInfo?: DataSpaceSupportInfo | undefined;
58
+
59
+ graph!: PureModel;
60
+
61
+ executionContextsIndex!: Map<string, DataSpaceExecutionContextAnalysisResult>;
62
+ defaultExecutionContext!: DataSpaceExecutionContextAnalysisResult;
63
+
64
+ featuredDiagrams: Diagram[] = [];
65
+ }
@@ -21,7 +21,7 @@ import {
21
21
  skipObserved,
22
22
  } from '@finos/legend-graph';
23
23
  import { makeObservable, override } from 'mobx';
24
- import type { DataSpace } from '../../../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
24
+ import type { DataSpace } from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
25
25
 
26
26
  export const observe_DataSpace = skipObserved(
27
27
  (metamodel: DataSpace): DataSpace => {
@@ -31,6 +31,7 @@ export const observe_DataSpace = skipObserved(
31
31
  _elementHashCode: override,
32
32
  });
33
33
 
34
+ // TODO
34
35
  // metamodel.executionContexts.forEach(observe_DataSpaceExecutionContext);
35
36
  // observe_DataSpaceExecutionContext(metamodel.defaultExecutionContext);
36
37
  // if (metamodel.supportInfo) {
@@ -0,0 +1,42 @@
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 {
18
+ type AbstractPureGraphManager,
19
+ AbstractPureGraphManagerExtension,
20
+ } from '@finos/legend-graph';
21
+ import type { Entity } from '@finos/legend-storage';
22
+ import { guaranteeNonNullable } from '@finos/legend-shared';
23
+ import type { DataSpaceAnalysisResult } from '../../action/analytics/DataSpaceAnalysis.js';
24
+
25
+ export abstract class DSLDataSpace_PureGraphManagerExtension extends AbstractPureGraphManagerExtension {
26
+ abstract analyzeDataSpace(
27
+ dataSpacePath: string,
28
+ entities: Entity[],
29
+ dependencyEntitiesIndex: Map<string, Entity[]>,
30
+ ): Promise<DataSpaceAnalysisResult>;
31
+ }
32
+
33
+ export const getDSLDataSpaceGraphManagerExtension = (
34
+ graphManager: AbstractPureGraphManager,
35
+ ): DSLDataSpace_PureGraphManagerExtension =>
36
+ guaranteeNonNullable(
37
+ graphManager.extensions.find(
38
+ (extension) =>
39
+ extension instanceof DSLDataSpace_PureGraphManagerExtension,
40
+ ),
41
+ `Can't find DSL Data Space Pure graph manager extension`,
42
+ ) as DSLDataSpace_PureGraphManagerExtension;
@@ -0,0 +1,27 @@
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 type {
18
+ AbstractPureGraphManager,
19
+ AbstractPureGraphManagerExtension,
20
+ } from '@finos/legend-graph';
21
+ import { V1_DSLDataSpace_PureGraphManagerExtension } from './v1/V1_DSLDataSpace_PureGraphManagerExtension.js';
22
+
23
+ export const DSLDataSpace_buildGraphManagerExtension = (
24
+ graphManager: AbstractPureGraphManager,
25
+ ): AbstractPureGraphManagerExtension =>
26
+ // NOTE: until we support more client versions, we always default to return V1
27
+ new V1_DSLDataSpace_PureGraphManagerExtension(graphManager);
@@ -39,7 +39,7 @@ import {
39
39
  DataSpace,
40
40
  DataSpaceExecutionContext,
41
41
  DataSpaceSupportEmail,
42
- } from '../../metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
42
+ } from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
43
43
  import {
44
44
  type PackageableElement,
45
45
  type V1_ElementProtocolClassifierPathGetter,
@@ -147,6 +147,7 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
147
147
  ),
148
148
  `Can't find default execution context '${elementProtocol.defaultExecutionContext}'`,
149
149
  );
150
+ element.title = elementProtocol.title;
150
151
  element.description = elementProtocol.description;
151
152
  if (elementProtocol.featuredDiagrams) {
152
153
  element.featuredDiagrams = elementProtocol.featuredDiagrams.map(
@@ -254,6 +255,7 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
254
255
  );
255
256
  protocol.defaultExecutionContext =
256
257
  metamodel.defaultExecutionContext.name;
258
+ protocol.title = metamodel.title;
257
259
  protocol.description = metamodel.description;
258
260
  protocol.featuredDiagrams = metamodel.featuredDiagrams?.map(
259
261
  (diagramPath) =>