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

View File

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

View File

@ -46,6 +46,11 @@ interface InfoDialog {
* The participant number of the user. * The participant number of the user.
*/ */
number: string; 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 // Initialize the groups
this.groups = this.groupRepo.getSortedViewModelList().filter(group => group.id !== 1); 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, name: user.username,
groups_id: user.groups_id, groups_id: user.groups_id,
gender: user.gender, gender: user.gender,
structure_level: user.structure_level,
number: user.number number: user.number
}; };