Updated delete moda
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details

pull/36/head
Manuel Aranda Rosales 2025-08-25 13:09:43 +02:00
parent 7a110d9d58
commit ee950fd685
2 changed files with 25 additions and 7 deletions

View File

@ -1,10 +1,11 @@
<h1 mat-dialog-title i18n="@@deleteDialogTitle">Eliminar</h1>
<h1 mat-dialog-title>{{ title }}</h1>
<div mat-dialog-content>
<p i18n="@@deleteConfirmationMessage">
¿Estás seguro que deseas eliminar <strong>{{ data.name }}</strong>?
<p>
{{ message }}
<strong *ngIf="showName">{{ name }}</strong>
</p>
</div>
<div mat-dialog-actions class="action-container">
<button class="ordinary-button" (click)="onNoClick()" i18n="@@cancelButton">Cancelar</button>
<button class="delete-button" (click)="onYesClick()" i18n="@@confirmButton">Eliminar</button>
<button class="ordinary-button" (click)="onNoClick()">{{ cancelText }}</button>
<button class="delete-button" (click)="onYesClick()">{{ confirmText }}</button>
</div>

View File

@ -7,10 +7,27 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
styleUrl: './delete-modal.component.css'
})
export class DeleteModalComponent {
title: string = 'Eliminar';
message: string = '¿Estás seguro que deseas eliminar este elemento?';
confirmText: string = 'Eliminar';
cancelText: string = 'Cancelar';
showName: boolean = false;
name: string = '';
constructor(
public dialogRef: MatDialogRef<DeleteModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: { name: string }
) {}
@Inject(MAT_DIALOG_DATA) public data: any
) {
// Configurar valores por defecto o usar los proporcionados
if (data) {
this.title = data.title || this.title;
this.message = data.message || this.message;
this.confirmText = data.confirmText || this.confirmText;
this.cancelText = data.cancelText || this.cancelText;
this.name = data.name || '';
this.showName = !!data.name;
}
}
onNoClick(): void {
this.dialogRef.close(false);