Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-132914 / 25.04 / Expose force_remove_ix_volumes flag on app deletion #11159

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/interfaces/app.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export type AppDeleteParams = [
{
remove_images?: boolean;
remove_ix_volumes?: boolean;
force_remove_ix_volumes?: boolean;
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ <h1 matDialogTitle>
{{ 'Delete {name}?' | translate: { name: data.name } }}
</p>

@if(data.showRemoveVolumes) {
@if (data.showRemoveVolumes) {
<ix-checkbox
formControlName="remove_volumes"
formControlName="removeVolumes"
[label]="'Remove iXVolumes' | translate"
></ix-checkbox>

@if (data.showRemoveVolumes && form.value.removeVolumes) {
<ix-checkbox
formControlName="forceRemoveVolumes"
[label]="'Force-remove iXVolumes' | translate"
></ix-checkbox>
}
}

<ix-checkbox
formControlName="remove_images"
formControlName="removeImages"
[label]="'Remove Images' | translate"
></ix-checkbox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ describe('AppDeleteDialogComponent', () => {
expect(spectator.inject(MatDialogRef).close).toHaveBeenCalledWith({
removeImages: true,
removeVolumes: true,
forceRemoveVolumes: false,
});
});

it('shows force remove volumes checkbox when Remove iXVolumes is selected', async () => {
expect(await form.getLabels()).not.toContain('Force-remove iXVolumes');

await form.fillForm({
'Remove iXVolumes': true,
'Force-remove iXVolumes': true,
});

const deleteButton = await loader.getHarness(MatButtonHarness.with({ text: 'Delete' }));
await deleteButton.click();

expect(spectator.inject(MatDialogRef).close).toHaveBeenCalledWith({
removeImages: true,
removeVolumes: true,
forceRemoveVolumes: true,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ import { AppDeleteDialogInputData, AppDeleteDialogOutputData } from 'app/pages/a
})
export class AppDeleteDialogComponent {
form = this.formBuilder.group({
remove_volumes: [false],
remove_images: [true],
removeVolumes: [false],
removeImages: [true],
forceRemoveVolumes: [false],
});

constructor(
Expand All @@ -44,9 +45,6 @@ export class AppDeleteDialogComponent {
) { }

onSubmit(): void {
this.dialogRef.close({
removeVolumes: this.form.value.remove_volumes,
removeImages: this.form.value.remove_images,
});
this.dialogRef.close(this.form.getRawValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export interface AppDeleteDialogInputData {
export interface AppDeleteDialogOutputData {
removeVolumes: boolean;
removeImages: boolean;
forceRemoveVolumes: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,16 @@ export class AppInfoCardComponent {
filter(Boolean),
untilDestroyed(this),
)
.subscribe(({ removeVolumes, removeImages }) => this.executeDelete(name, removeVolumes, removeImages));
.subscribe((options) => this.executeDelete(name, options));
}

executeDelete(name: string, removeVolumes = false, removeImages = true): void {
executeDelete(name: string, options: AppDeleteDialogOutputData): void {
this.dialogService.jobDialog(
this.api.job('app.delete', [name, { remove_images: removeImages, remove_ix_volumes: removeVolumes }]),
this.api.job('app.delete', [name, {
remove_images: options.removeImages,
remove_ix_volumes: options.removeVolumes,
force_remove_ix_volumes: options.forceRemoveVolumes,
}]),
{ title: helptextApps.apps.delete_dialog.job },
)
.afterClosed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class InstalledAppsListComponent implements OnInit {
}).afterClosed();
}),
filter(Boolean),
switchMap(({ removeVolumes, removeImages }) => this.executeBulkDeletion(removeVolumes, removeImages)),
switchMap((options) => this.executeBulkDeletion(options)),
this.errorHandler.catchError(),
untilDestroyed(this),
)
Expand Down Expand Up @@ -420,13 +420,14 @@ export class InstalledAppsListComponent implements OnInit {
});
}

private executeBulkDeletion(
removeVolumes = false,
removeImages = true,
): Observable<Job<CoreBulkResponse[]>> {
private executeBulkDeletion(options: AppDeleteDialogOutputData): Observable<Job<CoreBulkResponse[]>> {
const bulkDeletePayload = this.checkedAppsNames.map((name) => [
name,
{ remove_images: removeImages, remove_ix_volumes: removeVolumes },
{
remove_images: options.removeImages,
remove_ix_volumes: options.removeVolumes,
force_remove_ix_volumes: options.forceRemoveVolumes,
},
]);

return this.dialogService.jobDialog(
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/dsb.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en-au.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@
"Force the VM to stop if it has not already stopped within the specified shutdown timeout. Without this option selected, the VM will receive the shutdown signal, but may or may not complete the shutdown process.": "",
"Force unmount": "",
"Force using <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html\" target=\"_blank\">Signature Version 2</a> to sign API requests. Set this only if your AWS provider does not support default version 4 signatures.": "",
"Force-remove iXVolumes": "",
"Forces the addition of the <b>NTP</b> server, even if it is currently unreachable.": "",
"Forcing the other TrueNAS controller to become active requires a failover. This will temporarily interrupt system services. After confirmation, <b>SAVE AND FAILOVER</b> must be clicked on the previous screen.": "",
"Forums": "",
Expand Down
Loading
Loading