@finos/legend-application-query 13.8.28 → 13.8.30

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 (66) hide show
  1. package/lib/__lib__/LegendQueryNavigation.d.ts +12 -0
  2. package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendQueryNavigation.js +16 -0
  4. package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
  5. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
  6. package/lib/components/Core_LegendQueryApplicationPlugin.js +15 -0
  7. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  8. package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
  9. package/lib/components/LegendQueryWebApplication.js +2 -1
  10. package/lib/components/LegendQueryWebApplication.js.map +1 -1
  11. package/lib/components/QueryEditor.d.ts.map +1 -1
  12. package/lib/components/QueryEditor.js +5 -1
  13. package/lib/components/QueryEditor.js.map +1 -1
  14. package/lib/components/data-product/LegendQueryDataProductQueryBuilder.d.ts.map +1 -1
  15. package/lib/components/data-product/LegendQueryDataProductQueryBuilder.js +6 -40
  16. package/lib/components/data-product/LegendQueryDataProductQueryBuilder.js.map +1 -1
  17. package/lib/components/ingest/IngestInfo.d.ts +32 -0
  18. package/lib/components/ingest/IngestInfo.d.ts.map +1 -0
  19. package/lib/components/ingest/IngestInfo.js +63 -0
  20. package/lib/components/ingest/IngestInfo.js.map +1 -0
  21. package/lib/components/ingest/IngestQueryBuilderSetupPanel.d.ts +18 -0
  22. package/lib/components/ingest/IngestQueryBuilderSetupPanel.d.ts.map +1 -0
  23. package/lib/components/ingest/IngestQueryBuilderSetupPanel.js +77 -0
  24. package/lib/components/ingest/IngestQueryBuilderSetupPanel.js.map +1 -0
  25. package/lib/components/ingest/IngestQueryCreator.d.ts +27 -0
  26. package/lib/components/ingest/IngestQueryCreator.d.ts.map +1 -0
  27. package/lib/components/ingest/IngestQueryCreator.js +45 -0
  28. package/lib/components/ingest/IngestQueryCreator.js.map +1 -0
  29. package/lib/components/shared/LakehouseRuntimeConfigModal.d.ts +29 -0
  30. package/lib/components/shared/LakehouseRuntimeConfigModal.d.ts.map +1 -0
  31. package/lib/components/shared/LakehouseRuntimeConfigModal.js +60 -0
  32. package/lib/components/shared/LakehouseRuntimeConfigModal.js.map +1 -0
  33. package/lib/index.css +1 -1
  34. package/lib/light-mode.css +1 -1
  35. package/lib/package.json +1 -1
  36. package/lib/stores/QueryEditorStore.d.ts +10 -0
  37. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  38. package/lib/stores/QueryEditorStore.js +81 -2
  39. package/lib/stores/QueryEditorStore.js.map +1 -1
  40. package/lib/stores/ingest/IngestLegendQueryBuilderState.d.ts +122 -0
  41. package/lib/stores/ingest/IngestLegendQueryBuilderState.d.ts.map +1 -0
  42. package/lib/stores/ingest/IngestLegendQueryBuilderState.js +191 -0
  43. package/lib/stores/ingest/IngestLegendQueryBuilderState.js.map +1 -0
  44. package/lib/stores/ingest/IngestQueryCreatorStore.d.ts +75 -0
  45. package/lib/stores/ingest/IngestQueryCreatorStore.d.ts.map +1 -0
  46. package/lib/stores/ingest/IngestQueryCreatorStore.js +169 -0
  47. package/lib/stores/ingest/IngestQueryCreatorStore.js.map +1 -0
  48. package/lib/stores/ingest/IngestQueryGraphHelper.d.ts +58 -0
  49. package/lib/stores/ingest/IngestQueryGraphHelper.d.ts.map +1 -0
  50. package/lib/stores/ingest/IngestQueryGraphHelper.js +72 -0
  51. package/lib/stores/ingest/IngestQueryGraphHelper.js.map +1 -0
  52. package/package.json +12 -12
  53. package/src/__lib__/LegendQueryNavigation.ts +35 -0
  54. package/src/components/Core_LegendQueryApplicationPlugin.tsx +20 -0
  55. package/src/components/LegendQueryWebApplication.tsx +14 -0
  56. package/src/components/QueryEditor.tsx +12 -0
  57. package/src/components/data-product/LegendQueryDataProductQueryBuilder.tsx +7 -127
  58. package/src/components/ingest/IngestInfo.tsx +197 -0
  59. package/src/components/ingest/IngestQueryBuilderSetupPanel.tsx +204 -0
  60. package/src/components/ingest/IngestQueryCreator.tsx +75 -0
  61. package/src/components/shared/LakehouseRuntimeConfigModal.tsx +148 -0
  62. package/src/stores/QueryEditorStore.ts +131 -1
  63. package/src/stores/ingest/IngestLegendQueryBuilderState.ts +259 -0
  64. package/src/stores/ingest/IngestQueryCreatorStore.ts +262 -0
  65. package/src/stores/ingest/IngestQueryGraphHelper.ts +120 -0
  66. package/tsconfig.json +7 -0
