Skip to content

Commit

Permalink
NAS-130874 / 25.04 / snapshot batch delete button is deleting ALL sna…
Browse files Browse the repository at this point in the history
…pshots, not just selected (#10602)

* NAS-130874: snapshot batch delete button is deleting ALL snapshots, not just selected

* NAS-130874: snapshot batch delete button is deleting ALL snapshots, not just selected
  • Loading branch information
AlexKarpov98 authored Sep 5, 2024
1 parent f58a257 commit f9268d0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
import { MatDialog } from '@angular/material/dialog';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter, map, tap } from 'rxjs/operators';
import {
filter, map, take, tap,
} from 'rxjs/operators';
import { Role } from 'app/enums/role.enum';
import { ContainerImage } from 'app/interfaces/container-image.interface';
import { EmptyService } from 'app/modules/empty/empty.service';
Expand Down Expand Up @@ -50,9 +52,14 @@ export class DockerImagesListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.containerImages.forEach((image) => image.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((images) => {
images.forEach((image) => image.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
cssClass: 'checkboxs-column',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ export class SnapshotListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.snapshots.forEach((bootenv) => bootenv.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((snapshots) => {
snapshots.forEach((snapshot) => snapshot.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
cssClass: 'checkboxs-column',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter, forkJoin, map } from 'rxjs';
import {
filter, forkJoin, map, take,
} from 'rxjs';
import { Role } from 'app/enums/role.enum';
import { SmartTestResultPageType } from 'app/enums/smart-test-results-page-type.enum';
import { buildNormalizedFileSize } from 'app/helpers/file-size.utils';
Expand Down Expand Up @@ -55,9 +57,14 @@ export class DiskListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.disks.forEach((disk) => disk.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((disks) => {
disks.forEach((disk) => disk.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
}),
textColumn({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import {
filter, map, of, switchMap,
take,
} from 'rxjs';
import { BootEnvironmentAction } from 'app/enums/boot-environment-action.enum';
import { BootEnvironmentActive } from 'app/enums/boot-environment-active.enum';
Expand Down Expand Up @@ -64,9 +65,14 @@ export class BootEnvironmentListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.bootenvs.forEach((bootenv) => bootenv.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((bootEnvs) => {
bootEnvs.forEach((bootEnv) => bootEnv.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
cssClass: 'checkboxs-column',
}),
Expand Down

0 comments on commit f9268d0

Please sign in to comment.