@finos/legend-application-studio 28.18.136 → 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.
Files changed (33) hide show
  1. package/lib/__lib__/LegendStudioEvent.d.ts +2 -1
  2. package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioEvent.js +2 -0
  4. package/lib/__lib__/LegendStudioEvent.js.map +1 -1
  5. package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
  6. package/lib/components/LegendStudioWebApplication.js +13 -29
  7. package/lib/components/LegendStudioWebApplication.js.map +1 -1
  8. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js +43 -8
  10. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js.map +1 -1
  11. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +34 -15
  13. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
  14. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  15. package/lib/components/editor/side-bar/CreateNewElementModal.js +6 -5
  16. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  17. package/lib/index.css +2 -2
  18. package/lib/index.css.map +1 -1
  19. package/lib/package.json +1 -1
  20. package/lib/stores/editor/NewElementState.js +1 -1
  21. package/lib/stores/editor/NewElementState.js.map +1 -1
  22. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +4 -3
  23. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
  24. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +41 -10
  25. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
  26. package/package.json +6 -6
  27. package/src/__lib__/LegendStudioEvent.ts +3 -0
  28. package/src/components/LegendStudioWebApplication.tsx +31 -38
  29. package/src/components/editor/editor-group/dataProduct/DataPoductEditor.tsx +143 -20
  30. package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +101 -34
  31. package/src/components/editor/side-bar/CreateNewElementModal.tsx +5 -22
  32. package/src/stores/editor/NewElementState.ts +1 -1
  33. package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +72 -12
@@ -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 { action, flow, flowResult, makeObservable, observable } from 'mobx';
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
- validationError: IngestDefinitionValidationResponse | undefined;
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
- validationError: observable,
82
- setValError: action,
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
- setValError(val: IngestDefinitionValidationResponse | undefined): void {
97
- this.validationError = val;
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.notificationService.notifySuccess(
146
- `Ingest definition successfully deployed on ${deploymentResponse.ingestDefinitionUrn}`,
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.setValError(response.validationResponse);
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