Merge pull request #60 from Quantum-P3/feature/US-22
filtrar encuestas por nombre con pipe
This commit is contained in:
		
						commit
						f4cbb86dfb
					
				|  | @ -40,6 +40,13 @@ | ||||||
|     <span jhiTranslate="dataSurveyApp.encuesta.home.notFound">No surveys found</span> |     <span jhiTranslate="dataSurveyApp.encuesta.home.notFound">No surveys found</span> | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
|  |   <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> | ||||||
|  |   </form> | ||||||
|  | 
 | ||||||
|   <!-- Lista de Encuestas del Usuario --> |   <!-- Lista de Encuestas del Usuario --> | ||||||
|   <div class="ds-list" (contextmenu)="openContextMenu($event)" *ngIf="!isAdmin()"> |   <div class="ds-list" (contextmenu)="openContextMenu($event)" *ngIf="!isAdmin()"> | ||||||
|     <!-- Context Menu --> |     <!-- Context Menu --> | ||||||
|  | @ -93,7 +100,7 @@ | ||||||
| 
 | 
 | ||||||
|     <div |     <div | ||||||
|       class="ds-list--entity" |       class="ds-list--entity" | ||||||
|       *ngFor="let encuesta of encuestas; trackBy: trackId" |       *ngFor="let encuesta of encuestas! | filter: 'nombre':searchString; trackBy: trackId" | ||||||
|       (dblclick)="openSurvey($event)" |       (dblclick)="openSurvey($event)" | ||||||
|       (click)="selectSurvey($event)" |       (click)="selectSurvey($event)" | ||||||
|       [attr.data-id]="encuesta.id" |       [attr.data-id]="encuesta.id" | ||||||
|  | @ -233,7 +240,7 @@ | ||||||
|       </tr> |       </tr> | ||||||
|     </thead> |     </thead> | ||||||
|     <tbody> |     <tbody> | ||||||
|       <tr *ngFor="let encuesta of encuestas; trackBy: trackId" data-cy="entityTable"> |       <tr *ngFor="let encuesta of encuestas | filter: 'nombre':searchString; 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,6 +62,7 @@ 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; | ||||||
|  | @ -99,7 +100,9 @@ export class EncuestaComponent implements OnInit, AfterViewInit { | ||||||
|     protected fb: FormBuilder, |     protected fb: FormBuilder, | ||||||
|     protected accountService: AccountService, |     protected accountService: AccountService, | ||||||
|     protected router: Router |     protected router: Router | ||||||
|   ) {} |   ) { | ||||||
|  |     this.searchString = ''; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   resetForm(): void { |   resetForm(): void { | ||||||
|     this.editForm.reset(); |     this.editForm.reset(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue