Merge pull request #2454 from steven-zou/release-1.1.0

enable pagination for user list
This commit is contained in:
Steven Zou 2017-06-07 18:50:22 +08:00 committed by GitHub
commit 0eaa6a4868
2 changed files with 7 additions and 4 deletions

View File

@ -12,12 +12,12 @@
</span>
</div>
<div>
<clr-datagrid>
<clr-datagrid [clrDgLoading]="inProgress">
<clr-dg-column>{{'USER.COLUMN_NAME' | translate}}</clr-dg-column>
<clr-dg-column>{{'USER.COLUMN_ADMIN' | translate}}</clr-dg-column>
<clr-dg-column>{{'USER.COLUMN_EMAIL' | translate}}</clr-dg-column>
<clr-dg-column>{{'USER.COLUMN_REG_NAME' | translate}}</clr-dg-column>
<clr-dg-row *ngFor="let user of users" [clrDgItem]="user">
<clr-dg-row *clrDgItems="let user of users" [clrDgItem]="user">
<clr-dg-action-overflow [hidden]="isMySelf(user.user_id)">
<button class="action-item" (click)="changeAdminRole(user)">{{adminActions(user)}}</button>
<button class="action-item" (click)="deleteUser(user)">{{'USER.DEL_ACTION' | translate}}</button>
@ -27,7 +27,10 @@
<clr-dg-cell>{{user.email}}</clr-dg-cell>
<clr-dg-cell>{{user.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>{{users.length}} {{'USER.ITEMS' | translate}}</clr-dg-footer>
<clr-dg-footer>{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{pagination.totalItems}} users
<clr-dg-pagination #pagination [clrDgPageSize]="15" [clrDgTotalItems]="users.length"> {{'USER.ITEMS' | translate}}
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid>
</div>
<new-user-modal (addNew)="addUserToList($event)"></new-user-modal>

View File

@ -38,7 +38,7 @@ import { AppConfigService } from '../app-config.service';
export class UserComponent implements OnInit, OnDestroy {
users: User[] = [];
originalUsers: Promise<User[]>;
private onGoing: boolean = false;
private onGoing: boolean = true;
private adminMenuText: string = "";
private adminColumn: string = "";
private deletionSubscription: Subscription;