@finos/legend-application-studio 28.19.69 → 28.19.71
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/components/editor/editor-group/dataProduct/DataProductEditor.d.ts +5 -0
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +38 -5
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +338 -26
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
- package/lib/components/editor/side-bar/DevMetadataPanel.d.ts.map +1 -1
- package/lib/components/editor/side-bar/DevMetadataPanel.js +150 -32
- package/lib/components/editor/side-bar/DevMetadataPanel.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +7 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +11 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +25 -2
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +2 -0
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +19 -0
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.d.ts +16 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js +112 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts +8 -5
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js +18 -28
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +131 -4
- package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +599 -53
- package/src/components/editor/side-bar/DevMetadataPanel.tsx +613 -73
- package/src/stores/editor/EditorGraphState.ts +11 -4
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +35 -0
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +26 -0
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.ts +178 -1
- package/src/stores/editor/sidebar-state/dev-metadata/DevMetadataState.ts +28 -39
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +1 -1
|
@@ -799,15 +799,22 @@ export class EditorGraphState {
|
|
|
799
799
|
projectDependencies: ProjectDependency[],
|
|
800
800
|
): Promise<ProjectDependencyCoordinates[]> {
|
|
801
801
|
return Promise.all(
|
|
802
|
-
projectDependencies.map(async (dep) =>
|
|
803
|
-
|
|
802
|
+
projectDependencies.map(async (dep) => {
|
|
803
|
+
const exclusionCoordinates = (dep.exclusions ?? []).map(
|
|
804
|
+
(exclusion) => ({
|
|
805
|
+
groupId: guaranteeNonNullable(exclusion.groupId),
|
|
806
|
+
artifactId: guaranteeNonNullable(exclusion.artifactId),
|
|
807
|
+
}),
|
|
808
|
+
);
|
|
809
|
+
return Promise.resolve(
|
|
804
810
|
new ProjectDependencyCoordinates(
|
|
805
811
|
guaranteeNonNullable(dep.groupId),
|
|
806
812
|
guaranteeNonNullable(dep.artifactId),
|
|
807
813
|
dep.versionId,
|
|
814
|
+
exclusionCoordinates.length > 0 ? exclusionCoordinates : undefined,
|
|
808
815
|
),
|
|
809
|
-
)
|
|
810
|
-
),
|
|
816
|
+
);
|
|
817
|
+
}),
|
|
811
818
|
);
|
|
812
819
|
}
|
|
813
820
|
|
package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts
CHANGED
|
@@ -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(),
|
|
@@ -106,6 +106,8 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
106
106
|
setProjectConfiguration: action,
|
|
107
107
|
setSelectedTab: action,
|
|
108
108
|
setManualOverwrite: action,
|
|
109
|
+
syncExclusionsToProjectDependencies: action,
|
|
110
|
+
loadExclusionsFromProjectDependencies: action,
|
|
109
111
|
fectchAssociatedProjectsAndVersions: flow,
|
|
110
112
|
updateProjectConfiguration: flow,
|
|
111
113
|
updateToLatestStructure: flow,
|
|
@@ -131,6 +133,7 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
131
133
|
|
|
132
134
|
setProjectConfiguration(projectConfiguration: ProjectConfiguration): void {
|
|
133
135
|
this.projectConfiguration = projectConfiguration;
|
|
136
|
+
this.loadExclusionsFromProjectDependencies();
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
setSelectedTab(tab: CONFIGURATION_EDITOR_TAB): void {
|
|
@@ -191,6 +194,24 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
191
194
|
);
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
syncExclusionsToProjectDependencies(): void {
|
|
198
|
+
this.currentProjectConfiguration.projectDependencies.forEach((dep) => {
|
|
199
|
+
const exclusions = this.projectDependencyEditorState.getExclusions(
|
|
200
|
+
dep.projectId,
|
|
201
|
+
);
|
|
202
|
+
dep.setExclusions(exclusions);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
loadExclusionsFromProjectDependencies(): void {
|
|
207
|
+
this.projectConfiguration?.projectDependencies.forEach((dep) => {
|
|
208
|
+
if (dep.exclusions && dep.exclusions.length > 0) {
|
|
209
|
+
this.projectDependencyEditorState.dependencyExclusions[dep.projectId] =
|
|
210
|
+
[...dep.exclusions];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
194
215
|
*fectchAssociatedProjectsAndVersions(): GeneratorFn<void> {
|
|
195
216
|
this.fetchingProjectVersionsState.inProgress();
|
|
196
217
|
try {
|
|
@@ -234,6 +255,9 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
234
255
|
): GeneratorFn<void> {
|
|
235
256
|
try {
|
|
236
257
|
this.updatingConfigurationState.inProgress();
|
|
258
|
+
|
|
259
|
+
this.syncExclusionsToProjectDependencies();
|
|
260
|
+
|
|
237
261
|
yield this.editorStore.sdlcServerClient.updateConfiguration(
|
|
238
262
|
this.editorStore.sdlcState.activeProject.projectId,
|
|
239
263
|
this.editorStore.sdlcState.activeWorkspace,
|
|
@@ -340,6 +364,8 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
340
364
|
showLoading: true,
|
|
341
365
|
});
|
|
342
366
|
try {
|
|
367
|
+
this.syncExclusionsToProjectDependencies();
|
|
368
|
+
|
|
343
369
|
const updateProjectConfigurationCommand =
|
|
344
370
|
new UpdateProjectConfigurationCommand(
|
|
345
371
|
this.currentProjectConfiguration.groupId,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
assertErrorThrown,
|
|
25
25
|
LogEvent,
|
|
26
26
|
isNonNullable,
|
|
27
|
+
guaranteeNonNullable,
|
|
27
28
|
uuid,
|
|
28
29
|
} from '@finos/legend-shared';
|
|
29
30
|
import {
|
|
@@ -39,7 +40,11 @@ import {
|
|
|
39
40
|
} from '@finos/legend-server-depot';
|
|
40
41
|
import type { TreeData, TreeNodeData } from '@finos/legend-art';
|
|
41
42
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
|
|
42
|
-
import
|
|
43
|
+
import {
|
|
44
|
+
ProjectDependencyExclusion,
|
|
45
|
+
type ProjectConfiguration,
|
|
46
|
+
} from '@finos/legend-server-sdlc';
|
|
47
|
+
import { generateGAVCoordinates } from '@finos/legend-storage';
|
|
43
48
|
|
|
44
49
|
export abstract class ProjectDependencyConflictTreeNodeData
|
|
45
50
|
implements TreeNodeData
|
|
@@ -299,6 +304,12 @@ export class ProjectDependencyEditorState {
|
|
|
299
304
|
expandConflictsState = ActionState.create();
|
|
300
305
|
buildConflictPathState = ActionState.create();
|
|
301
306
|
|
|
307
|
+
// Exclusions management
|
|
308
|
+
selectedDependencyForExclusions: ProjectDependencyVersionNode | undefined;
|
|
309
|
+
dependencyExclusions: {
|
|
310
|
+
[dependencyId: string]: ProjectDependencyExclusion[];
|
|
311
|
+
} = {};
|
|
312
|
+
|
|
302
313
|
constructor(
|
|
303
314
|
configState: ProjectConfigurationEditorState,
|
|
304
315
|
editorStore: EditorStore,
|
|
@@ -312,6 +323,8 @@ export class ProjectDependencyEditorState {
|
|
|
312
323
|
reportTab: observable,
|
|
313
324
|
expandConflictsState: observable,
|
|
314
325
|
buildConflictPathState: observable,
|
|
326
|
+
selectedDependencyForExclusions: observable,
|
|
327
|
+
dependencyExclusions: observable,
|
|
315
328
|
setReportTab: action,
|
|
316
329
|
expandAllConflicts: action,
|
|
317
330
|
setFlattenDependencyTreeData: action,
|
|
@@ -320,6 +333,15 @@ export class ProjectDependencyEditorState {
|
|
|
320
333
|
setDependencyTreeData: action,
|
|
321
334
|
buildConflictPaths: action,
|
|
322
335
|
setConflictStates: action,
|
|
336
|
+
setSelectedDependencyForExclusions: action,
|
|
337
|
+
addExclusion: action,
|
|
338
|
+
addExclusionByCoordinate: action,
|
|
339
|
+
removeExclusion: action,
|
|
340
|
+
removeExclusionByCoordinate: action,
|
|
341
|
+
clearExclusions: action,
|
|
342
|
+
getExclusions: action,
|
|
343
|
+
getExclusionCoordinates: action,
|
|
344
|
+
syncExclusionsToProjectDependency: action,
|
|
323
345
|
fetchDependencyReport: flow,
|
|
324
346
|
});
|
|
325
347
|
this.configState = configState;
|
|
@@ -376,6 +398,149 @@ export class ProjectDependencyEditorState {
|
|
|
376
398
|
return this.configState.projectConfiguration;
|
|
377
399
|
}
|
|
378
400
|
|
|
401
|
+
setSelectedDependencyForExclusions(
|
|
402
|
+
dependency: ProjectDependencyVersionNode | undefined,
|
|
403
|
+
): void {
|
|
404
|
+
this.selectedDependencyForExclusions = dependency;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
addExclusion(
|
|
408
|
+
dependencyId: string,
|
|
409
|
+
exclusion: ProjectDependencyExclusion,
|
|
410
|
+
): void {
|
|
411
|
+
if (!this.dependencyExclusions[dependencyId]) {
|
|
412
|
+
this.dependencyExclusions[dependencyId] = [];
|
|
413
|
+
}
|
|
414
|
+
const existingExclusion = this.findExistingExclusion(
|
|
415
|
+
dependencyId,
|
|
416
|
+
generateGAVCoordinates(
|
|
417
|
+
guaranteeNonNullable(exclusion.groupId),
|
|
418
|
+
guaranteeNonNullable(exclusion.artifactId),
|
|
419
|
+
undefined,
|
|
420
|
+
),
|
|
421
|
+
);
|
|
422
|
+
if (!existingExclusion) {
|
|
423
|
+
this.dependencyExclusions[dependencyId].push(exclusion);
|
|
424
|
+
this.syncExclusionsToProjectDependency(dependencyId);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
addExclusionByCoordinate(
|
|
429
|
+
dependencyId: string,
|
|
430
|
+
exclusionCoordinate: string,
|
|
431
|
+
): void {
|
|
432
|
+
const exclusion =
|
|
433
|
+
ProjectDependencyExclusion.fromCoordinate(exclusionCoordinate);
|
|
434
|
+
this.addExclusion(dependencyId, exclusion);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
removeExclusion(
|
|
438
|
+
dependencyId: string,
|
|
439
|
+
exclusion: ProjectDependencyExclusion,
|
|
440
|
+
): void {
|
|
441
|
+
if (this.dependencyExclusions[dependencyId]) {
|
|
442
|
+
const coordinate = generateGAVCoordinates(
|
|
443
|
+
guaranteeNonNullable(exclusion.groupId),
|
|
444
|
+
guaranteeNonNullable(exclusion.artifactId),
|
|
445
|
+
undefined,
|
|
446
|
+
);
|
|
447
|
+
const index = this.findExclusionIndex(dependencyId, coordinate);
|
|
448
|
+
if (index > -1) {
|
|
449
|
+
this.dependencyExclusions[dependencyId].splice(index, 1);
|
|
450
|
+
}
|
|
451
|
+
if (this.dependencyExclusions[dependencyId].length === 0) {
|
|
452
|
+
delete this.dependencyExclusions[dependencyId];
|
|
453
|
+
}
|
|
454
|
+
this.syncExclusionsToProjectDependency(dependencyId);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
removeExclusionByCoordinate(
|
|
459
|
+
dependencyId: string,
|
|
460
|
+
exclusionCoordinate: string,
|
|
461
|
+
): void {
|
|
462
|
+
if (this.dependencyExclusions[dependencyId]) {
|
|
463
|
+
const index = this.findExclusionIndex(dependencyId, exclusionCoordinate);
|
|
464
|
+
if (index > -1) {
|
|
465
|
+
this.dependencyExclusions[dependencyId].splice(index, 1);
|
|
466
|
+
}
|
|
467
|
+
if (this.dependencyExclusions[dependencyId].length === 0) {
|
|
468
|
+
delete this.dependencyExclusions[dependencyId];
|
|
469
|
+
}
|
|
470
|
+
this.syncExclusionsToProjectDependency(dependencyId);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
clearExclusions(dependencyId?: string): void {
|
|
475
|
+
if (dependencyId) {
|
|
476
|
+
delete this.dependencyExclusions[dependencyId];
|
|
477
|
+
this.syncExclusionsToProjectDependency(dependencyId);
|
|
478
|
+
} else {
|
|
479
|
+
this.dependencyExclusions = {};
|
|
480
|
+
this.projectConfiguration?.projectDependencies.forEach((dep) => {
|
|
481
|
+
this.syncExclusionsToProjectDependency(dep.projectId);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
getExclusions(dependencyId: string): ProjectDependencyExclusion[] {
|
|
487
|
+
return this.dependencyExclusions[dependencyId] ?? [];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
getExclusionCoordinates(dependencyId: string): string[] {
|
|
491
|
+
const exclusions = this.getExclusions(dependencyId);
|
|
492
|
+
return exclusions.map((e) =>
|
|
493
|
+
generateGAVCoordinates(
|
|
494
|
+
guaranteeNonNullable(e.groupId),
|
|
495
|
+
guaranteeNonNullable(e.artifactId),
|
|
496
|
+
undefined,
|
|
497
|
+
),
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
private findExistingExclusion(
|
|
502
|
+
dependencyId: string,
|
|
503
|
+
coordinate: string,
|
|
504
|
+
): ProjectDependencyExclusion | undefined {
|
|
505
|
+
if (!this.dependencyExclusions[dependencyId]) {
|
|
506
|
+
return undefined;
|
|
507
|
+
}
|
|
508
|
+
for (let i = 0; i < this.dependencyExclusions[dependencyId].length; i++) {
|
|
509
|
+
const exclusion = guaranteeNonNullable(
|
|
510
|
+
this.dependencyExclusions[dependencyId][i],
|
|
511
|
+
);
|
|
512
|
+
const exclusionCoordinate = generateGAVCoordinates(
|
|
513
|
+
guaranteeNonNullable(exclusion.groupId),
|
|
514
|
+
guaranteeNonNullable(exclusion.artifactId),
|
|
515
|
+
undefined,
|
|
516
|
+
);
|
|
517
|
+
if (exclusionCoordinate === coordinate) {
|
|
518
|
+
return this.dependencyExclusions[dependencyId][i];
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return undefined;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
private findExclusionIndex(dependencyId: string, coordinate: string): number {
|
|
525
|
+
if (!this.dependencyExclusions[dependencyId]) {
|
|
526
|
+
return -1;
|
|
527
|
+
}
|
|
528
|
+
for (let i = 0; i < this.dependencyExclusions[dependencyId].length; i++) {
|
|
529
|
+
const exclusion = guaranteeNonNullable(
|
|
530
|
+
this.dependencyExclusions[dependencyId][i],
|
|
531
|
+
);
|
|
532
|
+
const exclusionCoordinate = generateGAVCoordinates(
|
|
533
|
+
guaranteeNonNullable(exclusion.groupId),
|
|
534
|
+
guaranteeNonNullable(exclusion.artifactId),
|
|
535
|
+
undefined,
|
|
536
|
+
);
|
|
537
|
+
if (exclusionCoordinate === coordinate) {
|
|
538
|
+
return i;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return -1;
|
|
542
|
+
}
|
|
543
|
+
|
|
379
544
|
*fetchDependencyReport(): GeneratorFn<void> {
|
|
380
545
|
try {
|
|
381
546
|
this.fetchingDependencyInfoState.inProgress();
|
|
@@ -442,5 +607,17 @@ export class ProjectDependencyEditorState {
|
|
|
442
607
|
clearTrees(): void {
|
|
443
608
|
this.flattenDependencyTreeData = undefined;
|
|
444
609
|
this.dependencyTreeData = undefined;
|
|
610
|
+
this.selectedDependencyForExclusions = undefined;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
syncExclusionsToProjectDependency(dependencyId: string): void {
|
|
614
|
+
const projectDependency =
|
|
615
|
+
this.projectConfiguration?.projectDependencies.find(
|
|
616
|
+
(dep) => dep.projectId === dependencyId,
|
|
617
|
+
);
|
|
618
|
+
if (projectDependency) {
|
|
619
|
+
const exclusions = this.getExclusions(dependencyId);
|
|
620
|
+
projectDependency.setExclusions(exclusions);
|
|
621
|
+
}
|
|
445
622
|
}
|
|
446
623
|
}
|
|
@@ -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 {
|
|
29
|
-
|
|
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:
|
|
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
|
-
|
|
43
|
+
options: observable,
|
|
44
|
+
setOptions: action,
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
this.
|
|
48
|
+
setOptions(options: MetadataRequestOptions): void {
|
|
49
|
+
this.options = options;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
95
|
-
|
|
84
|
+
currentProjectConfiguration.groupId,
|
|
85
|
+
currentProjectConfiguration.artifactId,
|
|
86
|
+
undefined,
|
|
87
|
+
this.options,
|
|
96
88
|
this.editorStore.graphManagerState.graph,
|
|
97
|
-
)) as
|
|
89
|
+
)) as DeployProjectResponse;
|
|
98
90
|
this.result = result;
|
|
99
|
-
this.
|
|
100
|
-
`Pushed to dev mode`,
|
|
101
|
-
);
|
|
91
|
+
this.pushState.complete();
|
|
102
92
|
} catch (error) {
|
|
103
93
|
assertErrorThrown(error);
|
|
104
|
-
this.
|
|
105
|
-
|
|
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,
|