@finos/legend-application-studio 28.18.131 → 28.18.132

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 (36) hide show
  1. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js +52 -4
  3. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js.map +1 -1
  4. package/lib/index.css +1 -1
  5. package/lib/package.json +1 -1
  6. package/lib/stores/editor/EditorTabManagerState.js +1 -1
  7. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  8. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.d.ts +5 -0
  9. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.d.ts.map +1 -1
  10. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.js +13 -0
  11. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.js.map +1 -1
  12. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +17 -3
  13. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  14. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +73 -3
  15. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  16. package/lib/stores/ingestion/AdhocDataProductDeployResponse.d.ts +21 -0
  17. package/lib/stores/ingestion/AdhocDataProductDeployResponse.d.ts.map +1 -0
  18. package/lib/stores/ingestion/AdhocDataProductDeployResponse.js +24 -0
  19. package/lib/stores/ingestion/AdhocDataProductDeployResponse.js.map +1 -0
  20. package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts +4 -0
  21. package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts.map +1 -1
  22. package/lib/stores/ingestion/IngestDeploymentServerClient.js +5 -0
  23. package/lib/stores/ingestion/IngestDeploymentServerClient.js.map +1 -1
  24. package/lib/stores/ingestion/IngestionManager.d.ts +2 -0
  25. package/lib/stores/ingestion/IngestionManager.d.ts.map +1 -1
  26. package/lib/stores/ingestion/IngestionManager.js +9 -1
  27. package/lib/stores/ingestion/IngestionManager.js.map +1 -1
  28. package/package.json +6 -6
  29. package/src/components/editor/editor-group/dataProduct/DataPoductEditor.tsx +146 -0
  30. package/src/stores/editor/EditorTabManagerState.ts +1 -1
  31. package/src/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.ts +22 -0
  32. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +120 -2
  33. package/src/stores/ingestion/AdhocDataProductDeployResponse.ts +29 -0
  34. package/src/stores/ingestion/IngestDeploymentServerClient.ts +18 -0
  35. package/src/stores/ingestion/IngestionManager.ts +26 -1
  36. package/tsconfig.json +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"IngestDeploymentServerClient.js","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestDeploymentServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,UAAU,GAEX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAOlD,MAAM,OAAO,4BAA6B,SAAQ,oBAAoB;IACpE,yBAAyB,CAAS;IAClC,YAAY,MAAoC;QAC9C,KAAK,CAAC;YACJ,OAAO,EAAE,MAAM,CAAC,eAAe;SAChC,CAAC,CAAC;QACH,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAC;QAClE,cAAc,CAAC,IAAI,EAAE;YACnB,yBAAyB,EAAE,UAAU;YACrC,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QACpC,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC,CAAC;IAEK,mBAAmB,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QACjD,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,UAAU;QACjD,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC,CAAC;IAEK,OAAO,GAAG,GAAW,EAAE,CAC7B,GAAG,IAAI,CAAC,OAAO,qCAAqC,CAAC;IAEvD,YAAY,CAAC,YAA0C;QACrD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,eAAe,CAAC;QAC5C,IAAI,CAAC,yBAAyB,GAAG,YAAY,CAAC,yBAAyB,CAAC;IAC1E,CAAC;IAED,QAAQ,CACN,eAAuB,EACvB,KAAyB;QAEzB,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,EAC5B,eAAe,EACf,SAAS,EACT,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAChC,CAAC;IACJ,CAAC;IAED,MAAM,CACJ,aAAqB,EACrB,KAAyB;QAEzB,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,EACnB,aAAa,EACb,SAAS,EACT,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAChC,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"IngestDeploymentServerClient.js","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestDeploymentServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,UAAU,GAEX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAQlD,MAAM,OAAO,4BAA6B,SAAQ,oBAAoB;IACpE,yBAAyB,CAAS;IAE1B,gBAAgB,GAAG,cAAc,CAAC;IAC1C,YAAY,MAAoC;QAC9C,KAA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J,CAAC;IAED,iBAAiB,CACf,WAAmB,EACnB,KAAyB;QAEzB,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,EACxB,WAAW,EACX,SAAS,EACT,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAChC,CAAC;IACJ,CAAC;CACF"}
@@ -18,6 +18,7 @@ import type { GenericLegendApplicationStore } from '@finos/legend-application';
18
18
  import { type ActionState } from '@finos/legend-shared';
19
19
  import { ValidateAndDeploymentResponse } from './IngestionDeploymentResponse.js';
