@finos/legend-extension-dsl-data-space 1.0.2 → 1.0.7

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 (61) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/components/DataSpaceViewer.d.ts +2 -1
  3. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  4. package/lib/components/DataSpaceViewer.js +6 -6
  5. package/lib/components/DataSpaceViewer.js.map +1 -1
  6. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts +1 -3
  7. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts.map +1 -1
  8. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js +1 -4
  9. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js.map +1 -1
  10. package/lib/components/query/DataSpaceQuerySetup.d.ts +1 -0
  11. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
  12. package/lib/components/query/DataSpaceQuerySetup.js +2 -1
  13. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  14. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts +1 -3
  15. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +1 -1
  16. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js +0 -3
  17. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +1 -1
  18. package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts +1 -3
  19. package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts.map +1 -1
  20. package/lib/graph/DSLDataSpace_PureGraphPlugin.js +0 -3
  21. package/lib/graph/DSLDataSpace_PureGraphPlugin.js.map +1 -1
  22. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts +1 -3
  23. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  24. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js +1 -4
  25. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js.map +1 -1
  26. package/lib/index.css +2 -2
  27. package/lib/index.css.map +1 -1
  28. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.d.ts +2 -3
  29. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.d.ts.map +1 -1
  30. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.js +1 -1
  31. package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.js.map +1 -1
  32. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +3 -5
  33. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  34. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +0 -3
  35. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  36. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.d.ts +2 -3
  37. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.d.ts.map +1 -1
  38. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.js +1 -1
  39. package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.js.map +1 -1
  40. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -1
  41. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -1
  42. package/lib/stores/DataSpaceViewerState.d.ts +1 -2
  43. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  44. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  45. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +5 -5
  46. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
  47. package/lib/stores/query/DataSpaceQuerySetupState.js +23 -3
  48. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
  49. package/package.json +23 -21
  50. package/src/components/DataSpaceViewer.tsx +25 -11
  51. package/src/components/query/DSLDataSpace_LegendQueryPlugin.tsx +6 -11
  52. package/src/components/query/DataSpaceQuerySetup.tsx +5 -2
  53. package/src/components/studio/DSLDataSpace_LegendStudioPlugin.tsx +9 -16
  54. package/src/graph/DSLDataSpace_PureGraphPlugin.ts +1 -9
  55. package/src/graphManager/DSLDataSpace_PureGraphManagerPlugin.ts +4 -9
  56. package/src/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.ts +6 -7
  57. package/src/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +16 -23
  58. package/src/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.ts +7 -8
  59. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +3 -3
  60. package/src/stores/DataSpaceViewerState.ts +2 -4
  61. package/src/stores/query/DataSpaceQuerySetupState.ts +43 -5
@@ -21,8 +21,8 @@ import {
21
21
  V1_DataSpaceExecutionContext,
22
22
  V1_DataSpaceSupportEmail,
23
23
  } from './v1/model/packageableElements/dataSpace/V1_DataSpace';
24
- import type { PlainObject } from '@finos/legend-shared';
25
24
  import {
25
+ type PlainObject,
26
26
  uuid,
27
27
  guaranteeNonEmptyString,
28
28
  guaranteeNonNullable,
@@ -36,30 +36,27 @@ import {
36
36
  V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE,
37
37
  } from './v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper';
38
38
  import { getDataSpace } from '../../../graphManager/DSLDataSpace_GraphManagerHelper';
39
- import type { DataSpaceSupportInfo } from '../../metamodels/pure/model/packageableElements/dataSpace/DataSpace';
40
39
  import {
40
+ type DataSpaceSupportInfo,
41
41
  DataSpace,
42
42
  DataSpaceExecutionContext,
43
43
  DataSpaceSupportEmail,
44
44
  } from '../../metamodels/pure/model/packageableElements/dataSpace/DataSpace';
45
- import type {
46
- GraphPluginManager,
47
- Mapping,
48
- PackageableElement,
49
- PackageableElementReference,
50
- PackageableRuntime,
51
- PureModel,
52
- V1_ElementProtocolClassifierPathGetter,
53
- V1_ElementProtocolDeserializer,
54
- V1_ElementProtocolSerializer,
55
- V1_ElementTransformer,
56
- V1_GraphBuilderContext,
57
- V1_GraphTransformerContext,
58
- V1_PackageableElement,
59
- V1_PureModelContextData,
60
- V1_TaggedValue,
61
- } from '@finos/legend-graph';
62
45
  import {
46
+ type Mapping,
47
+ type PackageableElement,
48
+ type PackageableElementReference,
49
+ type PackageableRuntime,
50
+ type PureModel,
51
+ type V1_ElementProtocolClassifierPathGetter,
52
+ type V1_ElementProtocolDeserializer,
53
+ type V1_ElementProtocolSerializer,
54
+ type V1_ElementTransformer,
55
+ type V1_GraphBuilderContext,
56
+ type V1_GraphTransformerContext,
57
+ type V1_PackageableElement,
58
+ type V1_PureModelContextData,
59
+ type V1_TaggedValue,
63
60
  V1_taggedValueSchema,
64
61
  PackageableElementExplicitReference,
65
62
  V1_PackageableElementPointer,
@@ -88,10 +85,6 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
88
85
  );
89
86
  }
