Merge pull request #63 from Quantum-P3/feature/US-24
This commit is contained in:
		
						commit
						cd2e7ed1e5
					
				| 
						 | 
				
			
			@ -42,8 +42,40 @@
 | 
			
		|||
 | 
			
		||||
  <form class="ds-form">
 | 
			
		||||
    <div class="input-group">
 | 
			
		||||
      <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
      <input type="text" name="searchString" placeholder="Buscar..." [(ngModel)]="searchString" />
 | 
			
		||||
      <div class="col-3">
 | 
			
		||||
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
        <input type="text" name="searchString" placeholder="Buscar por nombre..." [(ngModel)]="searchString" />
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-3">
 | 
			
		||||
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
        <select name="accesoEncuestas" id="accesoEncuesta" [(ngModel)]="accesoEncuesta" style="width: 200px">
 | 
			
		||||
          <option value="" selected="selected" disabled="disabled">Filtrar por acceso</option>
 | 
			
		||||
          <option value="">Todos Accesos</option>
 | 
			
		||||
          <option value="Public">Públicas</option>
 | 
			
		||||
          <option value="Private">Privadas</option>
 | 
			
		||||
        </select>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-3">
 | 
			
		||||
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
        <select name="estadoEncuesta" id="estadoEncuesta" [(ngModel)]="estadoEncuesta" style="width: 200px">
 | 
			
		||||
          <option value="" selected="selected" disabled="disabled">Filtrar por estado</option>
 | 
			
		||||
          <option value="">Todos Estados</option>
 | 
			
		||||
          <option value="Draft">Borradores</option>
 | 
			
		||||
          <option value="Active">Activadas</option>
 | 
			
		||||
          <option value="Finished">Finalizadas</option>
 | 
			
		||||
        </select>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!--<div class="col-3">
 | 
			
		||||
          <div class="input-group-addon "><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
          <select id="categoriaEncuesta"  name="categoriaEncuesta" [(ngModel)]="categoriaEncuesta">
 | 
			
		||||
            <option [ngValue]="null" selected>Filtre por categoría</option>
 | 
			
		||||
            <option
 | 
			
		||||
              *ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
 | 
			
		||||
              [ngValue]="categoriaOption.nombre"    >
 | 
			
		||||
              {{ categoriaOption.nombre }}
 | 
			
		||||
            </option>
 | 
			
		||||
          </select>
 | 
			
		||||
        </div>-->
 | 
			
		||||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -97,12 +129,15 @@
 | 
			
		|||
        </div>
 | 
			
		||||
      </ul>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div
 | 
			
		||||
      class="ds-list--entity"
 | 
			
		||||
      *ngFor="let encuesta of encuestas! | filter: 'nombre':searchString; trackBy: trackId"
 | 
			
		||||
      class="ds-list--entity card-encuesta lift"
 | 
			
		||||
      *ngFor="
 | 
			
		||||
        let encuesta of encuestas! | filter: 'nombre':searchString | filter: 'acceso':accesoEncuesta | filter: 'estado':estadoEncuesta;
 | 
			
		||||
        trackBy: trackId
 | 
			
		||||
      "
 | 
			
		||||
      (dblclick)="openSurvey($event)"
 | 
			
		||||
      (click)="selectSurvey($event)"
 | 
			
		||||
      [hidden]="encuesta.estado == 'DELETED'"
 | 
			
		||||
      [attr.data-id]="encuesta.id"
 | 
			
		||||
    >
 | 
			
		||||
      <div class="entity-header">
 | 
			
		||||
