Merge pull request #14 in TEA/dafa-web-monorepo from feature/more-mock-api-fixes to develop

Squashed commit of the following:

commit 9473ca4e23eb6c5967d9df3403cc071d48e0ab73
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Tue Jun 1 08:18:39 2021 +0200

    Adding footer

commit 8f13809ad3928fd09fd67d713a61c2ca4ef27bc4
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Tue Jun 1 06:57:34 2021 +0200

    Added footer

commit ee8a5be048786843e3c5672368a0663ead424852
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon May 31 16:07:14 2021 +0200

    Added size to edit icon

commit b8e99713bc0190075cfe201f8cd515dca78e184e
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon May 24 15:54:15 2021 +0200

    Renamed create account to employee form and fixed some validation

commit 935509bc5dd6bc7f6533b580197da2f8c15affc3
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon May 24 08:28:40 2021 +0200

    More changes to mock-api and views

commit d0bb8e1c0130c996ee89413f5ddda015fcf49ec5
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Fri May 21 11:22:40 2021 +0200

    Modified mock-api and implemented a part inside employee-list
This commit is contained in:
Erik Tiekstra
2021-06-01 11:19:22 +02:00
parent 4334fd7364
commit c4440a2bbe
41 changed files with 747 additions and 486 deletions

View File

@@ -1,4 +1,4 @@
import { Authorization, mapPegaAuthorizationToAuthorization, PegaAuthorization } from '@dafa-enums/authorization.enum';
import { Authorization } from './authorization.model';
import { Organization } from './organization.model';
export interface User {
@@ -7,9 +7,7 @@ export interface User {
lastName: string;
fullName: string;
ssn: string;
phone: string;
email: string;
organization: Organization;
organizations: Organization[];
authorizations: Authorization[];
}
@@ -18,9 +16,7 @@ export interface UserApiResponse {
firstName: string;
lastName: string;
ssn: string;
phone: string;
email: string;
organization: Organization;
organizations: Organization[];
authorizations: Authorization[];
}
@@ -35,30 +31,20 @@ export interface PegaUserApiResponse {
pyOrganization: string;
pyOrgDivision: string;
pyOrgUnit: string;
pyTelephone: string;
pyUserIdentifier: string;
pyUserName: string;
pyAccessGroupsAdditional: string[];
pyAddresses: {
Email: {
pxObjClass: string;
pxSubscript: string;
pyEmailAddress: string;
};
};
}
export function mapUserApiResponseToUser(data: UserApiResponse): User {
const { id, firstName, lastName, ssn, organization, phone, email, authorizations } = data;
const { id, firstName, lastName, ssn, organizations, authorizations } = data;
return {
id,
firstName,
lastName,
fullName: `${firstName} ${lastName}`,
ssn,
organization,
phone,
email,
organizations,
authorizations,
};
}
@@ -70,20 +56,21 @@ export function mapPegaUserApiReponseToUser(data: PegaUserApiResponse): User {
firstName: data.pyFirstName,
fullName: `${data.pyFirstName} ${data.pyLastName}`,
ssn: null,
organization: {
id: '',
name: data.pyOrganization,
kaNumber: null,
address: {
street: null,
houseNumber: null,
postalCode: null,
city: null,
kommun: null,
organizations: [
{
id: '',
name: data.pyOrganization,
kaNumber: null,
address: {
street: null,
houseNumber: null,
postalCode: null,
city: null,
kommun: null,
},
},
},
phone: data.pyTelephone,
email: data.pyAddresses.Email.pyEmailAddress,
authorizations: mapPegaAuthorizationToAuthorization(data.pyAccessGroup as PegaAuthorization),
],
authorizations: null,
// authorizations: mapPegaAuthorizationToAuthorization(data.pyAccessGroup as PegaAuthorization),
};
}