@finos/legend-extension-dsl-data-space 6.0.0 → 6.1.2
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.
- package/lib/components/DataSpaceViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceViewer.js +13 -10
- package/lib/components/DataSpaceViewer.js.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.js +9 -4
- package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts +1 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js +2 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js.map +1 -1
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +1 -0
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +1 -0
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
- package/lib/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +2 -0
- package/lib/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.js +31 -3
- package/lib/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +1 -0
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +2 -0
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js +2 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +1 -0
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/DataSpaceViewerState.d.ts +1 -1
- package/lib/stores/DataSpaceViewerState.js +1 -1
- package/lib/stores/query/DataSpaceQueryEditorStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryEditorStore.js +7 -6
- package/lib/stores/query/DataSpaceQueryEditorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupState.d.ts +2 -0
- package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupState.js +6 -1
- package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
- package/package.json +12 -12
- package/src/components/DataSpaceViewer.tsx +87 -24
- package/src/components/query/DataSpaceQuerySetup.tsx +22 -2
- package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.ts +2 -0
- package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +1 -0
- package/src/graphManager/protocol/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +2 -0
- package/src/graphManager/protocol/pure/v1/V1_DSLDataSpace_PureGraphManagerExtension.ts +38 -1
- package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +2 -0
- package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.ts +2 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +1 -0
- package/src/stores/DataSpaceViewerState.ts +1 -1
- package/src/stores/query/DataSpaceQueryEditorStore.ts +9 -7
- package/src/stores/query/DataSpaceQuerySetupState.ts +8 -1
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
V1_PureModelContextType,
|
|
28
28
|
V1_PackageableRuntime,
|
|
29
29
|
V1_EngineRuntime,
|
|
30
|
+
V1_Class,
|
|
30
31
|
} from '@finos/legend-graph';
|
|
31
32
|
import type { Entity } from '@finos/legend-storage';
|
|
32
33
|
import {
|
|
@@ -34,6 +35,7 @@ import {
|
|
|
34
35
|
guaranteeNonEmptyString,
|
|
35
36
|
guaranteeNonNullable,
|
|
36
37
|
guaranteeType,
|
|
38
|
+
isNonNullable,
|
|
37
39
|
uniq,
|
|
38
40
|
type PlainObject,
|
|
39
41
|
} from '@finos/legend-shared';
|
|
@@ -100,6 +102,7 @@ export class V1_DSLDataSpace_PureGraphManagerExtension extends DSLDataSpace_Pure
|
|
|
100
102
|
result.name = analysisResult.name;
|
|
101
103
|
result.package = analysisResult.package;
|
|
102
104
|
result.path = analysisResult.path;
|
|
105
|
+
result.title = analysisResult.title;
|
|
103
106
|
result.description = analysisResult.description;
|
|
104
107
|
|
|
105
108
|
result.taggedValues = analysisResult.taggedValues.map((taggedValue) => {
|
|
@@ -177,8 +180,42 @@ export class V1_DSLDataSpace_PureGraphManagerExtension extends DSLDataSpace_Pure
|
|
|
177
180
|
});
|
|
178
181
|
|
|
179
182
|
// prepare the model context data
|
|
180
|
-
// scan for models coming from system so we don't duplicate them when building the graph
|
|
181
183
|
const graphEntities = analysisResult.model.elements
|
|
184
|
+
// NOTE: this is a temporary hack to fix a problem with data space analytics
|
|
185
|
+
// where the classes for properties are not properly surveyed
|
|
186
|
+
// We need to wait for the actual fix in backend to be merged and released
|
|
187
|
+
// See https://github.com/finos/legend-engine/pull/836
|
|
188
|
+
.concat(
|
|
189
|
+
uniq(
|
|
190
|
+
analysisResult.model.elements.flatMap((element) => {
|
|
191
|
+
if (element instanceof V1_Class) {
|
|
192
|
+
return element.derivedProperties
|
|
193
|
+
.map((prop) => prop.returnType)
|
|
194
|
+
.concat(element.properties.map((prop) => prop.type));
|
|
195
|
+
}
|
|
196
|
+
return [];
|
|
197
|
+
}),
|
|
198
|
+
)
|
|
199
|
+
// make sure to not include types already returned by the analysis
|
|
200
|
+
.filter(
|
|
201
|
+
(path) =>
|
|
202
|
+
!analysisResult.model.elements
|
|
203
|
+
.map((el) => el.path)
|
|
204
|
+
.includes(path),
|
|
205
|
+
)
|
|
206
|
+
.map((path) => {
|
|
207
|
+
const [pkgPath, name] = resolvePackagePathAndElementName(path);
|
|
208
|
+
if (!pkgPath) {
|
|
209
|
+
// exclude package-less elements (i.e. primitive types)
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
const _class = new V1_Class();
|
|
213
|
+
_class.name = name;
|
|
214
|
+
_class.package = pkgPath;
|
|
215
|
+
return _class;
|
|
216
|
+
})
|
|
217
|
+
.filter(isNonNullable),
|
|
218
|
+
)
|
|
182
219
|
.concat(mappingModels)
|
|
183
220
|
.concat(runtimeModels)
|
|
184
221
|
// NOTE: if an element could be found in the graph already it means it comes from system
|
|
@@ -79,6 +79,7 @@ export class V1_DataSpaceAnalysisResult {
|
|
|
79
79
|
taggedValues: V1_DataSpaceTaggedValueInfo[] = [];
|
|
80
80
|
stereotypes: V1_DataSpaceStereotypeInfo[] = [];
|
|
81
81
|
|
|
82
|
+
title?: string | undefined;
|
|
82
83
|
description?: string | undefined;
|
|
83
84
|
supportInfo?: V1_DataSpaceSupportInfo | undefined;
|
|
84
85
|
|
|
@@ -98,6 +99,7 @@ export class V1_DataSpaceAnalysisResult {
|
|
|
98
99
|
taggedValues: list(object(V1_DataSpaceTaggedValueInfo)),
|
|
99
100
|
stereotypes: list(object(V1_DataSpaceStereotypeInfo)),
|
|
100
101
|
|
|
102
|
+
title: optional(primitive()),
|
|
101
103
|
description: optional(primitive()),
|
|
102
104
|
supportInfo: optionalCustom(
|
|
103
105
|
() => SKIP,
|
|
@@ -65,6 +65,7 @@ export class V1_DataSpace extends V1_PackageableElement implements Hashable {
|
|
|
65
65
|
executionContexts!: V1_DataSpaceExecutionContext[];
|
|
66
66
|
defaultExecutionContext!: string;
|
|
67
67
|
featuredDiagrams?: V1_PackageableElementPointer[] | undefined;
|
|
68
|
+
title?: string | undefined;
|
|
68
69
|
description?: string | undefined;
|
|
69
70
|
supportInfo?: V1_DataSpaceSupportInfo | undefined;
|
|
70
71
|
|
|
@@ -76,6 +77,7 @@ export class V1_DataSpace extends V1_PackageableElement implements Hashable {
|
|
|
76
77
|
hashArray(this.executionContexts),
|
|
77
78
|
this.defaultExecutionContext,
|
|
78
79
|
hashArray((this.featuredDiagrams ?? []).map((pointer) => pointer.path)),
|
|
80
|
+
this.title ?? '',
|
|
79
81
|
this.description ?? '',
|
|
80
82
|
this.supportInfo ?? '',
|
|
81
83
|
]);
|
|
@@ -111,15 +111,17 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
if (this.classPath) {
|
|
114
|
-
this.queryBuilderState.
|
|
115
|
-
this.queryBuilderState.graphManagerState.graph.getClass(this.classPath)
|
|
114
|
+
this.queryBuilderState.changeClass(
|
|
115
|
+
this.queryBuilderState.graphManagerState.graph.getClass(this.classPath),
|
|
116
|
+
);
|
|
116
117
|
this.queryBuilderState.querySetupState.setClassIsReadOnly(true);
|
|
117
|
-
}
|
|
118
|
-
|
|
118
|
+
} else {
|
|
119
|
+
// TODO?: should we set the class here automatically?
|
|
119
120
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
// initialize query builder state after setting up
|
|
122
|
+
this.queryBuilderState.resetQueryBuilder();
|
|
123
|
+
this.queryBuilderState.resetQuerySetup();
|
|
124
|
+
}
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
async getExportConfiguration(): Promise<QueryExportConfiguration> {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import type { ClassView } from '@finos/legend-extension-dsl-diagram';
|
|
18
18
|
import type { Class } from '@finos/legend-graph';
|
|
19
|
-
import type
|
|
19
|
+
import { type Entity, extractEntityNameFromPath } from '@finos/legend-storage';
|
|
20
20
|
import {
|
|
21
21
|
type QuerySetupStore,
|
|
22
22
|
QuerySetupState,
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
type PlainObject,
|
|
34
34
|
ActionState,
|
|
35
35
|
assertErrorThrown,
|
|
36
|
+
isString,
|
|
36
37
|
} from '@finos/legend-shared';
|
|
37
38
|
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
38
39
|
import type { DataSpaceAnalysisResult } from '../../graphManager/action/analytics/DataSpaceAnalysis.js';
|
|
@@ -45,6 +46,8 @@ export interface DataSpaceContext {
|
|
|
45
46
|
groupId: string;
|
|
46
47
|
artifactId: string;
|
|
47
48
|
versionId: string;
|
|
49
|
+
title: string | undefined;
|
|
50
|
+
name: string;
|
|
48
51
|
path: string;
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -107,6 +110,10 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
107
110
|
? SNAPSHOT_VERSION_ALIAS
|
|
108
111
|
: storedEntity.versionId,
|
|
109
112
|
path: storedEntity.entity.path,
|
|
113
|
+
name: extractEntityNameFromPath(storedEntity.entity.path),
|
|
114
|
+
title: isString(storedEntity.entity.content.title)
|
|
115
|
+
? storedEntity.entity.content.title
|
|
116
|
+
: undefined,
|
|
110
117
|
}));
|
|
111
118
|
this.loadDataSpacesState.pass();
|
|
112
119
|
} catch (error) {
|