| 
						 | 
				
			
			@ -172,21 +207,55 @@
 | 
			
		|||
      </div>
 | 
			
		||||
 | 
			
		||||
      <!-- <p>
 | 
			
		||||
        <a [routerLink]="['/encuesta', encuesta.id, 'view']">{{ encuesta.id }}</a>
 | 
			
		||||
      </p>
 | 
			
		||||
      <p>{{ encuesta.nombre }}</p>
 | 
			
		||||
      <p>{{ encuesta.descripcion }}</p>
 | 
			
		||||
      <p>{{ encuesta.fechaCreacion | formatMediumDatetime }}</p>
 | 
			
		||||
      <p>{{ encuesta.fechaPublicacion | formatMediumDatetime }}</p>
 | 
			
		||||
      <p>{{ encuesta.fechaFinalizar | formatMediumDatetime }}</p>
 | 
			
		||||
      <p>{{ encuesta.fechaFinalizada | formatMediumDatetime }}</p>
 | 
			
		||||
      <p>{{ encuesta.calificacion }}</p>
 | 
			
		||||
      <p jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</p>
 | 
			
		||||
      <p>{{ encuesta.contrasenna }}</p>
 | 
			
		||||
      <p jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</p>
 | 
			
		||||
      <div>
 | 
			
		||||
        <div *ngIf="encuesta.categoria">
 | 
			
		||||
          <a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a>
 | 
			
		||||
          <a [routerLink]="['/encuesta', encuesta.id, 'view']">{{ encuesta.id }}</a>
 | 
			
		||||
        </p>
 | 
			
		||||
        <p>{{ encuesta.nombre }}</p>
 | 
			
		||||
        <p>{{ encuesta.descripcion }}</p>
 | 
			
		||||
        <p>{{ encuesta.fechaCreacion | formatMediumDatetime }}</p>
 | 
			
		||||
        <p>{{ encuesta.fechaPublicacion | formatMediumDatetime }}</p>
 | 
			
		||||
        <p>{{ encuesta.fechaFinalizar | formatMediumDatetime }}</p>
 | 
			
		||||
        <p>{{ encuesta.fechaFinalizada | formatMediumDatetime }}</p>
 | 
			
		||||
        <p>{{ encuesta.calificacion }}</p>
 | 
			
		||||
        <p jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</p>
 | 
			
		||||
        <p>{{ encuesta.contrasenna }}</p>
 | 
			
		||||
        <p jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</p>
 | 
			
		||||
        <div>
 | 
			
		||||
          <div *ngIf="encuesta.categoria">
 | 
			
		||||
            <a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div>
 | 
			
		||||
          <div *ngIf="encuesta.usuarioExtra">
 | 
			
		||||
            <a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.id, 'view']">{{ encuesta.usuarioExtra?.id }}</a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="text-right">
 | 
			
		||||
          <div class="btn-group">
 | 
			
		||||
            <button
 | 
			
		||||
              type="submit"
 | 
			
		||||
              [routerLink]="['/encuesta', encuesta.id, 'view']"
 | 
			
		||||
              class="btn btn-info btn-sm"
 | 
			
		||||
              data-cy="entityDetailsButton"
 | 
			
		||||
            >
 | 
			
		||||
              <fa-icon icon="eye"></fa-icon>
 | 
			
		||||
              <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
 | 
			
		||||
            </button>
 | 
			
		||||
 | 
			
		||||
            <button
 | 
			
		||||
              type="submit"
 | 
			
		||||
              [routerLink]="['/encuesta', encuesta.id, 'edit']"
 | 
			
		||||
              class="btn btn-primary btn-sm"
 | 
			
		||||
              data-cy="entityEditButton"
 | 
			
		||||
            >
 | 
			
		||||
              <fa-icon icon="pencil-alt"></fa-icon>
 | 
			
		||||
              <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
            </button>
 | 
			
		||||
 | 
			
		||||
            <button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
 | 
			
		||||
              <fa-icon icon="times"></fa-icon>
 | 
			
		||||
              <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
 | 
			
		||||
            </button>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div>
 | 
			
		||||
| 
						 | 
				
			
			@ -225,7 +294,6 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="table-responsive" id="entities" *ngIf="isAdmin() && encuestas && encuestas.length > 0">
 | 
			
		||||
  <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <thead>
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +308,13 @@
 | 
			
		|||
      </tr>
 | 
			
		||||
    </thead>
 | 
			
		||||
    <tbody>
 | 
			
		||||
      <tr *ngFor="let encuesta of encuestas | filter: 'nombre':searchString; trackBy: trackId" data-cy="entityTable">
 | 
			
		||||
      <tr
 | 
			
		||||
        *ngFor="
 | 
			
		||||
          let encuesta of encuestas | filter: 'nombre':searchString | filter: 'acceso':accesoEncuesta | filter: 'estado':estadoEncuesta;
 | 
			
		||||
          trackBy: trackId
 | 
			
		||||
        "
 | 
			
		||||
        data-cy="entityTable"
 | 
			
		||||
      >
 | 
			
		||||
        <td>{{ encuesta.nombre }}</td>
 | 
			
		||||
        <td>{{ encuesta.fechaCreacion | formatMediumDatetime }}</td>
 | 
			
		||||
        <td jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</td>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,6 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
  account: Account | null = null;
 | 
			
		||||
  usuarioExtra: UsuarioExtra | null = null;
 | 
			
		||||
  estadoDeleted = EstadoEncuesta.DELETED;
 | 
			
		||||
  public searchString: string;
 | 
			
		||||
 | 
			
		||||
  encuestas?: IEncuesta[];
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -72,6 +71,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
  categoriasSharedCollection: ICategoria[] = [];
 | 
			
		||||
  usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
 | 
			
		||||
 | 
			
		||||
  public searchString: string;
 | 
			
		||||
  public accesoEncuesta: string;
 | 
			
		||||
  //public categoriaEncuesta: string;
 | 
			
		||||
  public estadoEncuesta: string;
 | 
			
		||||
 | 
			
		||||
  editForm = this.fb.group({
 | 
			
		||||
    id: [],
 | 
			
		||||
    nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
 | 
			
		||||
| 
						 | 
				
			
			@ -102,6 +106,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
    protected router: Router
 | 
			
		||||
  ) {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.accesoEncuesta = '';
 | 
			
		||||
    this.estadoEncuesta = '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  resetForm(): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -130,6 +136,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.accesoEncuesta = '';
 | 
			
		||||
    //this.categoriaEncuesta = '';
 | 
			
		||||
    this.estadoEncuesta = '';
 | 
			
		||||
 | 
			
		||||
    document.body.addEventListener('click', e => {
 | 
			
		||||
      document.getElementById('contextmenu')!.classList.add('ds-contextmenu--closed');
 | 
			
		||||
      document.getElementById('contextmenu')!.classList.remove('ds-contextmenu--open');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue