From 6b8cbe8b96f8888fa052ded7e69d8038f0668274 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Fri, 23 Jul 2021 01:20:43 -0600 Subject: [PATCH] Add ability to delete options from closed questions --- .../encuesta/update/encuesta-update.component.html | 7 +++++++ .../encuesta/update/encuesta-update.component.ts | 9 +++++++++ .../scss/paper-dashboard/_datasurvey-survey-update.scss | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html index 1b596a8..d3bce47 100644 --- a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html +++ b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html @@ -66,6 +66,13 @@ > + diff --git a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.ts b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.ts index 1e4f140..147e59f 100644 --- a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.ts +++ b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.ts @@ -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(); diff --git a/src/main/webapp/content/scss/paper-dashboard/_datasurvey-survey-update.scss b/src/main/webapp/content/scss/paper-dashboard/_datasurvey-survey-update.scss index f3b3d56..be641b9 100644 --- a/src/main/webapp/content/scss/paper-dashboard/_datasurvey-survey-update.scss +++ b/src/main/webapp/content/scss/paper-dashboard/_datasurvey-survey-update.scss @@ -34,6 +34,11 @@ background-color: #e73636; color: #fff; } + + &--small { + font-size: 0.8rem; + padding: 0.6rem; + } } }