@finos/legend-application-studio 28.19.70 → 28.19.72

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 (26) hide show
  1. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts +5 -0
  2. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  3. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +38 -5
  4. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  5. package/lib/components/editor/side-bar/DevMetadataPanel.d.ts.map +1 -1
  6. package/lib/components/editor/side-bar/DevMetadataPanel.js +150 -32
  7. package/lib/components/editor/side-bar/DevMetadataPanel.js.map +1 -1
  8. package/lib/index.css +2 -2
  9. package/lib/index.css.map +1 -1
  10. package/lib/package.json +5 -4
  11. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +11 -1
  12. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  13. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +25 -2
  14. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  15. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts +8 -5
  16. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts.map +1 -1
  17. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js +18 -28
  18. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js.map +1 -1
  19. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +1 -1
  20. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
  21. package/package.json +14 -13
  22. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +131 -4
  23. package/src/components/editor/side-bar/DevMetadataPanel.tsx +613 -73
  24. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +35 -0
  25. package/src/stores/editor/sidebar-state/dev-metadata/DevMetadataState.ts +28 -39
  26. package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +1 -1
@@ -64,6 +64,7 @@ import {
64
64
  V1_RemoteEngine,
65
65
  DataElementReference,
66
66
  DataElement,
67
+ DataProductDiagram,
67
68
  } from '@finos/legend-graph';
68
69
  import type { EditorStore } from '../../../EditorStore.js';
69
70
  import { ElementEditorState } from '../ElementEditorState.js';
