From 1a8431e962152708d9ea2390bb5482724513b440 Mon Sep 17 00:00:00 2001 From: Paola Date: Mon, 16 Aug 2021 18:37:05 -0600 Subject: [PATCH 01/17] agregacion pdf --- .../dashboard/dashboard-user/dashboard-user.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts index 8c03821..af7a330 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts @@ -458,6 +458,9 @@ export class DashboardUserComponent implements OnInit { doc.addPage('p'); saveGeneratedPDF(doc, _fileName); + } else { + /*REPORTES POR ENCUESTA: + * */ } } } From c240260ebbc5f2509d60088c17ef639c1e08f168 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Mon, 16 Aug 2021 18:44:37 -0600 Subject: [PATCH 02/17] remover checkeo de usuario para completar encuestas --- .../app/entities/encuesta/route/encuesta-routing.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/webapp/app/entities/encuesta/route/encuesta-routing.module.ts b/src/main/webapp/app/entities/encuesta/route/encuesta-routing.module.ts index f2147e8..00bf758 100644 --- a/src/main/webapp/app/entities/encuesta/route/encuesta-routing.module.ts +++ b/src/main/webapp/app/entities/encuesta/route/encuesta-routing.module.ts @@ -44,7 +44,6 @@ const encuestaRoute: Routes = [ resolve: { encuesta: EncuestaRoutingResolveService, }, - canActivate: [UserRouteAccessService], }, ]; From b005595b99a6e12f5042cb1d56295ba4339324e7 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Mon, 16 Aug 2021 18:49:20 -0600 Subject: [PATCH 03/17] =?UTF-8?q?redondear=20calificaci=C3=B3n=20de=20la?= =?UTF-8?q?=20encuesta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/app/entities/encuesta/complete/complete.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts index 1ee1f99..014fce0 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts @@ -196,7 +196,7 @@ export class EncuestaCompleteComponent implements OnInit { if (this.calificacion !== 0) { const newSumCalificacion = this.sumCalificacion + this.calificacion; const newCantidadCalificacion = this.cantidadCalificaciones + 1; - const newAvgCalificacion = newSumCalificacion / newCantidadCalificacion; + const newAvgCalificacion = Math.round(newSumCalificacion / newCantidadCalificacion); const newRating = this.joinRatingValues(newAvgCalificacion, newCantidadCalificacion); this.encuesta!.calificacion = Number(newRating); this.encuestaService.updateSurvey(this.encuesta!); From 1cdfb4d3f34144df132ab7b054282dcd56c2883f Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Mon, 16 Aug 2021 18:58:23 -0600 Subject: [PATCH 04/17] arreglar conversion a numero de calificacion de encuestas --- .../app/entities/encuesta/complete/complete.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts index 014fce0..835d464 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts @@ -197,8 +197,8 @@ export class EncuestaCompleteComponent implements OnInit { const newSumCalificacion = this.sumCalificacion + this.calificacion; const newCantidadCalificacion = this.cantidadCalificaciones + 1; const newAvgCalificacion = Math.round(newSumCalificacion / newCantidadCalificacion); - const newRating = this.joinRatingValues(newAvgCalificacion, newCantidadCalificacion); - this.encuesta!.calificacion = Number(newRating); + const newRating = Number(this.joinRatingValues(newAvgCalificacion, newCantidadCalificacion)); + this.encuesta!.calificacion = newRating; this.encuestaService.updateSurvey(this.encuesta!); } } From 05b67b3ccba4869521e05b1f148a621271496d63 Mon Sep 17 00:00:00 2001 From: Paola Date: Mon, 16 Aug 2021 19:02:48 -0600 Subject: [PATCH 05/17] preguntas excel --- .../dashboard-user.component.ts | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts index af7a330..a8eb7e1 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.ts @@ -396,6 +396,32 @@ export class DashboardUserComponent implements OnInit { const _excelFinalData = [_reporteEncuestasCreadas, _reporteUsuariosCompletadas, _reporteEncuestasEstado, _reporteEncuestasAcceso]; const _fileName = 'reportes_generales_encuestas_DataSurvey'; exportAsExcelFile(_sheets, _excelFinalData, _fileName); + } else if (!this.reportPreguntas) { + /*REPORTES POR ENCUESTA: + * Nombre encuesta + * categoria encuesta + * calificacion encuesta + * + * preguntas: + * contenido/ cantidad*/ + + const _sheets = ['Datos de encuesta', 'Contenido de preguntas']; + + const _reporteDatosEncuesta = [ + { + nombre_encuesta: this.encuesta?.nombre, + categoria_encuesta: this.encuesta?.categoria, + calificacion_encuesta: this.encuesta?.calificacion, + }, + ]; + + const _reporteDaetallePreguntas = [ + { + nombre_encuesta: this.encuesta?.nombre, + categoria_encuesta: this.encuesta?.categoria, + calificacion_encuesta: this.encuesta?.calificacion, + }, + ]; } } @@ -460,7 +486,12 @@ export class DashboardUserComponent implements OnInit { saveGeneratedPDF(doc, _fileName); } else { /*REPORTES POR ENCUESTA: - * */ + * Nombre encuesta + * categoria encuesta + * calificacion encuesta + * + * preguntas: + * contenido/ cantidad*/ } } } From 73d3db4694cbf93ff43b45694dffc1595a4142d5 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Mon, 16 Aug 2021 21:01:40 -0600 Subject: [PATCH 06/17] Fix home page DataSurvey logo --- src/main/webapp/app/home/home.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/home/home.component.html b/src/main/webapp/app/home/home.component.html index 3044200..3e623fd 100644 --- a/src/main/webapp/app/home/home.component.html +++ b/src/main/webapp/app/home/home.component.html @@ -3,7 +3,7 @@ -
+
diff --git a/src/main/webapp/app/home/home.component.ts b/src/main/webapp/app/home/home.component.ts index 84a01a9..7fc732d 100644 --- a/src/main/webapp/app/home/home.component.ts +++ b/src/main/webapp/app/home/home.component.ts @@ -94,6 +94,13 @@ export class HomeComponent implements OnInit, OnDestroy { (res: HttpResponse) => { this.isLoading = false; const tmpEncuestas = res.body ?? []; + + // Fix calificacion + tmpEncuestas.forEach(encuesta => { + const _calificacion = encuesta.calificacion; + encuesta.calificacion = Number(_calificacion?.toString().split('.')[0]); + }); + this.encuestas = tmpEncuestas.filter(e => e.estado === 'ACTIVE' && e.acceso === 'PUBLIC'); this.encuestasMostradas = this.encuestas.reverse().slice(0, 3); },