@finos/legend-application-query 11.0.16 → 12.0.1
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/__lib__/LegendQueryApplicationNavigationContext.d.ts.map +1 -0
- package/lib/__lib__/LegendQueryApplicationNavigationContext.js.map +1 -0
- package/lib/__lib__/LegendQueryEvent.d.ts.map +1 -0
- package/lib/__lib__/LegendQueryEvent.js.map +1 -0
- package/lib/__lib__/LegendQueryEventHelper.d.ts.map +1 -0
- package/lib/__lib__/LegendQueryEventHelper.js.map +1 -0
- package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -0
- package/lib/{application → __lib__}/LegendQueryNavigation.js +4 -4
- package/lib/__lib__/LegendQueryNavigation.js.map +1 -0
- package/lib/{application → __lib__}/LegendQueryTelemetryHelper.d.ts +2 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.d.ts.map +1 -0
- package/lib/{application → __lib__}/LegendQueryTelemetryHelper.js +4 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.js.map +1 -0
- package/lib/application/LegendQuery.d.ts +2 -1
- package/lib/application/LegendQuery.d.ts.map +1 -1
- package/lib/application/LegendQuery.js +4 -6
- package/lib/application/LegendQuery.js.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.d.ts +1 -0
- package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.js +3 -0
- package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
- package/lib/components/CloneQueryServiceSetup.d.ts.map +1 -1
- package/lib/components/CloneQueryServiceSetup.js +5 -5
- package/lib/components/CloneQueryServiceSetup.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +11 -7
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/CreateMappingQuerySetup.d.ts.map +1 -1
- package/lib/components/CreateMappingQuerySetup.js +7 -6
- package/lib/components/CreateMappingQuerySetup.js.map +1 -1
- package/lib/components/EditExistingQuerySetup.d.ts.map +1 -1
- package/lib/components/EditExistingQuerySetup.js +6 -7
- package/lib/components/EditExistingQuerySetup.js.map +1 -1
- package/lib/components/{LegendQueryBaseStoreProvider.d.ts → LegendQueryFrameworkProvider.d.ts} +3 -3
- package/lib/components/LegendQueryFrameworkProvider.d.ts.map +1 -0
- package/lib/components/{LegendQueryBaseStoreProvider.js → LegendQueryFrameworkProvider.js} +5 -6
- package/lib/components/LegendQueryFrameworkProvider.js.map +1 -0
- package/lib/components/{LegendQueryApplication.d.ts → LegendQueryWebApplication.d.ts} +3 -4
- package/lib/components/LegendQueryWebApplication.d.ts.map +1 -0
- package/lib/components/LegendQueryWebApplication.js +42 -0
- package/lib/components/LegendQueryWebApplication.js.map +1 -0
- package/lib/components/LoadProjectServiceQuerySetup.d.ts.map +1 -1
- package/lib/components/LoadProjectServiceQuerySetup.js +4 -5
- package/lib/components/LoadProjectServiceQuerySetup.js.map +1 -1
- package/lib/components/QueryEditor.js +4 -3
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/QueryEditorStoreProvider.d.ts.map +1 -1
- package/lib/components/QueryEditorStoreProvider.js +7 -8
- package/lib/components/QueryEditorStoreProvider.js.map +1 -1
- package/lib/components/QueryProductionizerSetup.d.ts.map +1 -1
- package/lib/components/QueryProductionizerSetup.js +6 -7
- package/lib/components/QueryProductionizerSetup.js.map +1 -1
- package/lib/components/QuerySetup.js +2 -2
- package/lib/components/QuerySetup.js.map +1 -1
- package/lib/components/UpdateExistingServiceQuerySetup.d.ts.map +1 -1
- package/lib/components/UpdateExistingServiceQuerySetup.js +4 -5
- package/lib/components/UpdateExistingServiceQuerySetup.js.map +1 -1
- package/lib/components/{QueryEditorComponentTestUtils.d.ts → __test-utils__/QueryEditorComponentTestUtils.d.ts} +3 -9
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts.map +1 -0
- package/lib/components/{QueryEditorComponentTestUtils.js → __test-utils__/QueryEditorComponentTestUtils.js} +17 -23
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/CloneServiceQuerySetupStore.js +1 -1
- package/lib/stores/CloneServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/CreateMappingQuerySetupStore.js +1 -1
- package/lib/stores/CreateMappingQuerySetupStore.js.map +1 -1
- package/lib/stores/LegendQueryBaseStore.d.ts +2 -2
- package/lib/stores/LegendQueryBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendQueryBaseStore.js +6 -3
- package/lib/stores/LegendQueryBaseStore.js.map +1 -1
- package/lib/stores/LoadProjectServiceQuerySetupStore.js +1 -1
- package/lib/stores/LoadProjectServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +10 -8
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/QueryProductionizerSetupStore.js +1 -1
- package/lib/stores/QueryProductionizerSetupStore.js.map +1 -1
- package/lib/stores/QuerySetupStore.js +4 -4
- package/lib/stores/QuerySetupStore.js.map +1 -1
- package/lib/stores/UpdateExistingServiceQuerySetupStore.js +1 -1
- package/lib/stores/UpdateExistingServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/{QueryEditorStoreTestUtils.d.ts → __test-utils__/LegendQueryApplicationTestUtils.d.ts} +2 -2
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.d.ts.map +1 -0
- package/lib/stores/{QueryEditorStoreTestUtils.js → __test-utils__/LegendQueryApplicationTestUtils.js} +5 -5
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.js.map +1 -0
- package/package.json +11 -11
- package/src/{application → __lib__}/LegendQueryNavigation.ts +4 -4
- package/src/{application → __lib__}/LegendQueryTelemetryHelper.ts +14 -0
- package/src/application/LegendQuery.tsx +10 -17
- package/src/application/LegendQueryApplicationConfig.ts +4 -0
- package/src/components/CloneQueryServiceSetup.tsx +11 -5
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +13 -7
- package/src/components/CreateMappingQuerySetup.tsx +16 -10
- package/src/components/EditExistingQuerySetup.tsx +16 -10
- package/src/components/{LegendQueryBaseStoreProvider.tsx → LegendQueryFrameworkProvider.tsx} +11 -4
- package/src/components/LegendQueryWebApplication.tsx +117 -0
- package/src/components/LoadProjectServiceQuerySetup.tsx +7 -5
- package/src/components/QueryEditor.tsx +3 -3
- package/src/components/QueryEditorStoreProvider.tsx +10 -8
- package/src/components/QueryProductionizerSetup.tsx +14 -9
- package/src/components/QuerySetup.tsx +2 -2
- package/src/components/UpdateExistingServiceQuerySetup.tsx +7 -5
- package/src/components/{QueryEditorComponentTestUtils.tsx → __test-utils__/QueryEditorComponentTestUtils.tsx} +30 -63
- package/src/index.ts +9 -4
- package/src/stores/CloneServiceQuerySetupStore.ts +1 -1
- package/src/stores/CreateMappingQuerySetupStore.ts +1 -1
- package/src/stores/LegendQueryBaseStore.ts +6 -7
- package/src/stores/LoadProjectServiceQuerySetupStore.ts +1 -1
- package/src/stores/QueryEditorStore.ts +11 -9
- package/src/stores/QueryProductionizerSetupStore.ts +1 -1
- package/src/stores/QuerySetupStore.ts +4 -4
- package/src/stores/UpdateExistingServiceQuerySetupStore.ts +1 -1
- package/src/stores/{QueryEditorStoreTestUtils.ts → __test-utils__/LegendQueryApplicationTestUtils.ts} +4 -4
- package/tsconfig.json +10 -10
- package/lib/application/LegendQueryApplicationNavigationContext.d.ts.map +0 -1
- package/lib/application/LegendQueryApplicationNavigationContext.js.map +0 -1
- package/lib/application/LegendQueryEvent.d.ts.map +0 -1
- package/lib/application/LegendQueryEvent.js.map +0 -1
- package/lib/application/LegendQueryEventHelper.d.ts.map +0 -1
- package/lib/application/LegendQueryEventHelper.js.map +0 -1
- package/lib/application/LegendQueryNavigation.d.ts.map +0 -1
- package/lib/application/LegendQueryNavigation.js.map +0 -1
- package/lib/application/LegendQueryTelemetryHelper.d.ts.map +0 -1
- package/lib/application/LegendQueryTelemetryHelper.js.map +0 -1
- package/lib/components/LegendQueryApplication.d.ts.map +0 -1
- package/lib/components/LegendQueryApplication.js +0 -49
- package/lib/components/LegendQueryApplication.js.map +0 -1
- package/lib/components/LegendQueryBaseStoreProvider.d.ts.map +0 -1
- package/lib/components/LegendQueryBaseStoreProvider.js.map +0 -1
- package/lib/components/QueryEditorComponentTestUtils.d.ts.map +0 -1
- package/lib/components/QueryEditorComponentTestUtils.js.map +0 -1
- package/lib/stores/QueryEditorStoreTestUtils.d.ts.map +0 -1
- package/lib/stores/QueryEditorStoreTestUtils.js.map +0 -1
- package/src/components/LegendQueryApplication.tsx +0 -133
- /package/lib/{application → __lib__}/LegendQueryApplicationNavigationContext.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendQueryApplicationNavigationContext.js +0 -0
- /package/lib/{application → __lib__}/LegendQueryEvent.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendQueryEvent.js +0 -0
- /package/lib/{application → __lib__}/LegendQueryEventHelper.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendQueryEventHelper.js +0 -0
- /package/lib/{application → __lib__}/LegendQueryNavigation.d.ts +0 -0
- /package/src/{application → __lib__}/LegendQueryApplicationNavigationContext.ts +0 -0
- /package/src/{application → __lib__}/LegendQueryEvent.ts +0 -0
- /package/src/{application → __lib__}/LegendQueryEventHelper.ts +0 -0
@@ -29,14 +29,16 @@ import { useContext, useEffect } from 'react';
|
|
29
29
|
import {
|
30
30
|
generateQuerySetupRoute,
|
31
31
|
generateServiceQueryCreatorRoute,
|
32
|
-
} from '../
|
32
|
+
} from '../__lib__/LegendQueryNavigation.js';
|
33
33
|
import {
|
34
34
|
LATEST_VERSION_ALIAS,
|
35
35
|
SNAPSHOT_VERSION_ALIAS,
|
36
|
-
useDepotServerClient,
|
37
36
|
} from '@finos/legend-server-depot';
|
38
37
|
import { useApplicationStore } from '@finos/legend-application';
|
39
|
-
import {
|
38
|
+
import {
|
39
|
+
useLegendQueryApplicationStore,
|
40
|
+
useLegendQueryBaseStore,
|
41
|
+
} from './LegendQueryFrameworkProvider.js';
|
40
42
|
import {
|
41
43
|
CloneServiceQuerySetupStore,
|
42
44
|
type ServiceExecutionOption,
|
@@ -55,9 +57,13 @@ const CloneServiceQuerySetupStoreProvider: React.FC<{
|
|
55
57
|
children: React.ReactNode;
|
56
58
|
}> = ({ children }) => {
|
57
59
|
const applicationStore = useLegendQueryApplicationStore();
|
58
|
-
const
|
60
|
+
const baseStore = useLegendQueryBaseStore();
|
59
61
|
const store = useLocalObservable(
|
60
|
-
() =>
|
62
|
+
() =>
|
63
|
+
new CloneServiceQuerySetupStore(
|
64
|
+
applicationStore,
|
65
|
+
baseStore.depotServerClient,
|
66
|
+
),
|
61
67
|
);
|
62
68
|
return (
|
63
69
|
<BaseQuerySetupStoreContext.Provider value={store}>
|
@@ -37,9 +37,8 @@ import {
|
|
37
37
|
generateQueryProductionizerSetupRoute,
|
38
38
|
generateUpdateExistingServiceQuerySetup,
|
39
39
|
LEGEND_QUERY_ROUTE_PATTERN,
|
40
|
-
} from '../
|
40
|
+
} from '../__lib__/LegendQueryNavigation.js';
|
41
41
|
import {
|
42
|
-
setupPureLanguageService,
|
43
42
|
type ApplicationPageEntry,
|
44
43
|
type LegendApplicationSetup,
|
45
44
|
} from '@finos/legend-application';
|
@@ -47,6 +46,10 @@ import { CloneQueryServiceSetup } from './CloneQueryServiceSetup.js';
|
|
47
46
|
import { QueryProductionizerSetup } from './QueryProductionizerSetup.js';
|
48
47
|
import { UpdateExistingServiceQuerySetup } from './UpdateExistingServiceQuerySetup.js';
|
49
48
|
import { LoadProjectServiceQuerySetup } from './LoadProjectServiceQuerySetup.js';
|
49
|
+
import {
|
50
|
+
configureCodeEditorComponent,
|
51
|
+
setupPureLanguageService,
|
52
|
+
} from '@finos/legend-lego/code-editor';
|
50
53
|
|
51
54
|
export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlugin {
|
52
55
|
static NAME = packageJson.extensions.applicationQueryPlugin;
|
@@ -58,7 +61,8 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
58
61
|
override getExtraApplicationSetups(): LegendApplicationSetup[] {
|
59
62
|
return [
|
60
63
|
async (applicationStore) => {
|
61
|
-
|
64
|
+
await configureCodeEditorComponent(applicationStore);
|
65
|
+
setupPureLanguageService({});
|
62
66
|
},
|
63
67
|
];
|
64
68
|
}
|
@@ -67,24 +71,26 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
67
71
|
return [
|
68
72
|
{
|
69
73
|
key: 'clone-service-query-setup-application-page',
|
70
|
-
|
74
|
+
addressPatterns: [LEGEND_QUERY_ROUTE_PATTERN.CLONE_SERVICE_QUERY_SETUP],
|
71
75
|
renderer: CloneQueryServiceSetup,
|
72
76
|
},
|
73
77
|
{
|
74
78
|
key: 'query-productionizer-setup-application-page',
|
75
|
-
|
79
|
+
addressPatterns: [
|
80
|
+
LEGEND_QUERY_ROUTE_PATTERN.QUERY_PRODUCTIONIZER_SETUP,
|
81
|
+
],
|
76
82
|
renderer: QueryProductionizerSetup,
|
77
83
|
},
|
78
84
|
{
|
79
85
|
key: 'update-existing-service-query-setup-application-page',
|
80
|
-
|
86
|
+
addressPatterns: [
|
81
87
|
LEGEND_QUERY_ROUTE_PATTERN.UPDATE_EXISTING_SERVICE_QUERY_SETUP,
|
82
88
|
],
|
83
89
|
renderer: UpdateExistingServiceQuerySetup,
|
84
90
|
},
|
85
91
|
{
|
86
92
|
key: 'load-project-service-query-setup-application-page',
|
87
|
-
|
93
|
+
addressPatterns: [
|
88
94
|
LEGEND_QUERY_ROUTE_PATTERN.LOAD_PROJECT_SERVICE_QUERY_SETUP,
|
89
95
|
],
|
90
96
|
renderer: LoadProjectServiceQuerySetup,
|
@@ -29,19 +29,16 @@ import { useContext, useEffect } from 'react';
|
|
29
29
|
import {
|
30
30
|
generateMappingQueryCreatorRoute,
|
31
31
|
generateQuerySetupRoute,
|
32
|
-
} from '../
|
32
|
+
} from '../__lib__/LegendQueryNavigation.js';
|
33
33
|
import {
|
34
34
|
LATEST_VERSION_ALIAS,
|
35
35
|
SNAPSHOT_VERSION_ALIAS,
|
36
|
-
useDepotServerClient,
|
37
36
|
} from '@finos/legend-server-depot';
|
37
|
+
import { useApplicationStore } from '@finos/legend-application';
|
38
38
|
import {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
getPackageableElementOptionFormatter,
|
43
|
-
} from '@finos/legend-application';
|
44
|
-
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
39
|
+
useLegendQueryApplicationStore,
|
40
|
+
useLegendQueryBaseStore,
|
41
|
+
} from './LegendQueryFrameworkProvider.js';
|
45
42
|
import { CreateMappingQuerySetupStore } from '../stores/CreateMappingQuerySetupStore.js';
|
46
43
|
import {
|
47
44
|
BaseQuerySetup,
|
@@ -53,14 +50,23 @@ import {
|
|
53
50
|
} from './QuerySetup.js';
|
54
51
|
import { compareSemVerVersions } from '@finos/legend-storage';
|
55
52
|
import type { Mapping, PackageableRuntime } from '@finos/legend-graph';
|
53
|
+
import {
|
54
|
+
buildElementOption,
|
55
|
+
getPackageableElementOptionFormatter,
|
56
|
+
type PackageableElementOption,
|
57
|
+
} from '@finos/legend-lego/graph-editor';
|
56
58
|
|
57
59
|
const CreateMappingQuerySetupStoreProvider: React.FC<{
|
58
60
|
children: React.ReactNode;
|
59
61
|
}> = ({ children }) => {
|
60
62
|
const applicationStore = useLegendQueryApplicationStore();
|
61
|
-
const
|
63
|
+
const baseStore = useLegendQueryBaseStore();
|
62
64
|
const store = useLocalObservable(
|
63
|
-
() =>
|
65
|
+
() =>
|
66
|
+
new CreateMappingQuerySetupStore(
|
67
|
+
applicationStore,
|
68
|
+
baseStore.depotServerClient,
|
69
|
+
),
|
64
70
|
);
|
65
71
|
return (
|
66
72
|
<BaseQuerySetupStoreContext.Provider value={store}>
|
@@ -32,28 +32,34 @@ import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
32
32
|
import {
|
33
33
|
generateExistingQueryEditorRoute,
|
34
34
|
generateQuerySetupRoute,
|
35
|
-
} from '../
|
36
|
-
import {
|
37
|
-
import {
|
38
|
-
useApplicationStore,
|
39
|
-
CODE_EDITOR_LANGUAGE,
|
40
|
-
} from '@finos/legend-application';
|
35
|
+
} from '../__lib__/LegendQueryNavigation.js';
|
36
|
+
import { useApplicationStore } from '@finos/legend-application';
|
41
37
|
import {
|
42
38
|
type QueryOption,
|
43
39
|
buildQueryOption,
|
44
40
|
} from '@finos/legend-query-builder';
|
45
|
-
import {
|
41
|
+
import {
|
42
|
+
useLegendQueryApplicationStore,
|
43
|
+
useLegendQueryBaseStore,
|
44
|
+
} from './LegendQueryFrameworkProvider.js';
|
46
45
|
import { EditExistingQuerySetupStore } from '../stores/EditExistingQuerySetupStore.js';
|
47
46
|
import { BaseQuerySetup, BaseQuerySetupStoreContext } from './QuerySetup.js';
|
48
|
-
import {
|
47
|
+
import {
|
48
|
+
CODE_EDITOR_LANGUAGE,
|
49
|
+
CodeEditor,
|
50
|
+
} from '@finos/legend-lego/code-editor';
|
49
51
|
|
50
52
|
const EditExistingQuerySetupStoreProvider: React.FC<{
|
51
53
|
children: React.ReactNode;
|
52
54
|
}> = ({ children }) => {
|
53
55
|
const applicationStore = useLegendQueryApplicationStore();
|
54
|
-
const
|
56
|
+
const baseStore = useLegendQueryBaseStore();
|
55
57
|
const store = useLocalObservable(
|
56
|
-
() =>
|
58
|
+
() =>
|
59
|
+
new EditExistingQuerySetupStore(
|
60
|
+
applicationStore,
|
61
|
+
baseStore.depotServerClient,
|
62
|
+
),
|
57
63
|
);
|
58
64
|
return (
|
59
65
|
<BaseQuerySetupStoreContext.Provider value={store}>
|
package/src/components/{LegendQueryBaseStoreProvider.tsx → LegendQueryFrameworkProvider.tsx}
RENAMED
@@ -18,12 +18,12 @@ import { createContext, useContext } from 'react';
|
|
18
18
|
import { useLocalObservable } from 'mobx-react-lite';
|
19
19
|
import { LegendQueryBaseStore } from '../stores/LegendQueryBaseStore.js';
|
20
20
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
21
|
-
import { useDepotServerClient } from '@finos/legend-server-depot';
|
22
21
|
import type { LegendQueryPluginManager } from '../application/LegendQueryPluginManager.js';
|
23
22
|
import type { LegendQueryApplicationConfig } from '../application/LegendQueryApplicationConfig.js';
|
24
23
|
import {
|
25
24
|
type ApplicationStore,
|
26
25
|
useApplicationStore,
|
26
|
+
ApplicationFrameworkProvider,
|
27
27
|
} from '@finos/legend-application';
|
28
28
|
|
29
29
|
export const useLegendQueryApplicationStore = (): ApplicationStore<
|
@@ -36,13 +36,12 @@ const LegendQueryBaseStoreContext = createContext<
|
|
36
36
|
LegendQueryBaseStore | undefined
|
37
37
|
>(undefined);
|
38
38
|
|
39
|
-
|
39
|
+
const LegendQueryBaseStoreProvider: React.FC<{
|
40
40
|
children: React.ReactNode;
|
41
41
|
}> = ({ children }) => {
|
42
42
|
const applicationStore = useLegendQueryApplicationStore();
|
43
|
-
const depotServerClient = useDepotServerClient();
|
44
43
|
const store = useLocalObservable(
|
45
|
-
() => new LegendQueryBaseStore(applicationStore
|
44
|
+
() => new LegendQueryBaseStore(applicationStore),
|
46
45
|
);
|
47
46
|
return (
|
48
47
|
<LegendQueryBaseStoreContext.Provider value={store}>
|
@@ -56,3 +55,11 @@ export const useLegendQueryBaseStore = (): LegendQueryBaseStore =>
|
|
56
55
|
useContext(LegendQueryBaseStoreContext),
|
57
56
|
`Can't find Legend Query base store in context`,
|
58
57
|
);
|
58
|
+
|
59
|
+
export const LegendQueryFrameworkProvider: React.FC<{
|
60
|
+
children: React.ReactNode;
|
61
|
+
}> = ({ children }) => (
|
62
|
+
<ApplicationFrameworkProvider>
|
63
|
+
<LegendQueryBaseStoreProvider>{children}</LegendQueryBaseStoreProvider>
|
64
|
+
</ApplicationFrameworkProvider>
|
65
|
+
);
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import { LEGEND_QUERY_ROUTE_PATTERN } from '../__lib__/LegendQueryNavigation.js';
|
19
|
+
import { QuerySetupLandingPage } from './QuerySetup.js';
|
20
|
+
import {
|
21
|
+
MappingQueryCreator,
|
22
|
+
ExistingQueryEditor,
|
23
|
+
ServiceQueryCreator,
|
24
|
+
} from './QueryEditor.js';
|
25
|
+
import {
|
26
|
+
BrowserEnvironmentProvider,
|
27
|
+
Redirect,
|
28
|
+
Route,
|
29
|
+
Switch,
|
30
|
+
generateExtensionUrlPattern,
|
31
|
+
} from '@finos/legend-application/browser';
|
32
|
+
import {
|
33
|
+
LegendQueryFrameworkProvider,
|
34
|
+
useLegendQueryApplicationStore,
|
35
|
+
useLegendQueryBaseStore,
|
36
|
+
} from './LegendQueryFrameworkProvider.js';
|
37
|
+
import { EditExistingQuerySetup } from './EditExistingQuerySetup.js';
|
38
|
+
import { CreateMappingQuerySetup } from './CreateMappingQuerySetup.js';
|
39
|
+
import { useEffect } from 'react';
|
40
|
+
import { flowResult } from 'mobx';
|
41
|
+
|
42
|
+
const LegendQueryWebApplicationRouter = observer(() => {
|
43
|
+
const applicationStore = useLegendQueryApplicationStore();
|
44
|
+
const baseStore = useLegendQueryBaseStore();
|
45
|
+
|
46
|
+
const extraApplicationPageEntries = applicationStore.pluginManager
|
47
|
+
.getApplicationPlugins()
|
48
|
+
.flatMap((plugin) => plugin.getExtraApplicationPageEntries?.() ?? []);
|
49
|
+
|
50
|
+
useEffect(() => {
|
51
|
+
flowResult(baseStore.initialize()).catch(
|
52
|
+
applicationStore.alertUnhandledError,
|
53
|
+
);
|
54
|
+
}, [applicationStore, baseStore]);
|
55
|
+
|
56
|
+
return (
|
57
|
+
<div className="app">
|
58
|
+
{baseStore.initState.hasCompleted && (
|
59
|
+
<Switch>
|
60
|
+
<Route
|
61
|
+
exact={true}
|
62
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.SETUP}
|
63
|
+
component={QuerySetupLandingPage}
|
64
|
+
/>
|
65
|
+
<Route
|
66
|
+
exact={true}
|
67
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY_SETUP}
|
68
|
+
component={EditExistingQuerySetup}
|
69
|
+
/>
|
70
|
+
<Route
|
71
|
+
exact={true}
|
72
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.CREATE_MAPPING_QUERY_SETUP}
|
73
|
+
component={CreateMappingQuerySetup}
|
74
|
+
/>
|
75
|
+
<Route
|
76
|
+
exact={true}
|
77
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY}
|
78
|
+
component={ExistingQueryEditor}
|
79
|
+
/>
|
80
|
+
<Route
|
81
|
+
exact={true}
|
82
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_SERVICE_QUERY}
|
83
|
+
component={ServiceQueryCreator}
|
84
|
+
/>
|
85
|
+
<Route
|
86
|
+
exact={true}
|
87
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_MAPPING_QUERY}
|
88
|
+
component={MappingQueryCreator}
|
89
|
+
/>
|
90
|
+
{extraApplicationPageEntries.map((entry) => (
|
91
|
+
<Route
|
92
|
+
key={entry.key}
|
93
|
+
exact={true}
|
94
|
+
path={entry.addressPatterns.map(generateExtensionUrlPattern)}
|
95
|
+
component={entry.renderer as React.ComponentType<unknown>}
|
96
|
+
/>
|
97
|
+
))}
|
98
|
+
<Redirect to={LEGEND_QUERY_ROUTE_PATTERN.SETUP} />
|
99
|
+
</Switch>
|
100
|
+
)}
|
101
|
+
</div>
|
102
|
+
);
|
103
|
+
});
|
104
|
+
|
105
|
+
export const LegendQueryWebApplication = observer(
|
106
|
+
(props: { baseUrl: string }) => {
|
107
|
+
const { baseUrl } = props;
|
108
|
+
|
109
|
+
return (
|
110
|
+
<BrowserEnvironmentProvider baseUrl={baseUrl}>
|
111
|
+
<LegendQueryFrameworkProvider>
|
112
|
+
<LegendQueryWebApplicationRouter />
|
113
|
+
</LegendQueryFrameworkProvider>
|
114
|
+
</BrowserEnvironmentProvider>
|
115
|
+
);
|
116
|
+
},
|
117
|
+
);
|
@@ -19,9 +19,11 @@ import { guaranteeType } from '@finos/legend-shared';
|
|
19
19
|
import { flowResult } from 'mobx';
|
20
20
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
21
21
|
import { useContext, useEffect } from 'react';
|
22
|
-
import { generateQuerySetupRoute } from '../
|
23
|
-
import {
|
24
|
-
|
22
|
+
import { generateQuerySetupRoute } from '../__lib__/LegendQueryNavigation.js';
|
23
|
+
import {
|
24
|
+
useLegendQueryApplicationStore,
|
25
|
+
useLegendQueryBaseStore,
|
26
|
+
} from './LegendQueryFrameworkProvider.js';
|
25
27
|
import { LoadProjectServiceQuerySetupStore } from '../stores/LoadProjectServiceQuerySetupStore.js';
|
26
28
|
import {
|
27
29
|
BaseQuerySetup,
|
@@ -36,12 +38,12 @@ const LoadProjectServiceQuerySetupStoreProvider: React.FC<{
|
|
36
38
|
children: React.ReactNode;
|
37
39
|
}> = ({ children }) => {
|
38
40
|
const applicationStore = useLegendQueryApplicationStore();
|
39
|
-
const
|
41
|
+
const baseStore = useLegendQueryBaseStore();
|
40
42
|
const store = useLocalObservable(
|
41
43
|
() =>
|
42
44
|
new LoadProjectServiceQuerySetupStore(
|
43
45
|
applicationStore,
|
44
|
-
depotServerClient,
|
46
|
+
baseStore.depotServerClient,
|
45
47
|
),
|
46
48
|
);
|
47
49
|
return (
|
@@ -55,7 +55,7 @@ import {
|
|
55
55
|
LEGEND_QUERY_ROUTE_PATTERN_TOKEN,
|
56
56
|
generateExistingQueryEditorRoute,
|
57
57
|
generateQuerySetupRoute,
|
58
|
-
} from '../
|
58
|
+
} from '../__lib__/LegendQueryNavigation.js';
|
59
59
|
import {
|
60
60
|
type QueryEditorStore,
|
61
61
|
ExistingQueryEditorStore,
|
@@ -66,8 +66,8 @@ import {
|
|
66
66
|
import {
|
67
67
|
LEGEND_APPLICATION_COLOR_THEME,
|
68
68
|
useApplicationStore,
|
69
|
-
useParams,
|
70
69
|
} from '@finos/legend-application';
|
70
|
+
import { useParams } from '@finos/legend-application/browser';
|
71
71
|
import {
|
72
72
|
MappingQueryCreatorStoreProvider,
|
73
73
|
ExistingQueryEditorStoreProvider,
|
@@ -76,7 +76,7 @@ import {
|
|
76
76
|
} from './QueryEditorStoreProvider.js';
|
77
77
|
import type { RawLambda } from '@finos/legend-graph';
|
78
78
|
import { flowResult } from 'mobx';
|
79
|
-
import { useLegendQueryApplicationStore } from './
|
79
|
+
import { useLegendQueryApplicationStore } from './LegendQueryFrameworkProvider.js';
|
80
80
|
import {
|
81
81
|
QueryBuilder,
|
82
82
|
QueryBuilderNavigationBlocker,
|
@@ -23,8 +23,10 @@ import {
|
|
23
23
|
ExistingQueryEditorStore,
|
24
24
|
ServiceQueryCreatorStore,
|
25
25
|
} from '../stores/QueryEditorStore.js';
|
26
|
-
import {
|
27
|
-
|
26
|
+
import {
|
27
|
+
useLegendQueryApplicationStore,
|
28
|
+
useLegendQueryBaseStore,
|
29
|
+
} from './LegendQueryFrameworkProvider.js';
|
28
30
|
import { parseGAVCoordinates } from '@finos/legend-storage';
|
29
31
|
|
30
32
|
export const QueryEditorStoreContext = createContext<
|
@@ -36,12 +38,12 @@ export const ExistingQueryEditorStoreProvider: React.FC<{
|
|
36
38
|
queryId: string;
|
37
39
|
}> = ({ children, queryId }) => {
|
38
40
|
const applicationStore = useLegendQueryApplicationStore();
|
39
|
-
const
|
41
|
+
const baseStore = useLegendQueryBaseStore();
|
40
42
|
const store = useLocalObservable(
|
41
43
|
() =>
|
42
44
|
new ExistingQueryEditorStore(
|
43
45
|
applicationStore,
|
44
|
-
depotServerClient,
|
46
|
+
baseStore.depotServerClient,
|
45
47
|
queryId,
|
46
48
|
),
|
47
49
|
);
|
@@ -60,12 +62,12 @@ export const MappingQueryCreatorStoreProvider: React.FC<{
|
|
60
62
|
}> = ({ children, gav, mappingPath, runtimePath }) => {
|
61
63
|
const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
|
62
64
|
const applicationStore = useLegendQueryApplicationStore();
|
63
|
-
const
|
65
|
+
const baseStore = useLegendQueryBaseStore();
|
64
66
|
const store = useLocalObservable(
|
65
67
|
() =>
|
66
68
|
new MappingQueryCreatorStore(
|
67
69
|
applicationStore,
|
68
|
-
depotServerClient,
|
70
|
+
baseStore.depotServerClient,
|
69
71
|
groupId,
|
70
72
|
artifactId,
|
71
73
|
versionId,
|
@@ -88,12 +90,12 @@ export const ServiceQueryCreatorStoreProvider: React.FC<{
|
|
88
90
|
}> = ({ children, gav, servicePath, executionKey }) => {
|
89
91
|
const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
|
90
92
|
const applicationStore = useLegendQueryApplicationStore();
|
91
|
-
const
|
93
|
+
const baseStore = useLegendQueryBaseStore();
|
92
94
|
const store = useLocalObservable(
|
93
95
|
() =>
|
94
96
|
new ServiceQueryCreatorStore(
|
95
97
|
applicationStore,
|
96
|
-
depotServerClient,
|
98
|
+
baseStore.depotServerClient,
|
97
99
|
groupId,
|
98
100
|
artifactId,
|
99
101
|
versionId,
|
@@ -28,29 +28,34 @@ import { debounce, guaranteeType } from '@finos/legend-shared';
|
|
28
28
|
import { flowResult } from 'mobx';
|
29
29
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
30
30
|
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
31
|
-
import {
|
31
|
+
import { useApplicationStore } from '@finos/legend-application';
|
32
32
|
import {
|
33
|
-
|
34
|
-
|
35
|
-
} from '
|
36
|
-
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
33
|
+
useLegendQueryApplicationStore,
|
34
|
+
useLegendQueryBaseStore,
|
35
|
+
} from './LegendQueryFrameworkProvider.js';
|
37
36
|
import { QueryProductionizerSetupStore } from '../stores/QueryProductionizerSetupStore.js';
|
38
37
|
import { BaseQuerySetup, BaseQuerySetupStoreContext } from './QuerySetup.js';
|
39
38
|
import {
|
40
39
|
buildQueryOption,
|
41
40
|
type QueryOption,
|
42
41
|
} from '@finos/legend-query-builder';
|
43
|
-
import { generateQuerySetupRoute } from '../
|
44
|
-
import {
|
42
|
+
import { generateQuerySetupRoute } from '../__lib__/LegendQueryNavigation.js';
|
43
|
+
import {
|
44
|
+
CODE_EDITOR_LANGUAGE,
|
45
|
+
CodeEditor,
|
46
|
+
} from '@finos/legend-lego/code-editor';
|
45
47
|
|
46
48
|
const QueryProductionizerSetupStoreProvider: React.FC<{
|
47
49
|
children: React.ReactNode;
|
48
50
|
}> = ({ children }) => {
|
49
51
|
const applicationStore = useLegendQueryApplicationStore();
|
50
|
-
const
|
52
|
+
const baseStore = useLegendQueryBaseStore();
|
51
53
|
const store = useLocalObservable(
|
52
54
|
() =>
|
53
|
-
new QueryProductionizerSetupStore(
|
55
|
+
new QueryProductionizerSetupStore(
|
56
|
+
applicationStore,
|
57
|
+
baseStore.depotServerClient,
|
58
|
+
),
|
54
59
|
);
|
55
60
|
return (
|
56
61
|
<BaseQuerySetupStoreContext.Provider value={store}>
|
@@ -35,14 +35,14 @@ import {
|
|
35
35
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
36
36
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
37
37
|
import React, { createContext, useContext, useEffect } from 'react';
|
38
|
-
import { LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN } from '../
|
38
|
+
import { LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN } from '../__lib__/LegendQueryNavigation.js';
|
39
39
|
import {
|
40
40
|
QuerySetupLandingPageStore,
|
41
41
|
type BaseQuerySetupStore,
|
42
42
|
} from '../stores/QuerySetupStore.js';
|
43
43
|
import type { ProjectData } from '@finos/legend-server-depot';
|
44
44
|
import { useApplicationStore } from '@finos/legend-application';
|
45
|
-
import { useLegendQueryApplicationStore } from './
|
45
|
+
import { useLegendQueryApplicationStore } from './LegendQueryFrameworkProvider.js';
|
46
46
|
import type { QuerySetupActionConfiguration } from '../stores/LegendQueryApplicationPlugin.js';
|
47
47
|
|
48
48
|
export type ProjectOption = { label: string; value: ProjectData };
|
@@ -24,9 +24,11 @@ import { debounce, guaranteeType } from '@finos/legend-shared';
|
|
24
24
|
import { flowResult } from 'mobx';
|
25
25
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
26
26
|
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
27
|
-
import { generateQuerySetupRoute } from '../
|
28
|
-
import {
|
29
|
-
|
27
|
+
import { generateQuerySetupRoute } from '../__lib__/LegendQueryNavigation.js';
|
28
|
+
import {
|
29
|
+
useLegendQueryApplicationStore,
|
30
|
+
useLegendQueryBaseStore,
|
31
|
+
} from './LegendQueryFrameworkProvider.js';
|
30
32
|
import { UpdateExistingServiceQuerySetupStore } from '../stores/UpdateExistingServiceQuerySetupStore.js';
|
31
33
|
import { BaseQuerySetup, BaseQuerySetupStoreContext } from './QuerySetup.js';
|
32
34
|
import {
|
@@ -39,12 +41,12 @@ const UpdateExistingServiceQuerySetupStoreProvider: React.FC<{
|
|
39
41
|
children: React.ReactNode;
|
40
42
|
}> = ({ children }) => {
|
41
43
|
const applicationStore = useLegendQueryApplicationStore();
|
42
|
-
const
|
44
|
+
const baseStore = useLegendQueryBaseStore();
|
43
45
|
const store = useLocalObservable(
|
44
46
|
() =>
|
45
47
|
new UpdateExistingServiceQuerySetupStore(
|
46
48
|
applicationStore,
|
47
|
-
depotServerClient,
|
49
|
+
baseStore.depotServerClient,
|
48
50
|
),
|
49
51
|
);
|
50
52
|
return (
|