@@ -98,8 +99,10 @@ import {
98
99
  dataProduct_addAccessPoint,
99
100
  dataProduct_addAccessPointGroup,
100
101
  supportInfo_addExpertise,
102
+ modelAccessPointGroup_addDiagram,
101
103
  dataProduct_deleteAccessPoint,
102
104
  dataProduct_deleteAccessPointGroup,
105
+ modelAccessPointGroup_removeDiagram,
103
106
  dataProduct_swapAccessPointGroups,
104
107
  modelAccessPointGroup_addCompatibleRuntime,
105
108
  modelAccessPointGroup_addElement,
@@ -121,6 +124,7 @@ import type {
121
124
  LakehouseIngestionManager,
122
125
  } from '@finos/legend-server-lakehouse';
123
126
  import { deserialize } from 'serializr';
127
+ import { Diagram } from '@finos/legend-extension-dsl-diagram';
124
128
 
125
129
  export enum DATA_PRODUCT_TAB {
126
130
  HOME = 'Home',
@@ -762,11 +766,13 @@ export class AccessPointGroupState {
762
766
 
763
767
  export class ModelAccessPointGroupState extends AccessPointGroupState {
764
768
  declare value: ModelAccessPointGroup;
769
+ readonly editorState: DataProductEditorState;
765
770
  showNewModal = false;
766
771
 
767
772
  constructor(val: ModelAccessPointGroup, editorState: DataProductEditorState) {
768
773
  super(val, editorState);
769
774
  this.value = val;
775
+ this.editorState = editorState;
770
776
  }
771
777
 
772
778
  setMapping(mapping: Mapping): void {
@@ -793,6 +799,23 @@ export class ModelAccessPointGroupState extends AccessPointGroupState {
793
799
  }
794
800
  }
795
801
 
802
+ getCompatibleDiagramOptions(): {
803
+ label: string;
804
+ value: PackageableElement;
805
+ }[] {
806
+ const currentDiagrams = this.value.diagrams.map(
807
+ (diagram) => diagram.diagram,
808
+ );
809
+
810
+ return this.state.editorStore.graphManagerState.graph.allOwnElements
811
+ .filter((element): element is Diagram => element instanceof Diagram)
812
+ .filter((diagram) => !currentDiagrams.includes(diagram))
813
+ .map((diagram) => ({
814
+ label: diagram.path,
815
+ value: diagram,
816
+ }));
817
+ }
818
+
796
819
  removeCompatibleRuntime(runtime: DataProductRuntimeInfo): void {
797
820
  modelAccessPointGroup_removeCompatibleRuntime(this.value, runtime);
798
821
  if (runtime === this.value.defaultRuntime) {
@@ -804,6 +827,18 @@ export class ModelAccessPointGroupState extends AccessPointGroupState {
804
827
  }
805
828
  }
806
829
 
830
+ addDiagram = (option: { label: string; value: PackageableElement }): void => {
831
+ const diagramValue = option.value;
832
+ const newDiagram = new DataProductDiagram();
833
+ newDiagram.title = diagramValue.name;
834
+ newDiagram.diagram = diagramValue;
835
+ modelAccessPointGroup_addDiagram(this.value, newDiagram);
836
+ };
837
+
838
+ handleRemoveDiagram = (diagram: DataProductDiagram): void => {
839
+ modelAccessPointGroup_removeDiagram(this.value, diagram);
840
+ };
841
+
807
842
  addFeaturedElement(element: DataProductElement): void {
808
843
  const elementPointer = observe_DataProductElementScope(
809
844
  new DataProductElementScope(),
@@ -17,48 +17,48 @@
17
17
  import {
18
18
  ActionState,
19
19
  assertErrorThrown,
20
- assertNonEmptyString,
21
20
  assertNonNullable,
22
21
  assertTrue,
23
- filterByType,
24
22
  type GeneratorFn,
25
23
  } from '@finos/legend-shared';
26
24
  import type { EditorStore } from '../../EditorStore.js';
27
25
  import { action, flow, makeObservable, observable } from 'mobx';
28
- import { type DevMetadataResult, IngestDefinition } from '@finos/legend-graph';
29
- import { generateGAVCoordinates } from '@finos/legend-storage';
26
+ import {
27
+ type DeployProjectResponse,
28
+ MetadataRequestOptions,
29
+ } from '@finos/legend-graph';
30
30
 
31
31
  export class DevMetadataState {
32
32
  readonly editorStore: EditorStore;
33
- result: DevMetadataResult | undefined;
33
+ result: DeployProjectResponse | undefined;
34
+ options: MetadataRequestOptions = new MetadataRequestOptions();
34
35
  pushState = ActionState.create();
35
- did = '';
36
36
 
37
37
  constructor(editorStore: EditorStore) {
38
38
  this.editorStore = editorStore;
39
39
 
40
40
  makeObservable(this, {
41
41
  pushState: observable,
42
- did: observable,
43
- setDid: action,
44
42
  push: flow,
45
- init: action,
43
+ options: observable,
44
+ setOptions: action,
46
45
  });
47
46
  }
48
47
 
49
- setDid(did: string): void {
50
- this.did = did;
48
+ setOptions(options: MetadataRequestOptions): void {
49
+ this.options = options;
51
50
  }
52
51
 
53
- init(): void {
54
- if (!this.did) {
55
- const ingestDID = this.editorStore.graphManagerState.graph.allElements
56
- .filter(filterByType(IngestDefinition))[0]
57
- ?.appDirDeployment?.appDirId?.toString();
58
- if (ingestDID) {
59
- this.setDid(ingestDID);
60
- }
52
+ get projectGAV(): { groupId: string; artifactId: string } | undefined {
53
+ const currentProjectConfiguration =
54
+ this.editorStore.projectConfigurationEditorState.projectConfiguration;
55
+ if (currentProjectConfiguration) {
56
+ return {
57
+ groupId: currentProjectConfiguration.groupId,
58
+ artifactId: currentProjectConfiguration.artifactId,
59
+ };
61
60
  }
61
+ return undefined;
62
62
  }
63
63
 
64
64
  *push(): GeneratorFn<void> {
@@ -78,34 +78,23 @@ export class DevMetadataState {
78
78
  currentProjectConfiguration,
79
79
  'Project Name required to push to dev mode',
80
80
  );
81
- const projectId = generateGAVCoordinates(
82
- currentProjectConfiguration.groupId,
83
- currentProjectConfiguration.artifactId,
84
- undefined,
85
- );
86
- assertNonEmptyString(this.did, 'DID required to push to dev mode');
87
81
  this.pushState.inProgress();
88
- this.editorStore.applicationStore.alertService.setBlockingAlert({
89
- message: 'Pushing to Dev Mode',
90
- showLoading: true,
91
- });
92
82
  const result =
93
83
  (yield this.editorStore.graphManagerState.graphManager.pushToDevMetadata(
94
- this.did,
95
- projectId,
84
+ currentProjectConfiguration.groupId,
85
+ currentProjectConfiguration.artifactId,
86
+ undefined,
87
+ this.options,
96
88
  this.editorStore.graphManagerState.graph,
97
- )) as DevMetadataResult;
89
+ )) as DeployProjectResponse;
98
90
  this.result = result;
99
- this.editorStore.applicationStore.notificationService.notifySuccess(
100
- `Pushed to dev mode`,
101
- );
91
+ this.pushState.complete();
102
92
  } catch (error) {
103
93
  assertErrorThrown(error);
104
- this.pushState.fail();
105
- } finally {
106
- this.editorStore.applicationStore.alertService.setBlockingAlert(
107
- undefined,
94
+ this.editorStore.applicationStore.notificationService.notifyError(
95
+ `Error pushing to dev metadata: ${error.message}`,
108
96
  );
97
+ this.pushState.fail();
109
98
  }
110
99
  }
111
100
  }
@@ -28,10 +28,10 @@ import {
28
28
  observe_SupportInfo,
29
29
  observer_DataProductLink,
30
30
  SupportInfo,
31
- type ModelAccessPointGroup,
32
31
  type DataProductRuntimeInfo,
33
32
  type PackageableElementReference,
34
33
  type Mapping,
34
+ type ModelAccessPointGroup,
35
35
  type DataProductDiagram,
36
36
  type DataProductElementScope,
37
37
  observe_APG,