20
20
  import { type LegendIngestionConfiguration } from '../../application/LegendIngestionConfiguration.js';
21
+ import { type AdhocDataProductDeployResponse } from './AdhocDataProductDeployResponse.js';
21
22
  export declare class IngestionManager {
22
23
  private ingestDiscoveryServerClient;
23
24
  private ingestDeploymentServerClient;
@@ -28,6 +29,7 @@ export declare class IngestionManager {
28
29
  isCurrentAppDirNode(appDirNode: AppDirNode): boolean;
29
30
  setCurrentAppDirNode(appDirNode: AppDirNode): void;
30
31
  deploy(ingestDefinition: string, appDirNode: AppDirNode, actionState: ActionState | undefined, token: string | undefined): Promise<ValidateAndDeploymentResponse>;
32
+ deployDataProduct(grammarText: string, appDirNode: AppDirNode, actionState: ActionState | undefined, token: string | undefined): Promise<AdhocDataProductDeployResponse>;
31
33
  private _validate;
32
34
  private _deploy;
33
35
  private identifyIngestDeploymentServer;
@@ -1 +1 @@
1
- {"version":3,"file":"IngestionManager.d.ts","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestionManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAIL,6BAA6B,EAE9B,MAAM,kCAAkC,CAAC;AA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qB;IAC1C,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgC;gBAG/D,MAAM,EAAE,4BAA4B,EACpC,gBAAgB,EAAE,6BAA6B;IAiBjD,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAOpD,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAK5C,MAAM,CACV,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAAC,6BAA6B,CAAC;IAmCnC,iBAAiB,CACrB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAAC,8BAA8B,CAAC;YAgB5B,SAAS;YAgBT,OAAO;YAgBP,8BAA8B;CAmB7C"}
@@ -18,6 +18,7 @@ import { IngestDiscoveryServerClient } from './IngestDiscoveryServerClient.js';
18
18
  import {} from '@finos/legend-shared';
19
19
  import { IngestDefinitionDeploymentResponse, IngestDefinitionValidationResponseStatus, ValidateAndDeploymentResponse, createIngestDefinitionValidationResponse, } from './IngestionDeploymentResponse.js';
20
20
  import { IngestDeploymentServerConfig, } from '../../application/LegendIngestionConfiguration.js';
21
+ import { createAdhocDataProductDeployResponse, } from './AdhocDataProductDeployResponse.js';
21
22
  export class IngestionManager {
22
23
  ingestDiscoveryServerClient;
23
24
  ingestDeploymentServerClient;
@@ -41,7 +42,7 @@ export class IngestionManager {
41
42
  }
42
43
  async deploy(ingestDefinition, appDirNode, actionState, token) {
43
44
  actionState?.setMessage(`Discovering associated ingest environment for DID ${appDirNode.appDirId}...`);
44
- // await this.identifyIngestDeploymentServer(appDirNode, token);
45
+ await this.identifyIngestDeploymentServer(appDirNode, token);
45
46
  actionState?.setMessage(`Validating ingest with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`);
46
47
  const validateResonse = await this._validate(ingestDefinition, undefined, token);
47
48
  const fullResponse = new ValidateAndDeploymentResponse(validateResonse, undefined);
@@ -54,6 +55,13 @@ export class IngestionManager {
54
55
  fullResponse.deploymentResponse = deployResponse;
55
56
  return fullResponse;
56
57
  }
58
+ async deployDataProduct(grammarText, appDirNode, actionState, token) {
59
+ actionState?.setMessage(`Discovering associated data product environment for DID ${appDirNode.appDirId}...`);
60
+ await this.identifyIngestDeploymentServer(appDirNode, token);
61
+ actionState?.setMessage(`Deploying data product with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`);
62
+ const deployResponse = await this.ingestDeploymentServerClient.deployDataProduct(grammarText, token);
63
+ return createAdhocDataProductDeployResponse(deployResponse);
64
+ }
57
65
  async _validate(ingestDefinition, appDirNode, token) {
58
66
  if (appDirNode) {
59
67
  await this.identifyIngestDeploymentServer(appDirNode, token);
@@ -1 +1 @@
1
- {"version":3,"file":"IngestionManager.js","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestionManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAsC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAEL,kCAAkC,EAClC,wCAAwC,EACxC,6BAA6B,EAC7B,wCAAwC,GACzC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,mDAAmD,CAAC;AAE3D,MAAM,OAAO,gBAAgB;IACnB,2BAA2B,CAA8B;IACzD,4BAA4B,CAA+B;IAC3D,aAAa,CAAqB;IAClC,aAAa,CAAqB;IACzB,gBAAgB,CAAgC;IAEjE,YACE,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AAU,CAAC,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QACD,MAAM,YAAY,GAAG,4BAA4B,CAAC,aAAa,CAAC,QAAQ,CACtE,MAAM,IAAI,CAAC,2BAA2B,CAAC,kBAAkB,CACvD,UAAU,CAAC,QAAQ,EACnB,UAAU,CAAC,KAAK,EAChB,KAAK,CACN,CACF,CAAC;QAEF,IAAI,CAAC,4BAA4B,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF"}
1
+ {"version":3,"file":"IngestionManager.js","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestionManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAsC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAEL,kCAAkC,EAClC,wCAAwC,EACxC,6BAA6B,EAC7B,wCAAwC,GACzC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,oCAAoC,GAErC,MAAM,qCAAqC,CAAC;AAE7C,MAAM,OAAO,gBAAgB;IACnB,2BAA2B,CAA8B;IACzD,4BAA4B,CAA+B;IAC3D,aAAa,CAAqB;IAClC,aAAa,CAAqB;IACzB,gBAAgB,CAAgC;IAEjE,YACE,MAAoC,EACpC,gBAA+C;QAE/C,IAAI,CAAC,2BAA2B,GAAG,IAAI,2BAA2B,CAChE,MAAM,CAAC,YAAY,CACpB,CAAC;QACF,IAAI,CAAC,2BAA2B,CAAC,gBAAgB,CAC/C,gBAAgB,CAAC,aAAa,CAC/B,CAAC;QACF,IAAI,CAAC,4BAA4B,GAAG,IAAI,4BAA4B,CAClE,MAAM,CAAC,UAAU,CAAC,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WAAW;QACX,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAC9D,gBAAgB,EAChB,KAAK,CACN,CAA+D,CAAC;QACjE,OAAO,kCAAkC,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC7E,CAAC;IAEO,KAAK,CAAC,8BAA8B,CAC1C,UAAsB,EACtB,KAAyB;QAEzB,qFAAqF;QACrF,IAAI,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QACD,MAAM,YAAY,GAAG,4BAA4B,CAAC,aAAa,CAAC,QAAQ,CACtE,MAAM,IAAI,CAAC,2BAA2B,CAAC,kBAAkB,CACvD,UAAU,CAAC,QAAQ,EACnB,UAAU,CAAC,KAAK,EAChB,KAAK,CACN,CACF,CAAC;QAEF,IAAI,CAAC,4BAA4B,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.18.131",
3
+ "version": "28.18.132",
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.47",
49
49
  "@finos/legend-art": "7.1.101",
50
- "@finos/legend-code-editor": "2.0.75",
51
- "@finos/legend-data-cube": "0.2.7",
52
- "@finos/legend-graph": "32.1.33",
53
- "@finos/legend-lego": "2.0.80",
54
- "@finos/legend-query-builder": "4.16.41",
50
+ "@finos/legend-code-editor": "2.0.76",
51
+ "@finos/legend-data-cube": "0.2.8",
52
+ "@finos/legend-graph": "32.1.34",
53
+ "@finos/legend-lego": "2.0.81",
54
+ "@finos/legend-query-builder": "4.16.42",
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",
@@ -18,6 +18,7 @@ import { observer } from 'mobx-react-lite';
18
18
  import { useEditorStore } from '../../EditorStoreProvider.js';
19
19
  import {
20
20
  DataProductEditorState,
21
+ generateUrlToDeployOnOpen,
21
22
  LakehouseAccessPointState,
22
23
  } from '../../../../stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js';
23
24
  import {
@@ -34,11 +35,21 @@ import {
34
35
  TimesIcon,
35
36
  PlusIcon,
36
37
  PanelHeaderActionItem,
38
+ RocketIcon,
39
+ Modal,
40
+ ModalHeader,
41
+ ModalTitle,
42
+ ModalBody,
43
+ ModalFooter,
44
+ ModalFooterButton,
37
45
  } from '@finos/legend-art';
38
46
  import { useRef, useState, useEffect } from 'react';
39
47
  import { filterByType } from '@finos/legend-shared';
40
48
  import { InlineLambdaEditor } from '@finos/legend-query-builder';
41
49
  import { flowResult } from 'mobx';
50
+ import { useAuth } from 'react-oidc-context';
51
+ import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
52
+ import { CodeEditor } from '@finos/legend-lego/code-editor';
42
53
 
43
54
  const NewAccessPointAccessPOint = observer(
44
55
  (props: { dataProductEditorState: DataProductEditorState }) => {
@@ -254,6 +265,83 @@ const DataProductEditorSplashScreen = observer(
254
265
  },
255
266
  );
256
267
 
268
+ const DataproductDeploymenetModal = observer(
269
+ (props: { state: DataProductEditorState }) => {
270
+ const { state } = props;
271
+ const applicationStore = state.editorStore.applicationStore;
272
+ return (
273
+ <Dialog
274
+ open={state.deploymentState.isInProgress}
275
+ classes={{ container: 'search-modal__container' }}
276
+ >
277
+ <Modal
278
+ darkMode={
279
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
280
+ }
281
+ className="database-builder"
282
+ >
283
+ <ModalHeader>
284
+ <ModalTitle title="Deploy Data Product" />
285
+ </ModalHeader>
286
+ <ModalBody>
287
+ <div>{state.deploymentState.message}</div>
288
+ </ModalBody>
289
+ </Modal>
290
+ </Dialog>
291
+ );
292
+ },
293
+ );
294
+
295
+ const DataProductDeploymentResponseModal = observer(
296
+ (props: { state: DataProductEditorState }) => {
297
+ const { state } = props;
298
+ const applicationStore = state.editorStore.applicationStore;
299
+ const closeModal = (): void => state.setDeployResponse(undefined);
300
+ return (
301
+ <Dialog
302
+ open={Boolean(state.deployResponse)}
303
+ classes={{
304
+ root: 'editor-modal__root-container',
305
+ container: 'editor-modal__container',
306
+ paper: 'editor-modal__content',
307
+ }}
308
+ onClose={closeModal}
309
+ >
310
+ <Modal
311
+ darkMode={
312
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
313
+ }
314
+ className="editor-modal"
315
+ >
316
+ <ModalHeader>
317
+ <ModalTitle title="Validation Error" />
318
+ </ModalHeader>
319
+ <ModalBody>
320
+ <PanelContent>
321
+ <CodeEditor
322
+ inputValue={JSON.stringify(
323
+ state.deployResponse?.content ?? {},
324
+ null,
325
+ 2,
326
+ )}
327
+ isReadOnly={true}
328
+ language={CODE_EDITOR_LANGUAGE.JSON}
329
+ />
330
+ </PanelContent>
331
+ </ModalBody>
332
+ <ModalFooter>
333
+ <ModalFooterButton
334
+ onClick={closeModal}
335
+ text="Close"
336
+ type="secondary"
337
+ />
338
+ </ModalFooter>
339
+ </Modal>
340
+ </Dialog>
341
+ );
342
+ },
343
+ );
344
+
257
345
  export const DataProductEditor = observer(() => {
258
346
  const editorStore = useEditorStore();
259
347
  const dataProductEditorState =
@@ -266,6 +354,30 @@ export const DataProductEditor = observer(() => {
266
354
  const openNewModal = () => {
267
355
  dataProductEditorState.setAccessPointModal(true);
268
356
  };
357
+ const auth = useAuth();
358
+ const deployDataProduct = (): void => {
359
+ // Trigger OAuth flow if not authenticated
360
+ if (!auth.isAuthenticated) {
361
+ // remove this redirect if we move to do oauth at the beginning of opening studio
362
+ auth
363
+ .signinRedirect({
364
+ state: generateUrlToDeployOnOpen(dataProductEditorState),
365
+ })
366
+ .catch(editorStore.applicationStore.alertUnhandledError);
367
+ return;
368
+ }
369
+ // Use the token for deployment
370
+ const token = auth.user?.access_token;
371
+ if (token) {
372
+ flowResult(dataProductEditorState.deploy(token)).catch(
373
+ editorStore.applicationStore.alertUnhandledError,
374
+ );
375
+ } else {
376
+ editorStore.applicationStore.notificationService.notifyError(
377
+ 'Authentication failed. No token available.',
378
+ );
379
+ }
380
+ };
269
381
 
270
382
  useEffect(() => {
271
383
  flowResult(dataProductEditorState.convertAccessPointsFuncObjects()).catch(
@@ -273,6 +385,18 @@ export const DataProductEditor = observer(() => {
273
385
  );
274
386
  }, [dataProductEditorState]);
275
387
 
388
+ useEffect(() => {
389
+ if (dataProductEditorState.deployOnOpen) {
390
+ flowResult(dataProductEditorState.deploy(auth.user?.access_token)).catch(
391
+ editorStore.applicationStore.alertUnhandledError,
392
+ );
393
+ }
394
+ }, [
395
+ auth,
396
+ editorStore.applicationStore.alertUnhandledError,
397
+ dataProductEditorState,
398
+ ]);
399
+
276
400
  return (
277
401
  <div className="data-product-editor">
278
402
  <div className="panel">
@@ -286,6 +410,20 @@ export const DataProductEditor = observer(() => {
286
410
  <div className="panel__header__title__label">data product</div>
287
411
  <div className="panel__header__title__content">{product.name}</div>
288
412
  </div>
413
+ <PanelHeaderActions>
414
+ <div className="btn__dropdown-combo btn__dropdown-combo--primary">
415
+ <button
416
+ className="btn__dropdown-combo__label"
417
+ onClick={deployDataProduct}
418
+ title={dataProductEditorState.deployValidationMessage}
419
+ tabIndex={-1}
420
+ disabled={!dataProductEditorState.deployValidationMessage}
421
+ >
422
+ <RocketIcon className="btn__dropdown-combo__label__icon" />
423
+ <div className="btn__dropdown-combo__label__title">Deploy</div>
424
+ </button>
425
+ </div>
426
+ </PanelHeaderActions>
289
427
  </div>
290
428
  <div className="panel">
291
429
  <PanelHeader>
@@ -324,6 +462,14 @@ export const DataProductEditor = observer(() => {
324
462
  dataProductEditorState={dataProductEditorState}
325
463
  />
326
464
  )}
465
+ {dataProductEditorState.deploymentState.isInProgress && (
466
+ <DataproductDeploymenetModal state={dataProductEditorState} />
467
+ )}
468
+ {dataProductEditorState.deployResponse && (
469
+ <DataProductDeploymentResponseModal
470
+ state={dataProductEditorState}
471
+ />
472
+ )}
327
473
  </div>
328
474
  </div>
329
475
  </div>
@@ -182,7 +182,7 @@ export class EditorTabManagerState extends TabManagerState {
182
182
  } else if (element instanceof Service) {
183
183
  return new ServiceEditorState(this.editorStore, element);
184
184
  } else if (element instanceof DataProduct) {
185
- return new DataProductEditorState(this.editorStore, element);
185
+ return new DataProductEditorState(this.editorStore, element, config);
186
186
  } else if (element instanceof GenerationSpecification) {
187
187
  return new GenerationSpecificationEditorState(this.editorStore, element);
188
188
  } else if (element instanceof FileGenerationSpecification) {
@@ -48,6 +48,18 @@ export class IngestElementEditorInitialConfiguration extends ElementEditorInitia
48
48
  );
49
49
  }
50
50
 
51
+ export class DataProductElementEditorInitialConfiguration extends ElementEditorInitialConfiguration {
52
+ deployOnOpen?: boolean;
53
+ type = PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT;
54
+
55
+ static readonly serialization = new SerializationFactory(
56
+ createModelSchema(DataProductElementEditorInitialConfiguration, {
57
+ _type: usingConstantValueSchema(PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT),
58
+ deployOnOpen: optional(primitive()),
59
+ }),
60
+ );
61
+ }
62
+
51
63
  const serializeElementEditorInitialConfiguration = (
52
64
  protocol: ElementEditorInitialConfiguration,
53
65
  ): PlainObject<ElementEditorInitialConfiguration> => {
@@ -56,6 +68,11 @@ const serializeElementEditorInitialConfiguration = (
56
68
  IngestElementEditorInitialConfiguration.serialization.schema,
57
69
  protocol,
58
70
  );
71
+ } else if (protocol instanceof DataProductElementEditorInitialConfiguration) {
72
+ return serialize(
73
+ DataProductElementEditorInitialConfiguration.serialization.schema,
74
+ protocol,
75
+ );
59
76
  }
60
77
  throw new UnsupportedOperationError(
61
78
  `Can't serialize element config`,
@@ -72,6 +89,11 @@ const deseralizeElementEditorInitialConfiguration = (
72
89
  IngestElementEditorInitialConfiguration.serialization.schema,
73
90
  json,
74
91
  );
92
+ case PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT:
93
+ return deserialize(
94
+ DataProductElementEditorInitialConfiguration.serialization.schema,
95
+ json,
96
+ );
75
97
  default: {
76
98
  throw new UnsupportedOperationError(
77
99
  `Can't deserialize element config`,
@@ -18,6 +18,7 @@ import {
18
18
  DataProduct,
19
19
  LakehouseAccessPoint,
20
20
  type PackageableElement,
21
+ type IngestDefinition,
21
22
  type AccessPoint,
22
23
  stub_RawLambda,
23
24
  LakehouseTargetEnv,
@@ -40,6 +41,9 @@ import {
40
41
  LogEvent,
41
42
  deleteEntry,
42
43
  filterByType,
44
+ ActionState,
45
+ guaranteeNonNullable,
46
+ assertTrue,
43
47
  } from '@finos/legend-shared';
44
48
  import {
45
49
  dataProduct_addAccessPoint,
@@ -47,6 +51,13 @@ import {
47
51
  dataProduct_deleteAccessPoint,
48
52
  } from '../../../../graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
49
53
  import { LambdaEditorState } from '@finos/legend-query-builder';
54
+ import type { IngestionManager } from '../../../../ingestion/IngestionManager.js';
55
+ import {
56
+ DataProductElementEditorInitialConfiguration,
57
+ EditorInitialConfiguration,
58
+ } from '../ElementEditorInitialConfiguration.js';
59
+ import { EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig } from '../../../../../__lib__/LegendStudioNavigation.js';
60
+ import type { AdhocDataProductDeployResponse } from '../../../../ingestion/AdhocDataProductDeployResponse.js';
50
61
 
51
62
  export class AccessPointState {
52
63
  readonly state: AccessPointGroupState;
@@ -181,10 +192,10 @@ export class AccessPointGroupState {
181
192
 
182
193
  constructor(val: AccessPointGroup, editorState: DataProductEditorState) {
183
194
  this.value = val;
195
+ this.state = editorState;
184
196
  this.accessPointStates = val.accessPoints.map((e) =>
185
197
  this.buildAccessPointState(e),
186
198
  );
187
- this.state = editorState;
188
199
  makeObservable(this, {
189
200
  value: observable,
190
201
  accessPointStates: observable,
@@ -213,12 +224,41 @@ export class AccessPointGroupState {
213
224
  }
214
225
  }
215
226
 
227
+ const createEditorInitialConfiguration = (): EditorInitialConfiguration => {
228
+ const config = new EditorInitialConfiguration();
229
+ const ingest = new DataProductElementEditorInitialConfiguration();
230
+ ingest.deployOnOpen = true;
231
+ config.elementEditorConfiguration = ingest;
232
+ return config;
233
+ };
234
+
235
+ const editorInitialConfigToBase64 = (val: EditorInitialConfiguration): string =>
236
+ btoa(JSON.stringify(EditorInitialConfiguration.serialization.toJson(val)));
237
+
238
+ export const generateUrlToDeployOnOpen = (
239
+ val: DataProductEditorState,
240
+ ): string => {
241
+ return val.editorStore.applicationStore.navigationService.navigator.generateAddress(
242
+ EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig(
243
+ val.editorStore.editorMode.generateElementLink(val.product.path),
244
+ editorInitialConfigToBase64(createEditorInitialConfiguration()),
245
+ ),
246
+ );
247
+ };
248
+
216
249
  export class DataProductEditorState extends ElementEditorState {
217
250
  accessPointModal = false;
251
+ deploymentState = ActionState.create();
218
252
  accessPointGroupStates: AccessPointGroupState[] = [];
219
253
  isConvertingTransformLambdaObjects = false;
254
+ deployOnOpen = false;
255
+ deployResponse: AdhocDataProductDeployResponse | undefined;
220
256
 
221
- constructor(editorStore: EditorStore, element: PackageableElement) {
257
+ constructor(
258
+ editorStore: EditorStore,
259
+ element: PackageableElement,
260
+ config?: EditorInitialConfiguration,
261
+ ) {
222
262
  super(editorStore, element);
223
263
 
224
264
  makeObservable(this, {
@@ -226,6 +266,11 @@ export class DataProductEditorState extends ElementEditorState {
226
266
  accessPointModal: observable,
227
267
  accessPointGroupStates: observable,
228
268
  isConvertingTransformLambdaObjects: observable,
269
+ deploy: flow,
270
+ deployOnOpen: observable,
271
+ deployResponse: observable,
272
+ setDeployOnOpen: action,
273
+ setDeployResponse: action,
229
274
  setAccessPointModal: action,
230
275
  addAccessPoint: action,
231
276
  convertAccessPointsFuncObjects: flow,
@@ -233,6 +278,20 @@ export class DataProductEditorState extends ElementEditorState {
233
278
  this.accessPointGroupStates = this.product.accessPointGroups.map(
234
279
  (e) => new AccessPointGroupState(e, this),
235
280
  );
281
+ const elementConfig = config?.elementEditorConfiguration;
282
+ if (elementConfig instanceof DataProductElementEditorInitialConfiguration) {
283
+ this.deployOnOpen = elementConfig.deployOnOpen ?? false;
284
+ }
285
+ }
286
+
287
+ setDeployOnOpen(value: boolean): void {
288
+ this.deployOnOpen = value;
289
+ }
290
+
291
+ setDeployResponse(
292
+ response: AdhocDataProductDeployResponse | undefined,
293
+ ): void {
294
+ this.deployResponse = response;
236
295
  }
237
296
 
238
297
  *convertAccessPointsFuncObjects(): GeneratorFn<void> {
@@ -303,6 +362,38 @@ export class DataProductEditorState extends ElementEditorState {
303
362
  return new AccessPointGroupState(group, this);
304
363
  }
305
364
 
365
+ *deploy(token: string | undefined): GeneratorFn<void> {
366
+ try {
367
+ assertTrue(
368
+ this.validForDeployment,
369
+ 'Data product definition is not valid for deployment',
370
+ );
371
+ this.deploymentState.inProgress();
372
+ // The grammar we provide will be for the current data product + all ingests (used for compilation)
373
+ const grammar =
374
+ (yield this.editorStore.graphManagerState.graphManager.elementsToPureCode(
375
+ [...this.editorStore.graphManagerState.graph.ingests, this.product],
376
+ )) as unknown as string;
377
+
378
+ const response = (yield guaranteeNonNullable(
379
+ this.ingestionManager,
380
+ ).deployDataProduct(
381
+ grammar,
382
+ guaranteeNonNullable(this.associatedIngest?.appDirDeployment),
383
+ this.deploymentState,
384
+ token,
385
+ )) as unknown as AdhocDataProductDeployResponse;
386
+ this.setDeployResponse(response);
387
+ } catch (error) {
388
+ assertErrorThrown(error);
389
+ this.editorStore.applicationStore.notificationService.notifyError(
390
+ `Ingest definition failed to deploy: ${error.message}`,
391
+ );
392
+ } finally {
393
+ this.deploymentState.complete();
394
+ }
395
+ }
396
+
306
397
  get product(): DataProduct {
307
398
  return guaranteeType(
308
399
  this.element,
@@ -311,10 +402,37 @@ export class DataProductEditorState extends ElementEditorState {
311
402
  );
312
403
  }
313
404
 
405
+ get validForDeployment(): boolean {
406
+ return Boolean(
407
+ this.associatedIngest?.appDirDeployment && this.ingestionManager,
408
+ );
409
+ }
410
+
314
411
  get accessPoints(): AccessPoint[] {
315
412
  return this.product.accessPointGroups.map((e) => e.accessPoints).flat();
316
413
  }
317
414
 
415
+ get ingestionManager(): IngestionManager | undefined {
416
+ return this.editorStore.ingestionManager;
417
+ }
418
+
419
+ get deployValidationMessage(): string {
420
+ if (!this.associatedIngest?.appDirDeployment) {
421
+ return 'No app dir deployment found';
422
+ } else if (!this.ingestionManager) {
423
+ return 'No ingestion manager found';
424
+ }
425
+ return 'Deploy';
426
+ }
427
+
428
+ // We need to get the associated Ingest to get the app dir deployment
429
+ // We could do a more in depth check on the access point lambdas to check which ingest it uses but for now
430
+ // we will assume all ingests have the same DID
431
+ // we get the last one, to prioritize the ones in the current project followed by dependency ones
432
+ get associatedIngest(): IngestDefinition | undefined {
433
+ return this.editorStore.graphManagerState.graph.ingests.slice(-1)[0];
434
+ }
435
+
318
436
  override reprocess(
319
437
  newElement: PackageableElement,
320
438
  editorStore: EditorStore,
@@ -0,0 +1,29 @@
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 type { PlainObject } from '@finos/legend-shared';
18
+
19
+ export class AdhocDataProductDeployResponse {
20
+ content!: PlainObject;
21
+ }
22
+
23
+ export const createAdhocDataProductDeployResponse = (
24
+ json: PlainObject<AdhocDataProductDeployResponse>,
25
+ ): AdhocDataProductDeployResponse => {
26
+ const response = new AdhocDataProductDeployResponse();
27
+ response.content = json;
28
+ return response;
29
+ };
@@ -26,9 +26,12 @@ import type {
26
26
  IngestDefinitionValidationResponse,
27
27
  } from './IngestionDeploymentResponse.js';
28
28
  import type { IngestDeploymentServerConfig } from '../../application/LegendIngestionConfiguration.js';
29
+ import type { AdhocDataProductDeployResponse } from './AdhocDataProductDeployResponse.js';
29
30
 
30
31
  export class IngestDeploymentServerClient extends AbstractServerClient {
31
32
  environmentClassification: string;
33
+
34
+ private DATA_PRODUCT_URL = 'data-product';
32
35
  constructor(config: IngestDeploymentServerConfig) {
33
36
  super({
34
37
  baseUrl: config.ingestServerUrl,
@@ -49,6 +52,9 @@ export class IngestDeploymentServerClient extends AbstractServerClient {
49
52
  Authorization: `Bearer ${token}`,
50
53
  });
51
54
 
55
+ private _dataProduct = (): string =>
56
+ `${this.baseUrl}/${this.DATA_PRODUCT_URL}/api/entitlements/sdlc/deploy/definitions`;
57
+
52
58
  private _ingest = (): string =>
53
59
  `${this.baseUrl}/api/ingest/sdlc/deploy/definitions`;
54
60
 
@@ -80,4 +86,16 @@ export class IngestDeploymentServerClient extends AbstractServerClient {
80
86
  this._tokenWithTextPlain(token),
81
87
  );
82
88
  }
89
+
90
+ deployDataProduct(
91
+ fullGrammar: string,
92
+ token: string | undefined,
93
+ ): Promise<PlainObject<AdhocDataProductDeployResponse>> {
94
+ return this.post(
95
+ `${this._dataProduct()}`,
96
+ fullGrammar,
97
+ undefined,
98
+ this._tokenWithTextPlain(token),
99
+ );
100
+ }
83
101
  }
@@ -30,6 +30,10 @@ import {
30
30
  IngestDeploymentServerConfig,
31
31
  type LegendIngestionConfiguration,
32
32
  } from '../../application/LegendIngestionConfiguration.js';
33
+ import {
34
+ createAdhocDataProductDeployResponse,
35
+ type AdhocDataProductDeployResponse,
36
+ } from './AdhocDataProductDeployResponse.js';
33
37
 
34
38
  export class IngestionManager {
35
39
  private ingestDiscoveryServerClient: IngestDiscoveryServerClient;
@@ -78,7 +82,7 @@ export class IngestionManager {
78
82
  actionState?.setMessage(
79
83
  `Discovering associated ingest environment for DID ${appDirNode.appDirId}...`,
80
84
  );
81
- // await this.identifyIngestDeploymentServer(appDirNode, token);
85
+ await this.identifyIngestDeploymentServer(appDirNode, token);
82
86
  actionState?.setMessage(
83
87
  `Validating ingest with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
84
88
  );
@@ -109,6 +113,27 @@ export class IngestionManager {
109
113
  return fullResponse;
110
114
  }
111
115
 
116
+ async deployDataProduct(
117
+ grammarText: string,
118
+ appDirNode: AppDirNode,
119
+ actionState: ActionState | undefined,
120
+ token: string | undefined,
121
+ ): Promise<AdhocDataProductDeployResponse> {
122
+ actionState?.setMessage(
123
+ `Discovering associated data product environment for DID ${appDirNode.appDirId}...`,
124
+ );
125
+ await this.identifyIngestDeploymentServer(appDirNode, token);
126
+ actionState?.setMessage(
127
+ `Deploying data product with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
128
+ );
129
+ const deployResponse =
130
+ await this.ingestDeploymentServerClient.deployDataProduct(
131
+ grammarText,
132
+ token,
133
+ );
134
+ return createAdhocDataProductDeployResponse(deployResponse);
135
+ }
136
+
112
137
  private async _validate(
113
138
  ingestDefinition: string,
114
139
  appDirNode: AppDirNode | undefined,