@finos/legend-application-query 13.6.5 → 13.6.6
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts +9 -1
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js +75 -3
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js.map +1 -1
- package/lib/components/data-cube/ExistingQueryDataCubeViewer.d.ts.map +1 -1
- package/lib/components/data-cube/ExistingQueryDataCubeViewer.js +2 -4
- package/lib/components/data-cube/ExistingQueryDataCubeViewer.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/package.json +9 -9
- package/src/components/__test-utils__/QueryEditorComponentTestUtils.tsx +174 -4
- package/src/components/data-cube/ExistingQueryDataCubeViewer.tsx +2 -11
@@ -14,21 +14,29 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { type RenderResult } from '@testing-library/react';
|
17
|
-
import { type
|
17
|
+
import { type PlainObject, type AbstractPlugin, type AbstractPreset } from '@finos/legend-shared';
|
18
|
+
import { type GraphManagerState, type RawMappingModelCoverageAnalysisResult, RawLambda } from '@finos/legend-graph';
|
18
19
|
import { LegendQueryPluginManager } from '../../application/LegendQueryPluginManager.js';
|
19
20
|
import type { Entity } from '@finos/legend-storage';
|
20
21
|
import { ExistingQueryEditorStore } from '../../stores/QueryEditorStore.js';
|
21
22
|
import type { LegendQueryApplicationStore } from '../../stores/LegendQueryBaseStore.js';
|
22
23
|
import { type QueryBuilderState } from '@finos/legend-query-builder';
|
24
|
+
import { type V1_DataSpaceAnalysisResult } from '@finos/legend-extension-dsl-data-space/graph';
|
23
25
|
export declare const TEST_QUERY_NAME = "MyTestQuery";
|
24
26
|
export declare const TEST__provideMockedQueryEditorStore: (customization?: {
|
25
27
|
mock?: ExistingQueryEditorStore;
|
26
28
|
applicationStore?: LegendQueryApplicationStore;
|
27
29
|
graphManagerState?: GraphManagerState;
|
28
30
|
pluginManager?: LegendQueryPluginManager;
|
31
|
+
extraPlugins?: AbstractPlugin[];
|
32
|
+
extraPresets?: AbstractPreset[];
|
29
33
|
}) => ExistingQueryEditorStore;
|
30
34
|
export declare const TEST__setUpQueryEditor: (MOCK__editorStore: ExistingQueryEditorStore, entities: Entity[], lambda: RawLambda, mappingPath: string, runtimePath: string, rawMappingModelCoverageAnalysisResult?: RawMappingModelCoverageAnalysisResult) => Promise<{
|
31
35
|
renderResult: RenderResult;
|
32
36
|
queryBuilderState: QueryBuilderState;
|
33
37
|
}>;
|
38
|
+
export declare const TEST__setUpDataSpaceExistingQueryEditor: (MOCK__editorStore: ExistingQueryEditorStore, v1_dataspaceAnalyticsResult: PlainObject<V1_DataSpaceAnalysisResult>, dataSpacePath: string, executionContext: string, lambda: RawLambda, mappingPath: string, entities: Entity[]) => Promise<{
|
39
|
+
renderResult: RenderResult;
|
40
|
+
queryBuilderState: QueryBuilderState;
|
41
|
+
}>;
|
34
42
|
//# sourceMappingURL=QueryEditorComponentTestUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryEditorComponentTestUtils.d.ts","sourceRoot":"","sources":["../../../src/components/__test-utils__/QueryEditorComponentTestUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,wBAAwB,CAAC;
|
1
|
+
{"version":3,"file":"QueryEditorComponentTestUtils.d.ts","sourceRoot":"","sources":["../../../src/components/__test-utils__/QueryEditorComponentTestUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,qCAAqC,EAG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ime";
|
|
15
15
|
* limitations under the License.
|
16
16
|
*/
|
17
17
|
import { render, waitFor } from '@testing-library/react';
|
18
|
-
import { guaranteeNonNullable } from '@finos/legend-shared';
|
18
|
+
import { guaranteeNonNullable, } from '@finos/legend-shared';
|
19
19
|
import { createMock, createSpy } from '@finos/legend-shared/test';
|
20
|
-
import { Query, LightQuery, RawLambda, PackageableElementExplicitReference, QueryExplicitExecutionContext, } from '@finos/legend-graph';
|
20
|
+
import { Query, LightQuery, RawLambda, PackageableElementExplicitReference, QueryExplicitExecutionContext, QueryDataSpaceExecutionContext, } from '@finos/legend-graph';
|
21
21
|
import { DepotServerClient } from '@finos/legend-server-depot';
|
22
22
|
import { ApplicationStoreProvider, ApplicationStore, } from '@finos/legend-application';
|
23
23
|
import { TEST__getTestLegendQueryApplicationConfig } from '../../stores/__test-utils__/LegendQueryApplicationTestUtils.js';
|
@@ -30,11 +30,18 @@ import { TEST__BrowserEnvironmentProvider } from '@finos/legend-application/test
|
|
30
30
|
import { Core_LegendQueryApplicationPlugin } from '../Core_LegendQueryApplicationPlugin.js';
|
31
31
|
import { Route, Routes } from '@finos/legend-application/browser';
|
32
32
|
import { generateExistingQueryEditorRoute, LEGEND_QUERY_ROUTE_PATTERN, } from '../../__lib__/LegendQueryNavigation.js';
|
33
|
+
import { DSL_DataSpace_getGraphManagerExtension, } from '@finos/legend-extension-dsl-data-space/graph';
|
33
34
|
const TEST_QUERY_ID = 'test-query-id';
|
34
35
|
export const TEST_QUERY_NAME = 'MyTestQuery';
|
35
36
|
export const TEST__provideMockedQueryEditorStore = (customization) => {
|
36
37
|
const pluginManager = customization?.pluginManager ?? LegendQueryPluginManager.create();
|
37
|
-
pluginManager
|
38
|
+
pluginManager
|
39
|
+
.usePlugins([
|
40
|
+
new Core_LegendQueryApplicationPlugin(),
|
41
|
+
...(customization?.extraPlugins ?? []),
|
42
|
+
])
|
43
|
+
.usePresets([...(customization?.extraPresets ?? [])])
|
44
|
+
.install();
|
38
45
|
const applicationStore = customization?.applicationStore ??
|
39
46
|
new ApplicationStore(TEST__getTestLegendQueryApplicationConfig(), pluginManager);
|
40
47
|
const value = customization?.mock ??
|
@@ -101,4 +108,69 @@ export const TEST__setUpQueryEditor = async (MOCK__editorStore, entities, lambda
|
|
101
108
|
queryBuilderState: guaranteeNonNullable(MOCK__editorStore.queryBuilderState, `Query builder state should have been initialized`),
|
102
109
|
};
|
103
110
|
};
|
111
|
+
export const TEST__setUpDataSpaceExistingQueryEditor = async (MOCK__editorStore, v1_dataspaceAnalyticsResult, dataSpacePath, executionContext, lambda, mappingPath, entities) => {
|
112
|
+
const projectData = {
|
113
|
+
id: 'test-id',
|
114
|
+
groupId: 'test.group',
|
115
|
+
artifactId: 'test-artifact',
|
116
|
+
projectId: 'test-project-id',
|
117
|
+
versions: ['0.0.0'],
|
118
|
+
latestVersion: '0.0.0',
|
119
|
+
};
|
120
|
+
const lightQuery = new LightQuery();
|
121
|
+
lightQuery.name = TEST_QUERY_NAME;
|
122
|
+
lightQuery.id = TEST_QUERY_ID;
|
123
|
+
lightQuery.versionId = '0.0.0';
|
124
|
+
lightQuery.groupId = 'test.group';
|
125
|
+
lightQuery.artifactId = 'test-artifact';
|
126
|
+
lightQuery.owner = 'test-artifact';
|
127
|
+
lightQuery.isCurrentUserQuery = true;
|
128
|
+
const graphManagerState = MOCK__editorStore.graphManagerState;
|
129
|
+
await graphManagerState.graphManager.initialize({
|
130
|
+
env: 'test',
|
131
|
+
tabSize: 2,
|
132
|
+
clientConfig: {},
|
133
|
+
});
|
134
|
+
await graphManagerState.initializeSystem();
|
135
|
+
await graphManagerState.graphManager.buildGraph(graphManagerState.graph, entities, graphManagerState.graphBuildState);
|
136
|
+
const query = new Query();
|
137
|
+
query.name = lightQuery.name;
|
138
|
+
query.id = lightQuery.id;
|
139
|
+
query.versionId = lightQuery.versionId;
|
140
|
+
query.groupId = lightQuery.groupId;
|
141
|
+
query.artifactId = lightQuery.artifactId;
|
142
|
+
query.owner = lightQuery.owner;
|
143
|
+
query.isCurrentUserQuery = lightQuery.isCurrentUserQuery;
|
144
|
+
const execContext = new QueryDataSpaceExecutionContext();
|
145
|
+
execContext.dataSpacePath = dataSpacePath;
|
146
|
+
execContext.executionKey = executionContext;
|
147
|
+
query.executionContext = execContext;
|
148
|
+
query.content = 'some content';
|
149
|
+
createSpy(MOCK__editorStore.depotServerClient, 'getProject').mockResolvedValue(projectData);
|
150
|
+
createSpy(MOCK__editorStore.depotServerClient, 'getEntities').mockResolvedValue([]);
|
151
|
+
createSpy(MOCK__editorStore.depotServerClient, 'getIndexedDependencyEntities').mockResolvedValue(new Map());
|
152
|
+
createSpy(MOCK__editorStore.depotServerClient, 'getEntitiesByClassifier').mockResolvedValue([]);
|
153
|
+
createSpy(graphManagerState.graphManager, 'getLightQuery').mockResolvedValue(lightQuery);
|
154
|
+
createSpy(graphManagerState.graphManager, 'pureCodeToLambda').mockResolvedValue(new RawLambda(lambda.parameters, lambda.body));
|
155
|
+
createSpy(graphManagerState.graphManager, 'lambdaToPureCode').mockResolvedValue('');
|
156
|
+
createSpy(graphManagerState.graphManager, 'getQuery').mockResolvedValue(query);
|
157
|
+
createSpy(MOCK__editorStore.depotServerClient, 'getGenerationContentByPath').mockResolvedValue('');
|
158
|
+
createSpy(graphManagerState.graphManager, 'surveyDatasets').mockResolvedValue([]);
|
159
|
+
createSpy(graphManagerState.graphManager, 'checkDatasetEntitlements').mockResolvedValue([]);
|
160
|
+
const graphManagerExtension = DSL_DataSpace_getGraphManagerExtension(graphManagerState.graphManager);
|
161
|
+
const dataspaceAnalyticsResult = await graphManagerExtension.buildDataSpaceAnalytics(v1_dataspaceAnalyticsResult, graphManagerState.graphManager.pluginManager.getPureProtocolProcessorPlugins());
|
162
|
+
createSpy(graphManagerExtension, 'analyzeDataSpace').mockResolvedValue(dataspaceAnalyticsResult);
|
163
|
+
const mappingAnalyticsResult = dataspaceAnalyticsResult.mappingToMappingCoverageResult?.get(mappingPath);
|
164
|
+
if (mappingAnalyticsResult) {
|
165
|
+
createSpy(graphManagerState.graphManager, 'analyzeMappingModelCoverage').mockResolvedValue(mappingAnalyticsResult);
|
166
|
+
}
|
167
|
+
MOCK__editorStore.buildGraph = createMock();
|
168
|
+
graphManagerState.graphManager.initialize = createMock();
|
169
|
+
const renderResult = render(_jsx(ApplicationStoreProvider, { store: MOCK__editorStore.applicationStore, children: _jsx(TEST__BrowserEnvironmentProvider, { initialEntries: [generateExistingQueryEditorRoute(lightQuery.id)], children: _jsx(LegendQueryFrameworkProvider, { children: _jsx(Routes, { children: _jsx(Route, { path: LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY, element: _jsx(ExistingQueryEditor, {}) }) }) }) }) }));
|
170
|
+
await waitFor(() => renderResult.getByTestId(QUERY_BUILDER_TEST_ID.QUERY_BUILDER));
|
171
|
+
return {
|
172
|
+
renderResult,
|
173
|
+
queryBuilderState: guaranteeNonNullable(MOCK__editorStore.queryBuilderState, `Query builder state should have been initialized`),
|
174
|
+
};
|
175
|
+
};
|
104
176
|
//# sourceMappingURL=QueryEditorComponentTestUtils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryEditorComponentTestUtils.js","sourceRoot":"","sources":["../../../src/components/__test-utils__/QueryEditorComponentTestUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAqB,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,
|
1
|
+
{"version":3,"file":"QueryEditorComponentTestUtils.js","sourceRoot":"","sources":["../../../src/components/__test-utils__/QueryEditorComponentTestUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAqB,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAIL,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CA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AAE,CAAC;IAEzD,MAAM,YAAY,GAAG,MAAM,CACzB,KAAC,wBAAwB,IAAC,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,YACjE,KAAC,gCAAgC,IAC/B,cAAc,EAAE,CAAC,gCAAgC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,YAEjE,KAAC,4BAA4B,cAC3B,KAAC,MAAM,cACL,KAAC,KAAK,IACJ,IAAI,EAAE,0BAA0B,CAAC,mBAAmB,EACpD,OAAO,EAAE,KAAC,mBAAmB,KAAG,GAChC,GACK,GACoB,GACE,GACV,CAC5B,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,EAAE,CACjB,YAAY,CAAC,WAAW,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAC9D,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,iBAAiB,EAAE,oBAAoB,CACrC,iBAAiB,CAAC,iBAAiB,EACnC,kDAAkD,CACnD;KACF,CAAC;AACJ,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExistingQueryDataCubeViewer.d.ts","sourceRoot":"","sources":["../../../src/components/data-cube/ExistingQueryDataCubeViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
1
|
+
{"version":3,"file":"ExistingQueryDataCubeViewer.d.ts","sourceRoot":"","sources":["../../../src/components/data-cube/ExistingQueryDataCubeViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH,eAAO,MAAM,eAAe;;CAY1B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;CAWtC,CAAC"}
|
@@ -21,8 +21,7 @@ import { useParams } from '@finos/legend-application/browser';
|
|
21
21
|
import { ExistingQueryDataCubeEditorStoreProvider, useExistingQueryDataCubeEditorStore, } from './ExistingQueryEditorStoreProviderProvider.js';
|
22
22
|
import { useEffect } from 'react';
|
23
23
|
import { flowResult } from 'mobx';
|
24
|
-
import { DataCube
|
25
|
-
import { QueryBuilderDataCubeApplicationEngine } from '@finos/legend-query-builder';
|
24
|
+
import { DataCube } from '@finos/legend-data-cube';
|
26
25
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
27
26
|
export const DataCubeWrapper = observer(() => {
|
28
27
|
const applicationStore = useApplicationStore();
|
@@ -33,8 +32,7 @@ export const DataCubeWrapper = observer(() => {
|
|
33
32
|
if (!store.engine) {
|
34
33
|
return null;
|
35
34
|
}
|
36
|
-
|
37
|
-
return (_jsx(DataCubeProvider, { application: _appEngine, engine: store.engine, children: _jsx(DataCube, {}) }));
|
35
|
+
return _jsx(DataCube, { engine: store.engine });
|
38
36
|
});
|
39
37
|
export const ExistingQueryDataCubeViewer = observer(() => {
|
40
38
|
const params = useParams();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExistingQueryDataCubeViewer.js","sourceRoot":"","sources":["../../../src/components/data-cube/ExistingQueryDataCubeViewer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,gCAAgC,GAEjC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EACL,wCAAwC,EACxC,mCAAmC,GACpC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"ExistingQueryDataCubeViewer.js","sourceRoot":"","sources":["../../../src/components/data-cube/ExistingQueryDataCubeViewer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ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ACJ,CAAC,CAAC,CAAC"}
|
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-query",
|
3
|
-
"version": "13.6.
|
3
|
+
"version": "13.6.6",
|
4
4
|
"description": "Legend Query application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -43,14 +43,14 @@
|
|
43
43
|
"test:watch": "jest --watch"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@finos/legend-application": "16.0.
|
47
|
-
"@finos/legend-art": "7.1.
|
48
|
-
"@finos/legend-code-editor": "2.0.
|
49
|
-
"@finos/legend-data-cube": "0.0.
|
50
|
-
"@finos/legend-extension-dsl-data-space": "10.3.
|
51
|
-
"@finos/legend-graph": "31.10.
|
52
|
-
"@finos/legend-lego": "2.0.
|
53
|
-
"@finos/legend-query-builder": "4.15.
|
46
|
+
"@finos/legend-application": "16.0.4",
|
47
|
+
"@finos/legend-art": "7.1.63",
|
48
|
+
"@finos/legend-code-editor": "2.0.6",
|
49
|
+
"@finos/legend-data-cube": "0.0.11",
|
50
|
+
"@finos/legend-extension-dsl-data-space": "10.3.83",
|
51
|
+
"@finos/legend-graph": "31.10.40",
|
52
|
+
"@finos/legend-lego": "2.0.8",
|
53
|
+
"@finos/legend-query-builder": "4.15.5",
|
54
54
|
"@finos/legend-server-depot": "6.0.63",
|
55
55
|
"@finos/legend-shared": "10.0.57",
|
56
56
|
"@finos/legend-storage": "3.0.107",
|
@@ -15,16 +15,22 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { type RenderResult, render, waitFor } from '@testing-library/react';
|
18
|
-
import {
|
18
|
+
import {
|
19
|
+
type PlainObject,
|
20
|
+
type AbstractPlugin,
|
21
|
+
type AbstractPreset,
|
22
|
+
guaranteeNonNullable,
|
23
|
+
} from '@finos/legend-shared';
|
19
24
|
import { createMock, createSpy } from '@finos/legend-shared/test';
|
20
25
|
import {
|
21
26
|
type GraphManagerState,
|
27
|
+
type RawMappingModelCoverageAnalysisResult,
|
22
28
|
Query,
|
23
29
|
LightQuery,
|
24
30
|
RawLambda,
|
25
31
|
PackageableElementExplicitReference,
|
26
|
-
type RawMappingModelCoverageAnalysisResult,
|
27
32
|
QueryExplicitExecutionContext,
|
33
|
+
QueryDataSpaceExecutionContext,
|
28
34
|
} from '@finos/legend-graph';
|
29
35
|
import { DepotServerClient } from '@finos/legend-server-depot';
|
30
36
|
import {
|
@@ -34,7 +40,7 @@ import {
|
|
34
40
|
import { TEST__getTestLegendQueryApplicationConfig } from '../../stores/__test-utils__/LegendQueryApplicationTestUtils.js';
|
35
41
|
import { LegendQueryPluginManager } from '../../application/LegendQueryPluginManager.js';
|
36
42
|
import { ExistingQueryEditor } from '../QueryEditor.js';
|
37
|
-
import type { Entity } from '@finos/legend-storage';
|
43
|
+
import type { EntitiesWithOrigin, Entity } from '@finos/legend-storage';
|
38
44
|
import { ExistingQueryEditorStore } from '../../stores/QueryEditorStore.js';
|
39
45
|
import type { LegendQueryApplicationStore } from '../../stores/LegendQueryBaseStore.js';
|
40
46
|
import {
|
@@ -49,6 +55,10 @@ import {
|
|
49
55
|
generateExistingQueryEditorRoute,
|
50
56
|
LEGEND_QUERY_ROUTE_PATTERN,
|
51
57
|
} from '../../__lib__/LegendQueryNavigation.js';
|
58
|
+
import {
|
59
|
+
type V1_DataSpaceAnalysisResult,
|
60
|
+
DSL_DataSpace_getGraphManagerExtension,
|
61
|
+
} from '@finos/legend-extension-dsl-data-space/graph';
|
52
62
|
|
53
63
|
const TEST_QUERY_ID = 'test-query-id';
|
54
64
|
export const TEST_QUERY_NAME = 'MyTestQuery';
|
@@ -58,10 +68,18 @@ export const TEST__provideMockedQueryEditorStore = (customization?: {
|
|
58
68
|
applicationStore?: LegendQueryApplicationStore;
|
59
69
|
graphManagerState?: GraphManagerState;
|
60
70
|
pluginManager?: LegendQueryPluginManager;
|
71
|
+
extraPlugins?: AbstractPlugin[];
|
72
|
+
extraPresets?: AbstractPreset[];
|
61
73
|
}): ExistingQueryEditorStore => {
|
62
74
|
const pluginManager =
|
63
75
|
customization?.pluginManager ?? LegendQueryPluginManager.create();
|
64
|
-
pluginManager
|
76
|
+
pluginManager
|
77
|
+
.usePlugins([
|
78
|
+
new Core_LegendQueryApplicationPlugin(),
|
79
|
+
...(customization?.extraPlugins ?? []),
|
80
|
+
])
|
81
|
+
.usePresets([...(customization?.extraPresets ?? [])])
|
82
|
+
.install();
|
65
83
|
const applicationStore =
|
66
84
|
customization?.applicationStore ??
|
67
85
|
new ApplicationStore(
|
@@ -201,3 +219,155 @@ export const TEST__setUpQueryEditor = async (
|
|
201
219
|
),
|
202
220
|
};
|
203
221
|
};
|
222
|
+
|
223
|
+
export const TEST__setUpDataSpaceExistingQueryEditor = async (
|
224
|
+
MOCK__editorStore: ExistingQueryEditorStore,
|
225
|
+
v1_dataspaceAnalyticsResult: PlainObject<V1_DataSpaceAnalysisResult>,
|
226
|
+
dataSpacePath: string,
|
227
|
+
executionContext: string,
|
228
|
+
lambda: RawLambda,
|
229
|
+
mappingPath: string,
|
230
|
+
entities: Entity[],
|
231
|
+
): Promise<{
|
232
|
+
renderResult: RenderResult;
|
233
|
+
queryBuilderState: QueryBuilderState;
|
234
|
+
}> => {
|
235
|
+
const projectData = {
|
236
|
+
id: 'test-id',
|
237
|
+
groupId: 'test.group',
|
238
|
+
artifactId: 'test-artifact',
|
239
|
+
projectId: 'test-project-id',
|
240
|
+
versions: ['0.0.0'],
|
241
|
+
latestVersion: '0.0.0',
|
242
|
+
};
|
243
|
+
|
244
|
+
const lightQuery = new LightQuery();
|
245
|
+
lightQuery.name = TEST_QUERY_NAME;
|
246
|
+
lightQuery.id = TEST_QUERY_ID;
|
247
|
+
lightQuery.versionId = '0.0.0';
|
248
|
+
lightQuery.groupId = 'test.group';
|
249
|
+
lightQuery.artifactId = 'test-artifact';
|
250
|
+
lightQuery.owner = 'test-artifact';
|
251
|
+
lightQuery.isCurrentUserQuery = true;
|
252
|
+
|
253
|
+
const graphManagerState = MOCK__editorStore.graphManagerState;
|
254
|
+
|
255
|
+
await graphManagerState.graphManager.initialize({
|
256
|
+
env: 'test',
|
257
|
+
tabSize: 2,
|
258
|
+
clientConfig: {},
|
259
|
+
});
|
260
|
+
|
261
|
+
await graphManagerState.initializeSystem();
|
262
|
+
await graphManagerState.graphManager.buildGraph(
|
263
|
+
graphManagerState.graph,
|
264
|
+
entities,
|
265
|
+
graphManagerState.graphBuildState,
|
266
|
+
);
|
267
|
+
|
268
|
+
const query = new Query();
|
269
|
+
query.name = lightQuery.name;
|
270
|
+
query.id = lightQuery.id;
|
271
|
+
query.versionId = lightQuery.versionId;
|
272
|
+
query.groupId = lightQuery.groupId;
|
273
|
+
query.artifactId = lightQuery.artifactId;
|
274
|
+
query.owner = lightQuery.owner;
|
275
|
+
query.isCurrentUserQuery = lightQuery.isCurrentUserQuery;
|
276
|
+
const execContext = new QueryDataSpaceExecutionContext();
|
277
|
+
execContext.dataSpacePath = dataSpacePath;
|
278
|
+
execContext.executionKey = executionContext;
|
279
|
+
query.executionContext = execContext;
|
280
|
+
query.content = 'some content';
|
281
|
+
createSpy(
|
282
|
+
MOCK__editorStore.depotServerClient,
|
283
|
+
'getProject',
|
284
|
+
).mockResolvedValue(projectData);
|
285
|
+
createSpy(
|
286
|
+
MOCK__editorStore.depotServerClient,
|
287
|
+
'getEntities',
|
288
|
+
).mockResolvedValue([]);
|
289
|
+
createSpy(
|
290
|
+
MOCK__editorStore.depotServerClient,
|
291
|
+
'getIndexedDependencyEntities',
|
292
|
+
).mockResolvedValue(new Map<string, EntitiesWithOrigin>());
|
293
|
+
createSpy(
|
294
|
+
MOCK__editorStore.depotServerClient,
|
295
|
+
'getEntitiesByClassifier',
|
296
|
+
).mockResolvedValue([]);
|
297
|
+
createSpy(graphManagerState.graphManager, 'getLightQuery').mockResolvedValue(
|
298
|
+
lightQuery,
|
299
|
+
);
|
300
|
+
createSpy(
|
301
|
+
graphManagerState.graphManager,
|
302
|
+
'pureCodeToLambda',
|
303
|
+
).mockResolvedValue(new RawLambda(lambda.parameters, lambda.body));
|
304
|
+
createSpy(
|
305
|
+
graphManagerState.graphManager,
|
306
|
+
'lambdaToPureCode',
|
307
|
+
).mockResolvedValue('');
|
308
|
+
createSpy(graphManagerState.graphManager, 'getQuery').mockResolvedValue(
|
309
|
+
query,
|
310
|
+
);
|
311
|
+
createSpy(
|
312
|
+
MOCK__editorStore.depotServerClient,
|
313
|
+
'getGenerationContentByPath',
|
314
|
+
).mockResolvedValue('');
|
315
|
+
createSpy(graphManagerState.graphManager, 'surveyDatasets').mockResolvedValue(
|
316
|
+
[],
|
317
|
+
);
|
318
|
+
createSpy(
|
319
|
+
graphManagerState.graphManager,
|
320
|
+
'checkDatasetEntitlements',
|
321
|
+
).mockResolvedValue([]);
|
322
|
+
|
323
|
+
const graphManagerExtension = DSL_DataSpace_getGraphManagerExtension(
|
324
|
+
graphManagerState.graphManager,
|
325
|
+
);
|
326
|
+
const dataspaceAnalyticsResult =
|
327
|
+
await graphManagerExtension.buildDataSpaceAnalytics(
|
328
|
+
v1_dataspaceAnalyticsResult,
|
329
|
+
graphManagerState.graphManager.pluginManager.getPureProtocolProcessorPlugins(),
|
330
|
+
);
|
331
|
+
createSpy(graphManagerExtension, 'analyzeDataSpace').mockResolvedValue(
|
332
|
+
dataspaceAnalyticsResult,
|
333
|
+
);
|
334
|
+
const mappingAnalyticsResult =
|
335
|
+
dataspaceAnalyticsResult.mappingToMappingCoverageResult?.get(mappingPath);
|
336
|
+
if (mappingAnalyticsResult) {
|
337
|
+
createSpy(
|
338
|
+
graphManagerState.graphManager,
|
339
|
+
'analyzeMappingModelCoverage',
|
340
|
+
).mockResolvedValue(mappingAnalyticsResult);
|
341
|
+
}
|
342
|
+
|
343
|
+
MOCK__editorStore.buildGraph = createMock();
|
344
|
+
graphManagerState.graphManager.initialize = createMock();
|
345
|
+
|
346
|
+
const renderResult = render(
|
347
|
+
<ApplicationStoreProvider store={MOCK__editorStore.applicationStore}>
|
348
|
+
<TEST__BrowserEnvironmentProvider
|
349
|
+
initialEntries={[generateExistingQueryEditorRoute(lightQuery.id)]}
|
350
|
+
>
|
351
|
+
<LegendQueryFrameworkProvider>
|
352
|
+
<Routes>
|
353
|
+
<Route
|
354
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY}
|
355
|
+
element={<ExistingQueryEditor />}
|
356
|
+
/>
|
357
|
+
</Routes>
|
358
|
+
</LegendQueryFrameworkProvider>
|
359
|
+
</TEST__BrowserEnvironmentProvider>
|
360
|
+
</ApplicationStoreProvider>,
|
361
|
+
);
|
362
|
+
await waitFor(() =>
|
363
|
+
renderResult.getByTestId(QUERY_BUILDER_TEST_ID.QUERY_BUILDER),
|
364
|
+
);
|
365
|
+
|
366
|
+
return {
|
367
|
+
renderResult,
|
368
|
+
queryBuilderState: guaranteeNonNullable(
|
369
|
+
MOCK__editorStore.queryBuilderState,
|
370
|
+
`Query builder state should have been initialized`,
|
371
|
+
),
|
372
|
+
};
|
373
|
+
};
|
@@ -27,8 +27,7 @@ import {
|
|
27
27
|
} from './ExistingQueryEditorStoreProviderProvider.js';
|
28
28
|
import { useEffect } from 'react';
|
29
29
|
import { flowResult } from 'mobx';
|
30
|
-
import { DataCube
|
31
|
-
import { QueryBuilderDataCubeApplicationEngine } from '@finos/legend-query-builder';
|
30
|
+
import { DataCube } from '@finos/legend-data-cube';
|
32
31
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
33
32
|
|
34
33
|
export const DataCubeWrapper = observer(() => {
|
@@ -42,15 +41,7 @@ export const DataCubeWrapper = observer(() => {
|
|
42
41
|
if (!store.engine) {
|
43
42
|
return null;
|
44
43
|
}
|
45
|
-
|
46
|
-
applicationStore,
|
47
|
-
);
|
48
|
-
|
49
|
-
return (
|
50
|
-
<DataCubeProvider application={_appEngine} engine={store.engine}>
|
51
|
-
<DataCube />
|
52
|
-
</DataCubeProvider>
|
53
|
-
);
|
44
|
+
return <DataCube engine={store.engine} />;
|
54
45
|
});
|
55
46
|
|
56
47
|
export const ExistingQueryDataCubeViewer = observer(() => {
|