add eliminar plantilla
This commit is contained in:
parent
e3852a7c72
commit
c218966a07
|
@ -1,21 +1,20 @@
|
|||
<form *ngIf="plantilla" name="deleteForm" (ngSubmit)="confirmDelete(plantilla.id!)">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" data-cy="plantillaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
|
||||
</div>
|
||||
|
||||
<form class="ds-form" *ngIf="plantilla" name="deleteForm" (ngSubmit)="confirmDelete(plantilla)">
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-plantilla-heading" jhiTranslate="dataSurveyApp.plantilla.delete.question" [translateValues]="{ id: plantilla.id }">
|
||||
<p class="ds-title--small">Eliminar plantilla</p>
|
||||
<p
|
||||
class="ds-subtitle"
|
||||
id="jhi-delete-plantilla-heading"
|
||||
jhiTranslate="dataSurveyApp.plantilla.delete.question"
|
||||
[translateValues]="{ id: plantilla.id }"
|
||||
>
|
||||
Are you sure you want to delete this Plantilla?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-plantilla" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
|
||||
|
|
|
@ -3,6 +3,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|||
|
||||
import { IPlantilla } from '../plantilla.model';
|
||||
import { PlantillaService } from '../service/plantilla.service';
|
||||
import { EstadoPlantilla } from '../../enumerations/estado-plantilla.model';
|
||||
|
||||
@Component({
|
||||
templateUrl: './plantilla-delete-dialog.component.html',
|
||||
|
@ -16,8 +17,9 @@ export class PlantillaDeleteDialogComponent {
|
|||
this.activeModal.dismiss();
|
||||
}
|
||||
|
||||
confirmDelete(id: number): void {
|
||||
this.plantillaService.delete(id).subscribe(() => {
|
||||
confirmDelete(pPlantilla: IPlantilla): void {
|
||||
pPlantilla.estado = EstadoPlantilla.DELETED;
|
||||
this.plantillaService.update(pPlantilla).subscribe(() => {
|
||||
this.activeModal.close('deleted');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.nombre">Nombre</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.descripcion">Descripcion</span></th>
|
||||
<!-- <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaCreacion">Fecha Creacion</span></th> -->
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaPublicacionTienda">Fecha Publicacion Tienda</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.estado">Estado</span></th>
|
||||
|
@ -51,7 +50,6 @@
|
|||
<tbody>
|
||||
<tr *ngFor="let plantilla of plantillas; trackBy: trackId" data-cy="entityTable">
|
||||
<td>{{ plantilla.nombre }}</td>
|
||||
<td>{{ plantilla.descripcion }}</td>
|
||||
<!-- <td>{{ plantilla.fechaCreacion | formatMediumDatetime }}</td> -->
|
||||
<td *ngIf="plantilla.fechaPublicacionTienda">{{ plantilla.fechaPublicacionTienda | formatShortDatetime | titlecase }}</td>
|
||||
<td *ngIf="!plantilla.fechaPublicacionTienda">No establecida</td>
|
||||
|
@ -61,16 +59,6 @@
|
|||
<td>{{ plantilla.categoria?.nombre }}</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/plantilla', plantilla.id, 'view']"
|
||||
class="ds-btn ds-btn--secondary btn-sm"
|
||||
data-cy="entityDetailsButton"
|
||||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline">Vista previa</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/plantilla', plantilla.id, 'edit']"
|
||||
|
|
|
@ -53,7 +53,8 @@ export class PlantillaComponent implements OnInit {
|
|||
this.plantillaService.query().subscribe(
|
||||
(res: HttpResponse<IPlantilla[]>) => {
|
||||
this.isLoading = false;
|
||||
this.plantillas = res.body ?? [];
|
||||
const tempPlantillas = res.body ?? [];
|
||||
this.plantillas = tempPlantillas.filter(p => p.estado !== EstadoPlantilla.DELETED);
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"updated": "Una plantilla ha sido actualizada con el identificador {{ param }}",
|
||||
"deleted": "Una plantilla ha sido eliminada con el identificador {{ param }}",
|
||||
"delete": {
|
||||
"question": "¿Seguro que quiere eliminar Plantilla {{ id }}?",
|
||||
"question": "¿Seguro que quiere eliminar esta plantilla?",
|
||||
"deletefromstore": "¿Seguro que quiere eliminar esta plantilla de la tienda?"
|
||||
},
|
||||
"publish": {
|
||||
|
|
Loading…
Reference in New Issue