Merge pull request #59 in TEA/dafa-web-monorepo from feature/TV-244 to develop

Squashed commit of the following:

commit b8ea6da64b2fbdc1bbc0d7546c6ce859ce6981cd
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 15:17:39 2021 +0200

    minor changes to get correct employee data from mock-api

commit 715eff33a8f3cccd7ddce8bd32996190dc6597f3
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 15:05:26 2021 +0200

    minor changes and added employee email to mock-data (TV-244)

commit 454641e1fd486e4aee271d63406a28f47c299b45
Merge: f5e0950 ecb929a
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 14:52:39 2021 +0200

    merged with develop and fixed conflicts (TV-244)

commit f5e0950da2de0465fb6eaee39a0e1c13b1c52281
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 13:31:01 2021 +0200

    flyttat över grundstrukturen till edit-employee-form componenten

commit bcce2e41646b45c65929d057248b6767a832d807
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 12:42:12 2021 +0200

    pre-populated email-input and minor changes to employee model and moch-api

commit 088ed6efb0cebdea86d25094ca1fd55827f938d2
Author: arbetsformedlingen_garcn <christian.gardebrink@arbetsformedlingen.se>
Date:   Thu Aug 19 11:12:57 2021 +0200

    TV-244 small adjustments.

commit be17adf5d898b42467a557832e728ca3827f58d6
Author: arbetsformedlingen_garcn <christian.gardebrink@arbetsformedlingen.se>
Date:   Thu Aug 19 10:43:26 2021 +0200

    TV-244 extended emplyee authorizations to a list with two random authorizations.

commit cc57a6d2ceae4069d48aa670a6fea95c21ebd628
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date:   Thu Aug 19 10:25:42 2021 +0200

    minor changes and re-wrote the mock-api to similar data for authorizations and employee-auth

commit 0a22b310729e2a359aa9f1c9d475ac875b6b2301
Author: arbetsformedlingen_garcn <christian.gardebrink@arbetsformedlingen.se>
Date:   Thu Aug 19 05:37:05 2021 +0200

    TV-244 wip

commit 0e80b5bc4ac14b74f1a8c58ec257ca1f6453e119
Author: arbetsformedlingen_garcn <christian.gardebrink@arbetsformedlingen.se>
Date:   Wed Aug 18 17:14:48 2021 +0200

    TV-244 WIP
This commit is contained in:
Christian Gårdebrink
2021-08-19 15:56:00 +02:00
parent ecb929a808
commit fae7d9ad8c
13 changed files with 574 additions and 202 deletions

View File

@@ -31,6 +31,7 @@ function generateEmployees(amount = 10) {
min: 1000,
max: 9999,
})}`,
email: '',
roles: hasBehorigheter ? ['Admin'] : [],
tjanst: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.name) : [],
tjansteKoder: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.code) : [],
@@ -38,6 +39,7 @@ function generateEmployees(amount = 10) {
utforandeVerksamhetIds: hasBehorigheter ? currentOrganizations.map(organization => organization.id) : [],
};
employee.email = `${employee.firstName}.${employee.lastName}@private-epost.se`.toLowerCase();
employees.push(employee);
}

View File

@@ -11,6 +11,7 @@ import participants from './participants.js';
const generatedEmployees = employees.generate(50);
const generatedDeltagare = deltagare.generate(50);
const generatedAvrop = avrop.generate(10, generatedDeltagare.slice(0, 10));
const auths = authorizations.generate();
const tjanster = [];
const organizations = [];
const kommuner = [];
@@ -67,6 +68,12 @@ generatedAvrop.forEach(({ tjanstekod, tjansteNamn, utforandeVerksamhetId, utfora
}
});
generatedEmployees.forEach(employee => {
employee.authorizations = [
auths[Math.floor(Math.random() * auths.length)],
auths[Math.floor(Math.random() * auths.length)],
];
});
const apiData = {
languages: languages.generate(),
employees: generatedEmployees,
@@ -80,7 +87,7 @@ const apiData = {
employeeId: generatedEmployees[Math.floor(Math.random() * generatedEmployees.length)].id,
})),
currentUser: currentUser.generate(),
authorizations: authorizations.generate(),
authorizations: auths,
getTokenFullAccess: authTokens.auth_code_from_CIAM_with_all_permissions,
invites: [],
};

View File

@@ -17,6 +17,7 @@ server.use(
'/employees*onlyEmployeesWithoutAuthorization=*': '/employees$1roles.length_lte=0',
'/employees/invite': '/invites',
'/employees*': '/employees$1',
'/services*': '/tjanster$1',
'/participants': '/participants?_embed=employees',
'/participant/:id': '/participants/:id?_embed=employees',
'/auth/userinfo': '/currentUser',