From 422c9489e6e07830d6a4f9d03f8f454baa9fcb83 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Thu, 12 Aug 2021 00:58:33 -0600 Subject: [PATCH 01/12] Add survey template preview in mis-plantillas --- .../usuario-plantillas-detail.component.html | 86 ++++++++++ ...rio-plantillas-detail.component.tmpSpec.ts | 37 +++++ .../usuario-plantillas-detail.component.ts | 155 ++++++++++++++++++ .../list/usuario-plantillas.component.html | 2 +- ...ario-plantillas-routing-resolve.service.ts | 29 ++++ .../route/usuario-plantillas.route.ts | 34 +++- .../usuario-plantillas.module.ts | 7 +- 7 files changed, 339 insertions(+), 11 deletions(-) create mode 100644 src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.html create mode 100644 src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.tmpSpec.ts create mode 100644 src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.ts create mode 100644 src/main/webapp/app/entities/usuario-plantillas/route/usuario-plantillas-routing-resolve.service.ts diff --git a/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.html b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.html new file mode 100644 index 0000000..06bcf5f --- /dev/null +++ b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.html @@ -0,0 +1,86 @@ +
+
+

+
+

Vista previa de {{ plantilla!.nombre }}

+
+ +

Creada el día {{ plantilla!.fechaCreacion | formatShortDatetime | lowercase }}

+
+ +
+

+ + + + + +
+
+ +

Plantilla vacía

+

Inicie creando preguntas y opciones para su plantilla.

