@finos/legend-application-query 13.8.55 → 13.8.57

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.
Files changed (60) hide show
  1. package/README.md +7 -0
  2. package/docs/data-space-analytics-and-entry-points.md +644 -0
  3. package/lib/__lib__/LegendQueryNavigation.d.ts +0 -13
  4. package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
  5. package/lib/__lib__/LegendQueryNavigation.js +0 -13
  6. package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
  7. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts +1 -2
  8. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
  9. package/lib/components/Core_LegendQueryApplicationPlugin.js +0 -13
  10. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  11. package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
  12. package/lib/components/LegendQueryWebApplication.js +1 -2
  13. package/lib/components/LegendQueryWebApplication.js.map +1 -1
  14. package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts +1 -17
  15. package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts.map +1 -1
  16. package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js +2 -175
  17. package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js.map +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.d.ts +1 -1
  20. package/lib/index.d.ts.map +1 -1
  21. package/lib/index.js +1 -1
  22. package/lib/index.js.map +1 -1
  23. package/lib/light-mode.css +1 -1
  24. package/lib/package.json +1 -1
  25. package/lib/stores/QueryEditorStore.d.ts +4 -4
  26. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  27. package/lib/stores/QueryEditorStore.js +9 -53
  28. package/lib/stores/QueryEditorStore.js.map +1 -1
  29. package/lib/stores/data-product/query-builder/DataProductArtifactHelper.d.ts.map +1 -1
  30. package/lib/stores/data-product/query-builder/DataProductArtifactHelper.js +1 -10
  31. package/lib/stores/data-product/query-builder/DataProductArtifactHelper.js.map +1 -1
  32. package/lib/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.d.ts +3 -2
  33. package/lib/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.d.ts.map +1 -1
  34. package/lib/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.js +21 -19
  35. package/lib/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.js.map +1 -1
  36. package/package.json +8 -8
  37. package/src/__lib__/LegendQueryNavigation.ts +0 -45
  38. package/src/components/Core_LegendQueryApplicationPlugin.tsx +0 -17
  39. package/src/components/LegendQueryWebApplication.tsx +0 -5
  40. package/src/components/__test-utils__/QueryEditorComponentTestUtils.tsx +0 -430
  41. package/src/index.ts +0 -1
  42. package/src/stores/QueryEditorStore.ts +10 -68
  43. package/src/stores/data-product/query-builder/DataProductArtifactHelper.ts +1 -13
  44. package/src/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.ts +33 -43
  45. package/tsconfig.json +0 -3
  46. package/lib/components/data-product/DataProductSampleQueryCreator.d.ts +0 -19
  47. package/lib/components/data-product/DataProductSampleQueryCreator.d.ts.map +0 -1
  48. package/lib/components/data-product/DataProductSampleQueryCreator.js +0 -53
  49. package/lib/components/data-product/DataProductSampleQueryCreator.js.map +0 -1
  50. package/lib/components/data-product/DataProductSampleQueryPanel.d.ts +0 -23
  51. package/lib/components/data-product/DataProductSampleQueryPanel.d.ts.map +0 -1
  52. package/lib/components/data-product/DataProductSampleQueryPanel.js +0 -95
  53. package/lib/components/data-product/DataProductSampleQueryPanel.js.map +0 -1
  54. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts +0 -39
  55. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts.map +0 -1
  56. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js +0 -71
  57. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js.map +0 -1
  58. package/src/components/data-product/DataProductSampleQueryCreator.tsx +0 -114
  59. package/src/components/data-product/DataProductSampleQueryPanel.tsx +0 -219
  60. package/src/stores/data-product/DataProductSampleQueryCreatorStore.ts +0 -152
@@ -16,7 +16,6 @@
16
16
 