@@ -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 {
@@ -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';
@@ -1210,6 +1212,16 @@ export const QueryEditor = observer(() => {
1210
1212
  closeModal={() => editorStore.setShowDataProductInfo(false)}
1211
1213
  />
1212
1214
  )}
1215
+ {editorStore.showIngestInfo &&
1216
+ editorStore.queryBuilderState instanceof
1217
+ IngestLegendQueryBuilderState && (
1218
+ <QueryEditorIngestInfoModal
1219
+ editorStore={editorStore}
1220
+ queryBuilderState={editorStore.queryBuilderState}
1221
+ open={editorStore.showIngestInfo}
1222
+ closeModal={() => editorStore.setShowIngestInfo(false)}
1223
+ />
1224
+ )}
1213
1225
  {isExistingQuery &&
1214
1226
  editorStore.updateState.showQueryInfo &&
1215
1227
  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 { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
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
- executionState={executionState}
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={
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ Dialog,
19
+ Modal,
20
+ ModalTitle,
21
+ Panel,
22
+ PanelFullContent,
23
+ } from '@finos/legend-art';
24
+ import {
25
+ LATEST_VERSION_ALIAS,
26
+ StoreProjectData,
27
+ VersionedProjectData,
28
+ } from '@finos/legend-server-depot';
29
+ import { observer } from 'mobx-react-lite';
30
+ import { flowResult } from 'mobx';
31
+ import { assertErrorThrown } from '@finos/legend-shared';
32
+ import { LakehouseRuntime } from '@finos/legend-graph';
33
+ import type { QueryEditorStore } from '../../stores/QueryEditorStore.js';
34
+ import type { IngestLegendQueryBuilderState } from '../../stores/ingest/IngestLegendQueryBuilderState.js';
35
+ import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl } from '../../__lib__/LegendQueryNavigation.js';
36
+
37
+ /**
38
+ * "About Ingest" info modal, mirroring `QueryEditorDataProductInfoModal`.
39
+ * Surfaces the project GAV, the ingest name + currently selected data set,
40
+ * the adhoc lakehouse runtime (environment + warehouse), and a link to the
41
+ * ingest definition's configuration in Studio.
42
+ */
43
+ export const QueryEditorIngestInfoModal = observer(
44
+ (props: {
45
+ editorStore: QueryEditorStore;
46
+ queryBuilderState: IngestLegendQueryBuilderState;
47
+ open: boolean;
48
+ closeModal: () => void;
49
+ }) => {
50
+ const { editorStore, queryBuilderState, open, closeModal } = props;
51
+ const projectInfo = editorStore.getProjectInfo();
52
+ const ingestDefinition = queryBuilderState.ingestDefinition;
53
+ const lakehouseRuntime = queryBuilderState.lakehouseRuntime;
54
+
55
+ /**
56
+ * Open the given element path (or the project root if `undefined`) in
57
+ * Studio's SDLC project view. Mirrors `DataProductInfo.visitElement`.
58
+ */
59
+ const visitElement = async (path: string | undefined): Promise<void> => {
60
+ try {
61
+ if (projectInfo) {
62
+ const project = StoreProjectData.serialization.fromJson(
63
+ await editorStore.depotServerClient.getProject(
64
+ projectInfo.groupId,
65
+ projectInfo.artifactId,
66
+ ),
67
+ );
68
+ const versionId =
69
+ projectInfo.versionId === LATEST_VERSION_ALIAS
70
+ ? VersionedProjectData.serialization.fromJson(
71
+ await editorStore.depotServerClient.getLatestVersion(
72
+ projectInfo.groupId,
73
+ projectInfo.artifactId,
74
+ ),
75
+ ).versionId
76
+ : projectInfo.versionId;
77
+ editorStore.applicationStore.navigationService.navigator.visitAddress(
78
+ EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl(
79
+ editorStore.applicationStore.config.studioApplicationUrl,
80
+ project.projectId,
81
+ versionId,
82
+ path,
83
+ ),
84
+ );
85
+ }
86
+ } catch (error) {
87
+ assertErrorThrown(error);
88
+ editorStore.applicationStore.notificationService.notifyError(
89
+ path
90
+ ? `Can't visit element of path: '${path}'`
91
+ : `Can't visit project`,
92
+ );
93
+ }
94
+ };
95
+
96
+ return (
97
+ <Dialog
98
+ open={open}
99
+ onClose={closeModal}
100
+ classes={{ container: 'dataspace-info-modal__container' }}
101
+ slotProps={{
102
+ paper: {
103
+ classes: { root: 'dataspace-info-modal__inner-container' },
104
+ },
105
+ }}
106
+ >
107
+ <Modal
108
+ darkMode={
109
+ !editorStore.applicationStore.layoutService
110
+ .TEMPORARY__isLightColorThemeEnabled
111
+ }
112
+ className="dataspace-info-modal"
113
+ >
114
+ <div className="dataspace-info-modal__header">
115
+ <ModalTitle title="About Ingest" />
116
+ </div>
117
+ <Panel>
118
+ <PanelFullContent>
119
+ {projectInfo && (
120
+ <div className="dataspace-info-modal__field">
121
+ <div className="dataspace-info-modal__field__label">
122
+ Project
123
+ </div>
124
+ <div
125
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
126
+ onClick={() => flowResult(visitElement(undefined))}
127
+ >
128
+ {`${projectInfo.groupId}:${projectInfo.artifactId}:${projectInfo.versionId}`}
129
+ </div>
130
+ </div>
131
+ )}
132
+ <div className="dataspace-info-modal__field">
133
+ <div className="dataspace-info-modal__field__label">Name</div>
134
+ <div className="dataspace-info-modal__field__value">
135
+ {ingestDefinition.name}
136
+ </div>
137
+ </div>
138
+ <div className="dataspace-info-modal__field">
139
+ <div className="dataspace-info-modal__field__label">Path</div>
140
+ <div className="dataspace-info-modal__field__value">
141
+ {ingestDefinition.path}
142
+ </div>
143
+ </div>
144
+ {queryBuilderState.dataSet && (
145
+ <div className="dataspace-info-modal__field">
146
+ <div className="dataspace-info-modal__field__label">
147
+ Data Set
148
+ </div>
149
+ <div className="dataspace-info-modal__field__value">
150
+ {queryBuilderState.dataSet}
151
+ </div>
152
+ </div>
153
+ )}
154
+ {lakehouseRuntime instanceof LakehouseRuntime && (
155
+ <>
156
+ {lakehouseRuntime.environment && (
157
+ <div className="dataspace-info-modal__field">
158
+ <div className="dataspace-info-modal__field__label">
159
+ Environment
160
+ </div>
161
+ <div className="dataspace-info-modal__field__value">
162
+ {lakehouseRuntime.environment}
163
+ </div>
164
+ </div>
165
+ )}
166
+ {lakehouseRuntime.warehouse && (
167
+ <div className="dataspace-info-modal__field">
168
+ <div className="dataspace-info-modal__field__label">
169
+ Warehouse
170
+ </div>
171
+ <div className="dataspace-info-modal__field__value">
172
+ {lakehouseRuntime.warehouse}
173
+ </div>
174
+ </div>
175
+ )}
176
+ </>
177
+ )}
178
+ <div className="dataspace-info-modal__field">
179
+ <div className="dataspace-info-modal__field__label">
180
+ Configuration
181
+ </div>
182
+ <div
183
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
184
+ onClick={() =>
185
+ flowResult(visitElement(ingestDefinition.path))
186
+ }
187
+ >
188
+ Show Ingest Configuration
189
+ </div>
190
+ </div>
191
+ </PanelFullContent>
192
+ </Panel>
193
+ </Modal>
194
+ </Dialog>
195
+ );
196
+ },
197
+ );