@finos/legend-application-query 8.1.2 → 9.0.0
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/application/LegendQuery.d.ts.map +1 -1
- package/lib/application/LegendQuery.js +7 -9
- package/lib/application/LegendQuery.js.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.d.ts +4 -0
- package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.js +4 -0
- package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
- package/lib/components/{QuerySetupStoreProvider.d.ts → CloneQueryServiceSetup.d.ts} +2 -7
- package/lib/components/CloneQueryServiceSetup.d.ts.map +1 -0
- package/lib/components/CloneQueryServiceSetup.js +137 -0
- package/lib/components/CloneQueryServiceSetup.js.map +1 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts +24 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.js +144 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -0
- package/lib/components/CreateMappingQuerySetup.d.ts +18 -0
- package/lib/components/CreateMappingQuerySetup.d.ts.map +1 -0
- package/lib/components/CreateMappingQuerySetup.js +160 -0
- package/lib/components/CreateMappingQuerySetup.js.map +1 -0
- package/lib/components/EditExistingQuerySetup.d.ts +18 -0
- package/lib/components/EditExistingQuerySetup.d.ts.map +1 -0
- package/lib/components/EditExistingQuerySetup.js +107 -0
- package/lib/components/EditExistingQuerySetup.js.map +1 -0
- package/lib/components/LegendQueryApplication.d.ts.map +1 -1
- package/lib/components/LegendQueryApplication.js +4 -2
- package/lib/components/LegendQueryApplication.js.map +1 -1
- package/lib/components/LoadProjectServiceQuerySetup.d.ts +18 -0
- package/lib/components/LoadProjectServiceQuerySetup.d.ts.map +1 -0
- package/lib/components/LoadProjectServiceQuerySetup.js +63 -0
- package/lib/components/LoadProjectServiceQuerySetup.js.map +1 -0
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +31 -33
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/QueryProductionizerSetup.d.ts +18 -0
- package/lib/components/QueryProductionizerSetup.d.ts.map +1 -0
- package/lib/components/QueryProductionizerSetup.js +85 -0
- package/lib/components/QueryProductionizerSetup.js.map +1 -0
- package/lib/components/QuerySetup.d.ts +20 -5
- package/lib/components/QuerySetup.d.ts.map +1 -1
- package/lib/components/QuerySetup.js +69 -473
- package/lib/components/QuerySetup.js.map +1 -1
- package/lib/components/UpdateExistingServiceQuerySetup.d.ts +18 -0
- package/lib/components/UpdateExistingServiceQuerySetup.d.ts.map +1 -0
- package/lib/components/UpdateExistingServiceQuerySetup.js +69 -0
- package/lib/components/UpdateExistingServiceQuerySetup.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/lib/package.json +5 -8
- package/lib/stores/CloneServiceQuerySetupStore.d.ts +41 -0
- package/lib/stores/CloneServiceQuerySetupStore.d.ts.map +1 -0
- package/lib/stores/CloneServiceQuerySetupStore.js +98 -0
- package/lib/stores/CloneServiceQuerySetupStore.js.map +1 -0
- package/lib/stores/CreateMappingQuerySetupStore.d.ts +40 -0
- package/lib/stores/CreateMappingQuerySetupStore.d.ts.map +1 -0
- package/lib/stores/CreateMappingQuerySetupStore.js +97 -0
- package/lib/stores/CreateMappingQuerySetupStore.js.map +1 -0
- package/lib/stores/EditExistingQuerySetupStore.d.ts +33 -0
- package/lib/stores/EditExistingQuerySetupStore.d.ts.map +1 -0
- package/lib/stores/EditExistingQuerySetupStore.js +85 -0
- package/lib/stores/EditExistingQuerySetupStore.js.map +1 -0
- package/lib/stores/LegendQueryApplicationPlugin.d.ts +21 -16
- package/lib/stores/LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendQueryApplicationPlugin.js +4 -0
- package/lib/stores/LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/stores/LegendQueryRouter.d.ts +28 -1
- package/lib/stores/LegendQueryRouter.d.ts.map +1 -1
- package/lib/stores/LegendQueryRouter.js +33 -3
- package/lib/stores/LegendQueryRouter.js.map +1 -1
- package/lib/stores/LoadProjectServiceQuerySetupStore.d.ts +27 -0
- package/lib/stores/LoadProjectServiceQuerySetupStore.d.ts.map +1 -0
- package/lib/stores/LoadProjectServiceQuerySetupStore.js +61 -0
- package/lib/stores/LoadProjectServiceQuerySetupStore.js.map +1 -0
- package/lib/stores/QueryEditorStore.d.ts +6 -2
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +35 -17
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/QueryEditorStoreTestUtils.d.ts.map +1 -1
- package/lib/stores/QueryEditorStoreTestUtils.js +3 -0
- package/lib/stores/QueryEditorStoreTestUtils.js.map +1 -1
- package/lib/stores/QueryProductionizerSetupStore.d.ts +32 -0
- package/lib/stores/QueryProductionizerSetupStore.d.ts.map +1 -0
- package/lib/stores/QueryProductionizerSetupStore.js +101 -0
- package/lib/stores/QueryProductionizerSetupStore.js.map +1 -0
- package/lib/stores/QuerySetupStore.d.ts +22 -85
- package/lib/stores/QuerySetupStore.d.ts.map +1 -1
- package/lib/stores/QuerySetupStore.js +78 -408
- package/lib/stores/QuerySetupStore.js.map +1 -1
- package/lib/stores/UpdateExistingServiceQuerySetupStore.d.ts +28 -0
- package/lib/stores/UpdateExistingServiceQuerySetupStore.d.ts.map +1 -0
- package/lib/stores/UpdateExistingServiceQuerySetupStore.js +73 -0
- package/lib/stores/UpdateExistingServiceQuerySetupStore.js.map +1 -0
- package/package.json +13 -16
- package/src/application/LegendQuery.tsx +7 -8
- package/src/application/LegendQueryApplicationConfig.ts +14 -0
- package/src/components/CloneQueryServiceSetup.tsx +312 -0
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +184 -0
- package/src/components/CreateMappingQuerySetup.tsx +352 -0
- package/src/components/EditExistingQuerySetup.tsx +280 -0
- package/src/components/LegendQueryApplication.tsx +14 -2
- package/src/components/LoadProjectServiceQuerySetup.tsx +131 -0
- package/src/components/QueryEditor.tsx +127 -81
- package/src/components/QueryProductionizerSetup.tsx +206 -0
- package/src/components/QuerySetup.tsx +285 -1183
- package/src/components/UpdateExistingServiceQuerySetup.tsx +153 -0
- package/src/index.ts +3 -2
- package/src/stores/CloneServiceQuerySetupStore.ts +151 -0
- package/src/stores/CreateMappingQuerySetupStore.ts +155 -0
- package/src/stores/EditExistingQuerySetupStore.ts +111 -0
- package/src/stores/LegendQueryApplicationPlugin.ts +27 -27
- package/src/stores/LegendQueryRouter.ts +95 -12
- package/src/stores/LoadProjectServiceQuerySetupStore.ts +87 -0
- package/src/stores/QueryEditorStore.ts +90 -24
- package/src/stores/QueryEditorStoreTestUtils.ts +3 -0
- package/src/stores/QueryProductionizerSetupStore.ts +143 -0
- package/src/stores/QuerySetupStore.ts +111 -604
- package/src/stores/UpdateExistingServiceQuerySetupStore.ts +118 -0
- package/tsconfig.json +13 -1
- package/lib/components/QuerySetupStoreProvider.d.ts.map +0 -1
- package/lib/components/QuerySetupStoreProvider.js +0 -34
- package/lib/components/QuerySetupStoreProvider.js.map +0 -1
- package/src/components/QuerySetupStoreProvider.tsx +0 -56
@@ -0,0 +1,160 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { ArrowLeftIcon, ArrowRightIcon, BlankPanelContent, clsx, CustomSelectorInput, PanelLoadingIndicator, } from '@finos/legend-art';
|
18
|
+
import { getNullableFirstElement, guaranteeType } from '@finos/legend-shared';
|
19
|
+
import { flowResult } from 'mobx';
|
20
|
+
import { observer, useLocalObservable } from 'mobx-react-lite';
|
21
|
+
import { useContext, useEffect } from 'react';
|
22
|
+
import { generateMappingQueryCreatorRoute, generateQuerySetupRoute, } from '../stores/LegendQueryRouter.js';
|
23
|
+
import { LATEST_VERSION_ALIAS, SNAPSHOT_VERSION_ALIAS, useDepotServerClient, } from '@finos/legend-server-depot';
|
24
|
+
import { useApplicationStore, buildElementOption, } from '@finos/legend-application';
|
25
|
+
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
26
|
+
import { CreateMappingQuerySetupStore } from '../stores/CreateMappingQuerySetupStore.js';
|
27
|
+
import { BaseQuerySetup, BaseQuerySetupStoreContext, buildProjectOption, buildVersionOption, } from './QuerySetup.js';
|
28
|
+
import { compareSemVerVersions } from '@finos/legend-storage';
|
29
|
+
const CreateMappingQuerySetupStoreProvider = ({ children }) => {
|
30
|
+
const applicationStore = useLegendQueryApplicationStore();
|
31
|
+
const depotServerClient = useDepotServerClient();
|
32
|
+
const store = useLocalObservable(() => new CreateMappingQuerySetupStore(applicationStore, depotServerClient));
|
33
|
+
return (_jsx(BaseQuerySetupStoreContext.Provider, { value: store, children: children }));
|
34
|
+
};
|
35
|
+
const useCreateMappingQuerySetupStore = () => guaranteeType(useContext(BaseQuerySetupStoreContext), CreateMappingQuerySetupStore, `Can't find query setup store in context`);
|
36
|
+
const CreateMappingQuerySetupContent = observer(() => {
|
37
|
+
const setupStore = useCreateMappingQuerySetupStore();
|
38
|
+
const applicationStore = useApplicationStore();
|
39
|
+
// actions
|
40
|
+
const back = () => {
|
41
|
+
applicationStore.navigator.goToLocation(generateQuerySetupRoute());
|
42
|
+
};
|
43
|
+
const next = () => {
|
44
|
+
if (setupStore.currentProject &&
|
45
|
+
setupStore.currentVersionId &&
|
46
|
+
setupStore.currentMapping &&
|
47
|
+
setupStore.currentRuntime) {
|
48
|
+
applicationStore.navigator.goToLocation(generateMappingQueryCreatorRoute(setupStore.currentProject.groupId, setupStore.currentProject.artifactId, setupStore.currentVersionId, setupStore.currentMapping.path, setupStore.currentRuntime.path));
|
49
|
+
}
|
50
|
+
};
|
51
|
+
const canProceed = setupStore.currentProject &&
|
52
|
+
setupStore.currentVersionId &&
|
53
|
+
setupStore.currentMapping &&
|
54
|
+
setupStore.currentRuntime;
|
55
|
+
// project
|
56
|
+
const projectOptions = setupStore.projects.map(buildProjectOption);
|
57
|
+
const selectedProjectOption = setupStore.currentProject
|
58
|
+
? buildProjectOption(setupStore.currentProject)
|
59
|
+
: null;
|
60
|
+
const projectSelectorPlaceholder = setupStore.loadProjectsState.isInProgress
|
61
|
+
? 'Loading projects'
|
62
|
+
: setupStore.loadProjectsState.hasFailed
|
63
|
+
? 'Error fetching projects'
|
64
|
+
: setupStore.projects.length
|
65
|
+
? 'Choose a project'
|
66
|
+
: 'You have no projects, please create or acquire access for at least one';
|
67
|
+
const onProjectOptionChange = (option) => {
|
68
|
+
if (option?.value !== setupStore.currentProject) {
|
69
|
+
setupStore.setCurrentProject(option?.value);
|
70
|
+
// cascade
|
71
|
+
setupStore.setCurrentVersionId(undefined);
|
72
|
+
setupStore.setCurrentMapping(undefined);
|
73
|
+
setupStore.setCurrentRuntime(undefined);
|
74
|
+
}
|
75
|
+
};
|
76
|
+
// version
|
77
|
+
const versionOptions = [
|
78
|
+
LATEST_VERSION_ALIAS,
|
79
|
+
SNAPSHOT_VERSION_ALIAS,
|
80
|
+
...(setupStore.currentProject?.versions ?? []),
|
81
|
+
]
|
82
|
+
.slice()
|
83
|
+
.sort((v1, v2) => compareSemVerVersions(v2, v1))
|
84
|
+
.map(buildVersionOption);
|
85
|
+
const selectedVersionOption = setupStore.currentVersionId
|
86
|
+
? buildVersionOption(setupStore.currentVersionId)
|
87
|
+
: null;
|
88
|
+
const versionSelectorPlaceholder = !setupStore.currentProject
|
89
|
+
? 'No project selected'
|
90
|
+
: 'Choose a version';
|
91
|
+
const onVersionOptionChange = async (option) => {
|
92
|
+
if (option?.value !== setupStore.currentVersionId) {
|
93
|
+
setupStore.setCurrentVersionId(option?.value);
|
94
|
+
// cascade
|
95
|
+
setupStore.setCurrentMapping(undefined);
|
96
|
+
setupStore.setCurrentRuntime(undefined);
|
97
|
+
if (setupStore.currentProject && setupStore.currentVersionId) {
|
98
|
+
await flowResult(setupStore.surveyMappingRuntimeCompatibility(setupStore.currentProject, setupStore.currentVersionId)).catch(applicationStore.alertUnhandledError);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
};
|
102
|
+
// mapping
|
103
|
+
const mappingOptions = setupStore.mappingRuntimeCompatibilitySurveyResult.map((result) => buildElementOption(result.mapping));
|
104
|
+
const selectedMappingOption = setupStore.currentMapping
|
105
|
+
? {
|
106
|
+
label: setupStore.currentMapping.name,
|
107
|
+
value: setupStore.currentMapping,
|
108
|
+
}
|
109
|
+
: null;
|
110
|
+
const mappingSelectorPlaceholder = mappingOptions.length
|
111
|
+
? 'Choose a mapping'
|
112
|
+
: 'No mapping available';
|
113
|
+
const onMappingOptionChange = (option) => {
|
114
|
+
setupStore.setCurrentMapping(option?.value);
|
115
|
+
// cascade
|
116
|
+
if (setupStore.currentMapping) {
|
117
|
+
setupStore.setCurrentRuntime(getNullableFirstElement(setupStore.compatibleRuntimes));
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
setupStore.setCurrentRuntime(undefined);
|
121
|
+
}
|
122
|
+
};
|
123
|
+
// runtime
|
124
|
+
const runtimeOptions = setupStore.compatibleRuntimes.map(buildElementOption);
|
125
|
+
const selectedRuntimeOption = setupStore.currentRuntime
|
126
|
+
? {
|
127
|
+
label: setupStore.currentRuntime.name,
|
128
|
+
value: setupStore.currentRuntime,
|
129
|
+
}
|
130
|
+
: null;
|
131
|
+
const runtimeSelectorPlaceholder = !setupStore.currentMapping
|
132
|
+
? 'No mapping specified'
|
133
|
+
: runtimeOptions.length
|
134
|
+
? 'Choose a runtime'
|
135
|
+
: 'No runtime available';
|
136
|
+
const onRuntimeOptionChange = (option) => {
|
137
|
+
setupStore.setCurrentRuntime(option?.value);
|
138
|
+
};
|
139
|
+
useEffect(() => {
|
140
|
+
flowResult(setupStore.loadProjects()).catch(applicationStore.alertUnhandledError);
|
141
|
+
}, [setupStore, applicationStore]);
|
142
|
+
return (_jsxs("div", { className: "query-setup__wizard query-setup__create-query", children: [_jsxs("div", { className: "query-setup__wizard__header query-setup__create-query__header", children: [_jsx("button", { className: "query-setup__wizard__header__btn", onClick: back, title: "Back to Main Menu", children: _jsx(ArrowLeftIcon, {}) }), _jsx("div", { className: "query-setup__wizard__header__title", children: "Creating a new query..." }), _jsx("button", { className: clsx('query-setup__wizard__header__btn', {
|
143
|
+
'query-setup__wizard__header__btn--ready': canProceed,
|
144
|
+
}), onClick: next, disabled: !canProceed, title: "Create a new query", children: _jsx(ArrowRightIcon, {}) })] }), _jsxs("div", { className: "query-setup__wizard__content", children: [_jsxs("div", { className: "query-setup__create-query__project", children: [_jsxs("div", { className: "query-setup__wizard__group", children: [_jsx("div", { className: "query-setup__wizard__group__title", children: "Project" }), _jsx(CustomSelectorInput, { className: "query-setup__wizard__selector", options: projectOptions, disabled: setupStore.loadProjectsState.isInProgress ||
|
145
|
+
!projectOptions.length, isLoading: setupStore.loadProjectsState.isInProgress, onChange: onProjectOptionChange, value: selectedProjectOption, placeholder: projectSelectorPlaceholder, isClearable: true, escapeClearsValue: true, darkMode: true })] }), _jsxs("div", { className: "query-setup__wizard__group", children: [_jsx("div", { className: "query-setup__wizard__group__title", children: "Version" }), _jsx(CustomSelectorInput, { className: "query-setup__wizard__selector", options: versionOptions, disabled: !setupStore.currentProject, onChange: onVersionOptionChange, value: selectedVersionOption, placeholder: versionSelectorPlaceholder, isClearable: true, escapeClearsValue: true, darkMode: true })] })] }), _jsxs("div", { className: "query-setup__create-query__graph", children: [(!setupStore.currentProject ||
|
146
|
+
!setupStore.currentVersionId ||
|
147
|
+
!setupStore.surveyMappingRuntimeCompatibilityState
|
148
|
+
.hasSucceeded) && (_jsxs("div", { className: "query-setup__create-query__graph__loader", children: [_jsx(PanelLoadingIndicator, { isLoading: Boolean(setupStore.currentProject) &&
|
149
|
+
Boolean(setupStore.currentVersionId) &&
|
150
|
+
!setupStore.surveyMappingRuntimeCompatibilityState
|
151
|
+
.hasSucceeded }), _jsx(BlankPanelContent, { children: setupStore.surveyMappingRuntimeCompatibilityState.isInProgress
|
152
|
+
? `Surveying runtime and mapping compatibility...`
|
153
|
+
: setupStore.surveyMappingRuntimeCompatibilityState.hasFailed
|
154
|
+
? `Can't load runtime and mapping`
|
155
|
+
: 'Project and version must be specified' })] })), setupStore.currentProject &&
|
156
|
+
setupStore.currentVersionId &&
|
157
|
+
setupStore.surveyMappingRuntimeCompatibilityState.hasSucceeded && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "query-setup__wizard__group", children: [_jsx("div", { className: "query-setup__wizard__group__title", children: "Mapping" }), _jsx(CustomSelectorInput, { className: "query-setup__wizard__selector", options: mappingOptions, disabled: !mappingOptions.length, onChange: onMappingOptionChange, value: selectedMappingOption, placeholder: mappingSelectorPlaceholder, isClearable: true, escapeClearsValue: true, darkMode: true })] }), _jsxs("div", { className: "query-setup__wizard__group", children: [_jsx("div", { className: "query-setup__wizard__group__title", children: "Runtime" }), _jsx(CustomSelectorInput, { className: "query-setup__wizard__selector", options: runtimeOptions, disabled: !mappingOptions.length || !setupStore.currentMapping, onChange: onRuntimeOptionChange, value: selectedRuntimeOption, placeholder: runtimeSelectorPlaceholder, isClearable: true, escapeClearsValue: true, darkMode: true })] })] }))] })] })] }));
|
158
|
+
});
|
159
|
+
export const CreateMappingQuerySetup = () => (_jsx(CreateMappingQuerySetupStoreProvider, { children: _jsx(BaseQuerySetup, { children: _jsx(CreateMappingQuerySetupContent, {}) }) }));
|
160
|
+
//# sourceMappingURL=CreateMappingQuerySetup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CreateMappingQuerySetup.js","sourceRoot":"","sources":["../../src/components/CreateMappingQuerySetup.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,IAAI,EACJ,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,GAGnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,MAAM,oCAAoC,GAErC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,MA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EAC5B,WAAW,EAAE,0BAA0B,EACvC,WAAW,EAAE,IAAI,EACjB,iBAAiB,EAAE,IAAI,EACvB,QAAQ,EAAE,IAAI,GACd,IACE,IACL,CACJ,IACC,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAa,GAAG,EAAE,CAAC,CACrD,KAAC,oCAAoC,cACnC,KAAC,cAAc,cACb,KAAC,8BAA8B,KAAG,GACnB,GACoB,CACxC,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
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
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
export declare const EditExistingQuerySetup: React.FC;
|
18
|
+
//# sourceMappingURL=EditExistingQuerySetup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditExistingQuerySetup.d.ts","sourceRoot":"","sources":["../../src/components/EditExistingQuerySetup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAmQH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAM1C,CAAC"}
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { ArrowLeftIcon, ArrowRightIcon, BlankPanelContent, clsx, CustomSelectorInput, PanelLoadingIndicator, SearchIcon, UserIcon, } from '@finos/legend-art';
|
18
|
+
import { debounce, guaranteeType } from '@finos/legend-shared';
|
19
|
+
import { flowResult } from 'mobx';
|
20
|
+
import { observer, useLocalObservable } from 'mobx-react-lite';
|
21
|
+
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
22
|
+
import { generateExistingQueryEditorRoute, generateQuerySetupRoute, } from '../stores/LegendQueryRouter.js';
|
23
|
+
import { useDepotServerClient } from '@finos/legend-server-depot';
|
24
|
+
import { useApplicationStore, EDITOR_LANGUAGE, TextInputEditor, } from '@finos/legend-application';
|
25
|
+
import { buildQueryOption, } from '@finos/legend-query-builder';
|
26
|
+
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
27
|
+
import { EditExistingQuerySetupStore } from '../stores/EditExistingQuerySetupStore.js';
|
28
|
+
import { BaseQuerySetup, BaseQuerySetupStoreContext } from './QuerySetup.js';
|
29
|
+
const EditExistingQuerySetupStoreProvider = ({ children }) => {
|
30
|
+
const applicationStore = useLegendQueryApplicationStore();
|
31
|
+
const depotServerClient = useDepotServerClient();
|
32
|
+
const store = useLocalObservable(() => new EditExistingQuerySetupStore(applicationStore, depotServerClient));
|
33
|
+
return (_jsx(BaseQuerySetupStoreContext.Provider, { value: store, children: children }));
|
34
|
+
};
|
35
|
+
const useEditExistingQuerySetupStore = () => guaranteeType(useContext(BaseQuerySetupStoreContext), EditExistingQuerySetupStore, `Can't find query setup store in context`);
|
36
|
+
const EditExistingQuerySetupContent = observer(() => {
|
37
|
+
const setupStore = useEditExistingQuerySetupStore();
|
38
|
+
const applicationStore = useApplicationStore();
|
39
|
+
const querySearchRef = useRef(null);
|
40
|
+
const [searchText, setSearchText] = useState('');
|
41
|
+
// actions
|
42
|
+
const back = () => {
|
43
|
+
applicationStore.navigator.goToLocation(generateQuerySetupRoute());
|
44
|
+
};
|
45
|
+
const next = () => {
|
46
|
+
if (setupStore.currentQuery) {
|
47
|
+
applicationStore.navigator.goToLocation(generateExistingQueryEditorRoute(setupStore.currentQuery.id));
|
48
|
+
}
|
49
|
+
};
|
50
|
+
const canProceed = setupStore.currentQuery;
|
51
|
+
// query
|
52
|
+
const queryOptions = setupStore.queries.map(buildQueryOption);
|
53
|
+
const selectedQueryOption = setupStore.currentQuery
|
54
|
+
? buildQueryOption(setupStore.currentQuery)
|
55
|
+
: null;
|
56
|
+
const onQueryOptionChange = (option) => {
|
57
|
+
if (option?.value !== setupStore.currentQuery) {
|
58
|
+
setupStore.setCurrentQuery(option?.value.id);
|
59
|
+
}
|
60
|
+
};
|
61
|
+
const formatQueryOptionLabel = (option) => {
|
62
|
+
const deleteQuery = (event) => {
|
63
|
+
event.preventDefault();
|
64
|
+
event.stopPropagation();
|
65
|
+
setupStore.graphManagerState.graphManager
|
66
|
+
.deleteQuery(option.value.id)
|
67
|
+
.then(() => flowResult(setupStore.loadQueries('')).catch(applicationStore.alertUnhandledError))
|
68
|
+
.catch(applicationStore.alertUnhandledError);
|
69
|
+
};
|
70
|
+
if (option.value.id === setupStore.currentQuery?.id) {
|
71
|
+
return option.label;
|
72
|
+
}
|
73
|
+
return (_jsxs("div", { className: "query-setup__existing-query__query-option", children: [_jsx("div", { className: "query-setup__existing-query__query-option__label", title: option.label, children: option.label }), setupStore.showCurrentUserQueriesOnly && (_jsx("button", { className: "query-setup__existing-query__query-option__action", tabIndex: -1, onClick: deleteQuery, children: "Delete" })), !setupStore.showCurrentUserQueriesOnly && Boolean(option.value.owner) && (_jsx("div", { className: clsx('query-setup__existing-query__query-option__user', {
|
74
|
+
'query-setup__existing-query__query-option__user--mine': option.value.isCurrentUserQuery,
|
75
|
+
}), children: option.value.isCurrentUserQuery ? 'mine' : option.value.owner }))] }));
|
76
|
+
};
|
77
|
+
// search text
|
78
|
+
const debouncedLoadQueries = useMemo(() => debounce((input) => {
|
79
|
+
flowResult(setupStore.loadQueries(input)).catch(applicationStore.alertUnhandledError);
|
80
|
+
}, 500), [applicationStore, setupStore]);
|
81
|
+
const onSearchTextChange = (value) => {
|
82
|
+
if (value !== searchText) {
|
83
|
+
setSearchText(value);
|
84
|
+
debouncedLoadQueries.cancel();
|
85
|
+
debouncedLoadQueries(value);
|
86
|
+
}
|
87
|
+
};
|
88
|
+
// show current user queries only
|
89
|
+
const toggleShowCurrentUserQueriesOnly = () => {
|
90
|
+
setupStore.setShowCurrentUserQueriesOnly(!setupStore.showCurrentUserQueriesOnly);
|
91
|
+
debouncedLoadQueries.cancel();
|
92
|
+
debouncedLoadQueries(searchText);
|
93
|
+
};
|
94
|
+
useEffect(() => {
|
95
|
+
flowResult(setupStore.loadQueries('')).catch(applicationStore.alertUnhandledError);
|
96
|
+
}, [setupStore, applicationStore]);
|
97
|
+
useEffect(() => {
|
98
|
+
querySearchRef.current?.focus();
|
99
|
+
}, []);
|
100
|
+
return (_jsxs("div", { className: "query-setup__wizard query-setup__existing-query", children: [_jsxs("div", { className: "query-setup__wizard__header query-setup__existing-query__header", children: [_jsx("button", { className: "query-setup__wizard__header__btn", onClick: back, title: "Back to Main Menu", children: _jsx(ArrowLeftIcon, {}) }), _jsx("div", { className: "query-setup__wizard__header__title", children: "Loading an existing query..." }), _jsx("button", { className: clsx('query-setup__wizard__header__btn', {
|
101
|
+
'query-setup__wizard__header__btn--ready': canProceed,
|
102
|
+
}), onClick: next, disabled: !canProceed, title: "Edit query", children: _jsx(ArrowRightIcon, {}) })] }), _jsxs("div", { className: "query-setup__wizard__content", children: [_jsxs("div", { className: "query-setup__wizard__group query-setup__wizard__group--inline", children: [_jsx("div", { className: "query-setup__wizard__group__title", children: _jsx(SearchIcon, {}) }), _jsxs("div", { className: "query-setup__existing-query__input", children: [_jsx(CustomSelectorInput, { ref: querySearchRef, className: "query-setup__wizard__selector", options: queryOptions, isLoading: setupStore.loadQueriesState.isInProgress, onInputChange: onSearchTextChange, inputValue: searchText, onChange: onQueryOptionChange, value: selectedQueryOption, placeholder: "Search for query by name...", isClearable: true, escapeClearsValue: true, darkMode: true, formatOptionLabel: formatQueryOptionLabel }), _jsx("button", { className: clsx('query-setup__existing-query__btn', {
|
103
|
+
'query-setup__existing-query__btn--active': setupStore.showCurrentUserQueriesOnly,
|
104
|
+
}), tabIndex: -1, title: `[${setupStore.showCurrentUserQueriesOnly ? 'on' : 'off'}] Toggle show only queries of current user`, onClick: toggleShowCurrentUserQueriesOnly, children: _jsx(UserIcon, {}) })] })] }), _jsxs("div", { className: "query-setup__existing-query__preview", children: [_jsx(PanelLoadingIndicator, { isLoading: setupStore.loadQueryState.isInProgress }), setupStore.currentQuery && (_jsxs(_Fragment, { children: [!setupStore.currentQueryInfo && (_jsx(BlankPanelContent, { children: `Can't preview query` })), setupStore.currentQueryInfo && (_jsx(TextInputEditor, { inputValue: setupStore.currentQueryInfo.content, isReadOnly: true, language: EDITOR_LANGUAGE.PURE, showMiniMap: false, hideGutter: true }))] })), !setupStore.currentQuery && (_jsx(BlankPanelContent, { children: "No query to preview" }))] })] })] }));
|
105
|
+
});
|
106
|
+
export const EditExistingQuerySetup = () => (_jsx(EditExistingQuerySetupStoreProvider, { children: _jsx(BaseQuerySetup, { children: _jsx(EditExistingQuerySetupContent, {}) }) }));
|
107
|
+
//# sourceMappingURL=EditExistingQuerySetup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditExist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AK,SAAS,EAAC,sCAAsC,aACnD,KAAC,qBAAqB,IACpB,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,YAAY,GACjD,EACD,UAAU,CAAC,YAAY,IAAI,CAC1B,8BACG,CAAC,UAAU,CAAC,gBAAgB,IAAI,CAC/B,KAAC,iBAAiB,cAAE,qBAAqB,GAAqB,CAC/D,EACA,UAAU,CAAC,gBAAgB,IAAI,CAC9B,KAAC,eAAe,IACd,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAC/C,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,eAAe,CAAC,IAAI,EAC9B,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,IAAI,GAChB,CACH,IACA,CACJ,EACA,CAAC,UAAU,CAAC,YAAY,IAAI,CAC3B,KAAC,iBAAiB,sCAAwC,CAC3D,IACG,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAa,GAAG,EAAE,CAAC,CACpD,KAAC,mCAAmC,cAClC,KAAC,cAAc,cACb,KAAC,6BAA6B,KAAG,GAClB,GACmB,CACvC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendQueryApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendQueryApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAkBH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;
|
1
|
+
{"version":3,"file":"LegendQueryApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendQueryApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAkBH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AA6DnG,eAAO,MAAM,sBAAsB,WACzB;IAAE,MAAM,EAAE,4BAA4B,CAAA;CAAE;;CAiBjD,CAAC"}
|
@@ -16,17 +16,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
*/
|
17
17
|
import { observer } from 'mobx-react-lite';
|
18
18
|
import { LEGEND_QUERY_ROUTE_PATTERN } from '../stores/LegendQueryRouter.js';
|
19
|
-
import {
|
19
|
+
import { QuerySetupLandingPage } from './QuerySetup.js';
|
20
20
|
import { MappingQueryCreator, ExistingQueryEditor, ServiceQueryCreator, } from './QueryEditor.js';
|
21
21
|
import { DepotServerClientProvider } from '@finos/legend-server-depot';
|
22
22
|
import { generateExtensionUrlPattern, LegendApplicationComponentFrameworkProvider, Redirect, Route, Switch, } from '@finos/legend-application';
|
23
23
|
import { LegendQueryBaseStoreProvider, useLegendQueryApplicationStore, } from './LegendQueryBaseStoreProvider.js';
|
24
|
+
import { EditExistingQuerySetup } from './EditExistingQuerySetup.js';
|
25
|
+
import { CreateMappingQuerySetup } from './CreateMappingQuerySetup.js';
|
24
26
|
const LegendQueryApplicationRoot = observer(() => {
|
25
27
|
const applicationStore = useLegendQueryApplicationStore();
|
26
28
|
const extraApplicationPageEntries = applicationStore.pluginManager
|
27
29
|
.getApplicationPlugins()
|
28
30
|
.flatMap((plugin) => plugin.getExtraApplicationPageEntries?.() ?? []);
|
29
|
-
return (_jsx("div", { className: "app", children: _jsxs(Switch, { children: [_jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.SETUP, component:
|
31
|
+
return (_jsx("div", { className: "app", children: _jsxs(Switch, { children: [_jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.SETUP, component: QuerySetupLandingPage }), _jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY_SETUP, component: EditExistingQuerySetup }), _jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.CREATE_MAPPING_QUERY_SETUP, component: CreateMappingQuerySetup }), _jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY, component: ExistingQueryEditor }), _jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_SERVICE_QUERY, component: ServiceQueryCreator }), _jsx(Route, { exact: true, path: LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_MAPPING_QUERY, component: MappingQueryCreator }), extraApplicationPageEntries.map((entry) => (_jsx(Route, { exact: true, path: entry.urlPatterns.map(generateExtensionUrlPattern), component: entry.renderer }, entry.key))), _jsx(Redirect, { to: LEGEND_QUERY_ROUTE_PATTERN.SETUP })] }) }));
|
30
32
|
});
|
31
33
|
export const LegendQueryApplication = observer((props) => {
|
32
34
|
const { config } = props;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendQueryApplication.js","sourceRoot":"","sources":["../../src/components/LegendQueryApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"LegendQueryApplication.js","sourceRoot":"","sources":["../../src/components/LegendQueryApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,2CAA2C,EAC3C,QAAQ,EACR,KAAK,EACL,MAAM,GACP,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,mCAAmC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,IAAI,EACX,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,2BAA2B,CAAC,EACxD,SAAS,EAAE,KAAK,CAAC,QAAwC,IAHpD,KAAK,CAAC,GAAG,CAId,CACH,CAAC,EACF,KAAC,QAAQ,IAAC,EAAE,EAAE,0BAA0B,CAAC,KAAK,GAAI,IAC3C,GACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAC5C,CAAC,KAA+C,EAAE,EAAE;IAClD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,OAAO,CACL,KAAC,yBAAyB,IACxB,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,CAAC,cAAc;SACjC,YAED,KAAC,4BAA4B,cAC3B,KAAC,2CAA2C,cAC1C,KAAC,0BAA0B,KAAG,GACc,GACjB,GACL,CAC7B,CAAC;AACJ,CAAC,CACF,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
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
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
export declare const LoadProjectServiceQuerySetup: React.FC;
|
18
|
+
//# sourceMappingURL=LoadProjectServiceQuerySetup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LoadProjectServiceQuerySetup.d.ts","sourceRoot":"","sources":["../../src/components/LoadProjectServiceQuerySetup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AA8GH,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAMhD,CAAC"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { ArrowLeftIcon, CustomSelectorInput } from '@finos/legend-art';
|
18
|
+
import { guaranteeType } from '@finos/legend-shared';
|
19
|
+
import { flowResult } from 'mobx';
|
20
|
+
import { observer, useLocalObservable } from 'mobx-react-lite';
|
21
|
+
import { useContext, useEffect } from 'react';
|
22
|
+
import { generateQuerySetupRoute } from '../stores/LegendQueryRouter.js';
|
23
|
+
import { useDepotServerClient } from '@finos/legend-server-depot';
|
24
|
+
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
25
|
+
import { LoadProjectServiceQuerySetupStore } from '../stores/LoadProjectServiceQuerySetupStore.js';
|
26
|
+
import { BaseQuerySetup, BaseQuerySetupStoreContext, buildProjectOption, } from './QuerySetup.js';
|
27
|
+
import '@finos/legend-query-builder';
|
28
|
+
import { useApplicationStore } from '@finos/legend-application';
|
29
|
+
const LoadProjectServiceQuerySetupStoreProvider = ({ children }) => {
|
30
|
+
const applicationStore = useLegendQueryApplicationStore();
|
31
|
+
const depotServerClient = useDepotServerClient();
|
32
|
+
const store = useLocalObservable(() => new LoadProjectServiceQuerySetupStore(applicationStore, depotServerClient));
|
33
|
+
return (_jsx(BaseQuerySetupStoreContext.Provider, { value: store, children: children }));
|
34
|
+
};
|
35
|
+
const useLoadProjectServiceQuerySetupStore = () => guaranteeType(useContext(BaseQuerySetupStoreContext), LoadProjectServiceQuerySetupStore, `Can't find query setup store in context`);
|
36
|
+
const LoadProjectServiceQuerySetupContent = observer(() => {
|
37
|
+
const applicationStore = useApplicationStore();
|
38
|
+
const setupStore = useLoadProjectServiceQuerySetupStore();
|
39
|
+
const back = () => {
|
40
|
+
applicationStore.navigator.goToLocation(generateQuerySetupRoute());
|
41
|
+
};
|
42
|
+
// project
|
43
|
+
const projectOptions = setupStore.projects.map(buildProjectOption);
|
44
|
+
const projectSelectorPlaceholder = setupStore.loadProjectsState.isInProgress
|
45
|
+
? 'Loading projects'
|
46
|
+
: setupStore.loadProjectsState.hasFailed
|
47
|
+
? 'Error fetching projects'
|
48
|
+
: setupStore.projects.length
|
49
|
+
? 'Choose a project'
|
50
|
+
: 'You have no projects, please create or acquire access for at least one';
|
51
|
+
const onProjectOptionChange = (option) => {
|
52
|
+
setupStore
|
53
|
+
.loadProjectServiceUpdater(option.value)
|
54
|
+
.catch(applicationStore.alertUnhandledError);
|
55
|
+
};
|
56
|
+
useEffect(() => {
|
57
|
+
flowResult(setupStore.loadProjects()).catch(applicationStore.alertUnhandledError);
|
58
|
+
}, [setupStore, applicationStore]);
|
59
|
+
return (_jsxs("div", { className: "query-setup__wizard query-setup__existing-service-query", children: [_jsxs("div", { className: "query-setup__wizard__header query-setup__service-query__header", children: [_jsx("button", { className: "query-setup__wizard__header__btn", onClick: back, title: "Back to Main Menu", children: _jsx(ArrowLeftIcon, {}) }), _jsx("div", { className: "query-setup__wizard__header__title", children: "Load service query from a project..." })] }), _jsx("div", { className: "query-setup__wizard__content", children: _jsx("div", { className: "query-setup__wizard__group query-setup__wizard__group--inline query-setup__existing-service-query__search-bar", children: _jsx(CustomSelectorInput, { className: "query-setup__wizard__selector", options: projectOptions, disabled: setupStore.loadProjectsState.isInProgress ||
|
60
|
+
!projectOptions.length, isLoading: setupStore.loadProjectsState.isInProgress, onChange: onProjectOptionChange, placeholder: projectSelectorPlaceholder, darkMode: true }) }) })] }));
|
61
|
+
});
|
62
|
+
export const LoadProjectServiceQuerySetup = () => (_jsx(LoadProjectServiceQuerySetupStoreProvider, { children: _jsx(BaseQuerySetup, { children: _jsx(LoadProjectServiceQuerySetupContent, {}) }) }));
|
63
|
+
//# sourceMappingURL=LoadProjectServiceQuerySetup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LoadProjectServiceQuerySetup.js","sourceRoot":"","sources":["../../src/components/LoadProjectServiceQuerySetup.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AACnG,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAe,6BAA6B,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,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;;;;GAcG;;
|
1
|
+
{"version":3,"file":"QueryEditor.d.ts","sourceRoot":"","sources":["../../src/components/QueryEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAgfH,eAAO,MAAM,WAAW;;CAsHtB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;CAS9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;CAmB9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;CAe9B,CAAC"}
|
@@ -14,18 +14,17 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
14
14
|
* See the License for the specific language governing permissions and
|
15
15
|
* limitations under the License.
|
16
16
|
*/
|
17
|
-
import { Dialog,
|
17
|
+
import { Dialog, ExternalLinkSquareIcon, PanelLoadingIndicator, SaveIcon, BlankPanelContent, clsx, EmptyLightBulbIcon, LightBulbIcon, SearchIcon, TimesIcon, CheckSquareIcon, SquareIcon, ManageSearchIcon, DropdownMenu, MenuContent, MenuContentItem, CaretDownIcon, MenuIcon, MenuContentDivider, MenuContentItemIcon, CheckIcon, MenuContentItemLabel, } from '@finos/legend-art';
|
18
18
|
import { debounce, getQueryParameters } from '@finos/legend-shared';
|
19
19
|
import { observer } from 'mobx-react-lite';
|
20
20
|
import { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
21
|
-
import {
|
22
|
-
import {
|
21
|
+
import { LEGEND_QUERY_QUERY_PARAM_TOKEN, LEGEND_QUERY_PATH_PARAM_TOKEN, generateExistingQueryEditorRoute, generateQuerySetupRoute, } from '../stores/LegendQueryRouter.js';
|
22
|
+
import { ExistingQueryEditorStore, QueryExportState, createViewProjectHandler, createViewSDLCProjectHandler, } from '../stores/QueryEditorStore.js';
|
23
23
|
import { useApplicationStore, useParams } from '@finos/legend-application';
|
24
24
|
import { MappingQueryCreatorStoreProvider, ExistingQueryEditorStoreProvider, ServiceQueryCreatorStoreProvider, useQueryEditorStore, } from './QueryEditorStoreProvider.js';
|
25
|
-
import { extractElementNameFromPath, } from '@finos/legend-graph';
|
26
25
|
import { flowResult } from 'mobx';
|
27
26
|
import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
|
28
|
-
import { QueryBuilder, } from '@finos/legend-query-builder';
|
27
|
+
import { QueryBuilder, QueryBuilderNavigationBlocker, } from '@finos/legend-query-builder';
|
29
28
|
const QueryExportDialogContent = observer((props) => {
|
30
29
|
const { exportState } = props;
|
31
30
|
const applicationStore = useApplicationStore();
|
@@ -54,27 +53,6 @@ const QueryExport = observer(() => {
|
|
54
53
|
paper: 'editor-modal__content',
|
55
54
|
}, children: _jsxs("div", { className: "modal modal--dark query-export", children: [_jsx("div", { className: "modal__header", children: _jsx("div", { className: "modal__title", children: "Save Query" }) }), exportState && _jsx(QueryExportDialogContent, { exportState: exportState })] }) }));
|
56
55
|
});
|
57
|
-
const renderQueryEditorHeaderLabel = (editorStore) => {
|
58
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
59
|
-
return (_jsx("div", { className: "query-editor__header__label query-editor__header__label--existing-query", children: editorStore.query.name }));
|
60
|
-
}
|
61
|
-
else if (editorStore instanceof MappingQueryCreatorStore) {
|
62
|
-
return (_jsx("div", { className: "query-editor__header__label query-editor__header__label--create-query", children: "New Query" }));
|
63
|
-
}
|
64
|
-
else if (editorStore instanceof ServiceQueryCreatorStore) {
|
65
|
-
return (_jsxs("div", { className: "query-editor__header__label query-editor__header__label--service-query", children: [_jsx(RobotIcon, { className: "query-editor__header__label__icon" }), extractElementNameFromPath(editorStore.servicePath), editorStore.executionKey && (_jsx("div", { className: "query-editor__header__label__tag", children: editorStore.executionKey }))] }));
|
66
|
-
}
|
67
|
-
const extraQueryEditorHeaderLabelers = editorStore.pluginManager
|
68
|
-
.getApplicationPlugins()
|
69
|
-
.flatMap((plugin) => plugin.getExtraQueryEditorHeaderLabelers?.() ?? []);
|
70
|
-
for (const labeler of extraQueryEditorHeaderLabelers) {
|
71
|
-
const label = labeler(editorStore);
|
72
|
-
if (label) {
|
73
|
-
return label;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
return null;
|
77
|
-
};
|
78
56
|
const QueryLoader = observer((props) => {
|
79
57
|
const { editorStore, queryBuilderState } = props;
|
80
58
|
const applicationStore = useApplicationStore();
|
@@ -113,7 +91,7 @@ const QueryLoader = observer((props) => {
|
|
113
91
|
if (selectedQueryID) {
|
114
92
|
queryBuilderState.changeDetectionState.alertUnsavedChanges(() => {
|
115
93
|
editorStore.queryLoaderState.setIsQueryLoaderOpen(false);
|
116
|
-
applicationStore.navigator.
|
94
|
+
applicationStore.navigator.goToLocation(generateExistingQueryEditorRoute(selectedQueryID), { ignoreBlocking: true });
|
117
95
|
});
|
118
96
|
}
|
119
97
|
};
|
@@ -141,9 +119,13 @@ const QueryEditorHeaderContent = observer((props) => {
|
|
141
119
|
const openQueryLoader = () => {
|
142
120
|
editorStore.queryLoaderState.setIsQueryLoaderOpen(true);
|
143
121
|
};
|
144
|
-
const
|
122
|
+
const viewProject = () => {
|
145
123
|
const { groupId, artifactId, versionId } = editorStore.getProjectInfo();
|
146
|
-
applicationStore
|
124
|
+
createViewProjectHandler(applicationStore)(groupId, artifactId, versionId, undefined);
|
125
|
+
};
|
126
|
+
const viewSDLCProject = () => {
|
127
|
+
const { groupId, artifactId } = editorStore.getProjectInfo();
|
128
|
+
createViewSDLCProjectHandler(applicationStore, editorStore.depotServerClient)(groupId, artifactId, undefined).catch(applicationStore.alertUnhandledError);
|
147
129
|
};
|
148
130
|
const toggleLightDarkMode = () => applicationStore.TEMPORARY__setIsLightThemeEnabled(!applicationStore.TEMPORARY__isLightThemeEnabled);
|
149
131
|
const saveQuery = () => {
|
@@ -153,18 +135,30 @@ const QueryEditorHeaderContent = observer((props) => {
|
|
153
135
|
})
|
154
136
|
.catch(applicationStore.alertUnhandledError);
|
155
137
|
};
|
156
|
-
return (_jsxs("div", { className: "query-editor__header__content", children: [_jsx("div", { className: "query-editor__header__content__main"
|
138
|
+
return (_jsxs("div", { className: "query-editor__header__content", children: [_jsx("div", { className: "query-editor__header__content__main" }), _jsxs("div", { className: "query-editor__header__actions", children: [editorStore instanceof ExistingQueryEditorStore &&
|
157
139
|
applicationStore.pluginManager
|
158
140
|
.getApplicationPlugins()
|
159
141
|
.flatMap((plugin) => plugin.getExtraExistingQueryActionRendererConfiguration?.() ??
|
160
142
|
[])
|
161
|
-
.map((actionConfig) => (_jsx(Fragment, { children: actionConfig.renderer(editorStore, queryBuilderState) }, actionConfig.key))), _jsx("button", { className: "query-editor__header__action btn--dark", tabIndex: -1, onClick: openQueryLoader, title: "Load query...", children: _jsx(ManageSearchIcon, { className: "query-editor__header__action__icon--loader" }) }), editorStore.queryLoaderState.isQueryLoaderOpen && (_jsx(QueryLoader, { editorStore: editorStore, queryBuilderState: queryBuilderState })), _jsx("button", { className: "query-
|
143
|
+
.map((actionConfig) => (_jsx(Fragment, { children: actionConfig.renderer(editorStore, queryBuilderState) }, actionConfig.key))), _jsx("button", { className: "query-editor__header__action btn--dark", tabIndex: -1, onClick: openQueryLoader, title: "Load query...", children: _jsx(ManageSearchIcon, { className: "query-editor__header__action__icon--loader" }) }), editorStore.queryLoaderState.isQueryLoaderOpen && (_jsx(QueryLoader, { editorStore: editorStore, queryBuilderState: queryBuilderState })), _jsxs("div", { className: "query-editor__header__action query-editor__header__action__view-project", children: [_jsx("button", { className: "query-editor__header__action__view-project__btn btn--dark", disabled: editorStore.isViewProjectActionDisabled, tabIndex: -1, title: "View project", onClick: viewProject, children: _jsx(ExternalLinkSquareIcon, {}) }), _jsx(DropdownMenu, { className: "query-editor__header__action__view-project__dropdown-trigger btn--dark", disabled: editorStore.isViewProjectActionDisabled, content: _jsx(MenuContent, { children: _jsx(MenuContentItem, { disabled: editorStore.isViewProjectActionDisabled, onClick: viewSDLCProject, children: "View SDLC project" }) }), children: _jsx(CaretDownIcon, {}) })] }), applicationStore.config.options.TEMPORARY__enableThemeSwitcher && (_jsx("button", { className: "query-editor__header__action btn--dark", tabIndex: -1, title: "Toggle light/dark mode", onClick: toggleLightDarkMode, children: applicationStore.TEMPORARY__isLightThemeEnabled ? (_jsx(EmptyLightBulbIcon, {})) : (_jsx(LightBulbIcon, {})) })), _jsx("button", { className: "query-editor__header__action btn--dark", tabIndex: -1, disabled: editorStore.isSaveActionDisabled, onClick: saveQuery, title: "Save query", children: _jsx(SaveIcon, {}) }), editorStore.exportState && _jsx(QueryExport, {})] })] }));
|
162
144
|
});
|
163
145
|
export const QueryEditor = observer(() => {
|
164
146
|
const applicationStore = useApplicationStore();
|
165
147
|
const editorStore = useQueryEditorStore();
|
166
148
|
const isLoadingEditor = !editorStore.initState.hasCompleted;
|
167
|
-
|
149
|
+
// documentation
|
150
|
+
const appDocUrl = applicationStore.documentationService.url;
|
151
|
+
const goToDocumentation = () => {
|
152
|
+
if (appDocUrl) {
|
153
|
+
applicationStore.navigator.visitAddress(appDocUrl);
|
154
|
+
}
|
155
|
+
};
|
156
|
+
// go to setup page
|
157
|
+
const goToQuerySetup = () => applicationStore.navigator.visitAddress(applicationStore.navigator.generateAddress(generateQuerySetupRoute()));
|
158
|
+
// settings
|
159
|
+
// NOTE: this is temporary until we find a better home for these settings in query builder
|
160
|
+
const engineConfig = editorStore.graphManagerState.graphManager.TEMPORARY__getEngineConfig();
|
161
|
+
const toggleEngineClientRequestPayloadCompression = () => engineConfig.setUseClientRequestPayloadCompression(!engineConfig.useClientRequestPayloadCompression);
|
168
162
|
useEffect(() => {
|
169
163
|
flowResult(editorStore.initialize()).catch(applicationStore.alertUnhandledError);
|
170
164
|
}, [editorStore, applicationStore]);
|
@@ -176,7 +170,11 @@ export const QueryEditor = observer(() => {
|
|
176
170
|
{
|
177
171
|
'query-editor--light': applicationStore.TEMPORARY__isLightThemeEnabled,
|
178
172
|
},
|
179
|
-
]), children: [_jsxs("div", { className: "query-editor__header", children: [_jsx("
|
173
|
+
]), children: [_jsxs("div", { className: "query-editor__header", children: [_jsx("div", { className: "query-editor__header__menu", children: _jsx(DropdownMenu, { className: "query-editor__header__menu-item", menuProps: {
|
174
|
+
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
175
|
+
transformOrigin: { vertical: 'top', horizontal: 'left' },
|
176
|
+
elevation: 7,
|
177
|
+
}, content: _jsxs(MenuContent, { children: [_jsx(MenuContentItem, { disabled: !appDocUrl, onClick: goToDocumentation, children: "See Documentation" }), _jsx(MenuContentItem, { onClick: goToQuerySetup, children: "Back to query setup" }), _jsx(MenuContentDivider, {}), _jsx(MenuContentItem, { disabled: true, children: "Settings" }), _jsxs(MenuContentItem, { onClick: toggleEngineClientRequestPayloadCompression, children: [_jsx(MenuContentItemIcon, { children: engineConfig.useClientRequestPayloadCompression ? (_jsx(CheckIcon, {})) : null }), _jsx(MenuContentItemLabel, { children: "Compress request payload" })] })] }), children: _jsx(MenuIcon, {}) }) }), !isLoadingEditor && editorStore.queryBuilderState && (_jsx(QueryEditorHeaderContent, { queryBuilderState: editorStore.queryBuilderState }))] }), _jsxs("div", { className: "query-editor__content", children: [_jsx(PanelLoadingIndicator, { isLoading: isLoadingEditor }), !isLoadingEditor && editorStore.queryBuilderState && (_jsxs(_Fragment, { children: [_jsx(QueryBuilderNavigationBlocker, { queryBuilderState: editorStore.queryBuilderState }), _jsx(QueryBuilder, { queryBuilderState: editorStore.queryBuilderState })] })), (isLoadingEditor || !editorStore.queryBuilderState) && (_jsx(BlankPanelContent, { children: editorStore.initState.message ??
|
180
178
|
editorStore.graphManagerState.systemBuildState.message ??
|
181
179
|
editorStore.graphManagerState.dependenciesBuildState.message ??
|
182
180
|
editorStore.graphManagerState.generationsBuildState.message ??
|