Add ability to delete options from closed questions
This commit is contained in:
		
							parent
							
								
									aeb5538a4a
								
							
						
					
					
						commit
						6b8cbe8b96
					
				| 
						 | 
				
			
			@ -66,6 +66,13 @@
 | 
			
		|||
                >
 | 
			
		||||
                  <!-- <input class="ds-survey--checkbox" id="{{ ePregunta.id }}-{{ ePreguntaOpcion2.id }}" type="checkbox" disabled /> -->
 | 
			
		||||
                  <label for="{{ ePregunta.id }}-{{ ePreguntaOpcion2.id }}">{{ ePreguntaOpcion2.nombre }}</label>
 | 
			
		||||
                  <fa-icon
 | 
			
		||||
                    *ngIf="encuesta!.estado === 'DRAFT'"
 | 
			
		||||
                    class="ds-survey--titulo--icon ds-survey--titulo--icon--small"
 | 
			
		||||
                    [icon]="faTimes"
 | 
			
		||||
                    (click)="deleteOption($event)"
 | 
			
		||||
                    [attr.data-optionid]="ePreguntaOpcion2.id"
 | 
			
		||||
                  ></fa-icon>
 | 
			
		||||
                </div>
 | 
			
		||||
              </ng-container>
 | 
			
		||||
            </ng-container>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -214,6 +214,15 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  deleteOption(event: any): void {
 | 
			
		||||
    const id = event.target.dataset.optionid;
 | 
			
		||||
    this.ePreguntaCerradaOpcionService.delete(id).subscribe(e => {
 | 
			
		||||
      this.ePreguntas = [];
 | 
			
		||||
      this.ePreguntasOpciones = [];
 | 
			
		||||
      this.loadAll();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  save(): void {
 | 
			
		||||
    this.isSaving = true;
 | 
			
		||||
    const ePreguntaCerradaOpcion = this.createFromForm();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,6 +34,11 @@
 | 
			
		|||
        background-color: #e73636;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &--small {
 | 
			
		||||
        font-size: 0.8rem;
 | 
			
		||||
        padding: 0.6rem;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue