diff --git a/HRM.UI/ClientApp/src/app/authentication/user-role/user-role-list/user-role-list.component.ts b/HRM.UI/ClientApp/src/app/authentication/user-role/user-role-list/user-role-list.component.ts
index 0e5944e..7d61995 100644
--- a/HRM.UI/ClientApp/src/app/authentication/user-role/user-role-list/user-role-list.component.ts
+++ b/HRM.UI/ClientApp/src/app/authentication/user-role/user-role-list/user-role-list.component.ts
@@ -15,6 +15,9 @@ interface AssignmentRow {
employeeID: number;
loginID: string;
userName: string;
+ /** Self Service only: the employee's payroll type. */
+ payrollTypeID: number;
+ payrollTypeName: string;
roles: string[];
rolesText: string;
pending: boolean;
@@ -56,6 +59,8 @@ export class UserRoleListComponent implements OnInit {
activeView: 'assignments' | 'pending' = 'assignments';
listRoleType: EnumRoleType = EnumRoleType.Admin;
currentUserID: number;
+ /** Payroll type names by ID, for the Self Service Payroll Type column. */
+ payrollTypeNames = new Map();
// All assignments
rows: AssignmentRow[] = [];
@@ -85,6 +90,10 @@ export class UserRoleListComponent implements OnInit {
this.currentUserID = resp?.userID;
this.loadPending();
});
+ this.userService.GetAllPayrollTypes().subscribe((resp: any[]) => {
+ this.payrollTypeNames = new Map((resp ?? []).map(p => [p.id, p.description] as [number, string]));
+ this.rows.forEach(r => r.payrollTypeName = this.payrollTypeName(r));
+ });
this.RefreshControl();
}
@@ -109,7 +118,7 @@ export class UserRoleListComponent implements OnInit {
if (!row) {
row = {
key: 'u' + r.userID, userID: r.userID, employeeID: r.employeeID, loginID: r.loginIDView,
- userName: r.userNameView, roles: [], rolesText: '', pending: false, statusText: '',
+ userName: r.userNameView, payrollTypeID: r.payrollTypeID, payrollTypeName: '', roles: [], rolesText: '', pending: false, statusText: '',
};
byUser.set(r.userID, row);
}
@@ -120,7 +129,10 @@ export class UserRoleListComponent implements OnInit {
}
});
this.rows = Array.from(byUser.values());
- this.rows.forEach(r => r.rolesText = r.roles.join(', '));
+ this.rows.forEach(r => {
+ r.rolesText = r.roles.join(', ');
+ r.payrollTypeName = this.payrollTypeName(r);
+ });
this.markPendingRows();
},
(err: any) => {
@@ -133,6 +145,11 @@ export class UserRoleListComponent implements OnInit {
);
}
+ private payrollTypeName(row: AssignmentRow): string {
+ const id = row.payrollTypeID;
+ return id ? (this.payrollTypeNames.get(id) ?? '') : '';
+ }
+
private pendingFor(row: AssignmentRow): PendingGroup {
return this.pendingGroups.find(g => g.roleType == this.listRoleType && g.userID == row.userID);
}