@finos/legend-application-studio 28.18.137 → 28.18.138
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__/LegendStudioEvent.d.ts +2 -1
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +2 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js +14 -5
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +34 -15
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +6 -5
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/NewElementState.js +1 -1
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +4 -3
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +41 -10
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
- package/package.json +6 -6
- package/src/__lib__/LegendStudioEvent.ts +3 -0
- package/src/components/editor/editor-group/dataProduct/DataPoductEditor.tsx +63 -18
- package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +101 -34
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +5 -22
- package/src/stores/editor/NewElementState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +72 -12
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-studio",
|
3
|
-
"version": "28.18.
|
3
|
+
"version": "28.18.138",
|
4
4
|
"description": "Legend Studio application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -47,11 +47,11 @@
|
|
47
47
|
"dependencies": {
|
48
48
|
"@finos/legend-application": "16.0.48",
|
49
49
|
"@finos/legend-art": "7.1.102",
|
50
|
-
"@finos/legend-code-editor": "2.0.
|
51
|
-
"@finos/legend-data-cube": "0.2.
|
52
|
-
"@finos/legend-graph": "32.1.
|
53
|
-
"@finos/legend-lego": "2.0.
|
54
|
-
"@finos/legend-query-builder": "4.16.
|
50
|
+
"@finos/legend-code-editor": "2.0.80",
|
51
|
+
"@finos/legend-data-cube": "0.2.12",
|
52
|
+
"@finos/legend-graph": "32.1.38",
|
53
|
+
"@finos/legend-lego": "2.0.85",
|
54
|
+
"@finos/legend-query-builder": "4.16.46",
|
55
55
|
"@finos/legend-server-depot": "6.0.92",
|
56
56
|
"@finos/legend-server-sdlc": "5.3.58",
|
57
57
|
"@finos/legend-server-showcase": "0.2.54",
|
@@ -77,4 +77,7 @@ export enum LEGEND_STUDIO_APP_EVENT {
|
|
77
77
|
TEXT_MODE_ACTION_KEYBOARD_SHORTCUT_GO_TO_DEFINITION__LAUNCH = 'editor.text-mode.action.keyboard.shortcut.go-to-element.launch',
|
78
78
|
TEXT_MODE_ACTION_KEYBOARD_SHORTCUT_GO_TO_DEFINITION__ERROR = 'editor.text-mode.action.keyboard.shortcut.go-to-element.error',
|
79
79
|
TEXT_MODE_ACTION_KEYBOARD_SHORTCUT_GO_TO_DEFINITION__SUCCESS = 'editor.text-mode.action.keyboard.shortcut.go-to-element.success',
|
80
|
+
|
81
|
+
// Ingestion
|
82
|
+
INGESTION_DEPLOY_SUCCESS_URN = 'editor.ingestion.deployment.success.urn',
|
80
83
|
}
|
@@ -43,6 +43,7 @@ import {
|
|
43
43
|
ModalFooter,
|
44
44
|
ModalFooterButton,
|
45
45
|
PencilEditIcon,
|
46
|
+
PanelFormTextField,
|
46
47
|
} from '@finos/legend-art';
|
47
48
|
import React, { useRef, useState, useEffect } from 'react';
|
48
49
|
import { filterByType } from '@finos/legend-shared';
|
@@ -365,7 +366,7 @@ const DataProductDeploymentResponseModal = observer(
|
|
365
366
|
className="editor-modal"
|
366
367
|
>
|
367
368
|
<ModalHeader>
|
368
|
-
<ModalTitle title="
|
369
|
+
<ModalTitle title="Data Product Deployment Response" />
|
369
370
|
</ModalHeader>
|
370
371
|
<ModalBody>
|
371
372
|
<PanelContent>
|
@@ -430,6 +431,19 @@ export const DataProductEditor = observer(() => {
|
|
430
431
|
}
|
431
432
|
};
|
432
433
|
|
434
|
+
const updateDataProductTitle = action((val: string | undefined): void => {
|
435
|
+
if (val === undefined) {
|
436
|
+
return;
|
437
|
+
}
|
438
|
+
product.name = val;
|
439
|
+
});
|
440
|
+
|
441
|
+
const updateDataProductDescription = action(
|
442
|
+
(val: string | undefined): void => {
|
443
|
+
product.description = val;
|
444
|
+
},
|
445
|
+
);
|
446
|
+
|
433
447
|
useEffect(() => {
|
434
448
|
flowResult(dataProductEditorState.convertAccessPointsFuncObjects()).catch(
|
435
449
|
dataProductEditorState.editorStore.applicationStore.alertUnhandledError,
|
@@ -459,7 +473,6 @@ export const DataProductEditor = observer(() => {
|
|
459
473
|
</div>
|
460
474
|
)}
|
461
475
|
<div className="panel__header__title__label">data product</div>
|
462
|
-
<div className="panel__header__title__content">{product.name}</div>
|
463
476
|
</div>
|
464
477
|
<PanelHeaderActions>
|
465
478
|
<div className="btn__dropdown-combo btn__dropdown-combo--primary">
|
@@ -476,10 +489,26 @@ export const DataProductEditor = observer(() => {
|
|
476
489
|
</div>
|
477
490
|
</PanelHeaderActions>
|
478
491
|
</div>
|
492
|
+
<div className="panel" style={{ padding: '1rem' }}>
|
493
|
+
<PanelFormTextField
|
494
|
+
name="Title"
|
495
|
+
value={product.name}
|
496
|
+
prompt="Provide a title for this Lakehouse Data Product."
|
497
|
+
update={updateDataProductTitle}
|
498
|
+
placeholder="Enter title"
|
499
|
+
/>
|
500
|
+
<PanelFormTextField
|
501
|
+
name="Description"
|
502
|
+
value={product.description}
|
503
|
+
prompt="Provide a description for this Lakehouse Data Product."
|
504
|
+
update={updateDataProductDescription}
|
505
|
+
placeholder="Enter description"
|
506
|
+
/>
|
507
|
+
</div>
|
479
508
|
<div className="panel">
|
480
509
|
<PanelHeader>
|
481
510
|
<div className="panel__header__title">
|
482
|
-
<div className="
|
511
|
+
<div className="panel__header__title__label">access points</div>
|
483
512
|
</div>
|
484
513
|
<PanelHeaderActions>
|
485
514
|
<PanelHeaderActionItem
|
@@ -492,22 +521,38 @@ export const DataProductEditor = observer(() => {
|
|
492
521
|
</PanelHeaderActionItem>
|
493
522
|
</PanelHeaderActions>
|
494
523
|
</PanelHeader>
|
495
|
-
<
|
496
|
-
|
497
|
-
.
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
524
|
+
<div style={{ overflow: 'auto' }}>
|
525
|
+
<PanelContent>
|
526
|
+
{dataProductEditorState.accessPointGroupStates.map(
|
527
|
+
(groupState) => (
|
528
|
+
<div
|
529
|
+
key={groupState.value.id}
|
530
|
+
className="access-point-editor__group-container"
|
531
|
+
>
|
532
|
+
<div className="access-point-editor__group-container__title">
|
533
|
+
<div className="panel__header__title__content">
|
534
|
+
{groupState.value.id}
|
535
|
+
</div>
|
536
|
+
</div>
|
537
|
+
{groupState.accessPointStates
|
538
|
+
.filter(filterByType(LakehouseAccessPointState))
|
539
|
+
.map((apState) => (
|
540
|
+
<LakehouseDataProductAcccessPointEditor
|
541
|
+
key={apState.accessPoint.id}
|
542
|
+
isReadOnly={isReadOnly}
|
543
|
+
accessPointState={apState}
|
544
|
+
/>
|
545
|
+
))}
|
546
|
+
</div>
|
547
|
+
),
|
548
|
+
)}
|
549
|
+
{!accessPointStates.length && (
|
550
|
+
<DataProductEditorSplashScreen
|
551
|
+
dataProductEditorState={dataProductEditorState}
|
503
552
|
/>
|
504
|
-
)
|
505
|
-
|
506
|
-
|
507
|
-
dataProductEditorState={dataProductEditorState}
|
508
|
-
/>
|
509
|
-
)}
|
510
|
-
</PanelContent>
|
553
|
+
)}
|
554
|
+
</PanelContent>
|
555
|
+
</div>
|
511
556
|
{dataProductEditorState.accessPointModal && (
|
512
557
|
<NewAccessPointAccessPOint
|
513
558
|
dataProductEditorState={dataProductEditorState}
|
@@ -17,6 +17,8 @@
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
18
18
|
import { useEditorStore } from '../../EditorStoreProvider.js';
|
19
19
|
import {
|
20
|
+
CheckCircleIcon,
|
21
|
+
CopyIcon,
|
20
22
|
Dialog,
|
21
23
|
Modal,
|
22
24
|
ModalBody,
|
@@ -34,50 +36,91 @@ import {
|
|
34
36
|
IngestDefinitionEditorState,
|
35
37
|
} from '../../../../stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js';
|
36
38
|
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
37
|
-
import { useEffect } from 'react';
|
39
|
+
import React, { useEffect } from 'react';
|
38
40
|
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
|
39
41
|
import { flowResult } from 'mobx';
|
40
42
|
import { useAuth } from 'react-oidc-context';
|
43
|
+
import {
|
44
|
+
type IngestDefinitionDeploymentResponse,
|
45
|
+
IngestDefinitionValidationResponse,
|
46
|
+
} from '../../../../stores/ingestion/IngestionDeploymentResponse.js';
|
41
47
|
|
42
|
-
const
|
43
|
-
(props: {
|
44
|
-
|
48
|
+
const IngestValidationError = observer(
|
49
|
+
(props: {
|
50
|
+
state: IngestDefinitionEditorState;
|
51
|
+
validateResponse: IngestDefinitionValidationResponse;
|
52
|
+
}) => {
|
53
|
+
const { state, validateResponse } = props;
|
45
54
|
const applicationStore = state.editorStore.applicationStore;
|
55
|
+
const closeModal = (): void =>
|
56
|
+
state.setValidateAndDeployResponse(undefined);
|
46
57
|
return (
|
47
58
|
<Dialog
|
48
|
-
open={
|
49
|
-
classes={{
|
59
|
+
open={true}
|
60
|
+
classes={{
|
61
|
+
root: 'editor-modal__root-container',
|
62
|
+
container: 'editor-modal__container',
|
63
|
+
paper: 'editor-modal__content',
|
64
|
+
}}
|
65
|
+
onClose={closeModal}
|
50
66
|
>
|
51
67
|
<Modal
|
52
68
|
darkMode={
|
53
69
|
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
54
70
|
}
|
55
|
-
className="
|
71
|
+
className="editor-modal"
|
56
72
|
>
|
57
73
|
<ModalHeader>
|
58
|
-
<ModalTitle title=
|
74
|
+
<ModalTitle title={'Validation Error'} />
|
59
75
|
</ModalHeader>
|
60
76
|
<ModalBody>
|
61
|
-
<
|
77
|
+
<PanelContent>
|
78
|
+
<CodeEditor
|
79
|
+
inputValue={JSON.stringify(validateResponse, null, 2)}
|
80
|
+
isReadOnly={true}
|
81
|
+
language={CODE_EDITOR_LANGUAGE.JSON}
|
82
|
+
/>
|
83
|
+
</PanelContent>
|
62
84
|
</ModalBody>
|
85
|
+
<ModalFooter>
|
86
|
+
<ModalFooterButton
|
87
|
+
onClick={closeModal}
|
88
|
+
text="Close"
|
89
|
+
type="secondary"
|
90
|
+
/>
|
91
|
+
</ModalFooter>
|
63
92
|
</Modal>
|
64
93
|
</Dialog>
|
65
94
|
);
|
66
95
|
},
|
67
96
|
);
|
68
97
|
|
69
|
-
|
70
|
-
|
71
|
-
|
98
|
+
// TODO: show full report i.e write envs etc
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
100
|
+
const IngestDeploymentResponseModal = observer(
|
101
|
+
(props: {
|
102
|
+
state: IngestDefinitionEditorState;
|
103
|
+
deploymentResponse: IngestDefinitionDeploymentResponse;
|
104
|
+
}) => {
|
105
|
+
const { state, deploymentResponse } = props;
|
72
106
|
const applicationStore = state.editorStore.applicationStore;
|
73
|
-
const
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
107
|
+
const closeModal = (): void =>
|
108
|
+
state.setValidateAndDeployResponse(undefined);
|
109
|
+
const copyURN = (text: string): void => {
|
110
|
+
state.editorStore.applicationStore.clipboardService
|
111
|
+
.copyTextToClipboard(text)
|
112
|
+
.then(() =>
|
113
|
+
state.editorStore.applicationStore.notificationService.notifySuccess(
|
114
|
+
'Ingest URN copied to clipboard',
|
115
|
+
undefined,
|
116
|
+
2500,
|
117
|
+
),
|
118
|
+
)
|
119
|
+
.catch(state.editorStore.applicationStore.alertUnhandledError);
|
120
|
+
};
|
78
121
|
return (
|
79
122
|
<Dialog
|
80
|
-
open={
|
123
|
+
open={true}
|
81
124
|
classes={{
|
82
125
|
root: 'editor-modal__root-container',
|
83
126
|
container: 'editor-modal__container',
|
@@ -92,19 +135,34 @@ const IngestValidationError = observer(
|
|
92
135
|
className="editor-modal"
|
93
136
|
>
|
94
137
|
<ModalHeader>
|
95
|
-
<ModalTitle
|
138
|
+
<ModalTitle
|
139
|
+
icon={<CheckCircleIcon />}
|
140
|
+
title="Deployment URN"
|
141
|
+
></ModalTitle>
|
96
142
|
</ModalHeader>
|
97
143
|
<ModalBody>
|
98
144
|
<PanelContent>
|
99
|
-
<
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
145
|
+
<div>
|
146
|
+
<div>Ingestion URN</div>
|
147
|
+
<div>{deploymentResponse.ingestDefinitionUrn}</div>
|
148
|
+
|
149
|
+
<div className="data-space__viewer__quickstart__tds__query-text__actions">
|
150
|
+
<button
|
151
|
+
className="data-space__viewer__quickstart__tds__query-text__action"
|
152
|
+
tabIndex={-1}
|
153
|
+
title="Copy"
|
154
|
+
onClick={() => {
|
155
|
+
copyURN(deploymentResponse.ingestDefinitionUrn);
|
156
|
+
}}
|
157
|
+
>
|
158
|
+
<CopyIcon />
|
159
|
+
</button>
|
160
|
+
<button
|
161
|
+
className="data-space__viewer__quickstart__tds__query-text__action"
|
162
|
+
tabIndex={-1}
|
163
|
+
></button>
|
164
|
+
</div>
|
165
|
+
</div>
|
108
166
|
</PanelContent>
|
109
167
|
</ModalBody>
|
110
168
|
<ModalFooter>
|
@@ -153,6 +211,20 @@ export const IngestDefinitionEditor = observer(() => {
|
|
153
211
|
}
|
154
212
|
};
|
155
213
|
|
214
|
+
const renderDeploymentResponse = (): React.ReactNode => {
|
215
|
+
const response = ingestDefinitionEditorState.deploymentResponse;
|
216
|
+
if (response instanceof IngestDefinitionValidationResponse) {
|
217
|
+
return (
|
218
|
+
<IngestValidationError
|
219
|
+
state={ingestDefinitionEditorState}
|
220
|
+
validateResponse={response}
|
221
|
+
/>
|
222
|
+
);
|
223
|
+
}
|
224
|
+
|
225
|
+
return null;
|
226
|
+
};
|
227
|
+
|
156
228
|
const isValid = ingestDefinitionEditorState.validForDeployment;
|
157
229
|
useEffect(() => {
|
158
230
|
ingestDefinitionEditorState.generateElementGrammar();
|
@@ -202,12 +274,7 @@ export const IngestDefinitionEditor = observer(() => {
|
|
202
274
|
language={CODE_EDITOR_LANGUAGE.PURE}
|
203
275
|
/>
|
204
276
|
</PanelContent>
|
205
|
-
{
|
206
|
-
<IngestDepoymentModal state={ingestDefinitionEditorState} />
|
207
|
-
)}
|
208
|
-
{ingestDefinitionEditorState.validationError && (
|
209
|
-
<IngestValidationError state={ingestDefinitionEditorState} />
|
210
|
-
)}
|
277
|
+
{renderDeploymentResponse()}
|
211
278
|
</PanelContent>
|
212
279
|
</div>
|
213
280
|
);
|
@@ -27,7 +27,6 @@ import {
|
|
27
27
|
NewServiceDriver,
|
28
28
|
CONNECTION_TYPE,
|
29
29
|
type RuntimeOption,
|
30
|
-
NewLakehouseDataProductDriver,
|
31
30
|
} from '../../../stores/editor/NewElementState.js';
|
32
31
|
import { Dialog, compareLabelFn, CustomSelectorInput } from '@finos/legend-art';
|
33
32
|
import type { EditorStore } from '../../../stores/editor/EditorStore.js';
|
@@ -441,27 +440,11 @@ const NewServiceDriverEditor = observer(() => {
|
|
441
440
|
});
|
442
441
|
|
443
442
|
const NewLakehouseDataProductEditor = observer(() => {
|
444
|
-
const editorStore = useEditorStore();
|
445
|
-
const newProductDriver = editorStore.newElementState.getNewElementDriver(
|
446
|
-
|
447
|
-
);
|
448
|
-
|
449
|
-
event,
|
450
|
-
) => newProductDriver.setTitle(event.target.value);
|
451
|
-
return (
|
452
|
-
<>
|
453
|
-
<div className="panel__content__form__section__header__label">Title</div>
|
454
|
-
<div className="explorer__new-element-modal__driver">
|
455
|
-
<input
|
456
|
-
className="input--dark explorer__new-element-modal__name-input"
|
457
|
-
spellCheck={false}
|
458
|
-
value={newProductDriver.title}
|
459
|
-
onChange={handleTitleChangee}
|
460
|
-
placeholder={`Data Product Title`}
|
461
|
-
/>
|
462
|
-
</div>
|
463
|
-
</>
|
464
|
-
);
|
443
|
+
// const editorStore = useEditorStore();
|
444
|
+
// const newProductDriver = editorStore.newElementState.getNewElementDriver(
|
445
|
+
// NewLakehouseDataProductDriver,
|
446
|
+
// );
|
447
|
+
return null;
|
465
448
|
});
|
466
449
|
|
467
450
|
const NewFileGenerationDriverEditor = observer(() => {
|
package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts
CHANGED
@@ -23,12 +23,21 @@ import {
|
|
23
23
|
assertTrue,
|
24
24
|
guaranteeNonNullable,
|
25
25
|
guaranteeType,
|
26
|
+
LogEvent,
|
26
27
|
removePrefix,
|
27
28
|
type GeneratorFn,
|
28
29
|
} from '@finos/legend-shared';
|
29
30
|
import type { IngestionManager } from '../../../../ingestion/IngestionManager.js';
|
30
|
-
import {
|
31
|
+
import {
|
32
|
+
action,
|
33
|
+
computed,
|
34
|
+
flow,
|
35
|
+
flowResult,
|
36
|
+
makeObservable,
|
37
|
+
observable,
|
38
|
+
} from 'mobx';
|
31
39
|
import type {
|
40
|
+
IngestDefinitionDeploymentResponse,
|
32
41
|
IngestDefinitionValidationResponse,
|
33
42
|
ValidateAndDeploymentResponse,
|
34
43
|
} from '../../../../ingestion/IngestionDeploymentResponse.js';
|
@@ -38,6 +47,11 @@ import {
|
|
38
47
|
} from '../ElementEditorInitialConfiguration.js';
|
39
48
|
import type { AuthContextProps } from 'react-oidc-context';
|
40
49
|
import { EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig } from '../../../../../__lib__/LegendStudioNavigation.js';
|
50
|
+
import {
|
51
|
+
ActionAlertActionType,
|
52
|
+
ActionAlertType,
|
53
|
+
} from '@finos/legend-application';
|
54
|
+
import { LEGEND_STUDIO_APP_EVENT } from '../../../../../__lib__/LegendStudioEvent.js';
|
41
55
|
|
42
56
|
const createEditorInitialConfiguration = (): EditorInitialConfiguration => {
|
43
57
|
const config = new EditorInitialConfiguration();
|
@@ -63,7 +77,7 @@ export const generateUrlToDeployOnOpen = (
|
|
63
77
|
|
64
78
|
const PARSER_SECTION = `###Lakehouse`;
|
65
79
|
export class IngestDefinitionEditorState extends ElementEditorState {
|
66
|
-
|
80
|
+
validateAndDeployResponse: ValidateAndDeploymentResponse | undefined;
|
67
81
|
deploymentState = ActionState.create();
|
68
82
|
deployOnOpen = false;
|
69
83
|
|
@@ -78,8 +92,9 @@ export class IngestDefinitionEditorState extends ElementEditorState {
|
|
78
92
|
deploymentState: observable,
|
79
93
|
deployOnOpen: observable,
|
80
94
|
setDeployOnOpen: observable,
|
81
|
-
|
82
|
-
|
95
|
+
validateAndDeployResponse: observable,
|
96
|
+
deploymentResponse: computed,
|
97
|
+
setValidateAndDeployResponse: action,
|
83
98
|
init_with_deploy: flow,
|
84
99
|
deploy: flow,
|
85
100
|
});
|
@@ -89,12 +104,24 @@ export class IngestDefinitionEditorState extends ElementEditorState {
|
|
89
104
|
}
|
90
105
|
}
|
91
106
|
|
107
|
+
get deploymentResponse():
|
108
|
+
| IngestDefinitionDeploymentResponse
|
109
|
+
| IngestDefinitionValidationResponse
|
110
|
+
| undefined {
|
111
|
+
return (
|
112
|
+
this.validateAndDeployResponse?.deploymentResponse ??
|
113
|
+
this.validateAndDeployResponse?.validationResponse
|
114
|
+
);
|
115
|
+
}
|
116
|
+
|
92
117
|
get ingestionManager(): IngestionManager | undefined {
|
93
118
|
return this.editorStore.ingestionManager;
|
94
119
|
}
|
95
120
|
|
96
|
-
|
97
|
-
|
121
|
+
setValidateAndDeployResponse(
|
122
|
+
val: ValidateAndDeploymentResponse | undefined,
|
123
|
+
): void {
|
124
|
+
this.validateAndDeployResponse = val;
|
98
125
|
}
|
99
126
|
|
100
127
|
setDeployOnOpen(value: boolean): void {
|
@@ -140,24 +167,57 @@ export class IngestDefinitionEditorState extends ElementEditorState {
|
|
140
167
|
}),
|
141
168
|
token,
|
142
169
|
)) as unknown as ValidateAndDeploymentResponse;
|
170
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert(
|
171
|
+
undefined,
|
172
|
+
);
|
143
173
|
const deploymentResponse = response.deploymentResponse;
|
144
174
|
if (deploymentResponse) {
|
145
|
-
this.editorStore.applicationStore.
|
146
|
-
|
175
|
+
this.editorStore.applicationStore.logService.info(
|
176
|
+
LogEvent.create(LEGEND_STUDIO_APP_EVENT.INGESTION_DEPLOY_SUCCESS_URN),
|
177
|
+
deploymentResponse.ingestDefinitionUrn,
|
147
178
|
);
|
179
|
+
this.editorStore.applicationStore.alertService.setActionAlertInfo({
|
180
|
+
title: `Ingest Definition Deployment`,
|
181
|
+
message: `Ingest definition deployed successfully. You may use URN for ingestion of Data`,
|
182
|
+
prompt: `${deploymentResponse.ingestDefinitionUrn}`,
|
183
|
+
type: ActionAlertType.STANDARD,
|
184
|
+
actions: [
|
185
|
+
{
|
186
|
+
label: 'Copy URN',
|
187
|
+
type: ActionAlertActionType.PROCEED,
|
188
|
+
handler: (): void => {
|
189
|
+
this.editorStore.applicationStore.clipboardService
|
190
|
+
.copyTextToClipboard(deploymentResponse.ingestDefinitionUrn)
|
191
|
+
.then(() =>
|
192
|
+
this.editorStore.applicationStore.notificationService.notifySuccess(
|
193
|
+
'Ingest URN copied to clipboard',
|
194
|
+
undefined,
|
195
|
+
2500,
|
196
|
+
),
|
197
|
+
)
|
198
|
+
.catch(this.editorStore.applicationStore.alertUnhandledError);
|
199
|
+
},
|
200
|
+
default: true,
|
201
|
+
},
|
202
|
+
{
|
203
|
+
label: 'Close',
|
204
|
+
type: ActionAlertActionType.PROCEED_WITH_CAUTION,
|
205
|
+
},
|
206
|
+
],
|
207
|
+
});
|
148
208
|
} else {
|
149
|
-
this.
|
209
|
+
this.setValidateAndDeployResponse(response);
|
150
210
|
}
|
151
211
|
} catch (error) {
|
212
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert(
|
213
|
+
undefined,
|
214
|
+
);
|
152
215
|
assertErrorThrown(error);
|
153
216
|
this.editorStore.applicationStore.notificationService.notifyError(
|
154
217
|
`Ingest definition failed to deploy: ${error.message}`,
|
155
218
|
);
|
156
219
|
} finally {
|
157
220
|
this.deploymentState.complete();
|
158
|
-
this.editorStore.applicationStore.alertService.setBlockingAlert(
|
159
|
-
undefined,
|
160
|
-
);
|
161
221
|
}
|
162
222
|
}
|
163
223
|
|