Merge pull request #4647 from GabrielInTheWorld/extend-user-dialog

Adds the structure-level and participant-number to the user-list
This commit is contained in:
Emanuel Schütze 2019-04-30 16:39:49 +02:00 committed by GitHub
commit d7c6583b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -62,6 +62,8 @@
</span>
<br *ngIf="user.groups && user.structure_level" />
<span *ngIf="user.structure_level"> <mat-icon>flag</mat-icon>{{ user.structure_level }}</span>
<br *ngIf="user.number" />
<span *ngIf="user.number"> <mat-icon>perm_identity</mat-icon>{{ user.number }}</span>
</div>
</div>
</mat-cell>
@ -110,6 +112,7 @@
[ngClass]="selectedRows.indexOf(row) >= 0 ? 'selected' : ''"
*matRowDef="let row; columns: getColumnDefinition()"
(click)="selectItem(row, $event)"
class="lg"
>
</mat-row>
</mat-table>
@ -253,6 +256,14 @@
<mat-option *ngFor="let gender of genderList" [value]="gender">{{ gender | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<input
type="text"
matInput
placeholder="{{ 'Structure level' | translate }}"
[(ngModel)]="infoDialog.structure_level"
/>
</mat-form-field>
<mat-form-field>
<input
type="text"
@ -270,7 +281,8 @@
[mat-dialog-close]="{
groups_id: infoDialog.groups_id,
gender: infoDialog.gender,
number: infoDialog.number
number: infoDialog.number,
structure_level: infoDialog.structure_level
}"
>
<span translate>Save</span>

View File

@ -13,6 +13,10 @@
flex: 2 0 60px;
.groupsCell {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
mat-icon {
font-size: 80%;
}

View File

@ -46,6 +46,11 @@ interface InfoDialog {
* The participant number of the user.
*/
number: string;
/**
* Structure level for one user.
*/
structure_level: string;
}
/**
@ -169,7 +174,9 @@ export class UserListComponent extends ListViewBaseComponent<ViewUser, User> imp
// Initialize the groups
this.groups = this.groupRepo.getSortedViewModelList().filter(group => group.id !== 1);
this.groupRepo.getViewModelListObservable().subscribe(groups => (this.groups = groups));
this.groupRepo
.getViewModelListObservable()
.subscribe(groups => (this.groups = groups.filter(group => group.id !== 1)));
}
/**
@ -203,6 +210,7 @@ export class UserListComponent extends ListViewBaseComponent<ViewUser, User> imp
name: user.username,
groups_id: user.groups_id,
gender: user.gender,
structure_level: user.structure_level,
number: user.number
};