@finos/legend-extension-dsl-data-space 10.3.61 → 10.3.63
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/index.css +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts +1 -1
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.js +25 -13
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.js.map +1 -1
- package/package.json +8 -8
- package/src/stores/query-builder/DataSpaceQueryBuilderState.ts +36 -15
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-extension-dsl-data-space",
|
3
|
-
"version": "10.3.
|
3
|
+
"version": "10.3.63",
|
4
4
|
"description": "Legend extension for Data Space DSL",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -53,7 +53,7 @@
|
|
53
53
|
"@finos/legend-server-sdlc": "workspace:*",
|
54
54
|
"@finos/legend-shared": "workspace:*",
|
55
55
|
"@finos/legend-storage": "workspace:*",
|
56
|
-
"@types/react": "18.3.
|
56
|
+
"@types/react": "18.3.5",
|
57
57
|
"mobx": "6.13.1",
|
58
58
|
"mobx-react-lite": "4.0.7",
|
59
59
|
"react": "18.3.1",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
import { type GenericLegendApplicationStore } from '@finos/legend-application';
|
17
17
|
import { type QueryBuilderConfig, type QuerySDLC, type QueryBuilderWorkflowState, type QueryBuilderActionConfig, QueryBuilderState } from '@finos/legend-query-builder';
|
18
|
-
import { type GraphManagerState, type QueryExecutionContext, type Runtime, type Mapping
|
18
|
+
import { type Class, type GraphManagerState, type QueryExecutionContext, type Runtime, type Mapping } from '@finos/legend-graph';
|
19
19
|
import { type DepotServerClient } from '@finos/legend-server-depot';
|
20
20
|
import { type GeneratorFn, ActionState } from '@finos/legend-shared';
|
21
21
|
import { type DataSpaceExecutionContext, type DataSpaceExecutable, DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataSpaceQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/query-builder/DataSpaceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,iBAAiB,
|
1
|
+
{"version":3,"file":"DataSpaceQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/query-builder/DataSpaceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,iBAAiB,EAGtB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,OAAO,EAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,iBAAiB,EAIvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAIZ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,SAAS,EAGV,MAAM,2FAA2F,CAAC;AAEnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,KAAK,EAA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AE,uBAAuB,GAAG,SAAS,EAC7D,wBAAwB,CAAC,EACrB,CAAC,CAAC,GAAG,EAAE,yBAAyB,KAAK,IAAI,CAAC,GAC1C,SAAS,EACb,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,EACtD,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,EAClD,MAAM,CAAC,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS;IA6BpC,IAAa,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAIlD;IAEQ,wBAAwB,IAAI,qBAAqB;IAO1D,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAI9C,mBAAmB,CAAC,GAAG,EAAE,yBAAyB,GAAG,IAAI;IAIzD,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAI1C;;;;;;OAMG;IACH,+BAA+B,CAC7B,gBAAgB,EAAE,yBAAyB,GAC1C,IAAI;CA2BR"}
|
@@ -15,9 +15,9 @@
|
|
15
15
|
*/
|
16
16
|
import {} from '@finos/legend-application';
|
17
17
|
import { QueryBuilderState, } from '@finos/legend-query-builder';
|
18
|
-
import { getMappingCompatibleClasses, RuntimePointer,
|
18
|
+
import { getMappingCompatibleClasses, RuntimePointer, Package, QueryDataSpaceExecutionContext, Service, elementBelongsToPackage, } from '@finos/legend-graph';
|
19
19
|
import { DepotScope, SNAPSHOT_VERSION_ALIAS, } from '@finos/legend-server-depot';
|
20
|
-
import { ActionState, assertErrorThrown, getNullableFirstEntry, filterByType,
|
20
|
+
import { ActionState, assertErrorThrown, getNullableFirstEntry, filterByType, } from '@finos/legend-shared';
|
21
21
|
import { action, flow, makeObservable, observable } from 'mobx';
|
22
22
|
import { renderDataSpaceQueryBuilderSetupPanelContent } from '../../components/query-builder/DataSpaceQueryBuilder.js';
|
23
23
|
import { DataSpace, DataSpacePackageableElementExecutable, } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
@@ -25,19 +25,31 @@ import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../graph-manager/protocol
|
|
25
25
|
import { DataSpaceAdvancedSearchState } from '../query/DataSpaceAdvancedSearchState.js';
|
26
26
|
import { extractDataSpaceInfo, } from '../shared/DataSpaceInfo.js';
|
27
27
|
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js';
|
28
|
+
const matchesDataElement = (_class, element) => {
|
29
|
+
if (_class === element) {
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
if (element instanceof Package) {
|
33
|
+
return elementBelongsToPackage(_class, element);
|
34
|
+
}
|
35
|
+
return false;
|
36
|
+
};
|
28
37
|
export const resolveUsableDataSpaceClasses = (dataSpace, mapping, graphManagerState) => {
|
38
|
+
const compatibleClasses = getMappingCompatibleClasses(mapping, graphManagerState.usableClasses);
|
29
39
|
if (dataSpace.elements?.length) {
|
30
|
-
const
|
31
|
-
return
|
32
|
-
|
33
|
-
|
34
|
-
.
|
35
|
-
.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
const elements = dataSpace.elements;
|
41
|
+
return compatibleClasses.filter((_class) => {
|
42
|
+
const _classElements = elements
|
43
|
+
.filter((e) => matchesDataElement(_class, e.element.value))
|
44
|
+
// we sort because we respect the closest definition to the element.
|
45
|
+
.sort((a, b) => b.element.value.path.length - a.element.value.path.length);
|
46
|
+
if (!_classElements.length) {
|
47
|
+
return false;
|
48
|
+
}
|
49
|
+
return !_classElements[0]?.exclude;
|
50
|
+
});
|
51
|
+
}
|
52
|
+
return compatibleClasses;
|
41
53
|
};
|
42
54
|
// could be abstracted for element
|
43
55
|
export class DataSpacesBuilderRepoistory {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataSpaceQueryBuilderState.js","sourceRoot":"","sources":["../../../src/stores/query-builder/DataSpaceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAsC,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAKL,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,
|
1
|
+
{"version":3,"file":"DataSpaceQueryBuilderState.js","sourceRoot":"","sources":["../../../src/stores/query-builder/DataSpaceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAsC,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAKL,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,2BAA2B,EAC3B,cAAc,EAId,OAAO,EACP,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,UAAU,EACV,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EAAE,4CAA4C,EAAE,MAAM,yDAAyD,CAAC;AACvH,OAAO,EAGL,SAAS,EACT,qCAAqC,GAEtC,MAAM,2FAA2F,CAAC;AACnG,OAAO,EAAE,kCAAkC,EAAE,MAAM,gFAAgF,CAAC;AACpI,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EAEL,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,0CAA0C,EAAE,MAAM,0EAA0E,CAAC;AAEtI,MAAM,kBAAkB,GAAG,CACzB,MAAa,EACb,OAAyB,EAChB,EAAE;IACX,IAAI,MAAM,KAAK,OAAO,E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AgB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;YAClE,IAAI,gBAAgB,EAAE,CAAC;gBACrB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-extension-dsl-data-space",
|
3
|
-
"version": "10.3.
|
3
|
+
"version": "10.3.63",
|
4
4
|
"description": "Legend extension for Data Space DSL",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -43,17 +43,17 @@
|
|
43
43
|
"test:watch": "jest --watch"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@finos/legend-application": "15.1.
|
47
|
-
"@finos/legend-art": "7.1.
|
48
|
-
"@finos/legend-extension-dsl-diagram": "8.
|
49
|
-
"@finos/legend-graph": "31.10.
|
50
|
-
"@finos/legend-lego": "1.2.
|
51
|
-
"@finos/legend-query-builder": "4.14.
|
46
|
+
"@finos/legend-application": "15.1.26",
|
47
|
+
"@finos/legend-art": "7.1.53",
|
48
|
+
"@finos/legend-extension-dsl-diagram": "8.1.1",
|
49
|
+
"@finos/legend-graph": "31.10.26",
|
50
|
+
"@finos/legend-lego": "1.2.63",
|
51
|
+
"@finos/legend-query-builder": "4.14.83",
|
52
52
|
"@finos/legend-server-depot": "6.0.58",
|
53
53
|
"@finos/legend-server-sdlc": "5.3.29",
|
54
54
|
"@finos/legend-shared": "10.0.53",
|
55
55
|
"@finos/legend-storage": "3.0.103",
|
56
|
-
"@types/react": "18.3.
|
56
|
+
"@types/react": "18.3.5",
|
57
57
|
"mobx": "6.13.1",
|
58
58
|
"mobx-react-lite": "4.0.7",
|
59
59
|
"react": "18.3.1",
|
@@ -23,17 +23,17 @@ import {
|
|
23
23
|
QueryBuilderState,
|
24
24
|
} from '@finos/legend-query-builder';
|
25
25
|
import {
|
26
|
+
type Class,
|
26
27
|
type GraphManagerState,
|
28
|
+
getMappingCompatibleClasses,
|
29
|
+
RuntimePointer,
|
27
30
|
type QueryExecutionContext,
|
28
31
|
type Runtime,
|
29
32
|
type Mapping,
|
30
|
-
getMappingCompatibleClasses,
|
31
|
-
RuntimePointer,
|
32
|
-
Class,
|
33
|
-
getDescendantsOfPackage,
|
34
33
|
Package,
|
35
34
|
QueryDataSpaceExecutionContext,
|
36
35
|
Service,
|
36
|
+
elementBelongsToPackage,
|
37
37
|
} from '@finos/legend-graph';
|
38
38
|
import {
|
39
39
|
type DepotServerClient,
|
@@ -47,7 +47,6 @@ import {
|
|
47
47
|
assertErrorThrown,
|
48
48
|
getNullableFirstEntry,
|
49
49
|
filterByType,
|
50
|
-
uniq,
|
51
50
|
} from '@finos/legend-shared';
|
52
51
|
import { action, flow, makeObservable, observable } from 'mobx';
|
53
52
|
import { renderDataSpaceQueryBuilderSetupPanelContent } from '../../components/query-builder/DataSpaceQueryBuilder.js';
|
@@ -56,6 +55,7 @@ import {
|
|
56
55
|
type DataSpaceExecutable,
|
57
56
|
DataSpace,
|
58
57
|
DataSpacePackageableElementExecutable,
|
58
|
+
type DataSpaceElement,
|
59
59
|
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
60
60
|
import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js';
|
61
61
|
import { DataSpaceAdvancedSearchState } from '../query/DataSpaceAdvancedSearchState.js';
|
@@ -67,23 +67,44 @@ import {
|
|
67
67
|
import type { ProjectGAVCoordinates } from '@finos/legend-storage';
|
68
68
|
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js';
|
69
69
|
|
70
|
+
const matchesDataElement = (
|
71
|
+
_class: Class,
|
72
|
+
element: DataSpaceElement,
|
73
|
+
): boolean => {
|
74
|
+
if (_class === element) {
|
75
|
+
return true;
|
76
|
+
}
|
77
|
+
if (element instanceof Package) {
|
78
|
+
return elementBelongsToPackage(_class, element);
|
79
|
+
}
|
80
|
+
return false;
|
81
|
+
};
|
82
|
+
|
70
83
|
export const resolveUsableDataSpaceClasses = (
|
71
84
|
dataSpace: DataSpace,
|
72
85
|
mapping: Mapping,
|
73
86
|
graphManagerState: GraphManagerState,
|
74
87
|
): Class[] => {
|
88
|
+
const compatibleClasses = getMappingCompatibleClasses(
|
89
|
+
mapping,
|
90
|
+
graphManagerState.usableClasses,
|
91
|
+
);
|
75
92
|
if (dataSpace.elements?.length) {
|
76
|
-
const
|
77
|
-
return
|
78
|
-
|
79
|
-
|
80
|
-
.
|
81
|
-
.
|
82
|
-
|
83
|
-
|
84
|
-
|
93
|
+
const elements = dataSpace.elements;
|
94
|
+
return compatibleClasses.filter((_class) => {
|
95
|
+
const _classElements = elements
|
96
|
+
.filter((e) => matchesDataElement(_class, e.element.value))
|
97
|
+
// we sort because we respect the closest definition to the element.
|
98
|
+
.sort(
|
99
|
+
(a, b) => b.element.value.path.length - a.element.value.path.length,
|
100
|
+
);
|
101
|
+
if (!_classElements.length) {
|
102
|
+
return false;
|
103
|
+
}
|
104
|
+
return !_classElements[0]?.exclude;
|
105
|
+
});
|
85
106
|
}
|
86
|
-
return
|
107
|
+
return compatibleClasses;
|
87
108
|
};
|
88
109
|
export interface DataSpaceQuerySDLC extends QuerySDLC {
|
89
110
|
groupId: string;
|