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);
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    categoria.estado = EstadoCategoria.INACTIVE;
 | 
			
		||||
    if (categoria.estado == EstadoCategoria.INACTIVE) {
 | 
			
		||||
      categoria.estado = EstadoCategoria.ACTIVE;
 | 
			
		||||
    } else {
 | 
			
		||||
      categoria.estado = EstadoCategoria.INACTIVE;
 | 
			
		||||
    }
 | 
			
		||||
    this.categoriaService.update(categoria).subscribe(() => {
 | 
			
		||||
      this.activeModal.close('deleted');
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ export class CategoriaComponent implements OnInit {
 | 
			
		|||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  delete(categoria: ICategoria): void {
 | 
			
		||||
  toggleStatus(categoria: ICategoria): void {
 | 
			
		||||
    const modalRef = this.modalService.open(CategoriaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
 | 
			
		||||
    modalRef.componentInstance.categoria = categoria;
 | 
			
		||||
    // 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 {
 | 
			
		||||
  background-color: transparent;
 | 
			
		||||
  color: #2962ff;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,7 +126,10 @@
 | 
			
		|||
      "open": "Abrir",
 | 
			
		||||
      "save": "Guardar",
 | 
			
		||||
      "view": "Vista",
 | 
			
		||||
      "create": "Crear"
 | 
			
		||||
      "create": "Crear",
 | 
			
		||||
      "enable": "Habilitar",
 | 
			
		||||
      "disable": "Deshabilitar",
 | 
			
		||||
      "toggleStatus": "Cambiar Estado"
 | 
			
		||||
    },
 | 
			
		||||
    "detail": {
 | 
			
		||||
      "field": "Campo",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue