Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6622 show no members message #6718

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app/users/users-table.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div [ngClass]="containerClass">
<mat-table #table [dataSource]="usersTable" [trackBy]="trackByFn" matSort [matSortActive]="matSortActive" matSortDirection="desc">
<mat-table #table *ngIf='!emptyData; else noUserFoundMessage' [dataSource]="usersTable" [trackBy]="trackByFn" matSort [matSortActive]="matSortActive" matSortDirection="desc">
<ng-container matColumnDef="select">
<mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null"
Expand Down Expand Up @@ -130,6 +130,9 @@
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row [ngClass]="{'cursor-pointer':!isDialog}" *matRowDef= "let row; columns: displayedColumns;" (click)="gotoProfileView(row.doc.name)" [ngClass]="{highlight:isSelected(row.doc)}"></mat-row>
</mat-table>
<ng-template #noUserFoundMessage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this below the mat-paginator element. That is related to the table and it's confusing seeing this in the middle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated both requested changes

<div class="view-container">No members available</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view-container should not be used here. It already applies to the containing element.

</ng-template>
<mat-paginator #paginator
[pageSize]="50"
[pageSizeOptions]="[5, 10, 20, 50, 100, 200]"
Expand Down
2 changes: 2 additions & 0 deletions src/app/users/users-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class UsersTableComponent implements OnInit, OnDestroy, AfterViewInit, On
usersTable = new MatTableDataSource();
filterType = 'local';
isUserAdmin = false;
emptyData = false;
selection = new SelectionModel(true, []);
private onDestroy$ = new Subject<void>();
isOnlyManagerSelected = false;
Expand Down Expand Up @@ -120,6 +121,7 @@ export class UsersTableComponent implements OnInit, OnDestroy, AfterViewInit, On
if (this.usersTable.paginator) {
this.tableDataChange.emit(data);
}
this.emptyData = !data.length;
});
}

Expand Down
1 change: 1 addition & 0 deletions src/app/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class UsersComponent implements OnInit, OnDestroy {
this.usersService.usersListener().pipe(takeUntil(this.onDestroy$)).subscribe(users => {
this.dialogsLoadingService.stop();
this.users = users.filter((user: any) => this.excludeIds.indexOf(user._id) === -1);
this.emptyData = !this.users.length;
});
this.searchChange.pipe(debounceTime(500), takeUntil(this.onDestroy$)).subscribe((searchText) => {
if (this.isDialog) {
Expand Down