17
17
  import {
18
18
  DataProductQueryBuilderState,
19
- NativeModelDataProductExecutionState,
20
19
  ModelAccessPointDataProductExecutionState,
21
20
  type DataProductOption,
22
21
  type QueryBuilderActionConfig,
@@ -38,18 +37,17 @@ import type {
38
37
  import {
39
38
  LegendSDLC,
40
39
  INTERNAL_ELEMENT_PATH,
41
- type PackageableRuntime,
40
+ createPath,
42
41
  type Class,
43
42
  type DataProduct,
44
43
  type GraphManagerState,
45
44
  type ModelAccessPointGroup,
46
- type NativeModelExecutionContext,
47
45
  type PackageableElement,
46
+ type PackageableRuntime,
48
47
  type V1_DataProductArtifact,
49
48
  type LakehouseAccessPoint,
50
49
  } from '@finos/legend-graph';
51
50
  import {
52
- generateDataProductNativeRoute,
53
51
  generateDataProductModelRoute,
54
52
  generateDataProductLakehouseRoute,
55
53
  } from '../../../__lib__/LegendQueryNavigation.js';
@@ -79,10 +77,7 @@ export class LegendQueryDataProductQueryBuilderState extends DataProductQueryBui
79
77
  actionConfig: QueryBuilderActionConfig,
80
78
  dataProduct: DataProduct,
81
79
  artifact: V1_DataProductArtifact | undefined,
82
- executionState:
83
- | NativeModelExecutionContext
84
- | ModelAccessPointGroup
85
- | LakehouseAccessPoint,
80
+ executionState: ModelAccessPointGroup | LakehouseAccessPoint,
86
81
  depotServerClient: DepotServerClient,
87
82
  project: ProjectGAVCoordinates,
88
83
  onDataProductChange: (val: DepotEntityWithOrigin) => Promise<void>,
@@ -137,18 +132,8 @@ export class LegendQueryDataProductQueryBuilderState extends DataProductQueryBui
137
132
  ModelAccessPointDataProductExecutionState &&
138
133
  origin instanceof LegendSDLC
139
134
  ) {
140
- const packageableRuntime = await this.createLakehousePackageableRuntime(
141
- this.dataProduct.path,
142
- {
143
- groupId: origin.groupId,
144
- artifactId: origin.artifactId,
145
- versionId: origin.versionId,
146
- },
147
- );
148
- this.graphManagerState.graph.addElement(
149
- packageableRuntime,
150
- INTERNAL_ELEMENT_PATH,
151
- );
135
+ const packageableRuntime =
136
+ await this.getOrCreateLakehousePackageableRuntime(origin);
152
137
 
153
138
  if (!this.executionState.adhocRuntime) {
154
139
  this.executionState.withAdhocRuntime();
@@ -159,23 +144,38 @@ export class LegendQueryDataProductQueryBuilderState extends DataProductQueryBui
159
144
  this.executionState instanceof LakehouseDataProductExecutionState &&
160
145
  origin instanceof LegendSDLC
161
146
  ) {
162
- const packageableRuntime = await this.createLakehousePackageableRuntime(
163
- this.dataProduct.path,
164
- {
165
- groupId: origin.groupId,
166
- artifactId: origin.artifactId,
167
- versionId: origin.versionId,
168
- },
169
- );
170
- this.graphManagerState.graph.addElement(
171
- packageableRuntime,
172
- INTERNAL_ELEMENT_PATH,
173
- );
147
+ const packageableRuntime =
148
+ await this.getOrCreateLakehousePackageableRuntime(origin);
174
149
  this.executionState.changeSelectedRuntime(packageableRuntime);
175
150
  }
176
151
  await super.prepareAccessForExecution();
177
152
  }
178
153
 
154
+ private async getOrCreateLakehousePackageableRuntime(
155
+ origin: LegendSDLC,
156
+ ): Promise<PackageableRuntime> {
157
+ const runtimeName = `${this.dataProduct.path}_LakehouseRuntime`;
158
+ const runtimePath = createPath(INTERNAL_ELEMENT_PATH, runtimeName);
159
+ const existing =
160
+ this.graphManagerState.graph.getNullableRuntime(runtimePath);
161
+ if (existing) {
162
+ return existing;
163
+ }
164
+ const packageableRuntime = await this.createLakehousePackageableRuntime(
165
+ this.dataProduct.path,
166
+ {
167
+ groupId: origin.groupId,
168
+ artifactId: origin.artifactId,
169
+ versionId: origin.versionId,
170
+ },
171
+ );
172
+ this.graphManagerState.graph.addElement(
173
+ packageableRuntime,
174
+ INTERNAL_ELEMENT_PATH,
175
+ );
176
+ return packageableRuntime;
177
+ }
178
+
179
179
  override get dataProductOptions(): DataProductOption[] {
180
180
  const graphOptions = super.dataProductOptions;
181
181
  const depotOptions: DataProductOption[] = [
@@ -229,17 +229,7 @@ export class LegendQueryDataProductQueryBuilderState extends DataProductQueryBui
229
229
  const dataProduct = this.dataProduct;
230
230
  const execState = this.executionState;
231
231
  let route: string;
232
- if (execState instanceof NativeModelDataProductExecutionState) {
233
- route = this.applicationStore.navigationService.navigator.generateAddress(
234
- generateDataProductNativeRoute(
235
- this.project.groupId,
236
- this.project.artifactId,
237
- this.project.versionId,
238
- dataProduct.path,
239
- execState.exectionValue.key,
240
- ),
241
- );
242
- } else if (execState instanceof ModelAccessPointDataProductExecutionState) {
232
+ if (execState instanceof ModelAccessPointDataProductExecutionState) {
243
233
  route = this.applicationStore.navigationService.navigator.generateAddress(
244
234
  generateDataProductModelRoute(
245
235
  this.project.groupId,
package/tsconfig.json CHANGED
@@ -83,7 +83,6 @@
83
83
  "./src/stores/__test-utils__/DataSpaceQueryBuilderStateTestUtils.ts",
84
84
  "./src/stores/__test-utils__/LegendQueryApplicationTestUtils.ts",
85
85
  "./src/stores/data-cube/ExistingQueryDataCubeViewer.ts",
86
- "./src/stores/data-product/DataProductSampleQueryCreatorStore.ts",
87
86
  "./src/stores/data-product/query-builder/DataProductArtifactHelper.ts",
88
87
  "./src/stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.ts",
89
88
  "./src/stores/data-space/DataProductQueryCreatorStore.ts",
@@ -115,8 +114,6 @@
115
114
  "./src/components/data-cube/ExistingQueryDataCubeViewer.tsx",
116
115
  "./src/components/data-cube/ExistingQueryEditorStoreProviderProvider.tsx",
117
116
  "./src/components/data-product/DataProductInfo.tsx",
118
- "./src/components/data-product/DataProductSampleQueryCreator.tsx",
119
- "./src/components/data-product/DataProductSampleQueryPanel.tsx",
120
117
  "./src/components/data-product/LegendQueryDataProductQueryBuilder.tsx",
121
118
  "./src/components/data-space/DataProductQueryCreator.tsx",
122
119
  "./src/components/data-space/DataSpaceInfo.tsx",
@@ -1,19 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-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
- export declare const DataProductSampleQueryCreator: (() => import("react/jsx-runtime").JSX.Element) & {
17
- displayName: string;
18
- };
19
- //# sourceMappingURL=DataProductSampleQueryCreator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryCreator.d.ts","sourceRoot":"","sources":["../../../src/components/data-product/DataProductSampleQueryCreator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoDH,eAAO,MAAM,6BAA6B;;CA+CxC,CAAC"}
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) 2026-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 { observer, useLocalObservable } from 'mobx-react-lite';
18
- import { useParams } from '@finos/legend-application/browser';
19
- import { parseGAVCoordinates } from '@finos/legend-storage';
20
- import { useLegendQueryApplicationStore, useLegendQueryBaseStore, } from '../LegendQueryFrameworkProvider.js';
21
- import { DataProductSampleQueryCreatorStore } from '../../stores/data-product/DataProductSampleQueryCreatorStore.js';
22
- import { QueryEditorStoreContext } from '../QueryEditorStoreProvider.js';
23
- import { DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN, generateDataProductSampleQueryRoute, } from '../../__lib__/LegendQueryNavigation.js';
24
- import { QueryEditor } from '../QueryEditor.js';
25
- import { guaranteeNonNullable } from '@finos/legend-shared';
26
- import { useApplicationStore } from '@finos/legend-application';
27
- import { extractQueryParams } from '../utils/QueryParameterUtils.js';
28
- import { useEffect } from 'react';
29
- const DataProductSampleQueryCreatorStoreProvider = ({ children, gav, dataProductPath, sampleQueryId, params }) => {
30
- const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
31
- const applicationStore = useLegendQueryApplicationStore();
32
- const baseStore = useLegendQueryBaseStore();
33
- const store = useLocalObservable(() => new DataProductSampleQueryCreatorStore(applicationStore, baseStore.depotServerClient, groupId, artifactId, versionId, dataProductPath, sampleQueryId, params));
34
- return (_jsx(QueryEditorStoreContext.Provider, { value: store, children: children }));
35
- };
36
- export const DataProductSampleQueryCreator = observer(() => {
37
- const applicationStore = useApplicationStore();
38
- const parameters = useParams();
39
- const gav = guaranteeNonNullable(parameters[DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV]);
40
- const dataProductPath = guaranteeNonNullable(parameters[DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_PATH]);
41
- const sampleQueryId = guaranteeNonNullable(parameters[DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.SAMPLE_QUERY_ID]);
42
- const queryParams = applicationStore.navigationService.navigator.getCurrentLocationParameters();
43
- const processed = extractQueryParams(queryParams);
44
- useEffect(() => {
45
- // clear params from URL after extracting
46
- if (processed && Object.keys(processed).length) {
47
- const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
48
- applicationStore.navigationService.navigator.updateCurrentLocation(generateDataProductSampleQueryRoute(groupId, artifactId, versionId, dataProductPath, sampleQueryId));
49
- }
50
- }, [applicationStore, gav, dataProductPath, sampleQueryId, processed]);
51
- return (_jsx(DataProductSampleQueryCreatorStoreProvider, { gav: gav, dataProductPath: dataProductPath, sampleQueryId: sampleQueryId, params: processed, children: _jsx(QueryEditor, {}) }));
52
- });
53
- //# sourceMappingURL=DataProductSampleQueryCreator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryCreator.js","sourceRoot":"","sources":["../../../src/components/data-product/DataProductSampleQueryCreator.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,qDAAqD,EACrD,mCAAmC,GAEpC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,0CAA0C,GAM3C,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE;IACjE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACpE,M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BAAqB,CAChE,mCAAmC,CACjC,OAAO,EACP,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,CACd,CACF,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IAEvE,OAAO,CACL,KAAC,0CAA0C,IACzC,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,SAAS,YAEjB,KAAC,WAAW,KAAG,GAC4B,CAC9C,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-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 type { LegendQueryDataProductQueryBuilderState } from '../../stores/data-product/query-builder/LegendQueryDataProductQueryBuilderState.js';
17
- export declare const DataProductSampleQueryPanel: ((props: {
18
- queryBuilderState: LegendQueryDataProductQueryBuilderState;
19
- }) => import("react/jsx-runtime").JSX.Element | null) & {
20
- displayName: string;
21
- };
22
- export declare const renderDataProductSampleQueryPanelContent: (queryBuilderState: LegendQueryDataProductQueryBuilderState) => React.ReactNode;
23
- //# sourceMappingURL=DataProductSampleQueryPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryPanel.d.ts","sourceRoot":"","sources":["../../../src/components/data-product/DataProductSampleQueryPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,oFAAoF,CAAC;AAiJlJ,eAAO,MAAM,2BAA2B,WAC9B;IAAE,iBAAiB,EAAE,uCAAuC,CAAA;CAAE;;CAkCvE,CAAC;AAEF,eAAO,MAAM,wCAAwC,GACnD,mBAAmB,uCAAuC,KACzD,KAAK,CAAC,SAER,CAAC"}
@@ -1,95 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) 2026-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 { PanelHeader, BasePopover, ClickAwayListener, ShareIcon, TagIcon, } from '@finos/legend-art';
18
- import { observer } from 'mobx-react-lite';
19
- import { useRef, useState } from 'react';
20
- import { ActionAlertActionType, ActionAlertType, useApplicationStore, } from '@finos/legend-application';
21
- import { flowResult } from 'mobx';
22
- import { generateDataProductSampleQueryRoute } from '../../__lib__/LegendQueryNavigation.js';
23
- const DataProductSampleQueryDialog = observer((props) => {
24
- const { triggerElement, queryBuilderState, sampleQueries, onClose } = props;
25
- const applicationStore = useApplicationStore();
26
- const loadSampleQuery = async (sampleQuery) => {
27
- const query = await queryBuilderState.graphManagerState.graphManager.pureCodeToLambda(sampleQuery.info.query);
28
- queryBuilderState.initializeWithQuery(query);
29
- onClose();
30
- };
31
- const loadQuery = async (sampleQuery) => {
32
- if (queryBuilderState.changeDetectionState.hasChanged) {
33
- applicationStore.alertService.setActionAlertInfo({
34
- message: 'Unsaved changes will be lost if you continue. Do you still want to proceed?',
35
- type: ActionAlertType.CAUTION,
36
- actions: [
37
- {
38
- label: 'Proceed',
39
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
40
- handler: () => {
41
- flowResult(loadSampleQuery(sampleQuery));
42
- },
43
- },
44
- {
45
- label: 'Abort',
46
- type: ActionAlertActionType.PROCEED,
47
- default: true,
48
- },
49
- ],
50
- });
51
- }
52
- else {
53
- flowResult(loadSampleQuery(sampleQuery));
54
- }
55
- };
56
- const visitSampleQuery = (sampleQuery) => {
57
- const id = sampleQuery.info.id;
58
- if (!id) {
59
- applicationStore.notificationService.notifyWarning('Sample query does not have an ID and cannot be visited via URL');
60
- return;
61
- }
62
- const project = queryBuilderState.project;
63
- applicationStore.navigationService.navigator.visitAddress(applicationStore.navigationService.navigator.generateAddress(generateDataProductSampleQueryRoute(project.groupId, project.artifactId, project.versionId, queryBuilderState.dataProduct.path, id)));
64
- };
65
- return (_jsx(ClickAwayListener, { onClickAway: onClose, children: _jsx("div", { children: _jsx(BasePopover, { open: true, slotProps: {
66
- paper: {
67
- classes: {
68
- root: '"query-builder__data-space__template-query-panel__container__root',
69
- },
70
- },
71
- }, className: "query-builder__data-space__template-query-panel__container", onClose: onClose, anchorEl: triggerElement, anchorOrigin: {
72
- vertical: 'bottom',
73
- horizontal: 'left',
74
- }, transformOrigin: {
75
- vertical: 'top',
76
- horizontal: 'center',
77
- }, children: _jsxs("div", { className: "query-builder__data-space__template-query-panel", children: [_jsx("div", { className: "query-builder__data-space__template-query-panel__header", children: "Sample Queries" }), sampleQueries.map((sampleQuery) => (_jsxs("div", { className: "query-builder__data-space__template-query-panel__query", children: [_jsx(TagIcon, { className: "query-builder__data-space__template-query-panel__query__icon" }), _jsx("button", { className: "query-builder__data-space__template-query-panel__query__entry", title: "click to load sample query", onClick: () => {
78
- flowResult(loadQuery(sampleQuery));
79
- }, children: _jsxs("div", { className: "query-builder__data-space__template-query-panel__query__entry__content", children: [_jsx("div", { className: "query-builder__data-space__template-query-panel__query__entry__content__title", children: sampleQuery.title }), sampleQuery.description && (_jsx("div", { className: "query-builder__data-space__template-query-panel__query__entry__content__description", children: sampleQuery.description }))] }) }), _jsxs("button", { className: "query-builder__data-space__template-query-panel__query__share", title: "Visit...", disabled: !sampleQuery.info.id, onClick: () => visitSampleQuery(sampleQuery), children: [_jsx(ShareIcon, {}), _jsx("div", { className: "query-builder__data-space__template-query-panel__query__share__label", children: "Visit" })] })] }, sampleQuery.info.id ?? sampleQuery.title)))] }) }) }) }));
80
- });
81
- export const DataProductSampleQueryPanel = observer((props) => {
82
- const { queryBuilderState } = props;
83
- const templateQueryButtonRef = useRef(null);
84
- const [isDialogOpen, setIsDialogOpen] = useState(false);
85
- const sampleQueries = queryBuilderState.isNativeMode
86
- ? (queryBuilderState.dataProductArtifact?.nativeModelAccess
87
- ?.sampleQueries ?? [])
88
- : [];
89
- if (sampleQueries.length === 0) {
90
- return null;
91
- }
92
- return (_jsxs(PanelHeader, { className: "query-builder__data-space__template-query", children: [_jsxs("button", { className: "query-builder__data-space__template-query__btn", ref: templateQueryButtonRef, onClick: () => setIsDialogOpen(true), children: ["Sample Queries ( ", sampleQueries.length, " )"] }), isDialogOpen && (_jsx(DataProductSampleQueryDialog, { triggerElement: templateQueryButtonRef.current, queryBuilderState: queryBuilderState, sampleQueries: sampleQueries, onClose: () => setIsDialogOpen(false) }))] }));
93
- });
94
- export const renderDataProductSampleQueryPanelContent = (queryBuilderState) => (_jsx(DataProductSampleQueryPanel, { queryBuilderState: queryBuilderState }));
95
- //# sourceMappingURL=DataProductSampleQueryPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryPanel.js","sourceRoot":"","sources":["../../../src/components/data-product/DataProductSampleQueryPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,OAAO,GACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C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B;YACvD,EAAE,aAAa,IAAI,EAAE,CAAC;QAC1B,CAAC,CAAC,EAAE,CAAC;IAEP,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,MAAC,WAAW,IAAC,SAAS,EAAC,2CAA2C,aAChE,kBACE,SAAS,EAAC,gDAAgD,EAC1D,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,kCAElB,aAAa,CAAC,MAAM,UAC/B,EACR,YAAY,IAAI,CACf,KAAC,4BAA4B,IAC3B,cAAc,EAAE,sBAAsB,CAAC,OAAO,EAC9C,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,GACrC,CACH,IACW,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wCAAwC,GAAG,CACtD,iBAA0D,EACzC,EAAE,CAAC,CACpB,KAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,GAAI,CACtE,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-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 { type DepotServerClient } from '@finos/legend-server-depot';
17
- import type { QueryBuilderState } from '@finos/legend-query-builder';
18
- import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
19
- import { BaseTemplateQueryCreatorStore } from '../BaseTemplateQueryCreatorStore.js';
20
- import { type LegendQueryDataProductSampleSourceInfo } from '../../__lib__/LegendQuerySourceInfo.js';
21
- export declare class DataProductSampleQueryCreatorStore extends BaseTemplateQueryCreatorStore {
22
- readonly dataProductPath: string;
23
- constructor(applicationStore: LegendQueryApplicationStore, depotServerClient: DepotServerClient, groupId: string, artifactId: string, versionId: string, dataProductPath: string, sampleQueryId: string, urlQueryParamValues: Record<string, string> | undefined);
24
- getEditorRoute(): string;
25
- getEntityPath(): string;
26
- getSearchTaggedValues(): {
27
- profile: string;
28
- tag: string;
29
- value: string;
30
- }[];
31
- getQueryDecoratorTaggedValues(): {
32
- profile: string;
33
- tag: string;
34
- value: string;
35
- }[] | undefined;
36
- getSourceInfo(): LegendQueryDataProductSampleSourceInfo;
37
- initializeQueryBuilderState(): Promise<QueryBuilderState>;
38
- }
39
- //# sourceMappingURL=DataProductSampleQueryCreatorStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryCreatorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/data-product/DataProductSampleQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAI9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EACL,KAAK,sCAAsC,EAE5C,MAAM,wCAAwC,CAAC;AAEhD,qBAAa,kCAAmC,SAAQ,6BAA6B;IACnF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAG/B,gBAAgB,EAAE,2BAA2B,EAC7C,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAchD,cAAc,IAAI,MAAM;IAUxB,aAAa,IAAI,MAAM;IAIvB,qBAAqB,IAAI;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,EAAE;IAIM,6BAA6B,IAClC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,GACjD,SAAS;IAIJ,aAAa,IAAI,sCAAsC;IAW1D,2BAA2B,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAyDhE"}
@@ -1,71 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-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 { DataProductAccessType } from '@finos/legend-graph';
17
- import {} from '@finos/legend-server-depot';
18
- import { IllegalStateError, guaranteeNonNullable } from '@finos/legend-shared';
19
- import { generateDataProductSampleQueryRoute } from '../../__lib__/LegendQueryNavigation.js';
20
- import { DataProductSelectorState } from '../data-space/DataProductSelectorState.js';
21
- import { createQueryDataProductTaggedValue } from '../../components/data-product/QueryDataProductUtil.js';
22
- import { BaseTemplateQueryCreatorStore } from '../BaseTemplateQueryCreatorStore.js';
23
- import { LegendQuerySourceType, } from '../../__lib__/LegendQuerySourceInfo.js';
24
- export class DataProductSampleQueryCreatorStore extends BaseTemplateQueryCreatorStore {
25
- dataProductPath;
26
- constructor(applicationStore, depotServerClient, groupId, artifactId, versionId, dataProductPath, sampleQueryId, urlQueryParamValues) {
27
- super(applicationStore, depotServerClient, groupId, artifactId, versionId, sampleQueryId, urlQueryParamValues);
28
- this.dataProductPath = dataProductPath;
29
- }
30
- getEditorRoute() {
31
- return generateDataProductSampleQueryRoute(this.groupId, this.artifactId, this.versionId, this.dataProductPath, this.templateQueryId);
32
- }
33
- getEntityPath() {
34
- return this.dataProductPath;
35
- }
36
- getSearchTaggedValues() {
37
- return [createQueryDataProductTaggedValue(this.dataProductPath)];
38
- }
39
- getQueryDecoratorTaggedValues() {
40
- return [createQueryDataProductTaggedValue(this.dataProductPath)];
41
- }
42
- getSourceInfo() {
43
- return {
44
- sourceType: LegendQuerySourceType.DATA_PRODUCT_SAMPLE,
45
- groupId: this.groupId,
46
- artifactId: this.artifactId,
47
- versionId: this.versionId,
48
- dataProduct: this.dataProductPath,
49
- sampleQueryId: this.templateQueryId,
50
- };
51
- }
52
- async initializeQueryBuilderState() {
53
- const artifact = await this.fetchDataProductArtifact(this.groupId, this.artifactId, this.versionId, this.dataProductPath);
54
- const nativeModelAccess = guaranteeNonNullable(artifact.nativeModelAccess, `Data product '${this.dataProductPath}' does not have native model access`);
55
- const sampleQuery = nativeModelAccess.sampleQueries?.find((sq) => sq.info.id === this.templateQueryId);
56
- if (!sampleQuery) {
57
- throw new IllegalStateError(`Can't find sample query with id '${this.templateQueryId}' in data product '${this.dataProductPath}'`);
58
- }
59
- this.templateQueryTitle = sampleQuery.title;
60
- const accessId = sampleQuery.info.executionContextKey ??
61
- nativeModelAccess.defaultExecutionContext;
62
- const queryBuilderState = await this.buildDataProductQueryBuilderState(this.groupId, this.artifactId, this.versionId, this.dataProductPath, artifact, accessId, DataProductAccessType.NATIVE, async () => {
63
- this.applicationStore.notificationService.notifyWarning(`Can't switch data product while visiting a sample query`);
64
- }, undefined, new DataProductSelectorState(this.depotServerClient, this.applicationStore, this.lakehouseState?.contractServerClient), this.getSourceInfo());
65
- const query = await this.graphManagerState.graphManager.pureCodeToLambda(sampleQuery.info.query);
66
- const defaultParameters = await this.resolveDefaultParameters(query);
67
- queryBuilderState.initializeWithQuery(query, defaultParameters);
68
- return queryBuilderState;
69
- }
70
- }
71
- //# sourceMappingURL=DataProductSampleQueryCreatorStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataProductSampleQueryCreatorStore.js","sourceRoot":"","sources":["../../../src/stores/data-product/DataProductSampleQueryCreatorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAA0B,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG/E,OAAO,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,uDAAuD,CAAC;AAC1G,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAEL,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,OAAO,kCAAmC,SAAQ,6BAA6B;IAC1E,eAAe,CAAS;IAEjC,YACE,gBAA6C,EAC7C,iBAAoC,EACpC,OAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,aAAqB,EACrB,mBAAuD;QAEvD,KAAK,CACH,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,CACpB,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAEQ,cAAc;QACrB,OAAO,mCAAmC,CACxC,IAAI,CAAC,OAAO,EACZ,IAAI,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C;QACJ,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,WAAW,CAAC,KAAK,CAAC;QAE5C,MAAM,QAAQ,GACZ,WAAW,CAAC,IAAI,CAAC,mBAAmB;YACpC,iBAAiB,CAAC,uBAAuB,CAAC;QAE5C,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,iCAAiC,CACpE,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,eAAe,EACpB,QAAQ,EACR,QAAQ,EACR,qBAAqB,CAAC,MAAM,EAC5B,KAAK,IAAI,EAAE;YACT,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,aAAa,CACrD,yDAAyD,CAC1D,CAAC;QACJ,CAAC,EACD,SAAS,EACT,IAAI,wBAAwB,CAC1B,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAC1C,EACD,IAAI,CAAC,aAAa,EAAE,CACrB,CAAC;QAEF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,gBAAgB,CACtE,WAAW,CAAC,IAAI,CAAC,KAAK,CACvB,CAAC;QAEF,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACrE,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QAEhE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF"}
@@ -1,114 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-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, useLocalObservable } from 'mobx-react-lite';
18
- import { useParams } from '@finos/legend-application/browser';
19
- import { parseGAVCoordinates } from '@finos/legend-storage';
20
- import {
21
- useLegendQueryApplicationStore,
22
- useLegendQueryBaseStore,
23
- } from '../LegendQueryFrameworkProvider.js';
24
- import { DataProductSampleQueryCreatorStore } from '../../stores/data-product/DataProductSampleQueryCreatorStore.js';
25
- import { QueryEditorStoreContext } from '../QueryEditorStoreProvider.js';
26
- import {
27
- DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN,
28
- generateDataProductSampleQueryRoute,
29
- type DataProductSampleQueryPathParams,
30
- } from '../../__lib__/LegendQueryNavigation.js';
31
- import { QueryEditor } from '../QueryEditor.js';
32
- import { guaranteeNonNullable } from '@finos/legend-shared';
33
- import { useApplicationStore } from '@finos/legend-application';
34
- import { extractQueryParams } from '../utils/QueryParameterUtils.js';
35
- import { useEffect } from 'react';
36
-
37
- const DataProductSampleQueryCreatorStoreProvider: React.FC<{
38
- children: React.ReactNode;
39
- gav: string;
40
- dataProductPath: string;
41
- sampleQueryId: string;
42
- params: Record<string, string> | undefined;
43
- }> = ({ children, gav, dataProductPath, sampleQueryId, params }) => {
44
- const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
45
- const applicationStore = useLegendQueryApplicationStore();
46
- const baseStore = useLegendQueryBaseStore();
47
- const store = useLocalObservable(
48
- () =>
49
- new DataProductSampleQueryCreatorStore(
50
- applicationStore,
51
- baseStore.depotServerClient,
52
- groupId,
53
- artifactId,
54
- versionId,
55
- dataProductPath,
56
- sampleQueryId,
57
- params,
58
- ),
59
- );
60
- return (
61
- <QueryEditorStoreContext.Provider value={store}>
62
- {children}
63
- </QueryEditorStoreContext.Provider>
64
- );
65
- };
66
-
67
- export const DataProductSampleQueryCreator = observer(() => {
68
- const applicationStore = useApplicationStore();
69
- const parameters = useParams<DataProductSampleQueryPathParams>();
70
- const gav = guaranteeNonNullable(
71
- parameters[DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.GAV],
72
- );
73
- const dataProductPath = guaranteeNonNullable(
74
- parameters[
75
- DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_PATH
76
- ],
77
- );
78
- const sampleQueryId = guaranteeNonNullable(
79
- parameters[
80
- DATA_PRODUCT_SAMPLE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.SAMPLE_QUERY_ID
81
- ],
82
- );
83
-
84
- const queryParams =
85
- applicationStore.navigationService.navigator.getCurrentLocationParameters();
86
- const processed = extractQueryParams(queryParams);
87
-
88
- useEffect(() => {
89
- // clear params from URL after extracting
90
- if (processed && Object.keys(processed).length) {
91
- const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
92
- applicationStore.navigationService.navigator.updateCurrentLocation(
93
- generateDataProductSampleQueryRoute(
94
- groupId,
95
- artifactId,
96
- versionId,
97
- dataProductPath,
98
- sampleQueryId,
99
- ),
100
- );
101
- }
102
- }, [applicationStore, gav, dataProductPath, sampleQueryId, processed]);
103
-
104
- return (
105
- <DataProductSampleQueryCreatorStoreProvider
106
- gav={gav}
107
- dataProductPath={dataProductPath}
108
- sampleQueryId={sampleQueryId}
109
- params={processed}
110
- >
111
- <QueryEditor />
112
- </DataProductSampleQueryCreatorStoreProvider>
113
- );
114
- });