Skip to content
Snippets Groups Projects
Commit c9393be5 authored by Lukas Haase's avatar Lukas Haase
Browse files

fix filter bug, adjust style

parent 8f5707bd
No related merge requests found
...@@ -264,7 +264,8 @@ ...@@ -264,7 +264,8 @@
<app-mat-spinner-overlay *ngIf="isLoading" overlay="true"></app-mat-spinner-overlay> <app-mat-spinner-overlay *ngIf="isLoading" overlay="true"></app-mat-spinner-overlay>
<div *ngIf="!isLoading"> <div *ngIf="!isLoading">
<app-comment *ngFor="let current of (hideCommentsList ? filteredComments : commentsFilteredByTime).slice(page*5,(page*5)+5); let i = index" <app-comment *ngFor="let current of (hideCommentsList ?
filteredComments : commentsFilteredByTime).slice(pageIndex*pageSize,(pageIndex*pageSize)+pageSize); let i = index"
[appScrollIntoView]="current.id === focusCommentId" [appScrollIntoView]="current.id === focusCommentId"
[usesJoyride]="i === 0 && isJoyrideActive" [usesJoyride]="i === 0 && isJoyrideActive"
[comment]="current" [comment]="current"
...@@ -279,7 +280,13 @@ ...@@ -279,7 +280,13 @@
(clickedOnKeyword)="clickedOnKeyword($event)" (clickedOnKeyword)="clickedOnKeyword($event)"
(votedComment)="votedComment($event)"> (votedComment)="votedComment($event)">
</app-comment> </app-comment>
<mat-paginator [pageSize]="5" (page)="setPage($event)" <mat-paginator class="mat-paginator"
[pageSize]="5"
(page)="handlePageEvent($event)"
[showFirstLastButtons]="showFirstLastButtons"
[pageSizeOptions]="pageSizeOptions"
[pageIndex]="pageIndex"
[color]="'primary'"
[length]="(hideCommentsList ? filteredComments : commentsFilteredByTime).length"></mat-paginator> [length]="(hideCommentsList ? filteredComments : commentsFilteredByTime).length"></mat-paginator>
<ars-row [height]="64"> <ars-row [height]="64">
</ars-row> </ars-row>
......
...@@ -275,3 +275,8 @@ h3 { ...@@ -275,3 +275,8 @@ h3 {
h1 { h1 {
color: red; color: red;
} }
.mat-paginator{
background-color:transparent;
color:var(--on-background);
}
...@@ -33,6 +33,7 @@ import { WsRoomService } from '../../../services/websockets/ws-room.service'; ...@@ -33,6 +33,7 @@ import { WsRoomService } from '../../../services/websockets/ws-room.service';
import { ActiveUserService } from '../../../services/http/active-user.service'; import { ActiveUserService } from '../../../services/http/active-user.service';
import { OnboardingService } from '../../../services/util/onboarding.service'; import { OnboardingService } from '../../../services/util/onboarding.service';
import { WorkerDialogComponent } from '../_dialogs/worker-dialog/worker-dialog.component'; import { WorkerDialogComponent } from '../_dialogs/worker-dialog/worker-dialog.component';
import { PageEvent } from '@angular/material/paginator';
export interface CommentListData { export interface CommentListData {
currentFilter: CommentFilter; currentFilter: CommentFilter;
...@@ -109,7 +110,10 @@ export class CommentListComponent implements OnInit, OnDestroy { ...@@ -109,7 +110,10 @@ export class CommentListComponent implements OnInit, OnDestroy {
private _subscriptionEventServiceTagConfig = null; private _subscriptionEventServiceTagConfig = null;
private _subscriptionEventServiceRoomData = null; private _subscriptionEventServiceRoomData = null;
private _subscriptionRoomService = null; private _subscriptionRoomService = null;
page=0; pageIndex = 0;
pageSize = 10;
pageSizeOptions = [5, 10, 25];
showFirstLastButtons = true;
constructor( constructor(
private commentService: CommentService, private commentService: CommentService,
...@@ -142,8 +146,9 @@ export class CommentListComponent implements OnInit, OnDestroy { ...@@ -142,8 +146,9 @@ export class CommentListComponent implements OnInit, OnDestroy {
}); });
} }
setPage(e:any){ handlePageEvent(e:PageEvent){
this.page=e.pageIndex; this.pageIndex = e.pageIndex;
this.pageSize = e.pageSize;
} }
initNavigation() { initNavigation() {
...@@ -369,6 +374,7 @@ export class CommentListComponent implements OnInit, OnDestroy { ...@@ -369,6 +374,7 @@ export class CommentListComponent implements OnInit, OnDestroy {
} }
filterComments(type: string, compare?: any): void { filterComments(type: string, compare?: any): void {
this.pageIndex=0;
this.currentFilter = type; this.currentFilter = type;
this.currentFilterCompare = compare; this.currentFilterCompare = compare;
if (type === '') { if (type === '') {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment