Updated delete moda
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
parent
7a110d9d58
commit
ee950fd685
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue