Fix delete projects cancel bug (#7437)
This commit is contained in:
parent
e3f20d81e2
commit
a5df12105b
|
@ -84,10 +84,9 @@ export class ProjectsComponent implements OnInit {
|
|||
}
|
||||
|
||||
async openDeleteProjectDialog(projects: ProjectListView[]) {
|
||||
if (projects.some((project) => project.write == false)) {
|
||||
let projectsToDelete = projects;
|
||||
const readOnlyProjects = projects.filter((project) => project.write == false);
|
||||
const writeProjects = projects.filter((project) => project.write);
|
||||
|
||||
if (readOnlyProjects.length > 0) {
|
||||
const dialogRef = this.dialogService.open<unknown, BulkConfirmationDetails>(
|
||||
BulkConfirmationDialogComponent,
|
||||
{
|
||||
|
@ -102,21 +101,18 @@ export class ProjectsComponent implements OnInit {
|
|||
|
||||
const result = await lastValueFrom(dialogRef.closed);
|
||||
|
||||
if (result == BulkConfirmationResult.Continue) {
|
||||
if (result !== BulkConfirmationResult.Continue) {
|
||||
return;
|
||||
}
|
||||
projectsToDelete = projects.filter((project) => project.write);
|
||||
}
|
||||
|
||||
this.dialogService.open<unknown, ProjectDeleteOperation>(ProjectDeleteDialogComponent, {
|
||||
data: {
|
||||
projects: writeProjects,
|
||||
projects: projectsToDelete,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.dialogService.open<unknown, ProjectDeleteOperation>(ProjectDeleteDialogComponent, {
|
||||
data: {
|
||||
projects,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private getBulkConfirmationDetails(projects: ProjectListView[]): BulkConfirmationStatus[] {
|
||||
return projects.map((project) => {
|
||||
|
|
Loading…
Reference in New Issue