@finos/legend-application-query 13.8.29 → 13.8.31
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__/LegendQueryEvent.d.ts +3 -0
- package/lib/__lib__/LegendQueryEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryEvent.js +3 -0
- package/lib/__lib__/LegendQueryEvent.js.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.d.ts +12 -0
- package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.js +16 -0
- package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
- package/lib/__lib__/LegendQueryTelemetryHelper.d.ts +3 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryTelemetryHelper.js +9 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +15 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
- package/lib/components/LegendQueryWebApplication.js +2 -1
- package/lib/components/LegendQueryWebApplication.js.map +1 -1
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +12 -2
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/data-product/LegendQueryDataProductQueryBuilder.d.ts.map +1 -1
- package/lib/components/data-product/LegendQueryDataProductQueryBuilder.js +6 -40
- package/lib/components/data-product/LegendQueryDataProductQueryBuilder.js.map +1 -1
- package/lib/components/ingest/IngestInfo.d.ts +32 -0
- package/lib/components/ingest/IngestInfo.d.ts.map +1 -0
- package/lib/components/ingest/IngestInfo.js +63 -0
- package/lib/components/ingest/IngestInfo.js.map +1 -0
- package/lib/components/ingest/IngestQueryBuilderSetupPanel.d.ts +18 -0
- package/lib/components/ingest/IngestQueryBuilderSetupPanel.d.ts.map +1 -0
- package/lib/components/ingest/IngestQueryBuilderSetupPanel.js +77 -0
- package/lib/components/ingest/IngestQueryBuilderSetupPanel.js.map +1 -0
- package/lib/components/ingest/IngestQueryCreator.d.ts +27 -0
- package/lib/components/ingest/IngestQueryCreator.d.ts.map +1 -0
- package/lib/components/ingest/IngestQueryCreator.js +45 -0
- package/lib/components/ingest/IngestQueryCreator.js.map +1 -0
- package/lib/components/shared/LakehouseRuntimeConfigModal.d.ts +29 -0
- package/lib/components/shared/LakehouseRuntimeConfigModal.d.ts.map +1 -0
- package/lib/components/shared/LakehouseRuntimeConfigModal.js +60 -0
- package/lib/components/shared/LakehouseRuntimeConfigModal.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/light-mode.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryEditorStore.d.ts +10 -0
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +81 -2
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/ingest/IngestLegendQueryBuilderState.d.ts +122 -0
- package/lib/stores/ingest/IngestLegendQueryBuilderState.d.ts.map +1 -0
- package/lib/stores/ingest/IngestLegendQueryBuilderState.js +191 -0
- package/lib/stores/ingest/IngestLegendQueryBuilderState.js.map +1 -0
- package/lib/stores/ingest/IngestQueryCreatorStore.d.ts +75 -0
- package/lib/stores/ingest/IngestQueryCreatorStore.d.ts.map +1 -0
- package/lib/stores/ingest/IngestQueryCreatorStore.js +169 -0
- package/lib/stores/ingest/IngestQueryCreatorStore.js.map +1 -0
- package/lib/stores/ingest/IngestQueryGraphHelper.d.ts +58 -0
- package/lib/stores/ingest/IngestQueryGraphHelper.d.ts.map +1 -0
- package/lib/stores/ingest/IngestQueryGraphHelper.js +72 -0
- package/lib/stores/ingest/IngestQueryGraphHelper.js.map +1 -0
- package/package.json +13 -13
- package/src/__lib__/LegendQueryEvent.ts +3 -0
- package/src/__lib__/LegendQueryNavigation.ts +35 -0
- package/src/__lib__/LegendQueryTelemetryHelper.ts +15 -0
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +20 -0
- package/src/components/LegendQueryWebApplication.tsx +14 -0
- package/src/components/QueryEditor.tsx +25 -1
- package/src/components/data-product/LegendQueryDataProductQueryBuilder.tsx +7 -127
- package/src/components/ingest/IngestInfo.tsx +197 -0
- package/src/components/ingest/IngestQueryBuilderSetupPanel.tsx +204 -0
- package/src/components/ingest/IngestQueryCreator.tsx +75 -0
- package/src/components/shared/LakehouseRuntimeConfigModal.tsx +148 -0
- package/src/stores/QueryEditorStore.ts +131 -1
- package/src/stores/ingest/IngestLegendQueryBuilderState.ts +259 -0
- package/src/stores/ingest/IngestQueryCreatorStore.ts +262 -0
- package/src/stores/ingest/IngestQueryGraphHelper.ts +120 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
import { resolveVersion, } from '@finos/legend-server-depot';
|
|
17
|
+
import { CORE_PURE_PATH, createGraphBuilderReport, IngestDefinition, LegendSDLC, } from '@finos/legend-graph';
|
|
18
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
19
|
+
/**
|
|
20
|
+
* Shared helpers for ingest-backed query flows (creator + existing-query
|
|
21
|
+
* loader). Centralizes how we list / cache / swap ingest definitions in the
|
|
22
|
+
* graph so both flows stay in lockstep.
|
|
23
|
+
*
|
|
24
|
+
* Why these live outside the stores: both
|
|
25
|
+
* {@link IngestQueryCreatorStore} (deep-link flow) and
|
|
26
|
+
* {@link ExistingQueryEditorStore} (saved-query flow) need to:
|
|
27
|
+
* 1. fetch every ingest entity in a project version (cheap, classifier-
|
|
28
|
+
* scoped depot call) so the source dropdown can list them all, and
|
|
29
|
+
* 2. build only the active ingest into the graph, swapping it out when the
|
|
30
|
+
* user picks a different one.
|
|
31
|
+
* Keeping the logic in one module avoids the two stores drifting apart.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Fetch every {@link IngestDefinition} entity for a project version via the
|
|
35
|
+
* classifier-scoped variant of `getVersionEntities`. The endpoint returns
|
|
36
|
+
* {@link EntityWithOrigin}-shaped payloads (entity wrapped with GAV) rather
|
|
37
|
+
* than raw entities, so we unwrap explicitly.
|
|
38
|
+
*
|
|
39
|
+
* Filters by `classifierPath` defensively in case the server returns extras.
|
|
40
|
+
*/
|
|
41
|
+
export const fetchIngestEntitiesByClassifier = async (depotServerClient, groupId, artifactId, versionId) => {
|
|
42
|
+
const wrapped = (await depotServerClient.getVersionEntities(groupId, artifactId, resolveVersion(versionId), CORE_PURE_PATH.INGEST_DEFINITION));
|
|
43
|
+
const entities = wrapped
|
|
44
|
+
.map((w) => w.entity)
|
|
45
|
+
.filter((e) => e.classifierPath === CORE_PURE_PATH.INGEST_DEFINITION);
|
|
46
|
+
return new Map(entities.map((e) => [e.path, e]));
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Build the given ingest entity into `graph`. If `currentPath` is provided
|
|
50
|
+
* and resolves to an existing ingest on the graph, that ingest is removed
|
|
51
|
+
* first — this is the swap path used when the user picks a different ingest
|
|
52
|
+
* from the source dropdown.
|
|
53
|
+
*
|
|
54
|
+
* The SDLC origin is only set when the graph has none yet, so subsequent
|
|
55
|
+
* swaps (which run after the initial graph build set the origin) don't
|
|
56
|
+
* clobber it.
|
|
57
|
+
*/
|
|
58
|
+
export const swapIngestInGraph = async (graphManagerState, entity, options) => {
|
|
59
|
+
if (options.currentPath !== undefined) {
|
|
60
|
+
const current = graphManagerState.graph.ingests.find((i) => i.path === options.currentPath);
|
|
61
|
+
if (current) {
|
|
62
|
+
graphManagerState.graph.deleteElement(current);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await graphManagerState.graphManager.buildGraph(graphManagerState.graph, [entity], graphManagerState.graphBuildState, graphManagerState.graph.origin === undefined
|
|
66
|
+
? {
|
|
67
|
+
origin: new LegendSDLC(options.groupId, options.artifactId, resolveVersion(options.versionId)),
|
|
68
|
+
}
|
|
69
|
+
: undefined, createGraphBuilderReport());
|
|
70
|
+
return guaranteeType(graphManagerState.graph.getElement(entity.path), IngestDefinition, `Can't find ingest definition '${entity.path}' after build`);
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=IngestQueryGraphHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IngestQueryGraphHelper.js","sourceRoot":"","sources":["../../../src/stores/ingest/IngestQueryGraphHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,EAClD,iBAAoC,EACpC,OAAe,EACf,UAAkB,EAClB,SAAiB,EACa,EAAE;IAChC,MAAM,OAAO,GAAG,CAAC,MAAM,iBAAiB,CAAC,kBAAkB,CACzD,OAAO,EACP,UAAU,EACV,cAAc,CAAC,SAAS,CAAC,EACzB,cAAc,CAAC,iBAAiB,CACjC,CAAkC,CAAC;IACpC,MAAM,QAAQ,GAAG,OAAO;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,cAAc,CAAC,iBAAiB,CAAC,CAAC;IACxE,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,iBAAoC,EACpC,MAAc,EACd,OAKC,EAC0B,EAAE;IAC7B,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAClD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,WAAW,CACtC,CAAC;QACF,IAAI,OAAO,EAAE,CAAC;YACZ,iBAAiB,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,MAAM,iBAAiB,CAAC,YAAY,CAAC,UAAU,CAC7C,iBAAiB,CAAC,KAAK,EACvB,CAAC,MAAM,CAAC,EACR,iBAAiB,CAAC,eAAe,EACjC,iBAAiB,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS;QAC1C,CAAC,CAAC;YACE,MAAM,EAAE,IAAI,UAAU,CACpB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,UAAU,EAClB,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAClC;SACF;QACH,CAAC,CAAC,SAAS,EACb,wBAAwB,EAAE,CAC3B,CAAC;IACF,OAAO,aAAa,CAClB,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAC/C,gBAAgB,EAChB,iCAAiC,MAAM,CAAC,IAAI,eAAe,CAC5D,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-query",
|
|
3
|
-
"version": "13.8.
|
|
3
|
+
"version": "13.8.31",
|
|
4
4
|
"description": "Legend Query application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"test:watch": "jest --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@finos/legend-application": "16.0.
|
|
48
|
-
"@finos/legend-art": "7.1.
|
|
49
|
-
"@finos/legend-code-editor": "2.0.
|
|
50
|
-
"@finos/legend-data-cube": "0.3.
|
|
51
|
-
"@finos/legend-extension-dsl-data-space": "10.4.
|
|
52
|
-
"@finos/legend-graph": "32.6.
|
|
53
|
-
"@finos/legend-lego": "2.0.
|
|
54
|
-
"@finos/legend-query-builder": "4.18.
|
|
55
|
-
"@finos/legend-server-depot": "6.1.
|
|
56
|
-
"@finos/legend-server-lakehouse": "0.3.
|
|
47
|
+
"@finos/legend-application": "16.0.115",
|
|
48
|
+
"@finos/legend-art": "7.1.155",
|
|
49
|
+
"@finos/legend-code-editor": "2.0.185",
|
|
50
|
+
"@finos/legend-data-cube": "0.3.102",
|
|
51
|
+
"@finos/legend-extension-dsl-data-space": "10.4.234",
|
|
52
|
+
"@finos/legend-graph": "32.6.16",
|
|
53
|
+
"@finos/legend-lego": "2.0.205",
|
|
54
|
+
"@finos/legend-query-builder": "4.18.24",
|
|
55
|
+
"@finos/legend-server-depot": "6.1.15",
|
|
56
|
+
"@finos/legend-server-lakehouse": "0.3.65",
|
|
57
57
|
"@finos/legend-shared": "11.0.26",
|
|
58
|
-
"@finos/legend-storage": "3.0.
|
|
58
|
+
"@finos/legend-storage": "3.0.148",
|
|
59
59
|
"@testing-library/dom": "10.4.0",
|
|
60
60
|
"@testing-library/react": "16.2.0",
|
|
61
61
|
"@types/react": "19.0.10",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"serializr": "3.0.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@finos/legend-dev-utils": "2.2.
|
|
73
|
+
"@finos/legend-dev-utils": "2.2.7",
|
|
74
74
|
"@jest/globals": "29.7.0",
|
|
75
75
|
"cross-env": "7.0.3",
|
|
76
76
|
"eslint": "9.22.0",
|
|
@@ -24,6 +24,9 @@ export enum LEGEND_QUERY_APP_EVENT {
|
|
|
24
24
|
RENAME_QUERY__SUCCESS = 'query-editor.rename.query.success',
|
|
25
25
|
INITIALIZE_QUERY_STATE__SUCCESS = 'query-editor.initialize-query-state.success',
|
|
26
26
|
LEGENDAI_QUERY_CHAT__OPENED = 'query-editor.legendai-query-chat.opened',
|
|
27
|
+
LEGENDAI_QUERY_SUGGEST__LAUNCH = 'query-editor.legendai-query-suggest.launch',
|
|
28
|
+
LEGENDAI_QUERY_SUGGEST__APPLY = 'query-editor.legendai-query-suggest.apply',
|
|
29
|
+
LEGENDAI_QUERY_SUGGEST__DISCARD = 'query-editor.legendai-query-suggest.discard',
|
|
27
30
|
|
|
28
31
|
VIEW_PROJECT__LAUNCH = 'query-editor.view-project.launch',
|
|
29
32
|
VIEW_SDLC_PROJECT__LAUNCH = 'query-editor.view-sdlc-project.launch',
|
|
@@ -47,6 +47,12 @@ export enum DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN {
|
|
|
47
47
|
SAMPLE_QUERY_ID = 'sampleQueryId',
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
export enum INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN {
|
|
51
|
+
GAV = 'gav',
|
|
52
|
+
INGEST_DEFINITION_PATH = 'ingestDefinitionPath',
|
|
53
|
+
DATA_SET = 'dataSet',
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
export const LEGEND_QUERY_ROUTE_PATTERN = Object.freeze({
|
|
51
57
|
DEFAULT: '/',
|
|
52
58
|
SETUP: '/setup',
|
|
@@ -62,6 +68,7 @@ export const LEGEND_QUERY_ROUTE_PATTERN = Object.freeze({
|
|
|
62
68
|
DATA_CUBE_EXISTING_QUERY: `/edit/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.QUERY_ID}/cube`,
|
|
63
69
|
DATA_PRODUCT: `/data-product/:${DATA_PRODUCT_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_ACCESS_TYPE}/:${DATA_PRODUCT_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV}/:${DATA_PRODUCT_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_PATH}/:${DATA_PRODUCT_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_ACCESS_ID}`,
|
|
64
70
|
DATA_PRODUCT_SAMPLE_QUERY: `/data-product/native/sample-query/:${DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV}/:${DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_PATH}/:${DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.SAMPLE_QUERY_ID}`,
|
|
71
|
+
INGEST_QUERY: `/ingest/:${INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV}/:${INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.INGEST_DEFINITION_PATH}/:${INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SET}`,
|
|
65
72
|
// Developer-only diagnostic page for inspecting depot DataSpace
|
|
66
73
|
// analytics artifact sizes. See `DataSpaceArtifactInspector`.
|
|
67
74
|
DEV_DATA_SPACE_INSPECTOR: '/dev/dataspace-inspector',
|
|
@@ -82,6 +89,12 @@ export type DataProductSampleQueryPathParams = {
|
|
|
82
89
|
[DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.SAMPLE_QUERY_ID]: string;
|
|
83
90
|
};
|
|
84
91
|
|
|
92
|
+
export type IngestQueryCreatorPathParams = {
|
|
93
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV]: string;
|
|
94
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.INGEST_DEFINITION_PATH]: string;
|
|
95
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SET]: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
85
98
|
/**
|
|
86
99
|
* Generates a data product route for the given access type.
|
|
87
100
|
*/
|
|
@@ -168,6 +181,28 @@ export const generateDataProductSampleQueryRoute = (
|
|
|
168
181
|
sampleQueryId,
|
|
169
182
|
});
|
|
170
183
|
|
|
184
|
+
// TODO: figure out where this URL should be generated from. Candidates:
|
|
185
|
+
// - a "create ingest query" entry point in the query setup landing page
|
|
186
|
+
// - a deep-link from the ingest definition page in Legend Studio
|
|
187
|
+
// Once decided, wire callers here.
|
|
188
|
+
export const generateIngestQueryCreatorRoute = (
|
|
189
|
+
groupId: string,
|
|
190
|
+
artifactId: string,
|
|
191
|
+
versionId: string,
|
|
192
|
+
ingestDefinitionPath: string,
|
|
193
|
+
dataSet: string,
|
|
194
|
+
): string =>
|
|
195
|
+
generatePath(LEGEND_QUERY_ROUTE_PATTERN.INGEST_QUERY, {
|
|
196
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV]: generateGAVCoordinates(
|
|
197
|
+
groupId,
|
|
198
|
+
artifactId,
|
|
199
|
+
versionId,
|
|
200
|
+
),
|
|
201
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.INGEST_DEFINITION_PATH]:
|
|
202
|
+
ingestDefinitionPath,
|
|
203
|
+
[INGEST_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SET]: dataSet,
|
|
204
|
+
});
|
|
205
|
+
|
|
171
206
|
// setup
|
|
172
207
|
|
|
173
208
|
export enum LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN {
|
|
@@ -112,4 +112,19 @@ export class LegendQueryTelemetryHelper {
|
|
|
112
112
|
static logEvent_QueryChatOpened(service: TelemetryService): void {
|
|
113
113
|
service.logEvent(LEGEND_QUERY_APP_EVENT.LEGENDAI_QUERY_CHAT__OPENED, {});
|
|
114
114
|
}
|
|
115
|
+
|
|
116
|
+
static logEvent_QueryAISuggestLaunched(service: TelemetryService): void {
|
|
117
|
+
service.logEvent(LEGEND_QUERY_APP_EVENT.LEGENDAI_QUERY_SUGGEST__LAUNCH, {});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static logEvent_QueryAISuggestApplied(service: TelemetryService): void {
|
|
121
|
+
service.logEvent(LEGEND_QUERY_APP_EVENT.LEGENDAI_QUERY_SUGGEST__APPLY, {});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static logEvent_QueryAISuggestDiscarded(service: TelemetryService): void {
|
|
125
|
+
service.logEvent(
|
|
126
|
+
LEGEND_QUERY_APP_EVENT.LEGENDAI_QUERY_SUGGEST__DISCARD,
|
|
127
|
+
{},
|
|
128
|
+
);
|
|
129
|
+
}
|
|
115
130
|
}
|
|
@@ -135,6 +135,7 @@ import { useQueryEditorStore } from './QueryEditorStoreProvider.js';
|
|
|
135
135
|
import { useLegendQueryApplicationStore } from './LegendQueryFrameworkProvider.js';
|
|
136
136
|
import { LegendQueryDataSpaceQueryBuilderState } from '../stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.js';
|
|
137
137
|
import { LegendQueryDataProductQueryBuilderState } from '../stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.js';
|
|
138
|
+
import { IngestLegendQueryBuilderState } from '../stores/ingest/IngestLegendQueryBuilderState.js';
|
|
138
139
|
import { renderDataProductSampleQueryPanelContent } from './data-product/DataProductSampleQueryPanel.js';
|
|
139
140
|
|
|
140
141
|
export const QUERY_DATACUBE_USAGE_TITLE = 'Legend DataCube';
|
|
@@ -647,6 +648,25 @@ export class Core_LegendQueryApplicationPlugin extends LegendQueryApplicationPlu
|
|
|
647
648
|
},
|
|
648
649
|
icon: <InfoCircleIcon />,
|
|
649
650
|
},
|
|
651
|
+
{
|
|
652
|
+
key: 'about-ingest',
|
|
653
|
+
title: 'About Ingest',
|
|
654
|
+
label: 'About Ingestion Data Set',
|
|
655
|
+
disableFunc: (queryBuilderState): boolean =>
|
|
656
|
+
!(queryBuilderState instanceof IngestLegendQueryBuilderState),
|
|
657
|
+
onClick: (queryBuilderState): void => {
|
|
658
|
+
if (
|
|
659
|
+
queryBuilderState.workflowState.actionConfig instanceof
|
|
660
|
+
QueryBuilderActionConfig_QueryApplication &&
|
|
661
|
+
queryBuilderState instanceof IngestLegendQueryBuilderState
|
|
662
|
+
) {
|
|
663
|
+
queryBuilderState.workflowState.actionConfig.editorStore.setShowIngestInfo(
|
|
664
|
+
true,
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
icon: <InfoCircleIcon />,
|
|
669
|
+
},
|
|
650
670
|
];
|
|
651
671
|
}
|
|
652
672
|
|
|
@@ -42,6 +42,7 @@ import { LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN } from '../__lib__/DSL_DataSpace_
|
|
|
42
42
|
import { DataSpaceTemplateQueryCreator } from './data-space/DataSpaceTemplateQueryCreator.js';
|
|
43
43
|
import { QueryCreator } from './data-space/DataProductQueryCreator.js';
|
|
44
44
|
import { DataProductSampleQueryCreator } from './data-product/DataProductSampleQueryCreator.js';
|
|
45
|
+
import { IngestQueryCreator } from './ingest/IngestQueryCreator.js';
|
|
45
46
|
import { ExistingQueryDataCubeViewer } from './data-cube/ExistingQueryDataCubeViewer.js';
|
|
46
47
|
import { DataSpaceArtifactInspector } from './DataSpaceArtifactInspector.js';
|
|
47
48
|
import {
|
|
@@ -113,6 +114,19 @@ const LegendQueryWebApplicationRouter = observer(() => {
|
|
|
113
114
|
path={LEGEND_QUERY_ROUTE_PATTERN.DATA_PRODUCT}
|
|
114
115
|
element={<QueryCreator />}
|
|
115
116
|
/>
|
|
117
|
+
{/*
|
|
118
|
+
Ingest query creator. Resolves `ingestDefinitionPath` and
|
|
119
|
+
`dataSet` from the route, fetches only the ingest definition
|
|
120
|
+
entity from Depot (no full graph build), and opens the editor
|
|
121
|
+
with a `QueryIngestExecutionContext`. The creator store builds
|
|
122
|
+
an adhoc lakehouse runtime (user env + consumer warehouse) and
|
|
123
|
+
selects it on the query builder state so execution works without
|
|
124
|
+
a packaged runtime.
|
|
125
|
+
*/}
|
|
126
|
+
<Route
|
|
127
|
+
path={LEGEND_QUERY_ROUTE_PATTERN.INGEST_QUERY}
|
|
128
|
+
element={<IngestQueryCreator />}
|
|
129
|
+
/>
|
|
116
130
|
<Route
|
|
117
131
|
path={LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_SERVICE_QUERY}
|
|
118
132
|
element={<ServiceQueryCreator />}
|
|
@@ -98,6 +98,8 @@ import {
|
|
|
98
98
|
import { LegendQueryInfo } from './LegendQueryAppInfo.js';
|
|
99
99
|
import { QueryEditorDataspaceInfoModal } from './data-space/DataSpaceInfo.js';
|
|
100
100
|
import { QueryEditorDataProductInfoModal } from './data-product/DataProductInfo.js';
|
|
101
|
+
import { QueryEditorIngestInfoModal } from './ingest/IngestInfo.js';
|
|
102
|
+
import { IngestLegendQueryBuilderState } from '../stores/ingest/IngestLegendQueryBuilderState.js';
|
|
101
103
|
import { DataSpaceQueryBuilderState } from '@finos/legend-extension-dsl-data-space/application';
|
|
102
104
|
import { LegendQueryBareQueryBuilderState } from '../stores/data-space/LegendQueryBareQueryBuilderState.js';
|
|
103
105
|
import { extractQueryParams } from './utils/QueryParameterUtils.js';
|
|
@@ -180,6 +182,9 @@ const CreateQueryDialog = observer(() => {
|
|
|
180
182
|
if (!aiSuggester || !editorStore.queryBuilderState || !legendAIUrl) {
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
185
|
+
LegendQueryTelemetryHelper.logEvent_QueryAISuggestLaunched(
|
|
186
|
+
applicationStore.telemetryService,
|
|
187
|
+
);
|
|
183
188
|
setIsSuggestingWithAI(true);
|
|
184
189
|
setAISuggestion(undefined);
|
|
185
190
|
try {
|
|
@@ -196,10 +201,19 @@ const CreateQueryDialog = observer(() => {
|
|
|
196
201
|
if (!aiSuggestion) {
|
|
197
202
|
return;
|
|
198
203
|
}
|
|
204
|
+
LegendQueryTelemetryHelper.logEvent_QueryAISuggestApplied(
|
|
205
|
+
applicationStore.telemetryService,
|
|
206
|
+
);
|
|
199
207
|
createQueryState.setQueryName(aiSuggestion.title);
|
|
200
208
|
createQueryState.setQueryDescription(aiSuggestion.description);
|
|
201
209
|
setAISuggestion(undefined);
|
|
202
210
|
};
|
|
211
|
+
const discardAISuggestion = (): void => {
|
|
212
|
+
LegendQueryTelemetryHelper.logEvent_QueryAISuggestDiscarded(
|
|
213
|
+
applicationStore.telemetryService,
|
|
214
|
+
);
|
|
215
|
+
setAISuggestion(undefined);
|
|
216
|
+
};
|
|
203
217
|
|
|
204
218
|
const debouncedLoadQueries = useMemo(
|
|
205
219
|
() =>
|
|
@@ -324,7 +338,7 @@ const CreateQueryDialog = observer(() => {
|
|
|
324
338
|
<ModalFooterButton
|
|
325
339
|
text="Dismiss"
|
|
326
340
|
type="secondary"
|
|
327
|
-
onClick={
|
|
341
|
+
onClick={discardAISuggestion}
|
|
328
342
|
/>
|
|
329
343
|
</>
|
|
330
344
|
) : (
|
|
@@ -1210,6 +1224,16 @@ export const QueryEditor = observer(() => {
|
|
|
1210
1224
|
closeModal={() => editorStore.setShowDataProductInfo(false)}
|
|
1211
1225
|
/>
|
|
1212
1226
|
)}
|
|
1227
|
+
{editorStore.showIngestInfo &&
|
|
1228
|
+
editorStore.queryBuilderState instanceof
|
|
1229
|
+
IngestLegendQueryBuilderState && (
|
|
1230
|
+
<QueryEditorIngestInfoModal
|
|
1231
|
+
editorStore={editorStore}
|
|
1232
|
+
queryBuilderState={editorStore.queryBuilderState}
|
|
1233
|
+
open={editorStore.showIngestInfo}
|
|
1234
|
+
closeModal={() => editorStore.setShowIngestInfo(false)}
|
|
1235
|
+
/>
|
|
1236
|
+
)}
|
|
1213
1237
|
{isExistingQuery &&
|
|
1214
1238
|
editorStore.updateState.showQueryInfo &&
|
|
1215
1239
|
editorStore.query && (
|
|
@@ -24,150 +24,25 @@ import {
|
|
|
24
24
|
AnchorLinkIcon,
|
|
25
25
|
CogIcon,
|
|
26
26
|
ControlledDropdownMenu,
|
|
27
|
-
Dialog,
|
|
28
27
|
MenuContent,
|
|
29
28
|
MenuContentItem,
|
|
30
29
|
MenuContentItemIcon,
|
|
31
30
|
MenuContentItemLabel,
|
|
32
|
-
Modal,
|
|
33
|
-
ModalBody,
|
|
34
|
-
ModalFooter,
|
|
35
|
-
ModalFooterButton,
|
|
36
|
-
ModalHeader,
|
|
37
|
-
ModalHeaderActions,
|
|
38
|
-
ModalTitle,
|
|
39
31
|
MoreVerticalIcon,
|
|
40
32
|
PanelHeader,
|
|
41
33
|
PanelHeaderActionItem,
|
|
42
34
|
PanelHeaderActions,
|
|
43
|
-
TimesIcon,
|
|
44
35
|
} from '@finos/legend-art';
|
|
45
36
|
import { observer } from 'mobx-react-lite';
|
|
46
37
|
import { LakehouseRuntime } from '@finos/legend-graph';
|
|
47
38
|
import { useEffect, useState } from 'react';
|
|
48
39
|
import type { LegendQueryDataProductQueryBuilderState } from '../../stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.js';
|
|
49
40
|
import { formatDataProductOptionLabel } from '../shared/LegendQueryDataProductOptionLabel.js';
|
|
50
|
-
import {
|
|
41
|
+
import { LakehouseRuntimeConfigModal } from '../shared/LakehouseRuntimeConfigModal.js';
|
|
51
42
|
|
|
52
43
|
/**
|
|
53
44
|
* Modal for editing LakehouseRuntime configuration (environment and warehouse).
|
|
54
45
|
*/
|
|
55
|
-
const LakehouseRuntimeConfigModal = observer(
|
|
56
|
-
(props: {
|
|
57
|
-
executionState:
|
|
58
|
-
| ModelAccessPointDataProductExecutionState
|
|
59
|
-
| LakehouseDataProductExecutionState;
|
|
60
|
-
open: boolean;
|
|
61
|
-
onClose: () => void;
|
|
62
|
-
darkMode: boolean;
|
|
63
|
-
}) => {
|
|
64
|
-
const { executionState, open, onClose, darkMode } = props;
|
|
65
|
-
const lakehouseRuntime =
|
|
66
|
-
executionState.selectedRuntime?.runtimeValue instanceof LakehouseRuntime
|
|
67
|
-
? executionState.selectedRuntime.runtimeValue
|
|
68
|
-
: undefined;
|
|
69
|
-
const [env, setEnv] = useState(lakehouseRuntime?.environment ?? '');
|
|
70
|
-
const [warehouse, setWarehouse] = useState(
|
|
71
|
-
lakehouseRuntime?.warehouse ?? '',
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
// sync local state when the modal opens or the runtime changes
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (open && lakehouseRuntime) {
|
|
77
|
-
setEnv(lakehouseRuntime.environment ?? '');
|
|
78
|
-
setWarehouse(lakehouseRuntime.warehouse ?? '');
|
|
79
|
-
}
|
|
80
|
-
}, [open, lakehouseRuntime]);
|
|
81
|
-
|
|
82
|
-
const applicationStore = useApplicationStore();
|
|
83
|
-
|
|
84
|
-
const handleApply = (): void => {
|
|
85
|
-
if (lakehouseRuntime) {
|
|
86
|
-
const newEnv = env || undefined;
|
|
87
|
-
const newWarehouse = warehouse || undefined;
|
|
88
|
-
const hasChanged =
|
|
89
|
-
newEnv !== lakehouseRuntime.environment ||
|
|
90
|
-
newWarehouse !== lakehouseRuntime.warehouse;
|
|
91
|
-
lakehouseRuntime.environment = newEnv;
|
|
92
|
-
lakehouseRuntime.warehouse = newWarehouse;
|
|
93
|
-
if (hasChanged) {
|
|
94
|
-
LegendQueryUserDataHelper.persistLakehouseUserInfo(
|
|
95
|
-
applicationStore.userDataService,
|
|
96
|
-
{
|
|
97
|
-
env: newEnv,
|
|
98
|
-
snowflakeWarehouse: newWarehouse,
|
|
99
|
-
},
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
onClose();
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
if (!lakehouseRuntime) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<Dialog onClose={onClose} open={open}>
|
|
112
|
-
<Modal darkMode={darkMode}>
|
|
113
|
-
<ModalHeader>
|
|
114
|
-
<ModalTitle
|
|
115
|
-
icon={<CogIcon />}
|
|
116
|
-
title="Lakehouse Runtime Configuration"
|
|
117
|
-
/>
|
|
118
|
-
<ModalHeaderActions>
|
|
119
|
-
<button
|
|
120
|
-
className="modal__header__action"
|
|
121
|
-
tabIndex={-1}
|
|
122
|
-
onClick={onClose}
|
|
123
|
-
>
|
|
124
|
-
<TimesIcon />
|
|
125
|
-
</button>
|
|
126
|
-
</ModalHeaderActions>
|
|
127
|
-
</ModalHeader>
|
|
128
|
-
<ModalBody>
|
|
129
|
-
<div className="panel__content__form__section">
|
|
130
|
-
<div className="panel__content__form__section__header__label">
|
|
131
|
-
Environment
|
|
132
|
-
</div>
|
|
133
|
-
<input
|
|
134
|
-
className="panel__content__form__section__input input--dark input--small"
|
|
135
|
-
spellCheck={false}
|
|
136
|
-
value={env}
|
|
137
|
-
placeholder="(optional)"
|
|
138
|
-
onChange={(e) => setEnv(e.target.value)}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
<div className="panel__content__form__section">
|
|
142
|
-
<div className="panel__content__form__section__header__label">
|
|
143
|
-
Warehouse
|
|
144
|
-
</div>
|
|
145
|
-
<input
|
|
146
|
-
className="panel__content__form__section__input input--dark input--small"
|
|
147
|
-
spellCheck={false}
|
|
148
|
-
value={warehouse}
|
|
149
|
-
placeholder="(optional)"
|
|
150
|
-
onChange={(e) => setWarehouse(e.target.value)}
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
153
|
-
</ModalBody>
|
|
154
|
-
<ModalFooter>
|
|
155
|
-
<ModalFooterButton
|
|
156
|
-
text="Apply"
|
|
157
|
-
onClick={handleApply}
|
|
158
|
-
type="primary"
|
|
159
|
-
/>
|
|
160
|
-
<ModalFooterButton
|
|
161
|
-
text="Cancel"
|
|
162
|
-
onClick={onClose}
|
|
163
|
-
type="secondary"
|
|
164
|
-
/>
|
|
165
|
-
</ModalFooter>
|
|
166
|
-
</Modal>
|
|
167
|
-
</Dialog>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
);
|
|
171
46
|
|
|
172
47
|
const LegendDataProductQueryBuilderSetupPanelContent = observer(
|
|
173
48
|
(props: { queryBuilderState: LegendQueryDataProductQueryBuilderState }) => {
|
|
@@ -256,7 +131,12 @@ const LegendDataProductQueryBuilderSetupPanelContent = observer(
|
|
|
256
131
|
{(executionState instanceof ModelAccessPointDataProductExecutionState ||
|
|
257
132
|
executionState instanceof LakehouseDataProductExecutionState) && (
|
|
258
133
|
<LakehouseRuntimeConfigModal
|
|
259
|
-
|
|
134
|
+
lakehouseRuntime={
|
|
135
|
+
executionState.selectedRuntime?.runtimeValue instanceof
|
|
136
|
+
LakehouseRuntime
|
|
137
|
+
? executionState.selectedRuntime.runtimeValue
|
|
138
|
+
: undefined
|
|
139
|
+
}
|
|
260
140
|
open={isLakehouseConfigModalOpen}
|
|
261
141
|
onClose={() => setIsLakehouseConfigModalOpen(false)}
|
|
262
142
|
darkMode={
|