agregar toggle en lugar de eliminar
This commit is contained in:
parent
1d75fb6960
commit
6986e3b16e
|
@ -34,7 +34,11 @@ export class CategoriaDeleteDialogComponent {
|
||||||
this.encuestaService.update(encuesta);
|
this.encuestaService.update(encuesta);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
categoria.estado = EstadoCategoria.INACTIVE;
|
if (categoria.estado == EstadoCategoria.INACTIVE) {
|
||||||
|
categoria.estado = EstadoCategoria.ACTIVE;
|
||||||
|
} else {
|
||||||
|
categoria.estado = EstadoCategoria.INACTIVE;
|
||||||
|
}
|
||||||
this.categoriaService.update(categoria).subscribe(() => {
|
this.categoriaService.update(categoria).subscribe(() => {
|
||||||
this.activeModal.close('deleted');
|
this.activeModal.close('deleted');
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,7 +42,7 @@ export class CategoriaComponent implements OnInit {
|
||||||
return item.id!;
|
return item.id!;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(categoria: ICategoria): void {
|
toggleStatus(categoria: ICategoria): void {
|
||||||
const modalRef = this.modalService.open(CategoriaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
|
const modalRef = this.modalService.open(CategoriaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||||
modalRef.componentInstance.categoria = categoria;
|
modalRef.componentInstance.categoria = categoria;
|
||||||
// unsubscribe not needed because closed completes on modal close
|
// unsubscribe not needed because closed completes on modal close
|
||||||
|
|
|
@ -41,6 +41,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ds-btn--toggle {
|
||||||
|
background-color: #ffaa47;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #e09935;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ds-btn--secondary {
|
.ds-btn--secondary {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: #2962ff;
|
color: #2962ff;
|
||||||
|
|
|
@ -126,7 +126,10 @@
|
||||||
"open": "Abrir",
|
"open": "Abrir",
|
||||||
"save": "Guardar",
|
"save": "Guardar",
|
||||||
"view": "Vista",
|
"view": "Vista",
|
||||||
"create": "Crear"
|
"create": "Crear",
|
||||||
|
"enable": "Habilitar",
|
||||||
|
"disable": "Deshabilitar",
|
||||||
|
"toggleStatus": "Cambiar Estado"
|
||||||
},
|
},
|
||||||
"detail": {
|
"detail": {
|
||||||
"field": "Campo",
|
"field": "Campo",
|
||||||
|
|
Loading…
Reference in New Issue