90
87
 
91
- install(pluginManager: GraphPluginManager): void {
92
- pluginManager.registerPureProtocolProcessorPlugin(this);
93
- }
94
-
95
88
  override V1_getExtraElementBuilders(): V1_ElementBuilder<V1_PackageableElement>[] {
96
89
  return [
97
90
  new V1_ElementBuilder<V1_DataSpace>({
@@ -14,16 +14,15 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { hashArray } from '@finos/legend-shared';
18
- import type { Hashable } from '@finos/legend-shared';
17
+ import { hashArray, type Hashable } from '@finos/legend-shared';
19
18
  import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../../DSLDataSpace_ModelUtils';
20
- import type {
21
- V1_PackageableElementPointer,
22
- V1_PackageableElementVisitor,
23
- V1_StereotypePtr,
24
- V1_TaggedValue,
19
+ import {
20
+ V1_PackageableElement,
21
+ type V1_PackageableElementPointer,
22
+ type V1_PackageableElementVisitor,
23
+ type V1_StereotypePtr,
24
+ type V1_TaggedValue,
25
25
  } from '@finos/legend-graph';
26
- import { V1_PackageableElement } from '@finos/legend-graph';
27
26
 
28
27
  export abstract class V1_DataSpaceSupportInfo implements Hashable {
29
28
  abstract get hashCode(): string;
@@ -25,22 +25,22 @@ import {
25
25
  serialize,
26
26
  SKIP,
27
27
  } from 'serializr';
28
- import type { V1_StereotypePtr } from '@finos/legend-graph';
29
28
  import {
29
+ type V1_StereotypePtr,
30
30
  V1_stereotypePtrSchema,
31
31
  V1_taggedValueSchema,
32
32
  V1_packageableElementPointerDeserializerSchema,
33
33
  } from '@finos/legend-graph';
34
- import type { PlainObject } from '@finos/legend-shared';
35
34
  import {
35
+ type PlainObject,
36
36
  deserializeArray,
37
37
  serializeArray,
38
38
  UnsupportedOperationError,
39
39
  usingConstantValueSchema,
40
40
  usingModelSchema,
41
41
  } from '@finos/legend-shared';
42
- import type { V1_DataSpaceSupportInfo } from '../../model/packageableElements/dataSpace/V1_DataSpace';
43
42
  import {
43
+ type V1_DataSpaceSupportInfo,
44
44
  V1_DataSpace,
45
45
  V1_DataSpaceExecutionContext,
46
46
  V1_DataSpaceSupportEmail,
@@ -14,11 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type {
18
- ClassView,
19
- DiagramRenderer,
20
- } from '@finos/legend-extension-dsl-diagram';
21
17
  import {
18
+ type ClassView,
19
+ type DiagramRenderer,
22
20
  Diagram,
23
21
  DIAGRAM_INTERACTION_MODE,
24
22
  } from '@finos/legend-extension-dsl-diagram';
@@ -15,22 +15,24 @@
15
15
  */
16
16
 
17
17
  import type { ClassView } from '@finos/legend-extension-dsl-diagram';
18
- import type { Class } from '@finos/legend-graph';
18
+ import { type Class, QueryTaggedValue } from '@finos/legend-graph';
19
19
  import type { Entity } from '@finos/legend-model-storage';
20
- import type { QuerySetupStore } from '@finos/legend-query';
21
20
  import {
21
+ type QuerySetupStore,
22
22
  CreateQueryInfoState,
23
23
  QuerySetupState,
24
24
  generateCreateQueryRoute,
25
25
  } from '@finos/legend-query';
26
- import type { StoredEntity } from '@finos/legend-server-depot';
27
26
  import {
27
+ type StoredEntity,
28
+ generateGAVCoordinates,
28
29
  DepotScope,
29
30
  ProjectData,
30
31
  SNAPSHOT_VERSION_ALIAS,
31
32
  } from '@finos/legend-server-depot';
32
- import type { GeneratorFn, PlainObject } from '@finos/legend-shared';
33
33
  import {
34
+ type GeneratorFn,
35
+ type PlainObject,
34
36
  ActionState,
35
37
  assertErrorThrown,
36
38
  guaranteeNonNullable,
@@ -54,10 +56,32 @@ export type LightDataSpace = Entity & {
54
56
  };
55
57
  };
56
58
 
59
+ const QUERY_PROFILE_PATH = 'meta::pure::profiles::query';
60
+ const QUERY_PROFILE_TAG_DATA_SPACE = 'dataSpace';
61
+ const DATA_SPACE_ID_DELIMITER = '@';
62
+
63
+ export const createQueryDataSpaceTaggedValue = (
64
+ dataSpacePath: string,
65
+ groupId: string,
66
+ artifactId: string,
67
+ versionId: string,
68
+ ): QueryTaggedValue => {
69
+ const taggedValue = new QueryTaggedValue();
70
+ taggedValue.profile = QUERY_PROFILE_PATH;
71
+ taggedValue.tag = QUERY_PROFILE_TAG_DATA_SPACE;
72
+ taggedValue.value = `${generateGAVCoordinates(
73
+ groupId,
74
+ artifactId,
75
+ versionId,
76
+ )}${DATA_SPACE_ID_DELIMITER}${dataSpacePath}`;
77
+ return taggedValue;
78
+ };
79
+
57
80
  export class DataSpaceQuerySetupState extends QuerySetupState {
58
81
  dataSpaces: LightDataSpace[] = [];
59
82
  loadDataSpacesState = ActionState.create();
60
83
  setUpDataSpaceState = ActionState.create();
84
+ setUpDataSpaceStatusText?: string | undefined;
61
85
  currentDataSpace?: LightDataSpace | undefined;
62
86
  dataSpaceViewerState?: DataSpaceViewerState | undefined;
63
87
  toGetSnapShot = false;
@@ -69,6 +93,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
69
93
  dataSpaces: observable,
70
94
  currentDataSpace: observable.ref,
71
95
  dataSpaceViewerState: observable,
96
+ setUpDataSpaceStatusText: observable,
72
97
  toGetSnapShot: observable,
73
98
  setCurrentDataSpace: action,
74
99
  setDataSpaceViewerState: action,
@@ -154,6 +179,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
154
179
  }
155
180
  this.setUpDataSpaceState.inProgress();
156
181
  try {
182
+ this.setUpDataSpaceStatusText = `Fetching information for data space...`;
157
183
  const projectData = ProjectData.serialization.fromJson(
158
184
  (yield flowResult(
159
185
  this.queryStore.depotServerClient.getProject(
@@ -162,6 +188,8 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
162
188
  ),
163
189
  )) as PlainObject<ProjectData>,
164
190
  );
191
+
192
+ this.setUpDataSpaceStatusText = `Building graph...`;
165
193
  yield flowResult(
166
194
  this.queryStore.buildGraph(projectData, dataSpace.content.versionId),
167
195
  );
@@ -198,6 +226,8 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
198
226
  assertErrorThrown(error);
199
227
  this.setUpDataSpaceState.fail();
200
228
  this.queryStore.applicationStore.notifyError(error);
229
+ } finally {
230
+ this.setUpDataSpaceStatusText = undefined;
201
231
  }
202
232
  }
203
233
 
@@ -218,7 +248,14 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
218
248
  this.dataSpaceViewerState.currentExecutionContext.mapping.value,
219
249
  this.dataSpaceViewerState.currentRuntime,
220
250
  );
221
- queryInfoState.class = _class;
251
+ queryInfoState.taggedValues = [
252
+ createQueryDataSpaceTaggedValue(
253
+ this.dataSpaceViewerState.dataSpace.path,
254
+ this.dataSpaceViewerState.dataSpaceGroupId,
255
+ this.dataSpaceViewerState.dataSpaceArtifactId,
256
+ this.dataSpaceViewerState.dataSpaceVersionId,
257
+ ),
258
+ ];
222
259
  this.queryStore.setQueryInfoState(queryInfoState);
223
260
  this.queryStore.applicationStore.navigator.goTo(
224
261
  generateCreateQueryRoute(
@@ -227,6 +264,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
227
264
  this.dataSpaceViewerState.dataSpace.versionId,
228
265
  this.dataSpaceViewerState.currentExecutionContext.mapping.value.path,
229
266
  this.dataSpaceViewerState.currentRuntime.path,
267
+ _class?.path,
230
268
  ),
231
269
  );
232
270
  this.setupStore.setSetupState(undefined);