Commit 21e80984 authored by mechtelm's avatar mechtelm
Browse files

Show status of idm registration in staff member list

parent 78608748
......@@ -14,6 +14,16 @@ class Staff {
})
public firstName: string;
@Column({
name: 'idm_id'
})
public idmId: string;
@Column({
name: 'idm_registered'
})
public idmRegistered: string;
@Column()
public address: string | null;
......
......@@ -23,7 +23,9 @@ export class StaffService {
contractStart: staffMember.contractStart,
contractEnd: staffMember.contractEnd,
contractType: staffMember.contractType,
payrollNumber: staffMember.payrollNumber
payrollNumber: staffMember.payrollNumber,
idmId: staffMember.idmId,
idmRegistered: staffMember.idmRegistered
})
});
return returnStaff;
......
......@@ -9,8 +9,16 @@ export class StaffMemberView {
contractEndDate.setMonth(contractEndDate.getMonth()-3);
if (now > contractEndDate) return 'orange';
contractEndDate.setMonth(contractEndDate.getMonth()-3);
if (now > contractEndDate) return 'date';
if (now > contractEndDate) return 'yellow';
}
return ''
}
static idmStatusColor(staffMemberData: StaffMemberInListDto): string {
if (staffMemberData.idmId) {
if (staffMemberData.idmRegistered) return '';
return 'yellow'
}
return 'orange'
}
}
......@@ -63,15 +63,16 @@ mat-button-toggle {
margin: 10px;
}
.date-all {
.date-all, .idm-all {
min-width: 80px;
margin-left: 2px;
}
.date-yellow {
.date-yellow, .idm-yellow {
background-color: yellow;
}
.date-orange {
.date-orange, .idm-orange {
background-color: orange;
}
.date-red {
.date-red, idm-red {
background-color: red;
}
......@@ -8,7 +8,8 @@
[class]="stM.id === (staffListService.selectedStaffMember$ | async) ? 'staff-list-entry selected' : 'staff-list-entry not-selected'">
<div>{{stM.name}}, {{stM.firstName}}</div>
<div fxLayout="row wrap" fxLayoutAlign="end center">
<div>{{stM.payrollNumber}} </div>
<div [class]="getIdmWarningClass(stM)"
fxLayout="column" fxLayoutAlign="center center">{{stM.idmId ? stM.idmId : '-'}}</div>
<div [class]="getContractWarningClass(stM)"
fxLayout="column" fxLayoutAlign="center center">{{stM.contractEnd ? (stM.contractEnd | date:'dd.MM.yyyy') : 'unbefr.'}}</div>
</div>
......
......@@ -98,4 +98,10 @@ export class StaffListComponent implements OnInit{
if (color) return `date-all date-${color}`
return 'date-all'
}
getIdmWarningClass(staffMember: StaffMemberInListDto): string {
const color = StaffMemberView.idmStatusColor(staffMember);
if (color) return `idm-all idm-${color}`
return 'idm-all'
}
}
......@@ -10,6 +10,12 @@ export class StaffMemberInListDto {
@ApiProperty()
firstName?: string;
@ApiProperty()
idmId?: string;
@ApiProperty()
idmRegistered?: string;
@ApiProperty()
canonicalName?: string;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment