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">
|
<form class="ds-form">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
<div class="col-3">
|
||||||
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
||||||
<input type="text" name="searchString" placeholder="Buscar..." [(ngModel)]="searchString" />
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -97,12 +129,15 @@
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="ds-list--entity"
|
class="ds-list--entity card-encuesta lift"
|
||||||
*ngFor="let encuesta of encuestas! | filter: 'nombre':searchString; trackBy: trackId"
|
*ngFor="
|
||||||
|
let encuesta of encuestas! | filter: 'nombre':searchString | filter: 'acceso':accesoEncuesta | filter: 'estado':estadoEncuesta;
|
||||||
|
trackBy: trackId
|
||||||
|
"
|
||||||
(dblclick)="openSurvey($event)"
|
(dblclick)="openSurvey($event)"
|
||||||
(click)="selectSurvey($event)"
|
(click)="selectSurvey($event)"
|
||||||
|
[hidden]="encuesta.estado == 'DELETED'"
|
||||||
[attr.data-id]="encuesta.id"
|
[attr.data-id]="encuesta.id"
|
||||||
>
|
>
|
||||||
<div class="entity-header">
|
<div class="entity-header">
|
||||||
|
@ -216,6 +251,40 @@
|
||||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||||
</button>
|
</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>
|
||||||
|
<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">
|
<button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
|
||||||
<fa-icon icon="times"></fa-icon>
|
<fa-icon icon="times"></fa-icon>
|
||||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
|
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
|
||||||
|
@ -225,7 +294,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive" id="entities" *ngIf="isAdmin() && encuestas && encuestas.length > 0">
|
<div class="table-responsive" id="entities" *ngIf="isAdmin() && encuestas && encuestas.length > 0">
|
||||||
<table class="table table-striped" aria-describedby="page-heading">
|
<table class="table table-striped" aria-describedby="page-heading">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -240,7 +308,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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.nombre }}</td>
|
||||||
<td>{{ encuesta.fechaCreacion | formatMediumDatetime }}</td>
|
<td>{{ encuesta.fechaCreacion | formatMediumDatetime }}</td>
|
||||||
<td jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</td>
|
<td jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</td>
|
||||||
|
|
|
@ -62,7 +62,6 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
||||||
account: Account | null = null;
|
account: Account | null = null;
|
||||||
usuarioExtra: UsuarioExtra | null = null;
|
usuarioExtra: UsuarioExtra | null = null;
|
||||||
estadoDeleted = EstadoEncuesta.DELETED;
|
estadoDeleted = EstadoEncuesta.DELETED;
|
||||||
public searchString: string;
|
|
||||||
|
|
||||||
encuestas?: IEncuesta[];
|
encuestas?: IEncuesta[];
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
@ -72,6 +71,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
||||||
categoriasSharedCollection: ICategoria[] = [];
|
categoriasSharedCollection: ICategoria[] = [];
|
||||||
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
|
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
|
||||||
|
|
||||||
|
public searchString: string;
|
||||||
|
public accesoEncuesta: string;
|
||||||
|
//public categoriaEncuesta: string;
|
||||||
|
public estadoEncuesta: string;
|
||||||
|
|
||||||
editForm = this.fb.group({
|
editForm = this.fb.group({
|
||||||
id: [],
|
id: [],
|
||||||
nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
|
nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
|
||||||
|
@ -102,6 +106,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
||||||
protected router: Router
|
protected router: Router
|
||||||
) {
|
) {
|
||||||
this.searchString = '';
|
this.searchString = '';
|
||||||
|
this.accesoEncuesta = '';
|
||||||
|
this.estadoEncuesta = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
resetForm(): void {
|
resetForm(): void {
|
||||||
|
@ -130,6 +136,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.searchString = '';
|
||||||
|
this.accesoEncuesta = '';
|
||||||
|
//this.categoriaEncuesta = '';
|
||||||
|
this.estadoEncuesta = '';
|
||||||
|
|
||||||
document.body.addEventListener('click', e => {
|
document.body.addEventListener('click', e => {
|
||||||
document.getElementById('contextmenu')!.classList.add('ds-contextmenu--closed');
|
document.getElementById('contextmenu')!.classList.add('ds-contextmenu--closed');
|
||||||
document.getElementById('contextmenu')!.classList.remove('ds-contextmenu--open');
|
document.getElementById('contextmenu')!.classList.remove('ds-contextmenu--open');
|
||||||
|
|
Loading…
Reference in New Issue