Merge branch 'dev' into feature/ver-reportes-colaborador
This commit is contained in:
		
						commit
						ac864a5739
					
				| 
						 | 
				
			
			@ -1,8 +1,9 @@
 | 
			
		|||
{
 | 
			
		||||
  "name": "data-survey",
 | 
			
		||||
  "version": "0.0.1-SNAPSHOT",
 | 
			
		||||
  "lockfileVersion": 2,
 | 
			
		||||
  "lockfileVersion": 1,
 | 
			
		||||
  "requires": true,
 | 
			
		||||
 | 
			
		||||
  "packages": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "name": "data-survey",
 | 
			
		||||
| 
						 | 
				
			
			@ -31003,6 +31004,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",
 | 
			
		||||
| 
						 | 
				
			
			@ -33023,6 +33032,11 @@
 | 
			
		|||
      "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "chart.js": {
 | 
			
		||||
      "version": "3.5.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.5.0.tgz",
 | 
			
		||||
      "integrity": "sha512-J1a4EAb1Gi/KbhwDRmoovHTRuqT8qdF0kZ4XgwxpGethJHUdDrkqyPYwke0a+BuvSeUxPf8Cos6AX2AB8H8GLA=="
 | 
			
		||||
    },
 | 
			
		||||
    "chartist": {
 | 
			
		||||
      "version": "0.11.4",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/chartist/-/chartist-0.11.4.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -40466,6 +40480,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",
 | 
			
		||||
| 
						 | 
				
			
			@ -41129,6 +41148,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",
 | 
			
		||||
| 
						 | 
				
			
			@ -41258,6 +41282,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",
 | 
			
		||||
| 
						 | 
				
			
			@ -42217,8 +42251,7 @@
 | 
			
		|||
    "performance-now": {
 | 
			
		||||
      "version": "2.1.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
 | 
			
		||||
      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
 | 
			
		||||
      "devOptional": true
 | 
			
		||||
      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
 | 
			
		||||
    },
 | 
			
		||||
    "picomatch": {
 | 
			
		||||
      "version": "2.3.0",
 | 
			
		||||
| 
						 | 
				
			
			@ -44514,6 +44547,7 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "regenerator-runtime": {
 | 
			
		||||
 | 
			
		||||
      "version": "0.13.9",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
 | 
			
		||||
      "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==",
 | 
			
		||||
| 
						 | 
				
			
			@ -46142,23 +46176,6 @@
 | 
			
		|||
        "readable-stream": "^3.0.6"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "string_decoder": {
 | 
			
		||||
      "version": "1.3.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
 | 
			
		||||
      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "safe-buffer": "~5.2.0"
 | 
			
		||||
      },
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "safe-buffer": {
 | 
			
		||||
          "version": "5.2.1",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
 | 
			
		||||
          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
 | 
			
		||||
          "dev": true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "string-argv": {
 | 
			
		||||
      "version": "0.3.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -46185,6 +46202,23 @@
 | 
			
		|||
        "strip-ansi": "^6.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "string_decoder": {
 | 
			
		||||
      "version": "1.3.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
 | 
			
		||||
      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "safe-buffer": "~5.2.0"
 | 
			
		||||
      },
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "safe-buffer": {
 | 
			
		||||
          "version": "5.2.1",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
 | 
			
		||||
          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
 | 
			
		||||
          "dev": true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "stringify-object": {
 | 
			
		||||
      "version": "3.3.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -48133,15 +48167,6 @@
 | 
			
		|||
          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
 | 
			
		||||
          "dev": true
 | 
			
		||||
        },
 | 
			
		||||
        "string_decoder": {
 | 
			
		||||
          "version": "1.1.1",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
 | 
			
		||||
          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
 | 
			
		||||
          "dev": true,
 | 
			
		||||
          "requires": {
 | 
			
		||||
            "safe-buffer": "~5.1.0"
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "string-width": {
 | 
			
		||||
          "version": "3.1.0",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -48170,6 +48195,15 @@
 | 
			
		|||
            }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "string_decoder": {
 | 
			
		||||
          "version": "1.1.1",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
 | 
			
		||||
          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
 | 
			
		||||
          "dev": true,
 | 
			
		||||
          "requires": {
 | 
			
		||||
            "safe-buffer": "~5.1.0"
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "strip-ansi": {
 | 
			
		||||
          "version": "3.0.1",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,6 +86,7 @@
 | 
			
		|||
    "@types/gapi.auth2": "0.0.54",
 | 
			
		||||
    "angularx-social-login": "^4.0.1",
 | 
			
		||||
    "bootstrap": "4.6.0",
 | 
			
		||||
    "chart.js": "^3.5.0",
 | 
			
		||||
    "chartist": "^0.11.4",
 | 
			
		||||
    "dayjs": "1.10.5",
 | 
			
		||||
    "file-saver": "^2.0.5",
 | 
			
		||||
| 
						 | 
				
			
			@ -93,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",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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';
 | 
			
		||||
| 
						 | 
				
			
			@ -313,7 +313,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 = [
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -353,13 +360,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);
 | 
			
		||||
| 
						 | 
				
			
			@ -382,15 +420,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);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1,266 @@
 | 
			
		|||
<p>dashboard-user works!</p>
 | 
			
		||||
<div class="content">
 | 
			
		||||
  <div class="py-2">
 | 
			
		||||
    <!--<button type="button" class="ds-btn ds-btn--primary" (click)="exportReportesGeneralesUserExcel()">Exportar como Excel</button>
 | 
			
		||||
    <button type="button" class="ds-btn ds-btn--primary" (click)="exportReportesGeneralesUserPDF()">Exportar como PDF</button>-->
 | 
			
		||||
    <button
 | 
			
		||||
      type="button"
 | 
			
		||||
      [hidden]="!reportsGeneral || reportForEncuestas"
 | 
			
		||||
      class="ds-btn ds-btn--primary"
 | 
			
		||||
      style="float: right"
 | 
			
		||||
      (click)="cambiarVista()"
 | 
			
		||||
    >
 | 
			
		||||
      Ver reportes generales
 | 
			
		||||
    </button>
 | 
			
		||||
    <button
 | 
			
		||||
      type="button"
 | 
			
		||||
      [hidden]="!reportForEncuestas || reportsGeneral"
 | 
			
		||||
      class="ds-btn ds-btn--primary"
 | 
			
		||||
      style="float: right"
 | 
			
		||||
      (click)="cambiarVista()"
 | 
			
		||||
    >
 | 
			
		||||
      Ver reportes por encuestas
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button type="button" [hidden]="reportPreguntas" class="ds-btn ds-btn--primary" style="float: right" (click)="cambiarVista()">
 | 
			
		||||
      Volver
 | 
			
		||||
    </button>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
    <div class="py-2" [hidden]="reportsGeneral">
 | 
			
		||||
      <h1>Reportes generales</h1>
 | 
			
		||||
      <h2>En esta sección encontrará los reportes generales de todas sus encuestas</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="py-2" [hidden]="reportForEncuestas">
 | 
			
		||||
      <h1>Reportes por encuesta</h1>
 | 
			
		||||
      <h2>En esta sección encontrará los reportes de cada una de sus encuestas</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="py-2" [hidden]="reportPreguntas">
 | 
			
		||||
      <h1>Detalles de la encuesta</h1>
 | 
			
		||||
      <h2>En esta sección encontrará los reportes con respecto al contenido de las preguntas de su encuesta</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
    <hr />
 | 
			
		||||
 | 
			
		||||
    <!--REPORTES GENERALES-->
 | 
			
		||||
    <div class="container-fluid py-5" [hidden]="reportsGeneral">
 | 
			
		||||
      <div class="">
 | 
			
		||||
        <div class="row justify-content-around">
 | 
			
		||||
          <div class="col-lg-3 col-sm-6">
 | 
			
		||||
            <div class="card">
 | 
			
		||||
              <div class="card-content">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                  <div class="col-xs-5 w-25 px-1">
 | 
			
		||||
                    <div class="icon-big icon-success text-center">
 | 
			
		||||
                      <fa-icon [icon]="faListAlt"></fa-icon>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="col-xs-7 w-50">
 | 
			
		||||
                    <div class="numbers">
 | 
			
		||||
                      <p class="ds-title--small">Cantidad de encuestas creadas</p>
 | 
			
		||||
                      {{ cantEncuestas }}
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="card-footer">
 | 
			
		||||
                <hr />
 | 
			
		||||
                <br />
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="col-lg-3 col-sm-6">
 | 
			
		||||
            <div class="card">
 | 
			
		||||
              <div class="card-content">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                  <div class="col-xs-5 w-25 px-1">
 | 
			
		||||
                    <div class="icon-big icon-users-active text-center">
 | 
			
		||||
                      <fa-icon [icon]="faUser"></fa-icon>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="col-xs-7 w-50">
 | 
			
		||||
                    <div class="numbers">
 | 
			
		||||
                      <p class="ds-title--small">Cantidad de usuario que han completado las encuestas</p>
 | 
			
		||||
                      {{ cantPersonas }}
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="card-footer">
 | 
			
		||||
                <hr />
 | 
			
		||||
                <br />
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="row justify-content-around por-categoria">
 | 
			
		||||
          <div class="col-md-5">
 | 
			
		||||
            <div class="grafico-encuestas-fecha">
 | 
			
		||||
              <div class="card" height="300" width="300">
 | 
			
		||||
                <h1 class="ds-title">Cantidad de encuestas por estado</h1>
 | 
			
		||||
 | 
			
		||||
                <div id="chartEstado" class="ct-chart ct-major-tenth"></div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="col-md-5">
 | 
			
		||||
            <div class="grafico-encuestas-fecha">
 | 
			
		||||
              <div class="card" height="300" width="300">
 | 
			
		||||
                <h1 class="ds-title">Cantidad de encuestas por acceso</h1>
 | 
			
		||||
 | 
			
		||||
                <div id="chartAcceso" class="ct-chart ct-major-tenth"></div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!--REPORTE POR ENCUESTA-->
 | 
			
		||||
 | 
			
		||||
    <div class="container-fluid" [hidden]="reportForEncuestas">
 | 
			
		||||
      <div class="row gx-5" *ngIf="encuestas && encuestas.length > 0">
 | 
			
		||||
        <div class="col-xl-4 col-lg-4 col-md-6 mb-5" *ngFor="let encuesta of encuestas">
 | 
			
		||||
          <div class="card-encuesta lift h-100" [attr.data-id]="encuesta.id">
 | 
			
		||||
            <div class="card-body p-3">
 | 
			
		||||
              <div class="card-title mb-0">{{ encuesta.nombre }}</div>
 | 
			
		||||
              <div class="entity-body--row m-2">
 | 
			
		||||
                <span class="tag mt-2">{{ encuesta.categoria?.nombre | lowercase }}</span>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="entity-body--row m-2">
 | 
			
		||||
                <span class="subtitle mt-2">{{ encuesta.descripcion | titlecase }}</span>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="text-xs text-gray-500">
 | 
			
		||||
                <div class="entity-body">
 | 
			
		||||
                  <div class="entity-body--row m-2">
 | 
			
		||||
                    <span class="mt-2" *ngIf="duracion! > 0"
 | 
			
		||||
                      ><fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon> Duración:     {{
 | 
			
		||||
                        duracion
 | 
			
		||||
                      }}</span
 | 
			
		||||
                    >
 | 
			
		||||
                    <span class="mt-2" *ngIf="duracion! == 0"
 | 
			
		||||
                      ><fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon> Duración:     Un día o
 | 
			
		||||
                      menos</span
 | 
			
		||||
                    >
 | 
			
		||||
 | 
			
		||||
                    <span class="mt-2" *ngIf="duracion! == -1"
 | 
			
		||||
                      ><fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon> Duración:     No ha
 | 
			
		||||
                      finalizado</span
 | 
			
		||||
                    >
 | 
			
		||||
                  </div>
 | 
			
		||||
 | 
			
		||||
                  <div class="entity-body--row m-2">
 | 
			
		||||
                    <p>Calificación:</p>
 | 
			
		||||
                    <fa-icon *ngFor="let i of [].constructor(encuesta.calificacion)" class="entity-icon--star" [icon]="faStar"></fa-icon>
 | 
			
		||||
                    <fa-icon
 | 
			
		||||
                      *ngFor="let i of [].constructor(5 - encuesta.calificacion!)"
 | 
			
		||||
                      class="entity-icon--star--off"
 | 
			
		||||
                      [icon]="faStar"
 | 
			
		||||
                    ></fa-icon>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="entity-body--row m-2">
 | 
			
		||||
                    <button (click)="detallesPreguntas(encuesta)" class="ds-btn btn-card ds-btn--primary">
 | 
			
		||||
                      <fa-icon [icon]="faEye"></fa-icon>  Detalle
 | 
			
		||||
                    </button>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!--REPORTES DE LAS PREGUNTAS-->
 | 
			
		||||
 | 
			
		||||
    <div class="container-fluid" *ngIf="encuesta" [hidden]="reportPreguntas">
 | 
			
		||||
      <div>
 | 
			
		||||
        <div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
 | 
			
		||||
          <span>No se encontraron preguntas</span>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="ds-survey preview-survey" id="entities" *ngIf="ePreguntas && ePreguntas.length > 0">
 | 
			
		||||
          <div class="ds-survey--all-question-wrapper col-8">
 | 
			
		||||
            <div class="ds-survey--question-wrapper card-encuesta" *ngFor="let ePregunta of ePreguntas; let i = index">
 | 
			
		||||
              <div
 | 
			
		||||
                [attr.data-index]="ePregunta.id"
 | 
			
		||||
                [attr.data-tipo]="ePregunta.tipo"
 | 
			
		||||
                [attr.data-opcional]="ePregunta.opcional"
 | 
			
		||||
                class="ds-survey--question"
 | 
			
		||||
              >
 | 
			
		||||
                <div class="ds-survey--titulo">
 | 
			
		||||
                  <span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div>
 | 
			
		||||
                  <span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
 | 
			
		||||
                    >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
 | 
			
		||||
                    {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
                  >
 | 
			
		||||
                  <span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
 | 
			
		||||
                    >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
 | 
			
		||||
                    {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
                  >
 | 
			
		||||
                  <span *ngIf="!ePregunta.tipo" class="ds-subtitle"
 | 
			
		||||
                    >Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
                  >
 | 
			
		||||
                </div>
 | 
			
		||||
                <ng-container *ngIf="ePregunta.tipo">
 | 
			
		||||
                  <ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index">
 | 
			
		||||
                    <ng-container *ngFor="let ePreguntaOpcionFinal of ePreguntaOpcion">
 | 
			
		||||
                      <ng-container *ngIf="ePregunta.id === ePreguntaOpcionFinal.epreguntaCerrada.id">
 | 
			
		||||
                        <div
 | 
			
		||||
                          class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
 | 
			
		||||
                          [attr.data-id]="ePreguntaOpcionFinal.id"
 | 
			
		||||
                        >
 | 
			
		||||
                          <div class="radio" *ngIf="ePregunta.tipo === 'SINGLE'">
 | 
			
		||||
                            <!--<input
 | 
			
		||||
                              type="text"
 | 
			
		||||
                              readonly
 | 
			
		||||
                              style="border-radius: 3px"
 | 
			
		||||
                              name="{{ 'radio' + ePregunta.id }}"
 | 
			
		||||
                              id="'radio'"
 | 
			
		||||
                            />-->
 | 
			
		||||
                            <label>{{
 | 
			
		||||
                              ePreguntaOpcionFinal.nombre + ' / Cantidad de veces seleccionada: ' + ePreguntaOpcionFinal.cantidad
 | 
			
		||||
                            }}</label>
 | 
			
		||||
                          </div>
 | 
			
		||||
                          <div class="checkbox" *ngIf="ePregunta.tipo === 'MULTIPLE'">
 | 
			
		||||
                            <!--<input
 | 
			
		||||
 | 
			
		||||
                              type="checkbox"
 | 
			
		||||
                              style="border-radius: 3px"
 | 
			
		||||
                              id="{{ 'checkbox' + ePreguntaOpcionFinal.id }}"
 | 
			
		||||
                            />-->
 | 
			
		||||
                            <label>{{
 | 
			
		||||
                              ePreguntaOpcionFinal.nombre + ' / Cantidad de veces seleccionada: ' + ePreguntaOpcionFinal.cantidad
 | 
			
		||||
                            }}</label>
 | 
			
		||||
                          </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                      </ng-container>
 | 
			
		||||
                    </ng-container>
 | 
			
		||||
                  </ng-container>
 | 
			
		||||
                </ng-container>
 | 
			
		||||
                <div *ngIf="!ePregunta.tipo">
 | 
			
		||||
                  <div *ngFor="let res of respuestaAbierta">
 | 
			
		||||
                    <!-- <ul>
 | 
			
		||||
                      <li *ngIf="res.epreguntaAbierta?.id == preguntaId"> {{ res.respuesta }}</li>
 | 
			
		||||
                    </ul>-->
 | 
			
		||||
                    <!-- <textarea readonly class="ds-survey--textarea" cols="33" rows="10" *ngIf="res.epreguntaAbierta?.id == preguntaId" > {{ res.respuesta }} </textarea>-->
 | 
			
		||||
 | 
			
		||||
                    <div *ngIf="res.epreguntaAbierta?.id == preguntaId">
 | 
			
		||||
                      <label> {{ '- ' + res.respuesta }}</label> <br />
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,14 +1,20 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { IUsuarioEncuesta } from '../../usuario-encuesta/usuario-encuesta.model';
 | 
			
		||||
import { IUsuarioExtra } from '../../usuario-extra/usuario-extra.model';
 | 
			
		||||
import { IUser } from '../../user/user.model';
 | 
			
		||||
import { UsuarioEncuestaService } from '../../usuario-encuesta/service/usuario-encuesta.service';
 | 
			
		||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { UsuarioExtraService } from '../../usuario-extra/service/usuario-extra.service';
 | 
			
		||||
import { ActivatedRoute, Router } from '@angular/router';
 | 
			
		||||
import { AccountService } from '../../../core/auth/account.service';
 | 
			
		||||
import { IUser } from '../../user/user.model';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import * as dayjs from 'dayjs';
 | 
			
		||||
import { IEncuesta } from '../../encuesta/encuesta.model';
 | 
			
		||||
import { EstadoEncuesta } from '../../enumerations/estado-encuesta.model';
 | 
			
		||||
import { EncuestaService } from '../../encuesta/service/encuesta.service';
 | 
			
		||||
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';
 | 
			
		||||
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',
 | 
			
		||||
| 
						 | 
				
			
			@ -17,35 +23,203 @@ import * as dayjs from 'dayjs';
 | 
			
		|||
})
 | 
			
		||||
export class DashboardUserComponent implements OnInit {
 | 
			
		||||
  usuarioEncuestas?: IUsuarioEncuesta[];
 | 
			
		||||
  usuarioExtra: IUsuarioExtra | null = null;
 | 
			
		||||
  user: IUser | null = null;
 | 
			
		||||
  cantEncuestas: number = 0;
 | 
			
		||||
  cantPersonas: number = 0;
 | 
			
		||||
  cantActivas: number = 0;
 | 
			
		||||
  cantFinalizadas: number = 0;
 | 
			
		||||
  cantDraft: number = 0;
 | 
			
		||||
  cantPublicas: number = 0;
 | 
			
		||||
  cantPrivadas: number = 0;
 | 
			
		||||
  faListAlt = faListAlt;
 | 
			
		||||
  faUser = faUser;
 | 
			
		||||
  faEye = faEye;
 | 
			
		||||
  faStar = faStar;
 | 
			
		||||
  faCalendarAlt = faCalendarAlt;
 | 
			
		||||
  reportsGeneral = false;
 | 
			
		||||
  reportForEncuestas = true;
 | 
			
		||||
  reportPreguntas = true;
 | 
			
		||||
  duracion?: number = 0;
 | 
			
		||||
  ePreguntas?: any[];
 | 
			
		||||
  ePreguntasOpciones?: any[];
 | 
			
		||||
  respuestaAbierta?: IEPreguntaAbiertaRespuesta[];
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  encuestas?: IEncuesta[];
 | 
			
		||||
  usuarioExtra: UsuarioExtra | null = null;
 | 
			
		||||
  account: Account | null = null;
 | 
			
		||||
  encuesta: IEncuesta | null = null;
 | 
			
		||||
  preguntaId?: number = 0;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected usuarioEncuestaService: UsuarioEncuestaService,
 | 
			
		||||
    protected modalService: NgbModal,
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    protected activatedRoute: ActivatedRoute,
 | 
			
		||||
    protected encuestaService: EncuestaService,
 | 
			
		||||
    protected accountService: AccountService,
 | 
			
		||||
    protected router: Router
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    protected usuarioEncuestaService: UsuarioEncuestaService,
 | 
			
		||||
    protected resAbierta: EPreguntaAbiertaRespuestaService
 | 
			
		||||
  ) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.loadUser();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  cambiarVista() {
 | 
			
		||||
    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;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadEncuestas() {
 | 
			
		||||
    this.encuestaService.query().subscribe(
 | 
			
		||||
      (res: HttpResponse<IEncuesta[]>) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        const tmpEncuestas = res.body ?? [];
 | 
			
		||||
 | 
			
		||||
        this.encuestas = tmpEncuestas.filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id);
 | 
			
		||||
        this.cantEncuestas = this.encuestas.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]);
 | 
			
		||||
 | 
			
		||||
          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;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadUser(): void {
 | 
			
		||||
    this.accountService.getAuthenticationState().subscribe(account => {
 | 
			
		||||
      if (account !== null) {
 | 
			
		||||
        this.usuarioExtraService.find(account.id).subscribe(usuarioExtra => {
 | 
			
		||||
          this.usuarioExtra = usuarioExtra.body;
 | 
			
		||||
          this.loadAllColaboraciones();
 | 
			
		||||
          if (this.usuarioExtra !== null) {
 | 
			
		||||
            if (this.usuarioExtra.id === undefined) {
 | 
			
		||||
              const today = dayjs().startOf('day');
 | 
			
		||||
              this.usuarioExtra.fechaNacimiento = today;
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    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(encuesta: IEncuesta): void {
 | 
			
		||||
    if (!this.reportForEncuestas) {
 | 
			
		||||
      this.reportPreguntas = false;
 | 
			
		||||
      this.reportForEncuestas = true;
 | 
			
		||||
      this.reportsGeneral = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.encuesta = encuesta;
 | 
			
		||||
    debugger;
 | 
			
		||||
    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 ?? [];
 | 
			
		||||
 | 
			
		||||
              debugger;
 | 
			
		||||
 | 
			
		||||
              this.getOpenQuestionAnswers();
 | 
			
		||||
            },
 | 
			
		||||
            () => {
 | 
			
		||||
              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();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getOpenQuestionAnswers() {
 | 
			
		||||
    this.ePreguntas!.forEach(pregunta => {
 | 
			
		||||
      debugger;
 | 
			
		||||
      if (!pregunta.tipo) {
 | 
			
		||||
        this.resAbierta.query().subscribe(res => {
 | 
			
		||||
          debugger;
 | 
			
		||||
 | 
			
		||||
          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);
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAllColaboraciones(): void {
 | 
			
		||||
    this.usuarioEncuestaService.query().subscribe((res: HttpResponse<IUsuarioEncuesta[]>) => {
 | 
			
		||||
      const tempUsuarioEncuestas = res.body ?? [];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,19 +20,23 @@ export const createPDFTableHeaders = (keys: any): any[] => {
 | 
			
		|||
      id: keys[i],
 | 
			
		||||
      name: keys[i],
 | 
			
		||||
      prompt: keys[i],
 | 
			
		||||
      width: 65,
 | 
			
		||||
      align: 'center',
 | 
			
		||||
      align: 'left',
 | 
			
		||||
      padding: 0,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  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.table(20, 30, _docData, _docHeaders, { autoSize: true });
 | 
			
		||||
  doc.setFont('helvetica');
 | 
			
		||||
 | 
			
		||||
  doc.table(20, 30, _docData, _docHeaders, { fontSize: 10, autoSize: true });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const saveGeneratedPDF = (doc: jsPDF, _fileName: string) => {
 | 
			
		||||
  const generatedFileName = generateFileName(_fileName, PDF_EXTENSION);
 | 
			
		||||
  doc.save(generatedFileName);
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,9 +22,9 @@
 | 
			
		|||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.ePreguntaAbiertaRespuesta.ePreguntaAbierta">E Pregunta Abierta</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <div *ngIf="ePreguntaAbiertaRespuesta.ePreguntaAbierta">
 | 
			
		||||
            <a [routerLink]="['/e-pregunta-abierta', ePreguntaAbiertaRespuesta.ePreguntaAbierta?.id, 'view']">{{
 | 
			
		||||
              ePreguntaAbiertaRespuesta.ePreguntaAbierta?.id
 | 
			
		||||
          <div *ngIf="ePreguntaAbiertaRespuesta.epreguntaAbierta">
 | 
			
		||||
            <a [routerLink]="['/e-pregunta-abierta', ePreguntaAbiertaRespuesta.epreguntaAbierta?.id, 'view']">{{
 | 
			
		||||
              ePreguntaAbiertaRespuesta.epreguntaAbierta?.id
 | 
			
		||||
            }}</a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </dd>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,9 +45,9 @@
 | 
			
		|||
          </td>
 | 
			
		||||
          <td>{{ ePreguntaAbiertaRespuesta.respuesta }}</td>
 | 
			
		||||
          <td>
 | 
			
		||||
            <div *ngIf="ePreguntaAbiertaRespuesta.ePreguntaAbierta">
 | 
			
		||||
              <a [routerLink]="['/e-pregunta-abierta', ePreguntaAbiertaRespuesta.ePreguntaAbierta?.id, 'view']">{{
 | 
			
		||||
                ePreguntaAbiertaRespuesta.ePreguntaAbierta?.id
 | 
			
		||||
            <div *ngIf="ePreguntaAbiertaRespuesta.epreguntaAbierta">
 | 
			
		||||
              <a [routerLink]="['/e-pregunta-abierta', ePreguntaAbiertaRespuesta.epreguntaAbierta?.id, 'view']">{{
 | 
			
		||||
                ePreguntaAbiertaRespuesta.epreguntaAbierta?.id
 | 
			
		||||
              }}</a>
 | 
			
		||||
            </div>
 | 
			
		||||
          </td>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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();
 | 
			
		||||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ export class EncuestaCompartirDialogComponent implements OnInit {
 | 
			
		|||
  constructor(protected activeModal: NgbActiveModal) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.baseURL = location.origin + '/' + this.encuesta?.id + '/complete';
 | 
			
		||||
    this.baseURL = location.origin + '/encuesta/' + this.encuesta?.id + '/complete';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  compartir(): void {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,6 +110,15 @@
 | 
			
		|||
                <div class="text-xs text-gray-500">
 | 
			
		||||
                  <div class="entity-body">
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <button
 | 
			
		||||
                        type="submit"
 | 
			
		||||
                        [routerLink]="['/plantilla', plantilla.id, 'view']"
 | 
			
		||||
                        class="ds-btn ds-btn--secondary btn-sm"
 | 
			
		||||
                        data-cy="entityDetailsButton"
 | 
			
		||||
                      >
 | 
			
		||||
                        <fa-icon icon="eye"></fa-icon>
 | 
			
		||||
                        <span class="d-none d-md-inline">Vista previa</span>
 | 
			
		||||
                      </button>
 | 
			
		||||
                      <button class="ds-btn btn-outline-success btn-card" (click)="triggerPaypalDialog(plantilla)">
 | 
			
		||||
                        <fa-icon [icon]="faCreditCard"></fa-icon>  Comprar con PayPal
 | 
			
		||||
                      </button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,10 +10,12 @@
 | 
			
		|||
 | 
			
		||||
    <hr />
 | 
			
		||||
 | 
			
		||||
    <h2 class="entity-body--row m-2">La plantilla ha comprar no tiene costo alguno</h2>
 | 
			
		||||
    <button type="button" class="ds-btn btn-outline-success fc-center" data-dismiss="modal" (click)="freePurchase()">
 | 
			
		||||
      <fa-icon [icon]="faCheck"></fa-icon> <span>Finalizar compra</span>
 | 
			
		||||
    </button>
 | 
			
		||||
    <div *ngIf="plantilla!.precio == 0">
 | 
			
		||||
      <h2 class="entity-body--row m-2">La plantilla ha comprar no tiene costo alguno</h2>
 | 
			
		||||
      <button type="button" class="ds-btn btn-outline-success fc-center" data-dismiss="modal" (click)="freePurchase()">
 | 
			
		||||
        <fa-icon [icon]="faCheck"></fa-icon> <span>Finalizar compra</span>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <ngx-paypal [config]="payPalConfig" *ngIf="plantilla!.precio != 0"></ngx-paypal>
 | 
			
		||||
  </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,86 @@
 | 
			
		|||
<div class="container-fluid" *ngIf="plantilla">
 | 
			
		||||
  <div>
 | 
			
		||||
    <h2 id="page-heading" data-cy="PPreguntaCerradaHeading">
 | 
			
		||||
      <div class="d-flex align-items-center">
 | 
			
		||||
        <p class="ds-title">Vista previa de {{ plantilla!.nombre }}</p>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <p class="ds-subtitle">Creada el día {{ plantilla!.fechaCreacion | formatShortDatetime | lowercase }}</p>
 | 
			
		||||
      <div class="d-flex justify-content-end">
 | 
			
		||||
        <button type="button" class="ds-btn ds-btn--secondary" (click)="previousState()">
 | 
			
		||||
          <fa-icon icon="arrow-left"></fa-icon>  <span jhiTranslate="entity.action.back">Back</span>
 | 
			
		||||
        </button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </h2>
 | 
			
		||||
 | 
			
		||||
    <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
    <!-- <jhi-alert></jhi-alert> -->
 | 
			
		||||
 | 
			
		||||
    <div class="ds-survey preview-survey" id="entities">
 | 
			
		||||
      <div class="ds-survey--all-question-wrapper col-8">
 | 
			
		||||
        <ng-container *ngIf="pPreguntas && pPreguntas.length === 0">
 | 
			
		||||
          <p class="ds-title text-center">Plantilla vacía</p>
 | 
			
		||||
          <p class="ds-subtitle text-center">Inicie creando preguntas y opciones para su plantilla.</p>
 | 
			
		||||
        </ng-container>
 | 
			
		||||
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-plantilla" *ngFor="let pPregunta of pPreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
          <div
 | 
			
		||||
            [attr.data-index]="pPregunta.id"
 | 
			
		||||
            [attr.data-tipo]="pPregunta.tipo"
 | 
			
		||||
            [attr.data-opcional]="pPregunta.opcional"
 | 
			
		||||
            class="ds-survey--question"
 | 
			
		||||
          >
 | 
			
		||||
            <div class="ds-survey--titulo">
 | 
			
		||||
              <span class="ds-survey--titulo--name">{{ i + 1 }}. {{ pPregunta.nombre }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <span *ngIf="pPregunta.tipo === 'SINGLE'" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
 | 
			
		||||
                {{ pPregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
              <span *ngIf="pPregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
 | 
			
		||||
                {{ pPregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
              <span *ngIf="!pPregunta.tipo" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta abierta {{ pPregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
            </div>
 | 
			
		||||
            <ng-container *ngIf="pPregunta.tipo">
 | 
			
		||||
              <ng-container *ngFor="let pPreguntaOpcion of pPreguntasOpciones; let j = index; trackBy: trackId">
 | 
			
		||||
                <ng-container *ngFor="let pPreguntaOpcionFinal of pPreguntaOpcion">
 | 
			
		||||
                  <ng-container *ngIf="pPregunta.id === pPreguntaOpcionFinal.ppreguntaCerrada.id">
 | 
			
		||||
                    <div
 | 
			
		||||
                      class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
 | 
			
		||||
                      [attr.data-id]="pPreguntaOpcionFinal.id"
 | 
			
		||||
                    >
 | 
			
		||||
                      <div class="radio" *ngIf="pPregunta.tipo === 'SINGLE'">
 | 
			
		||||
                        <input
 | 
			
		||||
                          type="radio"
 | 
			
		||||
                          style="border-radius: 3px"
 | 
			
		||||
                          name="{{ 'radio' + pPregunta.id }}"
 | 
			
		||||
                          id="{{ 'radio' + pPreguntaOpcionFinal.id }}"
 | 
			
		||||
                        />
 | 
			
		||||
                        <!-- <input class="ds-survey--checkbox" id="{{ pPregunta.id }}-{{ pPreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
 | 
			
		||||
                        <label for="{{ 'radio' + pPreguntaOpcionFinal.id }}">{{ pPreguntaOpcionFinal.nombre }}</label>
 | 
			
		||||
                      </div>
 | 
			
		||||
                      <div class="checkbox" *ngIf="pPregunta.tipo === 'MULTIPLE'">
 | 
			
		||||
                        <input type="checkbox" style="border-radius: 3px" id="{{ 'checkbox' + pPreguntaOpcionFinal.id }}" />
 | 
			
		||||
                        <!-- <input class="ds-survey--checkbox" id="{{ pPregunta.id }}-{{ pPreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
 | 
			
		||||
                        <label for="{{ 'checkbox' + pPreguntaOpcionFinal.id }}">{{ pPreguntaOpcionFinal.nombre }}</label>
 | 
			
		||||
                      </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </ng-container>
 | 
			
		||||
                </ng-container>
 | 
			
		||||
              </ng-container>
 | 
			
		||||
            </ng-container>
 | 
			
		||||
            <div class="ds-survey--option ds-survey--option--base ds-survey--open-option" *ngIf="!pPregunta.tipo">
 | 
			
		||||
              <textarea cols="30" rows="10" disabled></textarea>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -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<UsuarioPlantillasDetailComponent>;
 | 
			
		||||
 | 
			
		||||
    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 }));
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -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();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -48,7 +48,7 @@
 | 
			
		|||
            <div class="btn-group">
 | 
			
		||||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/plantilla', miPlantilla.id, 'preview']"
 | 
			
		||||
                [routerLink]="['/mis-plantillas', miPlantilla.id, 'preview']"
 | 
			
		||||
                class="ds-btn ds-btn--secondary btn-sm"
 | 
			
		||||
                data-cy="entityDetailsButton"
 | 
			
		||||
              >
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
import { Injectable } from '@angular/core';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router';
 | 
			
		||||
import { Observable, of, EMPTY } from 'rxjs';
 | 
			
		||||
import { mergeMap } from 'rxjs/operators';
 | 
			
		||||
import { IPlantilla, Plantilla } from 'app/entities/plantilla/plantilla.model';
 | 
			
		||||
import { PlantillaService } from 'app/entities/plantilla/service/plantilla.service';
 | 
			
		||||
 | 
			
		||||
@Injectable({ providedIn: 'root' })
 | 
			
		||||
export class UsuarioPlantillasRoutingResolveService implements Resolve<IPlantilla> {
 | 
			
		||||
  constructor(protected service: PlantillaService, protected router: Router) {}
 | 
			
		||||
 | 
			
		||||
  resolve(route: ActivatedRouteSnapshot): Observable<IPlantilla> | Observable<never> {
 | 
			
		||||
    const id = route.params['id'];
 | 
			
		||||
    if (id) {
 | 
			
		||||
      return this.service.find(id).pipe(
 | 
			
		||||
        mergeMap((plantilla: HttpResponse<Plantilla>) => {
 | 
			
		||||
          if (plantilla.body) {
 | 
			
		||||
            return of(plantilla.body);
 | 
			
		||||
          } else {
 | 
			
		||||
            this.router.navigate(['404']);
 | 
			
		||||
            return EMPTY;
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
    return of(new Plantilla());
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,11 +1,31 @@
 | 
			
		|||
import { Route, RouterModule } from '@angular/router';
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { RouterModule, Routes } from '@angular/router';
 | 
			
		||||
import { UserRouteAccessService } from 'app/core/auth/user-route-access.service';
 | 
			
		||||
import { UsuarioPlantillasDetailComponent } from '../detail/usuario-plantillas-detail.component';
 | 
			
		||||
 | 
			
		||||
import { UsuarioPlantillasComponent } from '../list/usuario-plantillas.component';
 | 
			
		||||
import { UsuarioPlantillasRoutingResolveService } from './usuario-plantillas-routing-resolve.service';
 | 
			
		||||
 | 
			
		||||
export const USUARIO_PLANTILLAS_ROUTE: Route = {
 | 
			
		||||
  path: '',
 | 
			
		||||
  component: UsuarioPlantillasComponent,
 | 
			
		||||
  data: {
 | 
			
		||||
    pageTitle: 'dataSurveyApp.usuarioExtra.plantillas.title',
 | 
			
		||||
const USUARIO_PLANTILLAS_ROUTE: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: UsuarioPlantillasComponent,
 | 
			
		||||
    data: {
 | 
			
		||||
      pageTitle: 'dataSurveyApp.usuarioExtra.plantillas.title',
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
  {
 | 
			
		||||
    path: ':id/preview',
 | 
			
		||||
    component: UsuarioPlantillasDetailComponent,
 | 
			
		||||
    resolve: {
 | 
			
		||||
      plantilla: UsuarioPlantillasRoutingResolveService,
 | 
			
		||||
    },
 | 
			
		||||
    canActivate: [UserRouteAccessService],
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(USUARIO_PLANTILLAS_ROUTE)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class UsuarioPlantillasRoutingModule {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,12 +2,13 @@ import { NgModule } from '@angular/core';
 | 
			
		|||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { UsuarioPlantillasComponent } from './list/usuario-plantillas.component';
 | 
			
		||||
import { RouterModule } from '@angular/router';
 | 
			
		||||
import { USUARIO_PLANTILLAS_ROUTE } from './route/usuario-plantillas.route';
 | 
			
		||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
 | 
			
		||||
import { SharedModule } from '../../shared/shared.module';
 | 
			
		||||
import { UsuarioPlantillasRoutingModule } from './route/usuario-plantillas.route';
 | 
			
		||||
import { UsuarioPlantillasDetailComponent } from './detail/usuario-plantillas-detail.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  declarations: [UsuarioPlantillasComponent],
 | 
			
		||||
  imports: [CommonModule, RouterModule.forChild([USUARIO_PLANTILLAS_ROUTE]), FontAwesomeModule, SharedModule],
 | 
			
		||||
  imports: [CommonModule, UsuarioPlantillasRoutingModule, FontAwesomeModule, SharedModule],
 | 
			
		||||
  declarations: [UsuarioPlantillasComponent, UsuarioPlantillasDetailComponent],
 | 
			
		||||
})
 | 
			
		||||
export class UsuarioPlantillasModule {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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' },
 | 
			
		||||
  // {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue