@finos/legend-application-query 13.5.38 → 13.5.40
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/data-space/DataSpaceTemplateQueryCreatorStore.d.ts +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +20 -10
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/package.json +12 -12
- package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +42 -21
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-query",
|
3
|
-
"version": "13.5.
|
3
|
+
"version": "13.5.40",
|
4
4
|
"description": "Legend Query application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"@finos/legend-storage": "workspace:*",
|
55
55
|
"@testing-library/dom": "10.4.0",
|
56
56
|
"@testing-library/react": "16.0.0",
|
57
|
-
"@types/react": "18.3.
|
57
|
+
"@types/react": "18.3.4",
|
58
58
|
"@types/react-dom": "18.3.0",
|
59
59
|
"mobx": "6.13.1",
|
60
60
|
"mobx-react-lite": "4.0.7",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { type
|
16
|
+
import { type QuerySearchSpecification, type RawLambda } from '@finos/legend-graph';
|
17
17
|
import { type DepotServerClient } from '@finos/legend-server-depot';
|
18
18
|
import { type QueryBuilderState } from '@finos/legend-query-builder';
|
19
19
|
import { type ProjectGAVCoordinates } from '@finos/legend-storage';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAGf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,gBAAgB,EAChB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAiB9E,qBAAa,kCAAmC,SAAQ,gBAAgB;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;gBAG1B,gBAAgB,EAAE,2BAA2B,EAC7C,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM;IAWzB,cAAc,IAAI,qBAAqB;IAQjC,2BAA2B,IAAI,OAAO,CAAC,iBAAiB,CAAC;IA+F/D,uBAAuB,CACrB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,GACzC,yBAAyB;IAqBnB,2BAA2B,CAClC,GAAG,EAAE,wBAAwB,GAC5B,wBAAwB;CAsB5B"}
|
@@ -15,11 +15,11 @@
|
|
15
15
|
*/
|
16
16
|
import { QueryProjectCoordinates, extractElementNameFromPath, } from '@finos/legend-graph';
|
17
17
|
import { StoreProjectData, } from '@finos/legend-server-depot';
|
18
|
-
import {
|
18
|
+
import { IllegalStateError, uuid } from '@finos/legend-shared';
|
19
19
|
import { QueryBuilderDataBrowserWorkflow, } from '@finos/legend-query-builder';
|
20
20
|
import { parseGACoordinates, } from '@finos/legend-storage';
|
21
21
|
import { QueryBuilderActionConfig_QueryApplication, QueryEditorStore, } from '../QueryEditorStore.js';
|
22
|
-
import { DSL_DataSpace_getGraphManagerExtension,
|
22
|
+
import { DSL_DataSpace_getGraphManagerExtension, getDataSpace, retrieveAnalyticsResultCache, getExecutionContextFromDataspaceExecutable, getQueryFromDataspaceExecutable, DataSpacePackageableElementExecutable, } from '@finos/legend-extension-dsl-data-space/graph';
|
23
23
|
import { DataSpaceQueryBuilderState, createQueryClassTaggedValue, createQueryDataSpaceTaggedValue, } from '@finos/legend-extension-dsl-data-space/application';
|
24
24
|
import { createDataSpaceDepoRepo } from './DataSpaceQueryBuilderHelper.js';
|
25
25
|
export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
@@ -46,13 +46,23 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
46
46
|
}
|
47
47
|
async initializeQueryBuilderState() {
|
48
48
|
const dataSpace = getDataSpace(this.dataSpacePath, this.graphManagerState.graph);
|
49
|
-
|
50
|
-
|
51
|
-
.find((executable) => executable
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
49
|
+
let template = dataSpace.executables?.find((executable) => executable.id === this.templateQueryId);
|
50
|
+
if (!template) {
|
51
|
+
template = dataSpace.executables?.find((executable) => executable instanceof DataSpacePackageableElementExecutable &&
|
52
|
+
executable.executable.value.path === this.templateQueryId);
|
53
|
+
}
|
54
|
+
if (!template) {
|
55
|
+
throw new IllegalStateError(`Can't find template query with id '${this.templateQueryId}'`);
|
56
|
+
}
|
57
|
+
const executionContext = getExecutionContextFromDataspaceExecutable(dataSpace, template);
|
58
|
+
if (!executionContext) {
|
59
|
+
throw new IllegalStateError(`Can't find a correpsonding execution context`);
|
60
|
+
}
|
61
|
+
const query = getQueryFromDataspaceExecutable(template, this.graphManagerState);
|
62
|
+
if (!query) {
|
63
|
+
throw new IllegalStateError(`Can't fetch query from dataspace executable`);
|
64
|
+
}
|
65
|
+
this.templateQueryTitle = template.title;
|
56
66
|
let dataSpaceAnalysisResult;
|
57
67
|
try {
|
58
68
|
const project = StoreProjectData.serialization.fromJson(await this.depotServerClient.getProject(this.groupId, this.artifactId));
|
@@ -72,7 +82,7 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
72
82
|
}, dataSpaceAnalysisResult, undefined, undefined, undefined, this.applicationStore.config.options.queryBuilderConfig, sourceInfo);
|
73
83
|
queryBuilderState.setExecutionContext(executionContext);
|
74
84
|
queryBuilderState.propagateExecutionContextChange(executionContext);
|
75
|
-
queryBuilderState.initializeWithQuery(
|
85
|
+
queryBuilderState.initializeWithQuery(query);
|
76
86
|
return queryBuilderState;
|
77
87
|
}
|
78
88
|
getPersistConfiguration(lambda, options) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.js","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.js","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,uBAAuB,EACvB,0BAA0B,GA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EAAE;gBACtB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;gBAClE,MAAM,WAAW,GAAG,IAAI,uBAAuB,EAAE,CAAC;gBAClD,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;gBAC9B,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;gBACpC,OAAO,WAAW,CAAC;YACrB,CAAC,CAAC;SACH,CAAC;QACF,GAAG,CAAC,YAAY,GAAG,CAAC,+BAA+B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACzE,GAAG,CAAC,4BAA4B,GAAG,IAAI,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-query",
|
3
|
-
"version": "13.5.
|
3
|
+
"version": "13.5.40",
|
4
4
|
"description": "Legend Query application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -43,18 +43,18 @@
|
|
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-data-space": "10.3.
|
49
|
-
"@finos/legend-graph": "31.10.
|
50
|
-
"@finos/legend-lego": "1.2.
|
51
|
-
"@finos/legend-query-builder": "4.14.
|
52
|
-
"@finos/legend-server-depot": "6.0.
|
53
|
-
"@finos/legend-shared": "10.0.
|
54
|
-
"@finos/legend-storage": "3.0.
|
46
|
+
"@finos/legend-application": "15.1.25",
|
47
|
+
"@finos/legend-art": "7.1.52",
|
48
|
+
"@finos/legend-extension-dsl-data-space": "10.3.61",
|
49
|
+
"@finos/legend-graph": "31.10.25",
|
50
|
+
"@finos/legend-lego": "1.2.62",
|
51
|
+
"@finos/legend-query-builder": "4.14.82",
|
52
|
+
"@finos/legend-server-depot": "6.0.58",
|
53
|
+
"@finos/legend-shared": "10.0.53",
|
54
|
+
"@finos/legend-storage": "3.0.103",
|
55
55
|
"@testing-library/dom": "10.4.0",
|
56
56
|
"@testing-library/react": "16.0.0",
|
57
|
-
"@types/react": "18.3.
|
57
|
+
"@types/react": "18.3.4",
|
58
58
|
"@types/react-dom": "18.3.0",
|
59
59
|
"mobx": "6.13.1",
|
60
60
|
"mobx-react-lite": "4.0.7",
|
@@ -63,7 +63,7 @@
|
|
63
63
|
"serializr": "3.0.2"
|
64
64
|
},
|
65
65
|
"devDependencies": {
|
66
|
-
"@finos/legend-dev-utils": "2.1.
|
66
|
+
"@finos/legend-dev-utils": "2.1.19",
|
67
67
|
"@jest/globals": "29.7.0",
|
68
68
|
"cross-env": "7.0.3",
|
69
69
|
"eslint": "8.57.0",
|
@@ -15,24 +15,24 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import {
|
18
|
-
QueryProjectCoordinates,
|
19
|
-
extractElementNameFromPath,
|
20
18
|
type Query,
|
21
|
-
type RawLambda,
|
22
19
|
type QuerySearchSpecification,
|
20
|
+
type RawLambda,
|
21
|
+
QueryProjectCoordinates,
|
22
|
+
extractElementNameFromPath,
|
23
23
|
} from '@finos/legend-graph';
|
24
24
|
import {
|
25
25
|
type DepotServerClient,
|
26
26
|
StoreProjectData,
|
27
27
|
} from '@finos/legend-server-depot';
|
28
|
-
import {
|
28
|
+
import { IllegalStateError, uuid } from '@finos/legend-shared';
|
29
29
|
import {
|
30
30
|
type QueryBuilderState,
|
31
31
|
QueryBuilderDataBrowserWorkflow,
|
32
32
|
} from '@finos/legend-query-builder';
|
33
33
|
import {
|
34
|
-
parseGACoordinates,
|
35
34
|
type ProjectGAVCoordinates,
|
35
|
+
parseGACoordinates,
|
36
36
|
} from '@finos/legend-storage';
|
37
37
|
import {
|
38
38
|
QueryBuilderActionConfig_QueryApplication,
|
@@ -42,15 +42,17 @@ import {
|
|
42
42
|
import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
|
43
43
|
import {
|
44
44
|
DSL_DataSpace_getGraphManagerExtension,
|
45
|
-
DataSpaceExecutableTemplate,
|
46
45
|
getDataSpace,
|
47
46
|
retrieveAnalyticsResultCache,
|
47
|
+
getExecutionContextFromDataspaceExecutable,
|
48
|
+
getQueryFromDataspaceExecutable,
|
49
|
+
DataSpacePackageableElementExecutable,
|
48
50
|
} from '@finos/legend-extension-dsl-data-space/graph';
|
49
51
|
import {
|
52
|
+
type DataSpaceInfo,
|
50
53
|
DataSpaceQueryBuilderState,
|
51
54
|
createQueryClassTaggedValue,
|
52
55
|
createQueryDataSpaceTaggedValue,
|
53
|
-
type DataSpaceInfo,
|
54
56
|
} from '@finos/legend-extension-dsl-data-space/application';
|
55
57
|
import { createDataSpaceDepoRepo } from './DataSpaceQueryBuilderHelper.js';
|
56
58
|
|
@@ -93,21 +95,40 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
93
95
|
this.dataSpacePath,
|
94
96
|
this.graphManagerState.graph,
|
95
97
|
);
|
96
|
-
|
97
|
-
|
98
|
-
?.filter(filterByType(DataSpaceExecutableTemplate))
|
99
|
-
.find((executable) => executable.id === this.templateQueryId),
|
100
|
-
`Can't find template query with id '${this.templateQueryId}'`,
|
98
|
+
let template = dataSpace.executables?.find(
|
99
|
+
(executable) => executable.id === this.templateQueryId,
|
101
100
|
);
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
101
|
+
if (!template) {
|
102
|
+
template = dataSpace.executables?.find(
|
103
|
+
(executable) =>
|
104
|
+
executable instanceof DataSpacePackageableElementExecutable &&
|
105
|
+
executable.executable.value.path === this.templateQueryId,
|
106
|
+
);
|
107
|
+
}
|
108
|
+
if (!template) {
|
109
|
+
throw new IllegalStateError(
|
110
|
+
`Can't find template query with id '${this.templateQueryId}'`,
|
111
|
+
);
|
112
|
+
}
|
113
|
+
const executionContext = getExecutionContextFromDataspaceExecutable(
|
114
|
+
dataSpace,
|
115
|
+
template,
|
116
|
+
);
|
117
|
+
if (!executionContext) {
|
118
|
+
throw new IllegalStateError(
|
119
|
+
`Can't find a correpsonding execution context`,
|
120
|
+
);
|
121
|
+
}
|
122
|
+
const query = getQueryFromDataspaceExecutable(
|
123
|
+
template,
|
124
|
+
this.graphManagerState,
|
109
125
|
);
|
110
|
-
|
126
|
+
if (!query) {
|
127
|
+
throw new IllegalStateError(
|
128
|
+
`Can't fetch query from dataspace executable`,
|
129
|
+
);
|
130
|
+
}
|
131
|
+
this.templateQueryTitle = template.title;
|
111
132
|
let dataSpaceAnalysisResult;
|
112
133
|
try {
|
113
134
|
const project = StoreProjectData.serialization.fromJson(
|
@@ -160,7 +181,7 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
160
181
|
);
|
161
182
|
queryBuilderState.setExecutionContext(executionContext);
|
162
183
|
queryBuilderState.propagateExecutionContextChange(executionContext);
|
163
|
-
queryBuilderState.initializeWithQuery(
|
184
|
+
queryBuilderState.initializeWithQuery(query);
|
164
185
|
return queryBuilderState;
|
165
186
|
}
|
166
187
|
|