commit
						8fa459a993
					
				| 
						 | 
				
			
			@ -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",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,4 +1,18 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
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',
 | 
			
		||||
| 
						 | 
				
			
			@ -6,7 +20,199 @@ import { Component, OnInit } from '@angular/core';
 | 
			
		|||
  styleUrls: ['./dashboard-user.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class DashboardUserComponent implements OnInit {
 | 
			
		||||
  constructor() {}
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected encuestaService: EncuestaService,
 | 
			
		||||
    protected accountService: AccountService,
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    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.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);
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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