@finos/legend-application-query 13.4.21 → 13.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.d.ts +1 -1
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.js +4 -4
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.d.ts +1 -0
- package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.js +1 -0
- package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +20 -11
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
- package/lib/components/LegendQueryWebApplication.js +15 -14
- package/lib/components/LegendQueryWebApplication.js.map +1 -1
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +2 -1
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/data-space/DataSpaceQueryCreator.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQueryCreator.js +25 -8
- package/lib/components/data-space/DataSpaceQueryCreator.js.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts +0 -3
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.js +2 -12
- package/lib/components/data-space/DataSpaceQuerySetup.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +4 -3
- package/lib/stores/QueryEditorStore.d.ts +3 -4
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +54 -62
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.d.ts +23 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.d.ts.map +1 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js +39 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js.map +1 -0
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts +35 -12
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js +189 -86
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts +3 -20
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.js +8 -81
- package/lib/stores/data-space/DataSpaceQuerySetupState.js.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +8 -8
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/package.json +14 -13
- package/src/__lib__/DSL_DataSpace_LegendQueryNavigation.ts +6 -4
- package/src/__lib__/LegendQueryNavigation.ts +1 -0
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +25 -17
- package/src/components/LegendQueryWebApplication.tsx +30 -27
- package/src/components/QueryEditor.tsx +2 -1
- package/src/components/data-space/DataSpaceQueryCreator.tsx +36 -18
- package/src/components/data-space/DataSpaceQuerySetup.tsx +2 -36
- package/src/index.ts +4 -2
- package/src/stores/QueryEditorStore.ts +109 -157
- package/src/stores/data-space/DataSpaceQueryBuilderHelper.ts +107 -0
- package/src/stores/data-space/DataSpaceQueryCreatorStore.ts +302 -173
- package/src/stores/data-space/DataSpaceQuerySetupState.ts +8 -156
- package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +11 -19
- package/tsconfig.json +1 -0
@@ -17,9 +17,10 @@ import { extractElementNameFromPath, } from '@finos/legend-graph';
|
|
17
17
|
import { StoreProjectData, } from '@finos/legend-server-depot';
|
18
18
|
import { filterByType, guaranteeNonNullable, uuid } from '@finos/legend-shared';
|
19
19
|
import { QueryBuilderDataBrowserWorkflow, } from '@finos/legend-query-builder';
|
20
|
-
import { QueryBuilderActionConfig_QueryApplication, QueryEditorStore,
|
20
|
+
import { QueryBuilderActionConfig_QueryApplication, QueryEditorStore, } from '../QueryEditorStore.js';
|
21
21
|
import { DSL_DataSpace_getGraphManagerExtension, DataSpaceExecutableTemplate, getDataSpace, retrieveAnalyticsResultCache, } from '@finos/legend-extension-dsl-data-space/graph';
|
22
|
-
import {
|
22
|
+
import { DataSpaceQueryBuilderState, createQueryClassTaggedValue, } from '@finos/legend-extension-dsl-data-space/application';
|
23
|
+
import { createDataSpaceDepoRepo } from './DataSpaceQueryBuilderHelper.js';
|
23
24
|
export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
24
25
|
groupId;
|
25
26
|
artifactId;
|
@@ -59,16 +60,15 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
59
60
|
catch {
|
60
61
|
// do nothing
|
61
62
|
}
|
62
|
-
const projectInfo = new DataSpaceProjectInfo(this.groupId, this.artifactId, this.versionId, createViewProjectHandler(this.applicationStore), createViewSDLCProjectHandler(this.applicationStore, this.depotServerClient));
|
63
63
|
const sourceInfo = {
|
64
|
-
groupId:
|
65
|
-
artifactId:
|
66
|
-
versionId:
|
64
|
+
groupId: this.groupId,
|
65
|
+
artifactId: this.artifactId,
|
66
|
+
versionId: this.versionId,
|
67
67
|
dataSpace: dataSpace.path,
|
68
68
|
};
|
69
|
-
const queryBuilderState = new DataSpaceQueryBuilderState(this.applicationStore, this.graphManagerState,
|
69
|
+
const queryBuilderState = new DataSpaceQueryBuilderState(this.applicationStore, this.graphManagerState, QueryBuilderDataBrowserWorkflow.INSTANCE, new QueryBuilderActionConfig_QueryApplication(this), dataSpace, executionContext, createDataSpaceDepoRepo(this, this.groupId, this.artifactId, this.versionId, undefined), (dataSpaceInfo) => {
|
70
70
|
this.applicationStore.notificationService.notifyWarning(`Can't switch data space to visit current template query`);
|
71
|
-
},
|
71
|
+
}, dataSpaceAnalysisResult, undefined, undefined, undefined, this.applicationStore.config.options.queryBuilderConfig, sourceInfo);
|
72
72
|
queryBuilderState.setExecutionContext(executionContext);
|
73
73
|
queryBuilderState.propagateExecutionContextChange(executionContext);
|
74
74
|
queryBuilderState.initializeWithQuery(dataSpaceExecutableTemplate.query);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.js","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,GAG3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAEL,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,yCAAyC,EACzC,gBAAgB,
|
1
|
+
{"version":3,"file":"DataSpaceTemplateQueryCreatorStore.js","sourceRoot":"","sources":["../../../src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,GAG3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAEL,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,OAA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;gBACjC,IAAI,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC;oBAClC,KAAK,CAAC,YAAY,GAAG;wBACnB,2BAA2B,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC;qBAC/D,CAAC;gBACJ,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-query",
|
3
|
-
"version": "13.
|
3
|
+
"version": "13.5.0",
|
4
4
|
"description": "Legend Query application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -43,16 +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-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.
|
55
|
-
"@testing-library/
|
46
|
+
"@finos/legend-application": "15.1.6",
|
47
|
+
"@finos/legend-art": "7.1.35",
|
48
|
+
"@finos/legend-extension-dsl-data-space": "10.3.21",
|
49
|
+
"@finos/legend-graph": "31.10.3",
|
50
|
+
"@finos/legend-lego": "1.2.36",
|
51
|
+
"@finos/legend-query-builder": "4.14.45",
|
52
|
+
"@finos/legend-server-depot": "6.0.44",
|
53
|
+
"@finos/legend-shared": "10.0.39",
|
54
|
+
"@finos/legend-storage": "3.0.89",
|
55
|
+
"@testing-library/dom": "10.1.0",
|
56
|
+
"@testing-library/react": "16.0.0",
|
56
57
|
"@types/react": "18.3.3",
|
57
58
|
"@types/react-dom": "18.3.0",
|
58
59
|
"mobx": "6.12.3",
|
@@ -62,14 +63,14 @@
|
|
62
63
|
"serializr": "3.0.2"
|
63
64
|
},
|
64
65
|
"devDependencies": {
|
65
|
-
"@finos/legend-dev-utils": "2.1.
|
66
|
+
"@finos/legend-dev-utils": "2.1.7",
|
66
67
|
"@jest/globals": "29.7.0",
|
67
68
|
"cross-env": "7.0.3",
|
68
69
|
"eslint": "8.57.0",
|
69
70
|
"jest": "29.7.0",
|
70
71
|
"npm-run-all": "4.1.5",
|
71
72
|
"rimraf": "5.0.7",
|
72
|
-
"sass": "1.77.
|
73
|
+
"sass": "1.77.4",
|
73
74
|
"typescript": "5.4.5"
|
74
75
|
},
|
75
76
|
"peerDependencies": {
|
@@ -59,7 +59,7 @@ export type DataSpaceQueryEditorQueryParams = {
|
|
59
59
|
[DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN.CLASS_PATH]?: string | undefined;
|
60
60
|
};
|
61
61
|
|
62
|
-
export const
|
62
|
+
export const LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN = Object.freeze({
|
63
63
|
SETUP: `/dataspace`,
|
64
64
|
CREATE: `/dataspace/:${DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV}/:${DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH}/:${DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.EXECUTION_CONTEXT}/:${DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.RUNTIME_PATH}?`,
|
65
65
|
TEMPLATE_QUERY: `/dataspace/:${DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV}/:${DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH}/:${DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.TEMPLATE}/:${DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.TEMPLATE_QUERY_ID}`,
|
@@ -67,7 +67,7 @@ export const DATA_SPACE_QUERY_ROUTE_PATTERN = Object.freeze({
|
|
67
67
|
|
68
68
|
export const generateDataSpaceQuerySetupRoute = (): string =>
|
69
69
|
generatePath(
|
70
|
-
generateExtensionUrlPattern(
|
70
|
+
generateExtensionUrlPattern(LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP),
|
71
71
|
{},
|
72
72
|
);
|
73
73
|
|
@@ -82,7 +82,7 @@ export const generateDataSpaceQueryCreatorRoute = (
|
|
82
82
|
): string =>
|
83
83
|
addQueryParametersToUrl(
|
84
84
|
generatePath(
|
85
|
-
generateExtensionUrlPattern(
|
85
|
+
generateExtensionUrlPattern(LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.CREATE),
|
86
86
|
{
|
87
87
|
[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV]:
|
88
88
|
generateGAVCoordinates(groupId, artifactId, versionId),
|
@@ -109,7 +109,9 @@ export const generateDataSpaceTemplateQueryCreatorRoute = (
|
|
109
109
|
templateQueryId: string,
|
110
110
|
): string =>
|
111
111
|
generatePath(
|
112
|
-
generateExtensionUrlPattern(
|
112
|
+
generateExtensionUrlPattern(
|
113
|
+
LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.TEMPLATE_QUERY,
|
114
|
+
),
|
113
115
|
{
|
114
116
|
[DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV]:
|
115
117
|
generateGAVCoordinates(groupId, artifactId, versionId),
|
@@ -74,7 +74,6 @@ import {
|
|
74
74
|
import {
|
75
75
|
ExistingQueryEditorStore,
|
76
76
|
QueryBuilderActionConfig_QueryApplication,
|
77
|
-
createViewSDLCProjectHandler,
|
78
77
|
} from '../stores/QueryEditorStore.js';
|
79
78
|
import {
|
80
79
|
DataSpaceQueryBuilderState,
|
@@ -87,6 +86,7 @@ import { buildUrl } from '@finos/legend-shared';
|
|
87
86
|
import { parseProjectIdentifier } from '@finos/legend-storage';
|
88
87
|
import { QueryEditorExistingQueryHeader } from './QueryEditor.js';
|
89
88
|
import { DataSpaceTemplateQueryCreatorStore } from '../stores/data-space/DataSpaceTemplateQueryCreatorStore.js';
|
89
|
+
import { createViewSDLCProjectHandler } from '../stores/data-space/DataSpaceQueryBuilderHelper.js';
|
90
90
|
|
91
91
|
export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlugin {
|
92
92
|
static NAME = packageJson.extensions.applicationQueryPlugin;
|
@@ -371,13 +371,16 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
371
371
|
LegendQueryTelemetryHelper.logEvent_QueryViewSdlcProjectLaunched(
|
372
372
|
editorStore.applicationStore.telemetryService,
|
373
373
|
);
|
374
|
-
const
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
374
|
+
const projectInfo = editorStore.getProjectInfo();
|
375
|
+
if (projectInfo) {
|
376
|
+
const { groupId, artifactId } = projectInfo;
|
377
|
+
createViewSDLCProjectHandler(
|
378
|
+
editorStore.applicationStore,
|
379
|
+
editorStore.depotServerClient,
|
380
|
+
)(groupId, artifactId, undefined).catch(
|
381
|
+
editorStore.applicationStore.alertUnhandledError,
|
382
|
+
);
|
383
|
+
}
|
381
384
|
}
|
382
385
|
},
|
383
386
|
icon: <InfoCircleIcon />,
|
@@ -539,18 +542,22 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
539
542
|
const editorStore =
|
540
543
|
queryBuilderState.workflowState.actionConfig.editorStore;
|
541
544
|
const openSaveQueryModal = (): void => {
|
542
|
-
if (editorStore
|
543
|
-
editorStore
|
544
|
-
|
545
|
-
|
545
|
+
if (editorStore.canPersistToSavedQuery) {
|
546
|
+
if (editorStore instanceof ExistingQueryEditorStore) {
|
547
|
+
editorStore.updateState.showSaveModal();
|
548
|
+
} else {
|
549
|
+
editorStore.queryCreatorState.open(undefined);
|
550
|
+
}
|
546
551
|
}
|
547
552
|
};
|
548
553
|
const handleQuerySaveAs = (): void => {
|
549
|
-
editorStore.
|
550
|
-
editorStore
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
+
if (editorStore.canPersistToSavedQuery) {
|
555
|
+
editorStore.queryCreatorState.open(
|
556
|
+
editorStore instanceof ExistingQueryEditorStore
|
557
|
+
? editorStore.query
|
558
|
+
: undefined,
|
559
|
+
);
|
560
|
+
}
|
554
561
|
};
|
555
562
|
return (
|
556
563
|
<div className="query-editor__header__action-combo btn__dropdown-combo">
|
@@ -558,6 +565,7 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
558
565
|
className="query-editor__header__action query-editor__header__action-combo__main-btn btn--dak"
|
559
566
|
disabled={
|
560
567
|
editorStore.isPerformingBlockingAction ||
|
568
|
+
!editorStore.canPersistToSavedQuery ||
|
561
569
|
!queryBuilderState.canBuildQuery
|
562
570
|
}
|
563
571
|
onClick={openSaveQueryModal}
|
@@ -24,7 +24,6 @@ import {
|
|
24
24
|
} from './QueryEditor.js';
|
25
25
|
import {
|
26
26
|
BrowserEnvironmentProvider,
|
27
|
-
Redirect,
|
28
27
|
Route,
|
29
28
|
Switch,
|
30
29
|
generateExtensionUrlPattern,
|
@@ -39,8 +38,7 @@ import { EditExistingQuerySetup } from './EditExistingQuerySetup.js';
|
|
39
38
|
import { CreateMappingQuerySetup } from './CreateMappingQuerySetup.js';
|
40
39
|
import { useEffect } from 'react';
|
41
40
|
import { flowResult } from 'mobx';
|
42
|
-
import {
|
43
|
-
import { DataSpaceQuerySetup } from './data-space/DataSpaceQuerySetup.js';
|
41
|
+
import { LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN } from '../__lib__/DSL_DataSpace_LegendQueryNavigation.js';
|
44
42
|
import { DataSpaceTemplateQueryCreator } from './data-space/DataSpaceTemplateQueryCreator.js';
|
45
43
|
import { DataSpaceQueryCreator } from './data-space/DataSpaceQueryCreator.js';
|
46
44
|
|
@@ -57,17 +55,16 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
57
55
|
applicationStore.alertUnhandledError,
|
58
56
|
);
|
59
57
|
}, [applicationStore, baseStore]);
|
60
|
-
|
61
58
|
return (
|
62
59
|
<div className="app">
|
63
60
|
{baseStore.initState.hasCompleted && (
|
64
61
|
<Switch>
|
65
62
|
<Route
|
66
63
|
exact={true}
|
67
|
-
path={LEGEND_QUERY_ROUTE_PATTERN.
|
64
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.DEFAULT}
|
68
65
|
component={
|
69
66
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
70
|
-
|
67
|
+
DataSpaceQueryCreator as TEMPORARY__ReactRouterComponentType
|
71
68
|
}
|
72
69
|
/>
|
73
70
|
<Route
|
@@ -78,6 +75,29 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
78
75
|
EditExistingQuerySetup as TEMPORARY__ReactRouterComponentType
|
79
76
|
}
|
80
77
|
/>
|
78
|
+
|
79
|
+
<Route
|
80
|
+
exact={true}
|
81
|
+
path={[
|
82
|
+
generateExtensionUrlPattern(
|
83
|
+
LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.TEMPLATE_QUERY,
|
84
|
+
),
|
85
|
+
]}
|
86
|
+
component={
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
88
|
+
DataSpaceTemplateQueryCreator as TEMPORARY__ReactRouterComponentType
|
89
|
+
}
|
90
|
+
/>
|
91
|
+
|
92
|
+
<Route
|
93
|
+
exact={true}
|
94
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.SETUP}
|
95
|
+
component={
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
97
|
+
QuerySetupLandingPage as TEMPORARY__ReactRouterComponentType
|
98
|
+
}
|
99
|
+
/>
|
100
|
+
|
81
101
|
<Route
|
82
102
|
exact={true}
|
83
103
|
path={LEGEND_QUERY_ROUTE_PATTERN.CREATE_MAPPING_QUERY_SETUP}
|
@@ -110,28 +130,17 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
110
130
|
MappingQueryCreator as TEMPORARY__ReactRouterComponentType
|
111
131
|
}
|
112
132
|
/>
|
113
|
-
{/* DATA SPACE */}
|
114
|
-
<Route
|
115
|
-
exact={true}
|
116
|
-
path={[
|
117
|
-
generateExtensionUrlPattern(DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP),
|
118
|
-
]}
|
119
|
-
component={
|
120
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
121
|
-
DataSpaceQuerySetup as TEMPORARY__ReactRouterComponentType
|
122
|
-
}
|
123
|
-
/>
|
124
|
-
|
133
|
+
{/* LEGACY DATA SPACE */}
|
125
134
|
<Route
|
126
135
|
exact={true}
|
127
136
|
path={[
|
128
137
|
generateExtensionUrlPattern(
|
129
|
-
|
138
|
+
LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP,
|
130
139
|
),
|
131
140
|
]}
|
132
141
|
component={
|
133
142
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
134
|
-
|
143
|
+
DataSpaceQueryCreator as TEMPORARY__ReactRouterComponentType
|
135
144
|
}
|
136
145
|
/>
|
137
146
|
|
@@ -139,7 +148,7 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
139
148
|
exact={true}
|
140
149
|
path={[
|
141
150
|
generateExtensionUrlPattern(
|
142
|
-
|
151
|
+
LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN.CREATE,
|
143
152
|
),
|
144
153
|
]}
|
145
154
|
component={
|
@@ -159,12 +168,6 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
159
168
|
}
|
160
169
|
/>
|
161
170
|
))}
|
162
|
-
{/* Redirect to data space view */}
|
163
|
-
<Redirect
|
164
|
-
to={generateExtensionUrlPattern(
|
165
|
-
DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP,
|
166
|
-
)}
|
167
|
-
/>
|
168
171
|
</Switch>
|
169
172
|
)}
|
170
173
|
</div>
|
@@ -721,7 +721,8 @@ export const QueryEditor = observer(() => {
|
|
721
721
|
title="Load query"
|
722
722
|
/>
|
723
723
|
)}
|
724
|
-
{editorStore.
|
724
|
+
{editorStore.canPersistToSavedQuery &&
|
725
|
+
editorStore.queryCreatorState.showCreateModal && <CreateQueryDialog />}
|
725
726
|
{editorStore.showAppInfo && (
|
726
727
|
<LegendQueryInfo
|
727
728
|
open={editorStore.showAppInfo}
|
@@ -16,13 +16,16 @@
|
|
16
16
|
|
17
17
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
18
18
|
import { useApplicationStore } from '@finos/legend-application';
|
19
|
-
import { useParams } from '@finos/legend-application/browser';
|
19
|
+
import { generatePath, useParams } from '@finos/legend-application/browser';
|
20
20
|
import { parseGAVCoordinates } from '@finos/legend-storage';
|
21
21
|
import {
|
22
22
|
useLegendQueryApplicationStore,
|
23
23
|
useLegendQueryBaseStore,
|
24
24
|
} from '../LegendQueryFrameworkProvider.js';
|
25
|
-
import {
|
25
|
+
import {
|
26
|
+
DataSpaceQueryCreatorStore,
|
27
|
+
type QueryableDataSpace,
|
28
|
+
} from '../../stores/data-space/DataSpaceQueryCreatorStore.js';
|
26
29
|
import { QueryEditorStoreContext } from '../QueryEditorStoreProvider.js';
|
27
30
|
import {
|
28
31
|
DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN,
|
@@ -30,12 +33,14 @@ import {
|
|
30
33
|
type DataSpaceQueryCreatorPathParams,
|
31
34
|
} from '../../__lib__/DSL_DataSpace_LegendQueryNavigation.js';
|
32
35
|
import { QueryEditor } from '../QueryEditor.js';
|
36
|
+
import { LEGEND_QUERY_ROUTE_PATTERN } from '../../__lib__/LegendQueryNavigation.js';
|
37
|
+
import { useEffect } from 'react';
|
33
38
|
|
34
39
|
const DataSpaceQueryCreatorStoreProvider: React.FC<{
|
35
40
|
children: React.ReactNode;
|
36
|
-
gav: string;
|
37
|
-
dataSpacePath: string;
|
38
|
-
executionContext: string;
|
41
|
+
gav: string | undefined;
|
42
|
+
dataSpacePath: string | undefined;
|
43
|
+
executionContext: string | undefined;
|
39
44
|
runtimePath: string | undefined;
|
40
45
|
classPath: string | undefined;
|
41
46
|
}> = ({
|
@@ -46,7 +51,19 @@ const DataSpaceQueryCreatorStoreProvider: React.FC<{
|
|
46
51
|
runtimePath,
|
47
52
|
classPath,
|
48
53
|
}) => {
|
49
|
-
|
54
|
+
let queryableDataSpace: QueryableDataSpace | undefined = undefined;
|
55
|
+
if (gav && dataSpacePath && executionContext) {
|
56
|
+
const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
|
57
|
+
queryableDataSpace = {
|
58
|
+
groupId,
|
59
|
+
artifactId,
|
60
|
+
versionId,
|
61
|
+
dataSpacePath,
|
62
|
+
executionContext,
|
63
|
+
runtimePath,
|
64
|
+
classPath,
|
65
|
+
};
|
66
|
+
}
|
50
67
|
const applicationStore = useLegendQueryApplicationStore();
|
51
68
|
const baseStore = useLegendQueryBaseStore();
|
52
69
|
const store = useLocalObservable(
|
@@ -54,15 +71,14 @@ const DataSpaceQueryCreatorStoreProvider: React.FC<{
|
|
54
71
|
new DataSpaceQueryCreatorStore(
|
55
72
|
applicationStore,
|
56
73
|
baseStore.depotServerClient,
|
57
|
-
|
58
|
-
artifactId,
|
59
|
-
versionId,
|
60
|
-
dataSpacePath,
|
61
|
-
executionContext,
|
62
|
-
runtimePath,
|
63
|
-
classPath,
|
74
|
+
queryableDataSpace,
|
64
75
|
),
|
65
76
|
);
|
77
|
+
useEffect(() => {
|
78
|
+
applicationStore.navigationService.navigator.updateCurrentLocation(
|
79
|
+
generatePath(LEGEND_QUERY_ROUTE_PATTERN.DEFAULT),
|
80
|
+
);
|
81
|
+
}, [applicationStore]);
|
66
82
|
return (
|
67
83
|
<QueryEditorStoreContext.Provider value={store}>
|
68
84
|
{children}
|
@@ -72,14 +88,16 @@ const DataSpaceQueryCreatorStoreProvider: React.FC<{
|
|
72
88
|
|
73
89
|
export const DataSpaceQueryCreator = observer(() => {
|
74
90
|
const applicationStore = useApplicationStore();
|
75
|
-
const parameters = useParams<DataSpaceQueryCreatorPathParams>();
|
76
|
-
const gav = parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV];
|
91
|
+
const parameters = useParams<DataSpaceQueryCreatorPathParams | undefined>();
|
92
|
+
const gav = parameters?.[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV];
|
77
93
|
const dataSpacePath =
|
78
|
-
parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH];
|
94
|
+
parameters?.[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH];
|
79
95
|
const executionContext =
|
80
|
-
parameters[
|
96
|
+
parameters?.[
|
97
|
+
DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.EXECUTION_CONTEXT
|
98
|
+
];
|
81
99
|
const runtimePath =
|
82
|
-
parameters[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.RUNTIME_PATH];
|
100
|
+
parameters?.[DATA_SPACE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.RUNTIME_PATH];
|
83
101
|
const classPath =
|
84
102
|
applicationStore.navigationService.navigator.getCurrentLocationParameterValue(
|
85
103
|
DATA_SPACE_QUERY_CREATOR_QUERY_PARAM_TOKEN.CLASS_PATH,
|
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { observer
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
18
|
import { useApplicationStore } from '@finos/legend-application';
|
19
19
|
import { useEffect, useRef } from 'react';
|
20
20
|
import { flowResult } from 'mobx';
|
@@ -26,16 +26,7 @@ import {
|
|
26
26
|
compareLabelFn,
|
27
27
|
type SelectComponent,
|
28
28
|
} from '@finos/legend-art';
|
29
|
-
import {
|
30
|
-
useLegendQueryApplicationStore,
|
31
|
-
useLegendQueryBaseStore,
|
32
|
-
} from '../LegendQueryFrameworkProvider.js';
|
33
|
-
import {
|
34
|
-
type DataSpaceQuerySetupState,
|
35
|
-
DataSpaceQuerySetupStore,
|
36
|
-
} from '../../stores/data-space/DataSpaceQuerySetupState.js';
|
37
|
-
import { QueryEditorStoreContext } from '../QueryEditorStoreProvider.js';
|
38
|
-
import { QueryEditor } from '../QueryEditor.js';
|
29
|
+
import { type DataSpaceQuerySetupState } from '../../stores/data-space/DataSpaceQuerySetupState.js';
|
39
30
|
import {
|
40
31
|
DataSpaceAdvancedSearchModal,
|
41
32
|
buildDataSpaceOption,
|
@@ -43,31 +34,6 @@ import {
|
|
43
34
|
type DataSpaceOption,
|
44
35
|
} from '@finos/legend-extension-dsl-data-space/application-query';
|
45
36
|
|
46
|
-
const DataSpaceQuerySetupStoreProvider: React.FC<{
|
47
|
-
children: React.ReactNode;
|
48
|
-
}> = ({ children }) => {
|
49
|
-
const applicationStore = useLegendQueryApplicationStore();
|
50
|
-
const baseStore = useLegendQueryBaseStore();
|
51
|
-
const store = useLocalObservable(
|
52
|
-
() =>
|
53
|
-
new DataSpaceQuerySetupStore(
|
54
|
-
applicationStore,
|
55
|
-
baseStore.depotServerClient,
|
56
|
-
),
|
57
|
-
);
|
58
|
-
return (
|
59
|
-
<QueryEditorStoreContext.Provider value={store}>
|
60
|
-
{children}
|
61
|
-
</QueryEditorStoreContext.Provider>
|
62
|
-
);
|
63
|
-
};
|
64
|
-
|
65
|
-
export const DataSpaceQuerySetup = observer(() => (
|
66
|
-
<DataSpaceQuerySetupStoreProvider>
|
67
|
-
<QueryEditor />
|
68
|
-
</DataSpaceQuerySetupStoreProvider>
|
69
|
-
));
|
70
|
-
|
71
37
|
/**
|
72
38
|
* This setup panel supports cascading in order: Data-space -> Execution context (-> Runtime) -> Class
|
73
39
|
*
|
package/src/index.ts
CHANGED
@@ -37,12 +37,14 @@ export * from './stores/LegendQueryApplicationPlugin.js';
|
|
37
37
|
export { BaseQuerySetupStore } from './stores/QuerySetupStore.js';
|
38
38
|
export {
|
39
39
|
type QueryPersistConfiguration,
|
40
|
-
createViewProjectHandler,
|
41
|
-
createViewSDLCProjectHandler,
|
42
40
|
QueryEditorStore,
|
43
41
|
ExistingQueryEditorStore,
|
44
42
|
QueryBuilderActionConfig_QueryApplication,
|
45
43
|
} from './stores/QueryEditorStore.js';
|
44
|
+
export {
|
45
|
+
createViewProjectHandler,
|
46
|
+
createViewSDLCProjectHandler,
|
47
|
+
} from './stores/data-space/DataSpaceQueryBuilderHelper.js';
|
46
48
|
// components
|
47
49
|
export {
|
48
50
|
QueryEditorStoreContext,
|