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:
@@ -1,17 +1,12 @@
|
||||
import faker from 'faker';
|
||||
import kommuner from './kommuner.js';
|
||||
import languages from './languages.js';
|
||||
import authorizations from './authorizations.js';
|
||||
import organizations from './organizations.js';
|
||||
import services from './services.js';
|
||||
|
||||
faker.locale = 'sv';
|
||||
|
||||
const SERVICES = services.generate();
|
||||
const KOMMUN = kommuner.generate();
|
||||
const ORGANIZATIONS = organizations.generate();
|
||||
const STATUSES = [true, false];
|
||||
const LANGUAGES = languages.generate();
|
||||
const AUTHORIZATIONS = ['Hantera användare', 'Hantera origisation', 'Hantera ekonomi'];
|
||||
|
||||
function generateEmployees(amount = 10) {
|
||||
const employees = [];
|
||||
@@ -27,24 +22,9 @@ function generateEmployees(amount = 10) {
|
||||
max: 9999,
|
||||
}
|
||||
)}`,
|
||||
phone: `07${faker.datatype.number(9)}-${faker.datatype.number({ min: 1000000, max: 9999999 })}`,
|
||||
email: faker.internet.email(),
|
||||
organization: ORGANIZATIONS[Math.floor(Math.random() * ORGANIZATIONS.length)],
|
||||
services: [SERVICES[Math.floor(Math.random() * SERVICES.length)].name],
|
||||
authorizations: AUTHORIZATIONS,
|
||||
// active: STATUSES[Math.floor(Math.random() * STATUSES.length)],
|
||||
// languages: [
|
||||
// LANGUAGES.find(language => language.name === 'Svenska'),
|
||||
// ...chooseRandom(LANGUAGES, faker.datatype.number(3)),
|
||||
// ],
|
||||
// outOfOffice: STATUSES[Math.floor(Math.random() * STATUSES.length)]
|
||||
// ? [
|
||||
// {
|
||||
// start: new Date('2021-07-12'),
|
||||
// end: new Date('2021-07-24'),
|
||||
// },
|
||||
// ]
|
||||
// : [],
|
||||
organizations: [ORGANIZATIONS[Math.floor(Math.random() * ORGANIZATIONS.length)]],
|
||||
services: [SERVICES[Math.floor(Math.random() * SERVICES.length)]],
|
||||
authorizations: authorizations.generate(),
|
||||
};
|
||||
|
||||
employees.push(person);
|
||||
|
||||
Reference in New Issue
Block a user