import { CephServiceSpec } from '~/app/shared/models/service.interface';
import { forkJoin, of, Subject } from 'rxjs';
import { catchError, map, switchMap, takeUntil } from 'rxjs/operators';
+import { DeletionImpact } from '~/app/shared/enum/delete-confirmation-modal-impact.enum';
const BASE_URL = 'block/nvmeof/subsystems';
const DEFAULT_PLACEHOLDER = $localize`Enter group name`;
@ViewChild('encryptionTpl', { static: true })
encryptionTpl: TemplateRef<any>;
+ @ViewChild('deleteTpl', { static: true })
+ deleteTpl: TemplateRef<any>;
+
subsystems: (NvmeofSubsystem & { gw_group?: string; initiator_count?: number })[] = [];
subsystemsColumns: any;
permissions: Permissions;
private authStorageService: AuthStorageService,
public actionLabels: ActionLabelsI18n,
private router: Router,
+ private route: ActivatedRoute,
private modalService: ModalCdsService,
private taskWrapper: TaskWrapperService,
- private route: ActivatedRoute,
private notificationService: NotificationService
) {
super();
cellTemplate: this.encryptionTpl
}
];
+
this.tableActions = [
{
name: this.actionLabels.CREATE,
deleteSubsystemModal() {
const subsystem = this.selection.first();
this.modalService.show(DeleteConfirmationModalComponent, {
- itemDescription: 'Subsystem',
+ itemDescription: $localize`Subsystem`,
+ impact: DeletionImpact.high,
+ bodyTemplate: this.deleteTpl,
itemNames: [subsystem.nqn],
actionDescription: 'delete',
+ bodyContext: {
+ deletionMessage: $localize`Deleting <strong>${subsystem.nqn}</strong> will remove all associated configurations and resources. Dependent services may stop working. This action cannot be undone.`
+ },
submitActionObservable: () =>
this.taskWrapper.wrapTaskAroundCall({
task: new FinishedTask('nvmeof/subsystem/delete', { nqn: subsystem.nqn }),
});
}
- // Gateway groups
onGroupSelection(selected: GroupsComboboxItem) {
selected.selected = true;
this.group = selected.content;
i18n>Yes, I am sure.</cds-checkbox>
</ng-container>
<ng-template #highImpactDeletion>
- <p i18n
- class="cds--type-body-01">
- Deleting <strong>{{ itemNames[0] }}</strong> will remove all associated {{itemDescription}} and may disrupt traffic routing for
- services relying on it. This action cannot be undone.
+ <p class="cds--type-body-01">
+ @if (bodyContext?.deletionMessage) {
+ <span [innerHTML]="bodyContext.deletionMessage"></span>
+ } @else {
+ <ng-container i18n>Deleting <strong>{{ itemNames[0] }}</strong> will remove all associated {{itemDescription}}.This action cannot be undone.</ng-container>
+ }
</p>
<ng-template #labelTemplate>
<span i18n>Type <strong>{{ itemNames[0] }}</strong> to confirm (required)</span>