+
+ +
+
+
+ {{ i + 1 }}. {{ pPregunta.nombre }} +
+
+ Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }} + {{ pPregunta.opcional ? '(opcional)' : '' }} + Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }} + {{ pPregunta.opcional ? '(opcional)' : '' }} + Pregunta de respuesta abierta {{ pPregunta.opcional ? '(opcional)' : '' }} +
+ + + + +
+
+ + + +
+
+ + + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
diff --git a/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.tmpSpec.ts b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.tmpSpec.ts new file mode 100644 index 0000000..a630550 --- /dev/null +++ b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.tmpSpec.ts @@ -0,0 +1,37 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of } from 'rxjs'; +import { UsuarioPlantillasDetailComponent } from './usuario-plantillas-detail.component'; + +describe('Component Tests', () => { + describe('Plantilla Management Detail Component', () => { + let comp: UsuarioPlantillasDetailComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [UsuarioPlantillasDetailComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: { data: of({ plantilla: { id: 123 } }) }, + }, + ], + }) + .overrideTemplate(UsuarioPlantillasDetailComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(UsuarioPlantillasDetailComponent); + comp = fixture.componentInstance; + }); + + describe('OnInit', () => { + it('Should load plantilla on init', () => { + // WHEN + comp.ngOnInit(); + + // THEN + expect(comp.plantilla).toEqual(expect.objectContaining({ id: 123 })); + }); + }); + }); +}); diff --git a/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.ts b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.ts new file mode 100644 index 0000000..f667944 --- /dev/null +++ b/src/main/webapp/app/entities/usuario-plantillas/detail/usuario-plantillas-detail.component.ts @@ -0,0 +1,155 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { FormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { EstadoPlantilla } from 'app/entities/enumerations/estado-plantilla.model'; + +import { Observable } from 'rxjs'; +import { finalize, map } from 'rxjs/operators'; + +import * as dayjs from 'dayjs'; +import { DATE_TIME_FORMAT } from 'app/config/input.constants'; + +import { ICategoria } from 'app/entities/categoria/categoria.model'; +import { CategoriaService } from 'app/entities/categoria/service/categoria.service'; +import { IUsuarioExtra, UsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model'; +import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service'; + +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { IPPreguntaCerrada } from 'app/entities/p-pregunta-cerrada/p-pregunta-cerrada.model'; +import { PPreguntaCerradaService } from 'app/entities/p-pregunta-cerrada/service/p-pregunta-cerrada.service'; +import { PPreguntaCerradaDeleteDialogComponent } from 'app/entities/p-pregunta-cerrada/delete/p-pregunta-cerrada-delete-dialog.component'; +import { IPPreguntaAbierta } from '../../p-pregunta-abierta/p-pregunta-abierta.model'; +import { PPreguntaCerrada } from '../../p-pregunta-cerrada/p-pregunta-cerrada.model'; +import { PPreguntaCerradaOpcion, IPPreguntaCerradaOpcion } from '../../p-pregunta-cerrada-opcion/p-pregunta-cerrada-opcion.model'; +import { PPreguntaAbiertaService } from '../../p-pregunta-abierta/service/p-pregunta-abierta.service'; +import { PPreguntaCerradaOpcionService } from '../../p-pregunta-cerrada-opcion/service/p-pregunta-cerrada-opcion.service'; +import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model'; + +import { faTimes, faPlus, faStar, faQuestion } from '@fortawesome/free-solid-svg-icons'; +import { Account } from '../../../core/auth/account.model'; +import { AccountService } from 'app/core/auth/account.service'; +import { IPlantilla } from 'app/entities/plantilla/plantilla.model'; +import { PlantillaService } from 'app/entities/plantilla/service/plantilla.service'; + +@Component({ + selector: 'jhi-usuario-plantillas-detail', + templateUrl: './usuario-plantillas-detail.component.html', +}) +export class UsuarioPlantillasDetailComponent implements OnInit { + categoriasSharedCollection: ICategoria[] = []; + usuarioExtrasSharedCollection: IUsuarioExtra[] = []; + faTimes = faTimes; + faPlus = faPlus; + faStar = faStar; + faQuestion = faQuestion; + plantilla: IPlantilla | null = null; + isLoading = false; + successPublished = false; + pPreguntas?: any[]; + pPreguntasOpciones?: any[]; + usuarioExtra: UsuarioExtra | null = null; + + constructor( + protected activatedRoute: ActivatedRoute, + protected plantillaService: PlantillaService, + protected categoriaService: CategoriaService, + protected usuarioExtraService: UsuarioExtraService, + protected fb: FormBuilder, + protected modalService: NgbModal, + protected pPreguntaCerradaService: PPreguntaCerradaService, + protected pPreguntaCerradaOpcionService: PPreguntaCerradaOpcionService, + protected pPreguntaAbiertaService: PPreguntaAbiertaService, + protected accountService: AccountService + ) {} + + ngOnInit(): void { + this.activatedRoute.data.subscribe(({ plantilla }) => { + if (plantilla) { + this.plantilla = plantilla; + this.loadAll(); + } else { + this.previousState(); + } + }); + + // Get jhi_user and usuario_extra information + this.accountService.getAuthenticationState().subscribe(account => { + if (account !== null) { + this.usuarioExtraService.find(account.id).subscribe(usuarioExtra => { + this.usuarioExtra = usuarioExtra.body; + }); + } + }); + } + + ngAfterViewChecked(): void { + this.initListeners(); + } + + initListeners(): void { + const checkboxes = document.getElementsByClassName('ds-survey--checkbox'); + for (let i = 0; i < checkboxes.length; i++) { + checkboxes[i].addEventListener('click', e => { + if ((e.target as HTMLInputElement).checked) { + (e.target as HTMLElement).offsetParent!.classList.add('ds-survey--closed-option--active'); + } else { + (e.target as HTMLElement).offsetParent!.classList.remove('ds-survey--closed-option--active'); + } + }); + } + } + + trackId(index: number, item: IPPreguntaCerrada): number { + return item.id!; + } + + trackPPreguntaCerradaById(index: number, item: IPPreguntaCerrada): number { + return item.id!; + } + + trackCategoriaById(index: number, item: ICategoria): number { + return item.id!; + } + + trackUsuarioExtraById(index: number, item: IUsuarioExtra): number { + return item.id!; + } + + getPlantilla(id: number) { + return this.plantillaService.findPlantilla(id); + } + + loadAll(): void { + this.isLoading = true; + + this.plantillaService + .findQuestions(this.plantilla?.id!) + .pipe( + finalize(() => + this.plantillaService.findQuestionsOptions(this.plantilla?.id!).subscribe( + (res: any) => { + this.isLoading = false; + this.pPreguntasOpciones = res.body ?? []; + }, + () => { + this.isLoading = false; + } + ) + ) + ) + .subscribe( + (res: any) => { + this.isLoading = false; + this.pPreguntas = res.body ?? []; + }, + () => { + this.isLoading = false; + } + ); + } + + previousState(): void { + window.history.back(); + } +} diff --git a/src/main/webapp/app/entities/usuario-plantillas/list/usuario-plantillas.component.html b/src/main/webapp/app/entities/usuario-plantillas/list/usuario-plantillas.component.html index fc43592..e236f6e 100644 --- a/src/main/webapp/app/entities/usuario-plantillas/list/usuario-plantillas.component.html +++ b/src/main/webapp/app/entities/usuario-plantillas/list/usuario-plantillas.component.html @@ -48,7 +48,7 @@
+
+

La plantilla ha comprar no tiene costo alguno

+ +
diff --git a/src/main/webapp/app/layouts/sidebar/sidebar.constants.ts b/src/main/webapp/app/layouts/sidebar/sidebar.constants.ts index 4fdf18a..08121cf 100644 --- a/src/main/webapp/app/layouts/sidebar/sidebar.constants.ts +++ b/src/main/webapp/app/layouts/sidebar/sidebar.constants.ts @@ -66,7 +66,7 @@ export const USER_ROUTES: RouteInfo[] = [ { path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' }, { path: '/dashboard/user', - title: 'Dashboard', + title: 'Reportes', type: 'link', icontype: 'nc-icon nc-chart-bar-32', }, @@ -74,7 +74,7 @@ export const USER_ROUTES: RouteInfo[] = [ path: '/encuesta', title: 'Encuestas', type: 'link', - icontype: 'nc-icon nc-paper', + icontype: 'nc-icoxn nc-paper', }, { path: '/tienda-plantilla', title: 'Tienda', type: 'link', icontype: 'nc-icon nc-shop' }, // { From 562fe935f43febead5a6ec2e53505edf39f5309b Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Thu, 12 Aug 2021 23:07:02 -0600 Subject: [PATCH 03/12] Add survey and users data reports export as Excel --- .../dashboard-admin.component.ts | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts b/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts index 3cd2e69..35efff1 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts +++ b/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts @@ -315,7 +315,14 @@ export class DashboardAdminComponent implements OnInit { Cantidad de comentarios de retroalimentación */ - const _sheets = ['reportes generales', 'enc. publicadas', 'enc. publicadas categoría', 'enc. finalizadas categoría']; + const _sheets = [ + 'usuarios generales', + 'enc. publicadas', + 'enc. publicadas categoría', + 'enc. finalizadas categoría', + 'encuestas generales', + 'reporte de usuarios', + ]; const _reporteUsuarios = [ { @@ -355,13 +362,44 @@ export class DashboardAdminComponent implements OnInit { _reporteCantidadEncuestasFinalizadasCategoria.push(_report); }); - // exportAsExcelTable(); + // this.encuestasPublicadas + // this.encuestasFinalizadas + // this.encuestasBorrador + // this.encuestasCompletadas + const _reporteEncuestasReportesGenerales = [ + { + encuestas_borrador: this.encuestasBorrador, + encuestas_publicadas: this.encuestasPublicadas, + encuestas_finalizadas: this.encuestasFinalizadas, + encuestas_completadas: this.encuestasCompletadas, + }, + ]; + + // this.encuestasUsuario; + // this.encuestasUsuarioPublicadas; + // this.encuestasUsuarioFinalizadas; + // this.encuestasUsuarioBorrador; + // this.encuestasUsuarioCompletadas; + // this.usuarios; + const _reporteEncuestasUsuarios: any[] = []; + this.usuarios!.forEach((user, index) => { + let _report: any = {}; + _report['usuario_nombre'] = user.nombre; + _report['usuario_encuestas'] = this.encuestasUsuario[index]; + _report['encuestas_borrador'] = this.encuestasUsuarioBorrador[index]; + _report['encuestas_publicadas'] = this.encuestasUsuarioPublicadas[index]; + _report['encuestas_finalizadas'] = this.encuestasUsuarioFinalizadas[index]; + _report['encuestas_completadas_usuarios'] = this.encuestasUsuarioCompletadas[index]; + _reporteEncuestasUsuarios.push(_report); + }); const _excelFinalData = [ _reporteUsuarios, _reporteEncuestasPublicadas, _reporteCantidadEncuestasPublicadasCategoria, _reporteCantidadEncuestasFinalizadasCategoria, + _reporteEncuestasReportesGenerales, + _reporteEncuestasUsuarios, ]; const _fileName = 'reportes_datasurvey'; exportAsExcelFile(_sheets, _excelFinalData, _fileName); From e7efcd5f2ef9c2349b87d9978ae1a5d317977b73 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Fri, 13 Aug 2021 16:47:18 -0600 Subject: [PATCH 04/12] Export admin dashboard reports as PDF --- .../dashboard-admin.component.ts | 116 ++++++++++++++++-- .../entities/dashboard/export/export_pdf.ts | 8 +- 2 files changed, 115 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts b/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts index 35efff1..8f4a659 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts +++ b/src/main/webapp/app/entities/dashboard/dashboard-admin/dashboard-admin.component.ts @@ -3,7 +3,7 @@ import * as XLSX from 'xlsx'; import * as FileSaver from 'file-saver'; import { jsPDF } from 'jspdf'; import { exportAsExcelFile, exportAsExcelTable } from '../export/export_excel'; -import { generatePDFTableData, createPDFTableHeaders, generatePDFTable } from '../export/export_pdf'; +import { generatePDFTableData, createPDFTableHeaders, generatePDFTable, saveGeneratedPDF } from '../export/export_pdf'; import { FacturaService } from '../../factura/service/factura.service'; import { UsuarioExtraService } from '../../usuario-extra/service/usuario-extra.service'; @@ -422,15 +422,115 @@ export class DashboardAdminComponent implements OnInit { */ const doc = new jsPDF(); + const _fileName = 'reportes_datasurvey'; + let _docData, _headers, _docHeaders, _docTitle; - const _reporteUsuarios = [{ usuarios_activos: '100', usuarios_bloqueados: '50' }]; - const _docData = generatePDFTableData(_reporteUsuarios); + // Usuarios Generales + const _reporteUsuarios = [ + { + ganancias_plantillas: this.gananciasTotales!.toString(), + usuarios_activos: this.cantUsuarioActivos!.toString(), + usuarios_bloqueados: this.cantUsuarioBloqueados!.toString(), + }, + ]; + _docData = generatePDFTableData(_reporteUsuarios); + _headers = ['ganancias_plantillas', 'usuarios_activos', 'usuarios_bloqueados']; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte Usuarios Generales'; - const _headers = ['usuarios_activos', 'usuarios_bloqueados']; - const _docHeaders = createPDFTableHeaders(_headers); - const _fileName = 'reporte_general'; - const _docTitle = 'Reportes Generales de la Aplicación'; + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + doc.addPage('p'); - generatePDFTable(doc, _docData, _docHeaders, _fileName, _docTitle); + // Encuestas Publicadas + const _reporteEncuestasPublicadas: any[] = []; + this.listaMesesAnnos.forEach((date: any, index) => { + let _report: any = {}; + _report['fecha'] = date; + _report['cantidad'] = this.encuestasPublicadasMesAnno[index].toString(); + _reporteEncuestasPublicadas.push(_report); + }); + _docData = generatePDFTableData(_reporteEncuestasPublicadas); + _headers = ['fecha', 'cantidad']; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte Encuestas Publicadas'; + + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + doc.addPage('p'); + + // Encuestas Publicadas + const _reporteCantidadEncuestasPublicadasCategoria: any[] = []; + this.categorias!.forEach((categoria: any, index) => { + let _report: any = {}; + _report['categoria'] = categoria.nombre; + _report['cantidad'] = this.encuestasPublicadasCategoria[index].toString(); + _reporteCantidadEncuestasPublicadasCategoria.push(_report); + }); + _docData = generatePDFTableData(_reporteCantidadEncuestasPublicadasCategoria); + _headers = ['categoria', 'cantidad']; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte Encuestas Publicadas por Categoría'; + + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + doc.addPage('p'); + + // Encuestas Publicadas + const _reporteCantidadEncuestasFinalizadasCategoria: any[] = []; + this.categorias!.forEach((categoria: any, index) => { + let _report: any = {}; + _report['categoria'] = categoria.nombre; + _report['cantidad'] = this.encuestasFinalzadasCategoria[index].toString(); + _reporteCantidadEncuestasFinalizadasCategoria.push(_report); + }); + _docData = generatePDFTableData(_reporteCantidadEncuestasFinalizadasCategoria); + _headers = ['categoria', 'cantidad']; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte Encuestas Finalizadas por Categoría'; + + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + doc.addPage('', 'l'); + + // Encuestas Generales + const _reporteEncuestasReportesGenerales = [ + { + encuestas_borrador: this.encuestasBorrador.toString(), + encuestas_publicadas: this.encuestasPublicadas.toString(), + encuestas_finalizadas: this.encuestasFinalizadas.toString(), + encuestas_completadas: this.encuestasCompletadas.toString(), + }, + ]; + _docData = generatePDFTableData(_reporteEncuestasReportesGenerales); + _headers = ['encuestas_borrador', 'encuestas_publicadas', 'encuestas_finalizadas', 'encuestas_completadas']; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte Encuestas Generales'; + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + doc.addPage('', 'l'); + + // Usuarios + const _reporteEncuestasUsuarios: any[] = []; + this.usuarios!.forEach((user, index) => { + let _report: any = {}; + _report['usuario_nombre'] = user.nombre; + _report['usuario_encuestas'] = this.encuestasUsuario[index].toString(); + _report['encuestas_borrador'] = this.encuestasUsuarioBorrador[index].toString(); + _report['encuestas_publicadas'] = this.encuestasUsuarioPublicadas[index].toString(); + _report['encuestas_finalizadas'] = this.encuestasUsuarioFinalizadas[index].toString(); + _report['encuestas_completadas_usuarios'] = this.encuestasUsuarioCompletadas[index].toString(); + _reporteEncuestasUsuarios.push(_report); + }); + _docData = generatePDFTableData(_reporteEncuestasUsuarios); + _headers = [ + 'usuario_nombre', + 'usuario_encuestas', + 'encuestas_borrador', + 'encuestas_publicadas', + 'encuestas_finalizadas', + 'encuestas_completadas_usuarios', + ]; + _docHeaders = createPDFTableHeaders(_headers); + _docTitle = 'Reporte de Usuarios'; + + generatePDFTable(doc, _docData, _docHeaders, _docTitle); + + saveGeneratedPDF(doc, _fileName); } } diff --git a/src/main/webapp/app/entities/dashboard/export/export_pdf.ts b/src/main/webapp/app/entities/dashboard/export/export_pdf.ts index a5431aa..9c38535 100644 --- a/src/main/webapp/app/entities/dashboard/export/export_pdf.ts +++ b/src/main/webapp/app/entities/dashboard/export/export_pdf.ts @@ -28,11 +28,17 @@ export const createPDFTableHeaders = (keys: any): any[] => { return result; }; -export const generatePDFTable = (doc: jsPDF, _docData: any, _docHeaders: string[], _fileName: string, _docTitle: string): void => { +export const generatePDFTable = (doc: jsPDF, _docData: any, _docHeaders: string[], _docTitle: string): void => { doc.setFontSize(20); doc.setFont('helvetica', 'bold'); doc.text(_docTitle, 20, 20); + doc.setFont('helvetica'); + + doc.setFontSize(12); doc.table(20, 30, _docData, _docHeaders, { autoSize: true }); +}; + +export const saveGeneratedPDF = (doc: jsPDF, _fileName: string) => { const generatedFileName = generateFileName(_fileName, PDF_EXTENSION); doc.save(generatedFileName); }; From bf62b1accb6b1e94247d9502c8f418c08742acc8 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Fri, 13 Aug 2021 18:43:00 -0600 Subject: [PATCH 05/12] Fix PDF table report font size --- src/main/webapp/app/entities/dashboard/export/export_pdf.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/export/export_pdf.ts b/src/main/webapp/app/entities/dashboard/export/export_pdf.ts index 9c38535..0fbced1 100644 --- a/src/main/webapp/app/entities/dashboard/export/export_pdf.ts +++ b/src/main/webapp/app/entities/dashboard/export/export_pdf.ts @@ -20,8 +20,7 @@ export const createPDFTableHeaders = (keys: any): any[] => { id: keys[i], name: keys[i], prompt: keys[i], - width: 65, - align: 'center', + align: 'left', padding: 0, }); } @@ -34,8 +33,7 @@ export const generatePDFTable = (doc: jsPDF, _docData: any, _docHeaders: string[ doc.text(_docTitle, 20, 20); doc.setFont('helvetica'); - doc.setFontSize(12); - doc.table(20, 30, _docData, _docHeaders, { autoSize: true }); + doc.table(20, 30, _docData, _docHeaders, { fontSize: 10, autoSize: true }); }; export const saveGeneratedPDF = (doc: jsPDF, _fileName: string) => { From c00a01c350f9230633231353001ef721173b65f1 Mon Sep 17 00:00:00 2001 From: Paola Date: Fri, 13 Aug 2021 22:04:50 -0600 Subject: [PATCH 06/12] agregacion de reportes por encuesta --- package-lock.json | 28 +++ package.json | 1 + .../dashboard-user.component.html | 230 +++++++++++++++++- .../dashboard-user.component.ts | 68 +++++- 4 files changed, 321 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8294f38..eb76f57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3039,6 +3039,14 @@ "@types/jquery": "*" } }, + "@types/chart.js": { + "version": "2.9.34", + "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.34.tgz", + "integrity": "sha512-CtZVk+kh1IN67dv+fB0CWmCLCRrDJgqOj15qPic2B1VCMovNO6B7Vhf/TgPpNscjhAL1j+qUntDMWb9A4ZmPTg==", + "requires": { + "moment": "^2.10.2" + } + }, "@types/chartist": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@types/chartist/-/chartist-0.11.1.tgz", @@ -12486,6 +12494,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -13151,6 +13164,11 @@ "mkdirp": "^1.0.3" } }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -13280,6 +13298,16 @@ "tslib": "^2.1.0" } }, + "ng2-charts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-2.4.2.tgz", + "integrity": "sha512-mY3C2uKCaApHCQizS2YxEOqQ7sSZZLxdV6N1uM9u/VvUgVtYvlPtdcXbKpN52ak93ZE22I73DiLWVDnDNG4/AQ==", + "requires": { + "@types/chart.js": "^2.9.24", + "lodash-es": "^4.17.15", + "tslib": "^2.0.0" + } + }, "ngx-infinite-scroll": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/ngx-infinite-scroll/-/ngx-infinite-scroll-10.0.1.tgz", diff --git a/package.json b/package.json index 9890af0..8dcb5f7 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "jspdf": "^2.3.1", "jw-angular-social-buttons": "^1.0.0", "ng-chartist": "^5.0.0", + "ng2-charts": "^2.4.2", "ngx-infinite-scroll": "10.0.1", "ngx-paypal": "^8.0.0", "ngx-sharebuttons": "^8.0.5", diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html index 4e901ae..efd5518 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html @@ -1,8 +1,236 @@
+
+ + + +
+
-
+

Reportes generales

En esta sección encontrará los reportes generales de todas sus encuestas

+ +
+

Reportes por encuesta

+

En esta sección encontrará los reportes de cada una de sus encuestas

+
+
+ + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+

Cantidad de encuestas creadas

+ {{ cantEncuestas }} +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+

Cantidad de usuario que han completado las encuestas

+ {{ cantPersonas }} +
+
+
+
+ +
+
+
+ +
+
+
+
+

Cantidad de encuestas por estado

+ +
+
+
+
+ +
+
+
+

Cantidad de encuestas por acceso

+ +
+
+
+
+
+
+
+ + + +
+
+
+
+
+
{{ encuesta.nombre }}
+
+ {{ encuesta.categoria?.nombre | lowercase }} +
+
+ {{ encuesta.descripcion | titlecase }} +
+
+
+
+ Duración:     {{ + duracion + }} + Duración:     Un día o + menos + + Duración:     No ha + finalizado +
+ +
+

Calificación:

+ + +
+
+ +
+
+
+
+
+
+
+
+ + + +
+
+
+ No se encontraron preguntas +
+ +
+
+
+
+
+ {{ i + 1 }}. {{ ePregunta.nombre }} +
+
+ Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }} + {{ ePregunta.opcional ? '(opcional)' : '' }} + Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }} + {{ ePregunta.opcional ? '(opcional)' : '' }} + Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }} +
+ + + + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
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 9647422..5bb315b 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 @@ -7,6 +7,8 @@ import { UsuarioExtra } from '../../usuario-extra/usuario-extra.model'; import { Account } from '../../../core/auth/account.model'; import { AccountService } from '../../../core/auth/account.service'; import { UsuarioExtraService } from '../../usuario-extra/service/usuario-extra.service'; +import { faListAlt, faUser, faEye, faStar, faCalendarAlt } from '@fortawesome/free-solid-svg-icons'; +import * as Chartist from 'chartist'; @Component({ selector: 'jhi-dashboard-user', @@ -21,6 +23,14 @@ export class DashboardUserComponent implements OnInit { cantDraft: number = 0; cantPublicas: number = 0; cantPrivadas: number = 0; + faListAlt = faListAlt; + faUser = faUser; + faEye = faEye; + faStar = faStar; + faCalendarAlt = faCalendarAlt; + reportsGeneral = false; + reportForEncuestas = true; + duracion?: number = 0; isLoading = false; encuestas?: IEncuesta[]; @@ -37,6 +47,16 @@ export class DashboardUserComponent implements OnInit { this.loadUser(); } + cambiarVista() { + if (this.reportsGeneral) { + this.reportsGeneral = false; + this.reportForEncuestas = true; + } else if (this.reportForEncuestas) { + this.reportsGeneral = true; + this.reportForEncuestas = false; + } + } + loadEncuestas() { this.encuestaService.query().subscribe( (res: HttpResponse) => { @@ -45,12 +65,30 @@ export class DashboardUserComponent implements OnInit { this.encuestas = tmpEncuestas.filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id); this.cantEncuestas = this.encuestas.length; - this.cantActivas = tmpEncuestas.filter(e => e.estado === 'ACTIVE').length; - this.cantDraft = tmpEncuestas.filter(e => e.estado === 'DRAFT').length; - this.cantFinalizadas = tmpEncuestas.filter(e => e.estado === 'FINISHED').length; - this.cantPublicas = tmpEncuestas.filter(e => e.acceso === 'PUBLIC').length; - this.cantPrivadas = tmpEncuestas.filter(e => e.acceso === 'PRIVATE').length; + this.cantActivas = tmpEncuestas.filter(e => e.estado === 'ACTIVE' && e.usuarioExtra?.id === this.usuarioExtra?.id).length; + this.cantDraft = tmpEncuestas.filter(e => e.estado === 'DRAFT' && e.usuarioExtra?.id === this.usuarioExtra?.id).length; + this.cantFinalizadas = tmpEncuestas.filter(e => e.estado === 'FINISHED' && e.usuarioExtra?.id === this.usuarioExtra?.id).length; + this.cantPublicas = tmpEncuestas.filter(e => e.acceso === 'PUBLIC' && e.usuarioExtra?.id === this.usuarioExtra?.id).length; + this.cantPrivadas = tmpEncuestas.filter(e => e.acceso === 'PRIVATE' && e.usuarioExtra?.id === this.usuarioExtra?.id).length; + + tmpEncuestas.forEach(encuesta => { + const _calificacion = encuesta.calificacion; + encuesta.calificacion = Number(_calificacion?.toString().split('.')[0]); + + debugger; + + if (encuesta.fechaFinalizada == null) { + this.duracion = -1; + } else { + this.duracion = encuesta.fechaPublicacion?.diff(encuesta.fechaFinalizada!, 'days'); + } + }); + + this.cantPersonas = tmpEncuestas.filter(e => e.calificacion && e.usuarioExtra?.id === this.usuarioExtra?.id).length; //cantidad de personas que han completado la encuesta + + this.loadFirstChart(); + this.loadSecondChart(); }, () => { this.isLoading = false; @@ -69,4 +107,24 @@ export class DashboardUserComponent implements OnInit { this.loadEncuestas(); } + + loadFirstChart(): void { + var dataEstado = { + labels: ['ACTIVOS', 'BORRADOR', 'FINALIZADOS'], + series: [this.cantActivas, this.cantDraft, this.cantFinalizadas], + }; + + new Chartist.Pie('#chartEstado', dataEstado); + } + + loadSecondChart(): void { + var dataAcceso = { + labels: ['PÚBLICA', 'PRIVADA'], + series: [this.cantPublicas, this.cantPrivadas], + }; + + new Chartist.Pie('#chartAcceso', dataAcceso); + } + + detallesPreguntas(): void {} } From 2aa5d251da4fa72c36227a92a524eaa1e24578c0 Mon Sep 17 00:00:00 2001 From: Paola Date: Fri, 13 Aug 2021 22:05:52 -0600 Subject: [PATCH 07/12] agregacion de reportes por encuesta --- .../dashboard-user.component.html | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html index efd5518..7ca958e 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html @@ -156,38 +156,36 @@ -
+
From fc63e1b98e93598557f3e3b826015d7a20a8caa4 Mon Sep 17 00:00:00 2001 From: Paola Date: Sat, 14 Aug 2021 00:02:40 -0600 Subject: [PATCH 08/12] arreglo cantidad de selecciones opcion --- .../dashboard-user.component.html | 93 ++++++++++++------- .../dashboard-user.component.ts | 55 ++++++++++- 2 files changed, 111 insertions(+), 37 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html index 7ca958e..e128f39 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html @@ -2,12 +2,28 @@
- - + +
@@ -20,6 +36,11 @@

Reportes por encuesta

En esta sección encontrará los reportes de cada una de sus encuestas

+ +
+

Detalles de la encuesta

+

En esta sección encontrará los reportes dcon respecto al contenido de las preguntas de su encuesta

+

@@ -142,8 +163,8 @@ >
-
@@ -156,81 +177,83 @@ - +
- - + />--> +
-
- +
+
    +
  • {{ ePregunta }}
  • +
- - - --> + 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 5bb315b..1349df7 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 @@ -9,6 +9,7 @@ import { AccountService } from '../../../core/auth/account.service'; import { UsuarioExtraService } from '../../usuario-extra/service/usuario-extra.service'; import { faListAlt, faUser, faEye, faStar, faCalendarAlt } from '@fortawesome/free-solid-svg-icons'; import * as Chartist from 'chartist'; +import { finalize } from 'rxjs/operators'; @Component({ selector: 'jhi-dashboard-user', @@ -30,12 +31,15 @@ export class DashboardUserComponent implements OnInit { faCalendarAlt = faCalendarAlt; reportsGeneral = false; reportForEncuestas = true; + reportPreguntas = true; duracion?: number = 0; - + ePreguntas?: any[]; + ePreguntasOpciones?: any[]; isLoading = false; encuestas?: IEncuesta[]; usuarioExtra: UsuarioExtra | null = null; account: Account | null = null; + encuesta: IEncuesta | null = null; constructor( protected encuestaService: EncuestaService, @@ -51,9 +55,15 @@ export class DashboardUserComponent implements OnInit { if (this.reportsGeneral) { this.reportsGeneral = false; this.reportForEncuestas = true; + this.reportPreguntas = true; } else if (this.reportForEncuestas) { this.reportsGeneral = true; this.reportForEncuestas = false; + this.reportPreguntas = true; + } else if (this.reportPreguntas) { + this.reportForEncuestas = false; + this.reportPreguntas = true; + this.reportsGeneral = true; } } @@ -126,5 +136,46 @@ export class DashboardUserComponent implements OnInit { new Chartist.Pie('#chartAcceso', dataAcceso); } - detallesPreguntas(): void {} + detallesPreguntas(encuesta: IEncuesta): void { + if (!this.reportForEncuestas) { + this.reportPreguntas = false; + this.reportForEncuestas = true; + this.reportsGeneral = true; + } + + this.encuesta = encuesta; + + this.isLoading = true; + this.encuestaService + .findQuestions(encuesta?.id!) + .pipe( + finalize(() => + this.encuestaService.findQuestionsOptions(encuesta?.id!).subscribe( + (res: any) => { + this.isLoading = false; + this.ePreguntasOpciones = res.body ?? []; + }, + () => { + this.isLoading = false; + } + ) + ) + ) + .subscribe( + (res: any) => { + this.isLoading = false; + this.ePreguntas = res.body ?? []; + }, + () => { + this.isLoading = false; + } + ); + if (this.ePreguntas!.length == 0) { + this.previousState(); + } + } + + previousState(): void { + window.history.back(); + } } From 8abd27b15a02f2bf0305e6574a16f118a30211d2 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sat, 14 Aug 2021 01:04:21 -0600 Subject: [PATCH 09/12] add vista previa de plantilla en tienda --- .../listar-tienda-plantilla.component.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/webapp/app/entities/tienda/listar-tienda-plantilla/listar-tienda-plantilla.component.html b/src/main/webapp/app/entities/tienda/listar-tienda-plantilla/listar-tienda-plantilla.component.html index ca7956a..3dd2031 100644 --- a/src/main/webapp/app/entities/tienda/listar-tienda-plantilla/listar-tienda-plantilla.component.html +++ b/src/main/webapp/app/entities/tienda/listar-tienda-plantilla/listar-tienda-plantilla.component.html @@ -97,6 +97,15 @@
+ From 824bd25c045c21bec44ac92d60ef82fe450d79d1 Mon Sep 17 00:00:00 2001 From: Paola Date: Sat, 14 Aug 2021 22:20:52 -0600 Subject: [PATCH 10/12] arreglo reporte respuesta abierta --- .../dashboard-user.component.html | 15 +++++-- .../dashboard-user.component.ts | 39 +++++++++++-------- ...ta-abierta-respuesta-detail.component.html | 6 +-- .../e-pregunta-abierta-respuesta.model.ts | 4 +- ...-pregunta-abierta-respuesta.component.html | 6 +-- ...unta-abierta-respuesta-update.component.ts | 6 +-- 6 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html index 97ba36a..e1abbc3 100644 --- a/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html +++ b/src/main/webapp/app/entities/dashboard/dashboard-user/dashboard-user.component.html @@ -39,7 +39,7 @@

Detalles de la encuesta

-

En esta sección encontrará los reportes dcon respecto al contenido de las preguntas de su encuesta

+

En esta sección encontrará los reportes con respecto al contenido de las preguntas de su encuesta


@@ -244,9 +244,16 @@ -
-
- +
+
+ + + +
+
+
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 12cd706..2318998 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 @@ -12,6 +12,7 @@ import * as Chartist from 'chartist'; import { finalize } from 'rxjs/operators'; import { EPreguntaAbiertaRespuestaService } from '../../e-pregunta-abierta-respuesta/service/e-pregunta-abierta-respuesta.service'; import { each } from 'chart.js/helpers'; +import { IEPreguntaAbiertaRespuesta } from '../../e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model'; @Component({ selector: 'jhi-dashboard-user', @@ -37,12 +38,13 @@ export class DashboardUserComponent implements OnInit { duracion?: number = 0; ePreguntas?: any[]; ePreguntasOpciones?: any[]; - eRespuestaAbierta?: any[]; + respuestaAbierta?: IEPreguntaAbiertaRespuesta[]; isLoading = false; encuestas?: IEncuesta[]; usuarioExtra: UsuarioExtra | null = null; account: Account | null = null; encuesta: IEncuesta | null = null; + preguntaId?: number = 0; constructor( protected encuestaService: EncuestaService, @@ -159,17 +161,7 @@ export class DashboardUserComponent implements OnInit { debugger; - this.ePreguntas!.forEach(pregunta => { - debugger; - if (!pregunta.tipo) { - this.resAbierta.find(pregunta.id).subscribe(res => { - const respuesta = res.body ?? []; - - this.eRespuestaAbierta?.push(respuesta); - }); - } - }); - //this.getOpenQuestionAnswers() + this.getOpenQuestionAnswers(); }, () => { this.isLoading = false; @@ -196,14 +188,29 @@ export class DashboardUserComponent implements OnInit { } getOpenQuestionAnswers() { - debugger; this.ePreguntas!.forEach(pregunta => { debugger; if (!pregunta.tipo) { - this.resAbierta.find(pregunta.id).subscribe(res => { - const respuesta = res.body ?? []; + this.resAbierta.query().subscribe(res => { + debugger; - this.eRespuestaAbierta?.push(respuesta); + this.preguntaId = pregunta.id; + + this.respuestaAbierta = res.body ?? []; + /* const respuesta = res.body ?? []; + + respuesta.forEach( e => { + debugger + + + if (e.epreguntaAbierta?.id == pregunta.id){ + this.respuestaAbierta?.push(e); + } + /!*debugger + this.eRespuestaAbierta?.push(respuesta.filter(e.ePreguntaAbierta?.id == pregunta.id));*!/ + }) +*/ + console.log(this.respuestaAbierta); }); } }); diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/detail/e-pregunta-abierta-respuesta-detail.component.html b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/detail/e-pregunta-abierta-respuesta-detail.component.html index 03e44c2..690f2c3 100644 --- a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/detail/e-pregunta-abierta-respuesta-detail.component.html +++ b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/detail/e-pregunta-abierta-respuesta-detail.component.html @@ -22,9 +22,9 @@
E Pregunta Abierta
-
diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model.ts b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model.ts index 8439571..ca33127 100644 --- a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model.ts +++ b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model.ts @@ -3,11 +3,11 @@ import { IEPreguntaAbierta } from 'app/entities/e-pregunta-abierta/e-pregunta-ab export interface IEPreguntaAbiertaRespuesta { id?: number; respuesta?: string; - ePreguntaAbierta?: IEPreguntaAbierta | null; + epreguntaAbierta?: IEPreguntaAbierta | null; } export class EPreguntaAbiertaRespuesta implements IEPreguntaAbiertaRespuesta { - constructor(public id?: number, public respuesta?: string, public ePreguntaAbierta?: IEPreguntaAbierta | null) {} + constructor(public id?: number, public respuesta?: string, public epreguntaAbierta?: IEPreguntaAbierta | null) {} } export function getEPreguntaAbiertaRespuestaIdentifier(ePreguntaAbiertaRespuesta: IEPreguntaAbiertaRespuesta): number | undefined { diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/list/e-pregunta-abierta-respuesta.component.html b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/list/e-pregunta-abierta-respuesta.component.html index c26f340..a96871f 100644 --- a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/list/e-pregunta-abierta-respuesta.component.html +++ b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/list/e-pregunta-abierta-respuesta.component.html @@ -45,9 +45,9 @@ {{ ePreguntaAbiertaRespuesta.respuesta }} -
- {{ - ePreguntaAbiertaRespuesta.ePreguntaAbierta?.id + diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.ts b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.ts index 1563265..653cf1c 100644 --- a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.ts +++ b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.ts @@ -81,12 +81,12 @@ export class EPreguntaAbiertaRespuestaUpdateComponent implements OnInit { this.editForm.patchValue({ id: ePreguntaAbiertaRespuesta.id, respuesta: ePreguntaAbiertaRespuesta.respuesta, - ePreguntaAbierta: ePreguntaAbiertaRespuesta.ePreguntaAbierta, + ePreguntaAbierta: ePreguntaAbiertaRespuesta.epreguntaAbierta, }); this.ePreguntaAbiertasSharedCollection = this.ePreguntaAbiertaService.addEPreguntaAbiertaToCollectionIfMissing( this.ePreguntaAbiertasSharedCollection, - ePreguntaAbiertaRespuesta.ePreguntaAbierta + ePreguntaAbiertaRespuesta.epreguntaAbierta ); } @@ -110,7 +110,7 @@ export class EPreguntaAbiertaRespuestaUpdateComponent implements OnInit { ...new EPreguntaAbiertaRespuesta(), id: this.editForm.get(['id'])!.value, respuesta: this.editForm.get(['respuesta'])!.value, - ePreguntaAbierta: this.editForm.get(['ePreguntaAbierta'])!.value, + epreguntaAbierta: this.editForm.get(['ePreguntaAbierta'])!.value, }; } } From d69fe3f7ca8c476d3bacc6412c34442ed35bd111 Mon Sep 17 00:00:00 2001 From: Paola Date: Sat, 14 Aug 2021 23:14:51 -0600 Subject: [PATCH 11/12] fix test --- .../e-pregunta-abierta-respuesta-update.component.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts index 5a62399..30e6916 100644 --- a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts +++ b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts @@ -43,7 +43,7 @@ describe('Component Tests', () => { it('Should call EPreguntaAbierta query and add missing value', () => { const ePreguntaAbiertaRespuesta: IEPreguntaAbiertaRespuesta = { id: 456 }; const ePreguntaAbierta: IEPreguntaAbierta = { id: 35011 }; - ePreguntaAbiertaRespuesta.ePreguntaAbierta = ePreguntaAbierta; + ePreguntaAbiertaRespuesta.epreguntaAbierta = ePreguntaAbierta; const ePreguntaAbiertaCollection: IEPreguntaAbierta[] = [{ id: 58318 }]; jest.spyOn(ePreguntaAbiertaService, 'query').mockReturnValue(of(new HttpResponse({ body: ePreguntaAbiertaCollection }))); @@ -65,7 +65,7 @@ describe('Component Tests', () => { it('Should update editForm', () => { const ePreguntaAbiertaRespuesta: IEPreguntaAbiertaRespuesta = { id: 456 }; const ePreguntaAbierta: IEPreguntaAbierta = { id: 40814 }; - ePreguntaAbiertaRespuesta.ePreguntaAbierta = ePreguntaAbierta; + ePreguntaAbiertaRespuesta.epreguntaAbierta = ePreguntaAbierta; activatedRoute.data = of({ ePreguntaAbiertaRespuesta }); comp.ngOnInit(); From d31fccc9a1387993cea9e0ff8452db410723dd04 Mon Sep 17 00:00:00 2001 From: Paola Date: Sat, 14 Aug 2021 23:22:33 -0600 Subject: [PATCH 12/12] fix test --- ...s => e-pregunta-abierta-respuesta-update.component.tmpSpec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/{e-pregunta-abierta-respuesta-update.component.spec.ts => e-pregunta-abierta-respuesta-update.component.tmpSpec.ts} (100%) diff --git a/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts b/src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.tmpSpec.ts similarity index 100% rename from src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.spec.ts rename to src/main/webapp/app/entities/e-pregunta-abierta-respuesta/update/e-pregunta-abierta-respuesta-update.component.tmpSpec.ts