@finos/legend-application-studio 28.19.73 → 28.19.74
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/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +26 -338
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.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/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +1 -7
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +0 -2
- 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 +0 -19
- 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 +1 -16
- 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 +1 -112
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js.map +1 -1
- package/package.json +5 -5
- package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +53 -599
- package/src/stores/editor/EditorGraphState.ts +4 -11
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +0 -26
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.ts +1 -178
|
@@ -799,22 +799,15 @@ export class EditorGraphState {
|
|
|
799
799
|
projectDependencies: ProjectDependency[],
|
|
800
800
|
): Promise<ProjectDependencyCoordinates[]> {
|
|
801
801
|
return Promise.all(
|
|
802
|
-
projectDependencies.map(async (dep) =>
|
|
803
|
-
|
|
804
|
-
(exclusion) => ({
|
|
805
|
-
groupId: guaranteeNonNullable(exclusion.groupId),
|
|
806
|
-
artifactId: guaranteeNonNullable(exclusion.artifactId),
|
|
807
|
-
}),
|
|
808
|
-
);
|
|
809
|
-
return Promise.resolve(
|
|
802
|
+
projectDependencies.map(async (dep) =>
|
|
803
|
+
Promise.resolve(
|
|
810
804
|
new ProjectDependencyCoordinates(
|
|
811
805
|
guaranteeNonNullable(dep.groupId),
|
|
812
806
|
guaranteeNonNullable(dep.artifactId),
|
|
813
807
|
dep.versionId,
|
|
814
|
-
exclusionCoordinates.length > 0 ? exclusionCoordinates : undefined,
|
|
815
808
|
),
|
|
816
|
-
)
|
|
817
|
-
|
|
809
|
+
),
|
|
810
|
+
),
|
|
818
811
|
);
|
|
819
812
|
}
|
|
820
813
|
|
|
@@ -106,8 +106,6 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
106
106
|
setProjectConfiguration: action,
|
|
107
107
|
setSelectedTab: action,
|
|
108
108
|
setManualOverwrite: action,
|
|
109
|
-
syncExclusionsToProjectDependencies: action,
|
|
110
|
-
loadExclusionsFromProjectDependencies: action,
|
|
111
109
|
fectchAssociatedProjectsAndVersions: flow,
|
|
112
110
|
updateProjectConfiguration: flow,
|
|
113
111
|
updateToLatestStructure: flow,
|
|
@@ -133,7 +131,6 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
133
131
|
|
|
134
132
|
setProjectConfiguration(projectConfiguration: ProjectConfiguration): void {
|
|
135
133
|
this.projectConfiguration = projectConfiguration;
|
|
136
|
-
this.loadExclusionsFromProjectDependencies();
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
setSelectedTab(tab: CONFIGURATION_EDITOR_TAB): void {
|
|
@@ -194,24 +191,6 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
194
191
|
);
|
|
195
192
|
}
|
|
196
193
|
|
|
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
|
-
|
|
215
194
|
*fectchAssociatedProjectsAndVersions(): GeneratorFn<void> {
|
|
216
195
|
this.fetchingProjectVersionsState.inProgress();
|
|
217
196
|
try {
|
|
@@ -255,9 +234,6 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
255
234
|
): GeneratorFn<void> {
|
|
256
235
|
try {
|
|
257
236
|
this.updatingConfigurationState.inProgress();
|
|
258
|
-
|
|
259
|
-
this.syncExclusionsToProjectDependencies();
|
|
260
|
-
|
|
261
237
|
yield this.editorStore.sdlcServerClient.updateConfiguration(
|
|
262
238
|
this.editorStore.sdlcState.activeProject.projectId,
|
|
263
239
|
this.editorStore.sdlcState.activeWorkspace,
|
|
@@ -364,8 +340,6 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
364
340
|
showLoading: true,
|
|
365
341
|
});
|
|
366
342
|
try {
|
|
367
|
-
this.syncExclusionsToProjectDependencies();
|
|
368
|
-
|
|
369
343
|
const updateProjectConfigurationCommand =
|
|
370
344
|
new UpdateProjectConfigurationCommand(
|
|
371
345
|
this.currentProjectConfiguration.groupId,
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
assertErrorThrown,
|
|
25
25
|
LogEvent,
|
|
26
26
|
isNonNullable,
|
|
27
|
-
guaranteeNonNullable,
|
|
28
27
|
uuid,
|
|
29
28
|
} from '@finos/legend-shared';
|
|
30
29
|
import {
|
|
@@ -40,11 +39,7 @@ import {
|
|
|
40
39
|
} from '@finos/legend-server-depot';
|
|
41
40
|
import type { TreeData, TreeNodeData } from '@finos/legend-art';
|
|
42
41
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
|
|
43
|
-
import {
|
|
44
|
-
ProjectDependencyExclusion,
|
|
45
|
-
type ProjectConfiguration,
|
|
46
|
-
} from '@finos/legend-server-sdlc';
|
|
47
|
-
import { generateGAVCoordinates } from '@finos/legend-storage';
|
|
42
|
+
import type { ProjectConfiguration } from '@finos/legend-server-sdlc';
|
|
48
43
|
|
|
49
44
|
export abstract class ProjectDependencyConflictTreeNodeData
|
|
50
45
|
implements TreeNodeData
|
|
@@ -304,12 +299,6 @@ export class ProjectDependencyEditorState {
|
|
|
304
299
|
expandConflictsState = ActionState.create();
|
|
305
300
|
buildConflictPathState = ActionState.create();
|
|
306
301
|
|
|
307
|
-
// Exclusions management
|
|
308
|
-
selectedDependencyForExclusions: ProjectDependencyVersionNode | undefined;
|
|
309
|
-
dependencyExclusions: {
|
|
310
|
-
[dependencyId: string]: ProjectDependencyExclusion[];
|
|
311
|
-
} = {};
|
|
312
|
-
|
|
313
302
|
constructor(
|
|
314
303
|
configState: ProjectConfigurationEditorState,
|
|
315
304
|
editorStore: EditorStore,
|
|
@@ -323,8 +312,6 @@ export class ProjectDependencyEditorState {
|
|
|
323
312
|
reportTab: observable,
|
|
324
313
|
expandConflictsState: observable,
|
|
325
314
|
buildConflictPathState: observable,
|
|
326
|
-
selectedDependencyForExclusions: observable,
|
|
327
|
-
dependencyExclusions: observable,
|
|
328
315
|
setReportTab: action,
|
|
329
316
|
expandAllConflicts: action,
|
|
330
317
|
setFlattenDependencyTreeData: action,
|
|
@@ -333,15 +320,6 @@ export class ProjectDependencyEditorState {
|
|
|
333
320
|
setDependencyTreeData: action,
|
|
334
321
|
buildConflictPaths: action,
|
|
335
322
|
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,
|
|
345
323
|
fetchDependencyReport: flow,
|
|
346
324
|
});
|
|
347
325
|
this.configState = configState;
|
|
@@ -398,149 +376,6 @@ export class ProjectDependencyEditorState {
|
|
|
398
376
|
return this.configState.projectConfiguration;
|
|
399
377
|
}
|
|
400
378
|
|
|
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
|
-
|
|
544
379
|
*fetchDependencyReport(): GeneratorFn<void> {
|
|
545
380
|
try {
|
|
546
381
|
this.fetchingDependencyInfoState.inProgress();
|
|
@@ -607,17 +442,5 @@ export class ProjectDependencyEditorState {
|
|
|
607
442
|
clearTrees(): void {
|
|
608
443
|
this.flattenDependencyTreeData = undefined;
|
|
609
444
|
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
|
-
}
|
|
622
445
|
}
|
|
623
446
|
}
|