Added a checkbox to the usermanagement screen.. Does nothing yet #865 #1456

This commit is contained in:
Jamie.Rees 2017-08-07 14:22:23 +01:00
parent bd27e4ad70
commit 018cd7a072
5 changed files with 81 additions and 58 deletions

View file

@ -6,6 +6,10 @@
emailAddress: string,
password: string,
userType: UserType,
// FOR UI
checked: boolean,
}
export enum UserType {

View file

@ -27,7 +27,8 @@ export class UserManagementAddComponent implements OnInit {
id: "",
password: "",
username: "",
userType: UserType.LocalUser
userType: UserType.LocalUser,
checked:false
}
}

View file

@ -22,6 +22,11 @@
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<th>
<a>
<input type="checkbox" ng-checked="checkAll" (change)="checkAllBoxes()">
</a>
</th>
<th>
<a>
Username
@ -51,6 +56,9 @@
</thead>
<tbody>
<tr *ngFor="let u of users">
<td>
<input type="checkbox" [(ngModel)]="u.checked">
</td>
<td>
{{u.username}}
</td>
@ -61,7 +69,9 @@
{{u.emailAddress}}
</td>
<td>
<div *ngFor="let claim of u.claims"><span *ngIf="claim.enabled">{{claim.value}}</span></div>
<div *ngFor="let claim of u.claims">
<span *ngIf="claim.enabled">{{claim.value}}</span>
</div>
</td>
<td ng-hide="hideColumns">

View file

@ -19,6 +19,12 @@ export class UserManagementComponent implements OnInit {
}
users: IUser[];
checkAll = false;
checkAllBoxes() {
this.checkAll = !this.checkAll;
this.users.forEach(user => {
user.checked = this.checkAll;
});
}
}

View file

@ -2,6 +2,7 @@
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MultiSelectModule } from 'primeng/primeng';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
@ -28,6 +29,7 @@ const routes: Routes = [
ReactiveFormsModule,
RouterModule.forChild(routes),
NgbModule.forRoot(),
MultiSelectModule
],
declarations: [
UserManagementComponent,