feat(employee): Showing employee-data inside employee-card page. (TV-341)
Squashed commit of the following: commit 4fd71e0d0655a0d75dda59151ac74e2361f187bc Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Fri Aug 20 10:59:46 2021 +0200 Updated RoleEnum and mock-data för roles commit f05a93239727ce1245650ece3b48cf75dc7091ca Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Fri Aug 20 08:34:20 2021 +0200 Fixed issue with mock-api commit c31e94da6b90e442fd84c5113789db245be81c6d Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Fri Aug 20 08:26:14 2021 +0200 Fixed issue with tjanster commit a183a08f0446cdaea7d01c8935d88ac436b0438f Merge: eb310c11e2d925Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Fri Aug 20 07:59:06 2021 +0200 Merge branch 'develop' into feature/TV-341-erik commit eb310c10bdf0f4b60032bdda97df75c19bdbf447 Merge: 877b68bfae7d9aAuthor: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Fri Aug 20 07:21:39 2021 +0200 Merged develop and fixed conflicts commit 877b68b8827e89cfd230856c9d8247f1cd8db264 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Aug 19 15:01:55 2021 +0200 Now fetching tjanster from mock-api commit 1ecd26595b21ea46ce6fb0c193c6642f66250ae3 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Aug 19 14:24:11 2021 +0200 Some more changes to employee-card commit e42ae254e7aa7b994627fdccb7037493b116d6a2 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Aug 19 13:44:23 2021 +0200 Added new enum Role and fixed some issues mapping roles inside employee-card commit 7801831d83feae5ef5e5b92e6421b18863b2a1db Merge: c78f3f8d6e4666Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Aug 19 12:37:56 2021 +0200 Merge branch 'develop' into feature/TV-341-fe-anpassa-personal-kortet-sa-att-den-ar-enligt-skiss commit c78f3f886752477d2dbc4af20356252af4128440 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Thu Aug 19 11:19:56 2021 +0200 Authorization commit 9c043720a9cfa5fd6943013f643d948a50c8f135 Merge: 77d6a9cffeb372Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Thu Aug 19 11:19:43 2021 +0200 Merge branch 'develop' into feature/TV-341-fe-anpassa-personal-kortet-sa-att-den-ar-enligt-skiss # Conflicts: # apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.scss # apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.module.ts # apps/mina-sidor-fa/src/app/shared/enums/employee-authorization.enum.ts commit 77d6a9c600e6b42e97fa5431ed37ad430c5febd3 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Wed Aug 18 10:22:45 2021 +0200 Moved subscription, added icons, refactured markup commit b43c18e28b5aabb8115fa659a98b4ae8c0a7bf40 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Tue Aug 17 10:50:02 2021 +0200 unsubscribed commit 9f48cddc75872fc3f740c53de998cd54666b0b1d Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Mon Aug 16 16:40:08 2021 +0200 Unsubscription behöver läggas till efter genomgång av hur unsubscribeOnDestroy fungerar commit b2cef346f18482e72c11c09d0a6e629370d01bd5 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Mon Aug 16 16:37:13 2021 +0200 Authorization commit 5fe0b5d5fc725551f9e794cbaa70dc0f077f8717 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Fri Aug 13 15:46:50 2021 +0200 - Changed first h2 to h3 - Changed link to routerLink commit fd1cb3c6249535ce84e61df035cae63352b1b00b Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Fri Aug 13 11:53:36 2021 +0200 Amends after PR commit 13e9881e3680bd829736205b3fef57b2228638d5 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Wed Aug 11 16:19:36 2021 +0200 Employee-card amends to look more like the sketch.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export interface AvropTjanstResponse {
|
||||
code: string;
|
||||
name: string;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { RoleEnum } from '@msfa-enums/role.enum';
|
||||
import { PaginationMeta } from '@msfa-models/pagination-meta.model';
|
||||
|
||||
export interface EmployeeCompactResponse {
|
||||
@@ -13,10 +14,10 @@ export interface EmployeeResponse {
|
||||
lastName: string;
|
||||
email: string;
|
||||
personnummer: string;
|
||||
roles: string[];
|
||||
roles: RoleEnum[];
|
||||
tjansteKoder: string[];
|
||||
utforandeVerksamhetIds: string[];
|
||||
adressIds: string[];
|
||||
utforandeVerksamhetIds: number[];
|
||||
adressIds: number[];
|
||||
}
|
||||
|
||||
export interface EmployeesApiResponse {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export interface TjanstResponse {
|
||||
code: string;
|
||||
id: string;
|
||||
name: string;
|
||||
tjanstekod: string;
|
||||
tjanstId: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { AvropTjanstResponse } from './api/avrop-tjanst.response.model';
|
||||
|
||||
export interface AvropTjanst {
|
||||
code: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function mapResponseToAvropTjanst(data: AvropTjanstResponse): AvropTjanst {
|
||||
const { code, name } = data;
|
||||
|
||||
return {
|
||||
code,
|
||||
name,
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { RoleEnum } from '@msfa-enums/role.enum';
|
||||
import { EmployeeCompactResponse, EmployeeResponse } from './api/employee.response.model';
|
||||
import { PaginationMeta } from './pagination-meta.model';
|
||||
import { Tjanst } from './tjanst.model';
|
||||
|
||||
export interface EmployeeCompact {
|
||||
id: string;
|
||||
@@ -12,12 +14,14 @@ export interface Employee {
|
||||
id: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
fullName: string;
|
||||
email: string;
|
||||
ssn: string;
|
||||
roles: string[];
|
||||
roles: RoleEnum[];
|
||||
tjanstCodes: string[];
|
||||
utforandeVerksamhetIds: string[];
|
||||
utforandeAdressIds: string[];
|
||||
tjanster?: Tjanst[];
|
||||
utforandeVerksamhetIds: number[];
|
||||
utforandeAdressIds: number[];
|
||||
}
|
||||
|
||||
export interface EmployeesData {
|
||||
@@ -29,8 +33,8 @@ export interface EmployeeRequestData {
|
||||
email: string;
|
||||
roles: string[];
|
||||
tjansteKoder: string[];
|
||||
utforandeVerksamhetIds: string[];
|
||||
adressIds: string[];
|
||||
utforandeVerksamhetIds: number[];
|
||||
adressIds: number[];
|
||||
}
|
||||
|
||||
export function mapEmployeeToRequestData(data: Employee): EmployeeRequestData {
|
||||
@@ -71,11 +75,12 @@ export function mapResponseToEmployee(data: EmployeeResponse): Employee {
|
||||
id: ciamUserId,
|
||||
firstName,
|
||||
lastName,
|
||||
fullName: `${firstName} ${lastName}`,
|
||||
email,
|
||||
ssn: personnummer,
|
||||
roles,
|
||||
tjanstCodes: tjansteKoder,
|
||||
utforandeVerksamhetIds,
|
||||
utforandeAdressIds: adressIds,
|
||||
roles: roles || [],
|
||||
tjanstCodes: tjansteKoder || [],
|
||||
utforandeVerksamhetIds: utforandeVerksamhetIds || [],
|
||||
utforandeAdressIds: adressIds || [],
|
||||
};
|
||||
}
|
||||
|
||||
6
apps/mina-sidor-fa/src/app/shared/models/role.model.ts
Normal file
6
apps/mina-sidor-fa/src/app/shared/models/role.model.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { RoleEnum } from '@msfa-enums/role.enum';
|
||||
|
||||
export interface Role {
|
||||
name: string;
|
||||
type: RoleEnum;
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
import { TjanstResponse } from './api/tjanst.response.model';
|
||||
|
||||
export interface Tjanst {
|
||||
code: string;
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
tjanstId: number;
|
||||
}
|
||||
|
||||
export function mapTjanstResponseToTjanst(data: TjanstResponse): Tjanst {
|
||||
const { code, name } = data;
|
||||
export function mapResponseToTjanst(data: TjanstResponse): Tjanst {
|
||||
const { id, name, tjanstekod, tjanstId } = data;
|
||||
|
||||
return {
|
||||
code,
|
||||
id,
|
||||
name,
|
||||
code: tjanstekod,
|
||||
tjanstId,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user