File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
frontend/src/app/projects-tab Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1414 "inactive" : " Crawler ist inaktiv" ,
1515 "cache" : " Caches werden kompiliert"
1616 },
17- "maxProjects" : 10
17+ "maxProjects" : 20
1818 },
1919 "mostImportantChecks" : [
2020 3 ,
Original file line number Diff line number Diff line change 8989
9090 <!-- Paginator and Repositories -->
9191 < mat-card-content >
92- < mat-paginator
92+ < mat-paginator #paginator
9393 [length] ="projects.totalElements "
9494 [pageSize] ="pageSize "
9595 [pageSizeOptions] ="pageSizeOptions "
Original file line number Diff line number Diff line change 1- import { Component } from '@angular/core' ;
1+ import { Component , ViewChild } from '@angular/core' ;
22import { FormControl } from '@angular/forms' ;
33import { OnInit } from '@angular/core' ;
44import { MatDialog } from '@angular/material/dialog' ;
5- import { PageEvent } from '@angular/material/paginator' ;
5+ import { MatPaginator , PageEvent } from '@angular/material/paginator' ;
66import { debounceTime , distinctUntilChanged } from 'rxjs/operators' ;
77
88import { Config , PagedProjects } from '../schemas' ;
@@ -36,6 +36,7 @@ export class ProjectsTabComponent implements OnInit {
3636 config : Config ;
3737 projects : PagedProjects = < PagedProjects > { content : [ ] , totalElements : 0 } ;
3838 // paging
39+ @ViewChild ( 'paginator' ) paginator : MatPaginator ;
3940 pageSizeOptions : number [ ] = [ 10 , 25 , 100 ] ;
4041 currentPage : number = 0 ;
4142 pageSize : number = this . pageSizeOptions [ 0 ] ;
@@ -111,6 +112,9 @@ export class ProjectsTabComponent implements OnInit {
111112 . subscribe (
112113 ( data ) => {
113114 this . projects = data ;
115+ if ( this . searchQuery != '' ) {
116+ this . paginator . firstPage ( ) ;
117+ }
114118 } ,
115119 ( error ) => {
116120 this . openSnackBar ( 'Fehler beim Laden der Projekte' , 'OK' ) ;
You can’t perform that action at this time.
0 commit comments