From 1d69b4b01379aeb0387146ad416c39216b98f6e6 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Tue, 3 Aug 2021 12:49:24 +0200 Subject: [PATCH] feat(deltagare): Matched deltagareinformation page to the design. (TV-269) Squashed commit of the following: commit f850837fb7629ca9acbd7e9e9d6b8e3a9b356e6d Author: Erik Tiekstra Date: Tue Aug 3 12:42:46 2021 +0200 Removed some unnecessary null-checks commit 2817775633dc9ed546c48cfdd2092eafb0679686 Author: Erik Tiekstra Date: Tue Aug 3 12:20:58 2021 +0200 Some template changes commit 9305a1dce85bf177964ec3ad6bb6fe58b7c52332 Author: Erik Tiekstra Date: Mon Aug 2 15:21:53 2021 +0200 Added some fixes to layout commit 69d5847a0f0ff4aa9fac39ef202edecc28bcfe0f Merge: c06d16d fe89d57 Author: Erik Tiekstra Date: Mon Aug 2 11:36:45 2021 +0200 Merged develop and fixed conflicts commit c06d16debbe933c1c7f7c927c0f0c32034c6f011 Author: panpe Date: Fri Jul 16 12:56:05 2021 +0200 fixed some small issues such as disability was not caught. Connected this to the swagger backend. But it needs some better null checks commit c6a933b3bc2658816bbab5c8399a2de9d3a0bc4a Author: Cecilia Varnava Date: Mon Jul 12 01:12:35 2021 +0200 TV-269 wip commit 5e7252d0dbe33ca3aca0e2e82860fa5b799745cc Author: Cecilia Varnava Date: Mon Jul 12 01:03:47 2021 +0200 TV-269 Deltagare - mocked workexperiences commit f50fa65e2e297f7f551be53a2c181983b53119e4 Author: Cecilia Varnava Date: Thu Jul 8 11:15:47 2021 +0200 TV-269 added tabs style and deltagare data --- .../src/app/pages/avrop/avrop.component.ts | 1 + .../deltagare-card.component.html | 231 +++++++++++++----- .../deltagare-card.component.scss | 58 +++-- .../deltagare-card.component.ts | 13 + .../deltagare-card/deltagare-card.module.ts | 14 ++ .../participants-list.component.html | 123 ---------- .../participants-list.component.scss | 35 --- .../participants-list.component.spec.ts | 29 --- .../participants-list.component.ts | 47 ---- .../participants-list.module.ts | 13 - .../participant-card.component.html | 202 --------------- .../participant-card.component.scss | 51 ---- .../participant-card.component.ts | 30 --- .../participant-card.module.ts | 35 --- .../participants-routing.module.ts | 20 -- .../participants/participants.component.html | 44 ---- .../participants/participants.component.scss | 9 - .../participants.component.spec.ts | 32 --- .../participants/participants.component.ts | 44 ---- .../pages/participants/participants.module.ts | 22 -- .../models/api/deltagare.response.model.ts | 2 + .../models/api/disability.response.model.ts | 1 + .../src/app/shared/models/deltagare.model.ts | 18 +- .../src/app/shared/models/disability.model.ts | 1 - .../src/app/shared/models/education.model.ts | 10 +- .../src/app/shared/models/user.model.ts | 1 + .../shared/models/work-experience.model.ts | 10 +- .../shared/services/api/deltagare.service.ts | 19 +- ...so-date.util.ts => format-to-date.util.ts} | 10 +- mock-api/dafa-web/scripts/deltagare.js | 5 + mock-api/dafa-web/scripts/work-experiences.js | 38 +++ package-lock.json | 14 +- package.json | 2 +- 33 files changed, 329 insertions(+), 855 deletions(-) delete mode 100644 apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.html delete mode 100644 apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.scss delete mode 100644 apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.spec.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.module.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.html delete mode 100644 apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.scss delete mode 100644 apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.module.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/participants-routing.module.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/participants.component.html delete mode 100644 apps/dafa-web/src/app/pages/participants/participants.component.scss delete mode 100644 apps/dafa-web/src/app/pages/participants/participants.component.spec.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/participants.component.ts delete mode 100644 apps/dafa-web/src/app/pages/participants/participants.module.ts rename apps/dafa-web/src/app/shared/utils/{format-to-iso-date.util.ts => format-to-date.util.ts} (52%) create mode 100644 mock-api/dafa-web/scripts/work-experiences.js diff --git a/apps/dafa-web/src/app/pages/avrop/avrop.component.ts b/apps/dafa-web/src/app/pages/avrop/avrop.component.ts index 10763c0..8d466a0 100644 --- a/apps/dafa-web/src/app/pages/avrop/avrop.component.ts +++ b/apps/dafa-web/src/app/pages/avrop/avrop.component.ts @@ -57,6 +57,7 @@ export class AvropComponent { this.avropService.setHandledareState(handledareId); } + goToStep1(): void { this.avropService.goToStep1(); } diff --git a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.html b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.html index 70d8518..e1fa3cb 100644 --- a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.html +++ b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.html @@ -1,72 +1,177 @@
- -
- Tillbaka till deltagarlistan -

{{ deltagare.fullName }}

-
-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus accusantium sit, reprehenderit, esse suscipit - quis similique harum est eum eveniet aspernatur delectus magni asperiores porro aliquam voluptate! Architecto, - perferendis commodi. -

- -
{{deltagare | json}}
- -
-
-

Personuppgifter

- -
-
Namn
-
{{ deltagare.fullName }}
-
Personnummer
-
{{ deltagare.ssn }}
-
Epostadress
-
{{ deltagare.email }}
-
Telefonnummer
- - -
{{ phoneNumber.type }}: {{phoneNumber.number}}
-
-
-
- -

Särskilda behov

-

- Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus, voluptatum quibusdam repellendus animi, - quidem, commodi quos porro quia incidunt saepe veritatis voluptatem. Cupiditate, accusamus atque! Illum, - quisquam esse? Omnis, quasi! -

-
- -
-

Om tjänsten

-
- -
-

Matchningsuppgifter

-
- -
-

Körkortsinformation

-
-
Har körkort
-
{{deltagare.driversLicense.licenses.length ? 'Ja' : 'Nej'}}
- -
Körkortsklasser
-
{{deltagare.driversLicense.licenses.join(', ')}}
-
Tillgång till bil
-
{{deltagare.driversLicense.accessToCar ? 'Ja' : 'Nej'}}
-
-
-
-
+
+ +
+ Tillbaka till deltagarlistan +

Deltagarinformation

+
+ + +
+
+

Personuppgifter

+
+
Namn:
+
{{ deltagare.fullName }}
+
Personnummer:
+
+ +
+ +
{{address.type}}
+
+
+ {{ address.street }}
+ {{ address.postalCode }} {{ address.city }} +
+
+
+
Telefon:
+ + +
{{ phoneNumber.type }}: {{phoneNumber.number}}
+
+
+
Epostadress:
+
{{ deltagare.email }}
+
+
+
+

Särskilda behov

+
+
Funktionsnedsättningar:
+ +
+ {{ disability.title }} + {{ disability.description }} +
+
+
+
+
Tolk:
+
{{deltagare.translator ? 'Ja ({{deltagare.translator}})' : 'Nej'}}
+
+
+
+

Om tjänsten

+
+
Tillhörande tjänst:
+
{{ deltagare.service }}
+
Datum för tjänstens början:
+
{{ deltagare.startDate | localDate }}
+
Datum för tjänstens slut:
+
{{ deltagare.endDate | localDate }}
+
Deltagandefrekvens:
+
{{ deltagare.service.frequency }}
+
Utförande verksamhet:
+
{{ deltagare.service.organisation }}
+
Utförande adress:
+
+ {{ deltagare.service.organisation.adress }} +
+
Genomförandereferens:
+
{{ deltagare.service.reference }}
+
+
+
+
+ +
+
+

Arbetslivserfarenhet

+
+
Arbetsgivare:
+ + +
+ + -
+ {{ workExperience.employer }}
+ {{ workExperience.profession }}
+ {{ workExperience.description }} +
+
+
+ + + {{ accordionExpanded ? 'Dölj' : 'Visa' }} fler arbetsgivare +
+ - +
+ {{ workExperience.employer }}
+ {{ workExperience.profession }}
+ {{ workExperience.description }} +
+
+
+
+
+
+

Utbildning

+
+
Utbildningar:
+ +
+ - +
+ {{ education.organizer }}
+ {{ education.education}}
+ {{ education.description }} +
+
+
+
+
Högsta utbildningsnivå:
+
+ {{ deltagare.highestEducation.level.description }}: {{ deltagare.highestEducation.sunKod.description + }} +
+
+
+
Språk jag kan använda på jobbet:
+
{{ deltagare.workLanguages.join(', ')}}
+
+

Körkortsinformation

+
+
Har körkort
+
{{deltagare.driversLicense.licenses ? 'Ja' : 'Nej'}}
+ +
Körkortsklasser
+
{{deltagare.driversLicense.licenses.join(', ')}}
+
Tillgång till bil
+
{{deltagare.driversLicense.accessToCar ? 'Ja' : 'Nej'}}
+
+
+
+
+
+
+
Tillbaka till deltagarlistan
- +
diff --git a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.scss b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.scss index 0f5dcea..150827f 100644 --- a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.scss +++ b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.scss @@ -1,45 +1,55 @@ @import 'variables/gutters'; .deltagare-card { - &__contents { + &__tab-contents { display: flex; - flex-direction: column; - gap: $digi--layout--gutter--xl $digi--layout--gutter--l; + gap: $digi--layout--gutter--l; + margin: 0 $digi--layout--gutter--l; + } - h2 { - margin-top: 0; + &__tab-column { + width: 50%; + } + + dd { + margin: 0 0 var(--digi--layout--gutter--xs); + + + dd { + margin-top: var(--digi--layout--gutter); } } - &__column { - width: 100%; - max-width: var(--digi--typography--text--max-width); - } - - dl { - display: grid; - grid-template-columns: auto 1fr; - gap: 0.5rem 2rem; - } - - dt, - dd { - margin: 0; - } - dt { - grid-column: 1; font-weight: var(--digi--typography--font-weight--semibold); } - dd { - grid-column: 2; + &__accordion { + max-width: 80%; + min-width: 250px; + + dd:first-of-type { + margin-top: var(--digi--layout--gutter); + } + } + + &__accordion-trigger { + font-weight: var(--digi--typography--font-weight--semibold); + } + + &__popover { + display: inline-block; + margin-left: var(--digi--layout--gutter--s); } &__header, &__footer { display: flex; flex-direction: row-reverse; + align-items: center; justify-content: space-between; } + + &__footer { + margin-top: $digi--layout--gutter--l; + } } diff --git a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.ts b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.ts index 7c81eda..733fb64 100644 --- a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.ts +++ b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { IconType } from '@dafa-enums/icon-type.enum'; import { Deltagare } from '@dafa-models/deltagare.model'; +import { WorkExperience } from '@dafa-models/work-experience.model'; import { DeltagareService } from '@dafa-services/api/deltagare.service'; import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; @@ -19,7 +20,19 @@ export class DeltagareCardComponent { deltagare$: Observable = this._deltagareId$.pipe( switchMap(deltagareId => this.deltagaresService.deltagare$(deltagareId)) ); + firstVisibleWorkExperiences$: Observable = this.deltagare$.pipe( + map(deltagare => deltagare.workExperiences.slice(0, 2)) + ); + hiddenWorkExperiences$: Observable = this.deltagare$.pipe( + map(deltagare => deltagare.workExperiences.slice(2)) + ); + iconType = IconType; + accordionExpanded = false; constructor(private activatedRoute: ActivatedRoute, private deltagaresService: DeltagareService) {} + + toggleAccordionExpanded(): void { + this.accordionExpanded = !this.accordionExpanded; + } } diff --git a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.module.ts b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.module.ts index 8209118..664a0c7 100644 --- a/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.module.ts +++ b/apps/dafa-web/src/app/pages/deltagare/pages/deltagare-card/deltagare-card.module.ts @@ -1,10 +1,17 @@ +import { DigiNgLayoutExpansionPanelModule } from '@af/digi-ng/_layout/layout-expansion-panel'; import { DigiNgLinkInternalModule } from '@af/digi-ng/_link/link-internal'; +import { DigiNgNavigationTabModule } from '@af/digi-ng/_navigation/navigation-tab'; +import { DigiNgNavigationTabsModule } from '@af/digi-ng/_navigation/navigation-tabs'; +import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover'; +import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { BackLinkModule } from '@dafa-shared/components/back-link/back-link.module'; +import { HideTextModule } from '@dafa-shared/components/hide-text/hide-text.module'; import { IconModule } from '@dafa-shared/components/icon/icon.module'; import { LayoutModule } from '@dafa-shared/components/layout/layout.module'; +import { LocalDatePipeModule } from '@dafa-shared/pipes/local-date/local-date.module'; import { DeltagareCardComponent } from './deltagare-card.component'; @NgModule({ @@ -17,6 +24,13 @@ import { DeltagareCardComponent } from './deltagare-card.component'; DigiNgLinkInternalModule, IconModule, BackLinkModule, + DigiNgNavigationTabsModule, + DigiNgNavigationTabModule, + DigiNgLayoutExpansionPanelModule, + LocalDatePipeModule, + HideTextModule, + DigiNgSkeletonBaseModule, + DigiNgPopoverModule, ], exports: [DeltagareCardComponent], }) diff --git a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.html b/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.html deleted file mode 100644 index a384036..0000000 --- a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - {{ participant.fullName }} - - {{ participant.errandNumber }}{{ participant.service }}{{ participant.startDate | date: 'yyyy-MM-dd' }}{{ participant.endDate | date: 'yyyy-MM-dd' }}{{ participant.handleBefore | date: 'yyyy-MM-dd' }}
-
- - diff --git a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.scss b/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.scss deleted file mode 100644 index b36e161..0000000 --- a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.scss +++ /dev/null @@ -1,35 +0,0 @@ -@import 'variables/gutters'; - -.participants-list { - &__column-head { - padding: 0; - } - - &__sort-button { - position: relative; - background-color: transparent; - border-width: 0; - width: 100%; - text-align: left; - padding: var(--digi--layout--gutter--s) $digi--layout--gutter--l var(--digi--layout--gutter--s) - var(--digi--layout--gutter); - margin: 0; - font-size: inherit; - font-weight: inherit; - display: flex; - align-items: center; - gap: var(--digi--layout--gutter); - cursor: pointer; - } - - &__sort-icon { - position: absolute; - display: inline-flex; - right: 0.5rem; - } - - &__pagination { - display: block; - margin-top: var(--digi--layout--gutter); - } -} diff --git a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.spec.ts b/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.spec.ts deleted file mode 100644 index 1f94238..0000000 --- a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { DigiNgTableModule } from '@af/digi-ng/_table/table'; -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ParticipantsListComponent } from './participants-list.component'; - -describe('ParticipantsListComponent', () => { - let component: ParticipantsListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ParticipantsListComponent], - imports: [RouterTestingModule, DigiNgTableModule], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ParticipantsListComponent); - component = fixture.componentInstance; - component.participants = []; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.ts b/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.ts deleted file mode 100644 index 7f36896..0000000 --- a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; -import { Participant } from '@dafa-models/participant.model'; -import { Sort } from '@dafa-models/sort.model'; -import { BehaviorSubject } from 'rxjs'; - -@Component({ - selector: 'dafa-participants-list', - templateUrl: './participants-list.component.html', - styleUrls: ['./participants-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ParticipantsListComponent { - @Input() participants: Participant[]; - @Input() sortBy: Sort | null; - @Output() sorted = new EventEmitter(); - - private _currentPage$ = new BehaviorSubject(1); - private _participantsPerPage = 10; - - get currentPage(): number { - return this._currentPage$.getValue(); - } - - get totalPages(): number { - return Math.ceil(this.participants.length / this._participantsPerPage); - } - - get pagedParticipants(): Participant[] { - return [...this.participants].slice(this.currentResultStart - 1, this.currentResultEnd - 1); - } - - get currentResultStart(): number { - return (this.currentPage - 1) * this._participantsPerPage + 1; - } - - get currentResultEnd(): number { - return this.currentResultStart + this._participantsPerPage; - } - - handleSort(key: keyof Participant): void { - this.sorted.emit(key); - } - - handlePagination(page: number): void { - this._currentPage$.next(page); - } -} diff --git a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.module.ts b/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.module.ts deleted file mode 100644 index b17f57a..0000000 --- a/apps/dafa-web/src/app/pages/participants/components/participants-list/participants-list.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { DigiNgTableModule } from '@af/digi-ng/_table/table'; -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { ParticipantsListComponent } from './participants-list.component'; - -@NgModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ParticipantsListComponent], - imports: [CommonModule, RouterModule, DigiNgTableModule], - exports: [ParticipantsListComponent], -}) -export class ParticipantsListModule {} diff --git a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.html b/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.html deleted file mode 100644 index 3be77c0..0000000 --- a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.html +++ /dev/null @@ -1,202 +0,0 @@ - -
-
-
- Tillbaka till deltagarlistan -

Deltagarinformation

-
- - - - -
-
-

Personuppgifter

-
-
Namn:
-
{{ detailedParticipantData.fullName }}
-
Personnummer:
-
- -
-
Folkbokföringsadress:
-
- {{ detailedParticipantData.address.street }} + ' ' + {{ detailedParticipantData.address.number }}, - {{ detailedParticipantData.address.postalcode }} + ' ' + {{ detailedParticipantData.address.city }} -
-
Postadress:
-
- {{ detailedParticipantData.postalAddress.street }} + ' ' + {{ - detailedParticipantData.postalAddress.number }}, {{ detailedParticipantData.postalAddress.postalcode - }} + ' ' + {{ detailedParticipantData.postalAddress.city }} -
-
Telefon:
-
-
{{ detailedParticipantData.phoneMobile }}
-
Mailadress:
-
-
{{ detailedParticipantData.email }}
-
-
-
-

Särskilda behov

-
-
Funktionsnedsättningar
- - -
- {{ disability.name }}
- {{ disability.description }} -
-
-
-
-
Tolk
-
- Ja ( {{ detailedParticipantData.interpretorLanguage }} ) -
-
Språkstöd
-
- Ja ( {{ detailedParticipantData.supportLanguage }} ) -
-
-
-
-

Om tjänsten

-
-
Tillhörande tjänst
-
{{ detailedParticipantData.service }}
-
Datum för tjänstens början
-
- {{ detailedParticipantData.startDate | localDate }} -
-
Datum för tjänstens slut
-
- {{ detailedParticipantData.endDate | localDate }} -
-
Deltagandefrekvens
-
- {{ detailedParticipantData.service.frequency }} -
-
Utförande verksamhet
-
- {{ detailedParticipantData.service.organisation }} -
-
Utförande adress
-
- {{ detailedParticipantData.service.organisation.adress }} -
-
Genomförandereferens
-
- {{ detailedParticipantData.service.reference }} -
-
-
-
-
-
- - -
-
-

Arbetslivserfarenhet

-
-
Arbetsgivare
- - -
- - {{ workExperience.dateFrom | localDate }} - {{ workExperience.dateTo | localDate }}
- {{ workExperience.company }}
- {{ workExperience.direction }}
- {{ workExperience.description }} -
-
-
-
- - - {{ accordionExpanded ? 'Dölj' : 'Visa' }} fler arbetsgivare - - -
-
- - {{ workExperience.dateFrom | localDate }} - {{ workExperience.dateTo | localDate }}
- {{ workExperience.company }}
- {{ workExperience.direction }}
- {{ workExperience.description }} -
-
-
-
-
-
-
-

Utbildning

-
-
Utbildningar
- - -
- {{ education.dateFrom | localDate }} - {{ education.dateTo | localDate }}
- {{ education.organizer }}
- {{ education.direction }}
- {{ education.description }}
-
-
-
-
-
Högsta utbildningsnivå
-
- {{ detailedParticipantData.highestEduction }} -
-
-
-
Körkortsinformation
-
Innehar körkort ( {{ detailedParticipantData.driversLicenses ? 'Ja' : 'Nej' }} )
-
- - Körkortsklasser ( {{ detailedParticipantData.driversLicenses.join(', ') }} )
- Tillgång till bil ( {{ detailedParticipantData.accessToCar ? 'Ja' : 'Nej' }} ) -
-
-
-
-
-
-
-
- Tillbaka till deltagarlistan -
-
-
- - - - - -
- - Info saknas -
-
- -
- Nej -
-
-
diff --git a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.scss b/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.scss deleted file mode 100644 index a651369..0000000 --- a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.scss +++ /dev/null @@ -1,51 +0,0 @@ -@import 'variables/gutters'; - -.participant-card { - &__tab-contents { - display: flex; - gap: $digi--layout--gutter--xl $digi--layout--gutter--l; - margin-left: $digi--layout--gutter--l; - - h2 { - margin-top: $digi--layout--gutter--l; - } - } - - &__tab-column { - flex: 1; - max-width: var(--digi--typography--text--max-width); - } - - &__tab-column-education { - flex: 2; - } - - dl { - display: block; - } - - dt, - dd { - margin: 0; - padding-bottom: var(--digi--layout--gutter--xs); - } - - dt { - font-weight: var(--digi--typography--font-weight--semibold); - } - - &__employers-expansion { - width: 70%; - - &__trigger-text { - font-weight: var(--digi--typography--font-weight--bold); - } - } - - &__header, - &__footer { - display: flex; - flex-direction: row-reverse; - justify-content: space-between; - } -} diff --git a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.ts b/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.ts deleted file mode 100644 index c6c6bed..0000000 --- a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.component.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { IconType } from '@dafa-enums/icon-type.enum'; -import { Participant } from '@dafa-models/participant.model'; -import { ParticipantsService } from '@dafa-services/api/participants.service'; -import { Observable } from 'rxjs'; -import { map, switchMap } from 'rxjs/operators'; - -@Component({ - selector: 'dafa-participant-card', - templateUrl: './participant-card.component.html', - styleUrls: ['./participant-card.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ParticipantCardComponent { - private _participantId$: Observable = this.activatedRoute.params.pipe( - map(({ participantId }) => participantId as string) - ); - detailedParticipantData$: Observable = this._participantId$.pipe( - switchMap(participantId => this.participantsService.fetchDetailedParticipantData$(participantId)) - ); - iconType = IconType; - accordionExpanded = false; - - constructor(private activatedRoute: ActivatedRoute, private participantsService: ParticipantsService) {} - - toggleAccordionExpanded(): void { - this.accordionExpanded = !this.accordionExpanded; - } -} diff --git a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.module.ts b/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.module.ts deleted file mode 100644 index c4c5067..0000000 --- a/apps/dafa-web/src/app/pages/participants/pages/participant-card/participant-card.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DigiNgLinkInternalModule } from '@af/digi-ng/_link/link-internal'; -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { BackLinkModule } from '@dafa-shared/components/back-link/back-link.module'; -import { IconModule } from '@dafa-shared/components/icon/icon.module'; -import { LayoutModule } from '@dafa-shared/components/layout/layout.module'; -import { ParticipantCardComponent } from './participant-card.component'; -import { HideTextModule } from '@dafa-shared/components/hide-text/hide-text.module'; -import { DigiNgNavigationTabsModule } from '@af/digi-ng/_navigation/navigation-tabs'; -import { DigiNgNavigationTabModule } from '@af/digi-ng/_navigation/navigation-tab'; -import { DigiNgLayoutExpansionPanelModule } from '@af/digi-ng/_layout/layout-expansion-panel'; -import { DigiNgTypographyBaseModule } from '@af/digi-ng/_typography/typography-base'; -import { LocalDatePipeModule } from '@dafa-shared/pipes/local-date/local-date.module'; - -@NgModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ParticipantCardComponent], - imports: [ - CommonModule, - RouterModule.forChild([{ path: '', component: ParticipantCardComponent }]), - LayoutModule, - DigiNgLinkInternalModule, - IconModule, - BackLinkModule, - HideTextModule, - DigiNgNavigationTabsModule, - DigiNgNavigationTabModule, - DigiNgLayoutExpansionPanelModule, - DigiNgTypographyBaseModule, - LocalDatePipeModule, - ], - exports: [ParticipantCardComponent], -}) -export class ParticipantCardModule {} diff --git a/apps/dafa-web/src/app/pages/participants/participants-routing.module.ts b/apps/dafa-web/src/app/pages/participants/participants-routing.module.ts deleted file mode 100644 index 2a25de9..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants-routing.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ParticipantsComponent } from './participants.component'; - -const routes: Routes = [ - { - path: '', - component: ParticipantsComponent, - }, - { - path: ':participantId', - loadChildren: () => import('./pages/participant-card/participant-card.module').then(m => m.ParticipantCardModule), - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class ParticipantsRoutingModule {} diff --git a/apps/dafa-web/src/app/pages/participants/participants.component.html b/apps/dafa-web/src/app/pages/participants/participants.component.html deleted file mode 100644 index d3bdc3e..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants.component.html +++ /dev/null @@ -1,44 +0,0 @@ - -
- -

Mina deltagare

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam magna neque, interdum vel massa eget, condimentum - rutrum velit. Sed vitae ullamcorper sem. Aliquam malesuada nunc sed purus mollis scelerisque. Curabitur bibendum - leo quis ante porttitor tincidunt. Nam tincidunt imperdiet tortor eu suscipit. Maecenas ut dui est. -

-
- -
- -
- -
-

Pågående tjänst

- -
- -
-

För uppföljning

- -
- - - - -
-
diff --git a/apps/dafa-web/src/app/pages/participants/participants.component.scss b/apps/dafa-web/src/app/pages/participants/participants.component.scss deleted file mode 100644 index 091ea36..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -@import 'variables/gutters'; - -.participants { - &__search-wrapper { - max-width: var(--digi--typography--text--max-width); - margin-top: $digi--layout--gutter--l; - margin-bottom: $digi--layout--gutter--xl; - } -} diff --git a/apps/dafa-web/src/app/pages/participants/participants.component.spec.ts b/apps/dafa-web/src/app/pages/participants/participants.component.spec.ts deleted file mode 100644 index fcbabab..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants.component.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ParticipantsListModule } from './components/participants-list/participants-list.module'; -import { ParticipantsComponent } from './participants.component'; - -describe('ParticipantsComponent', () => { - let component: ParticipantsComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - void TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ParticipantsComponent], - imports: [RouterTestingModule, HttpClientTestingModule, DigiNgSkeletonBaseModule, ParticipantsListModule], - }).compileComponents(); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(ParticipantsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/dafa-web/src/app/pages/participants/participants.component.ts b/apps/dafa-web/src/app/pages/participants/participants.component.ts deleted file mode 100644 index b51b02c..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { Participant } from '@dafa-models/participant.model'; -import { Sort } from '@dafa-models/sort.model'; -import { ParticipantsService } from '@dafa-services/api/participants.service'; -import { BehaviorSubject, Observable } from 'rxjs'; - -@Component({ - selector: 'dafa-participants', - templateUrl: './participants.component.html', - styleUrls: ['./participants.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ParticipantsComponent { - private _searchValue$ = new BehaviorSubject(''); - activeParticipants$: Observable = this.participantsService.activeParticipants$; - followUpParticipants$: Observable = this.participantsService.followUpParticipants$; - activeParticipantsSortBy$: Observable | null> = this.participantsService - .activeParticipantsSortBy$; - followUpParticipantsSortBy$: Observable | null> = this.participantsService - .followUpParticipantsSortBy$; - - constructor(private participantsService: ParticipantsService) {} - - get searchValue(): string { - return this._searchValue$.getValue(); - } - - handleSearchSubmit(): void { - this.participantsService.setSearchFilter(this.searchValue); - } - - handleSearchInput($event: CustomEvent): void { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - this._searchValue$.next($event.detail.target.value); - } - - handleActiveParticipantsSort(key: keyof Participant): void { - this.participantsService.setActiveParticipantsSortKey(key); - } - - handleFollowUpParticipantsSort(key: keyof Participant): void { - this.participantsService.setFollowUpParticipantsSortKey(key); - } -} diff --git a/apps/dafa-web/src/app/pages/participants/participants.module.ts b/apps/dafa-web/src/app/pages/participants/participants.module.ts deleted file mode 100644 index 69cc0bb..0000000 --- a/apps/dafa-web/src/app/pages/participants/participants.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { LayoutModule } from '@dafa-shared/components/layout/layout.module'; -import { ParticipantsListModule } from './components/participants-list/participants-list.module'; -import { ParticipantsRoutingModule } from './participants-routing.module'; -import { ParticipantsComponent } from './participants.component'; - -@NgModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ParticipantsComponent], - imports: [ - CommonModule, - LayoutModule, - ParticipantsRoutingModule, - FormsModule, - DigiNgSkeletonBaseModule, - ParticipantsListModule, - ], -}) -export class ParticipantsModule {} diff --git a/apps/dafa-web/src/app/shared/models/api/deltagare.response.model.ts b/apps/dafa-web/src/app/shared/models/api/deltagare.response.model.ts index 784385d..1d5cddd 100644 --- a/apps/dafa-web/src/app/shared/models/api/deltagare.response.model.ts +++ b/apps/dafa-web/src/app/shared/models/api/deltagare.response.model.ts @@ -4,6 +4,7 @@ import { DriversLicenseResponse } from './drivers-license.response.model'; import { EducationsResponse } from './educations.response.model'; import { HighestEducationResponse } from './highest-education.response.model'; import { TranslatorResponse } from './translator.response.model'; +import { WorkExperiencesResponse } from './work-experiences.response.model'; import { WorkLanguagesResponse } from './work-languages.response.model'; export interface DeltagareResponse { @@ -15,4 +16,5 @@ export interface DeltagareResponse { translator: TranslatorResponse; workLanguages: WorkLanguagesResponse; disabilities: DisabilitiesResponse; + workExperiences: WorkExperiencesResponse; } diff --git a/apps/dafa-web/src/app/shared/models/api/disability.response.model.ts b/apps/dafa-web/src/app/shared/models/api/disability.response.model.ts index 914ccf6..efd8d2f 100644 --- a/apps/dafa-web/src/app/shared/models/api/disability.response.model.ts +++ b/apps/dafa-web/src/app/shared/models/api/disability.response.model.ts @@ -1,4 +1,5 @@ export interface DisabilityResponse { + kod: string; funktionsnedsattning: string; beskrivning: string; diff --git a/apps/dafa-web/src/app/shared/models/deltagare.model.ts b/apps/dafa-web/src/app/shared/models/deltagare.model.ts index c567284..e5fe975 100644 --- a/apps/dafa-web/src/app/shared/models/deltagare.model.ts +++ b/apps/dafa-web/src/app/shared/models/deltagare.model.ts @@ -6,6 +6,7 @@ import { DriversLicense, mapResponseToDriversLicense } from './drivers-license.m import { Education, mapResponseToEducation } from './education.model'; import { HighestEducation, mapResponseToHighestEducation } from './highest-education.model'; import { PhoneNumber } from './phonenumber.model'; +import { mapResponseToWorkExperience, WorkExperience } from './work-experience.model'; export interface DeltagareCompact { id: string; @@ -25,11 +26,21 @@ export interface Deltagare extends DeltagareCompact { translator: string; disabilities: Disability[]; workLanguages: string[]; - // workExperiences: WorkExperience[]; // TODO: Missing from API + workExperiences: WorkExperience[]; } export function mapResponseToDeltagare(data: DeltagareResponse): Deltagare { - const { id, contact, driverlicense, highestEducation, educations, translator, workLanguages, disabilities } = data; + const { + id, + contact, + driverlicense, + highestEducation, + educations, + translator, + workLanguages, + disabilities, + workExperiences, + } = data; return { id, @@ -41,5 +52,8 @@ export function mapResponseToDeltagare(data: DeltagareResponse): Deltagare { workLanguages: workLanguages && workLanguages.sprak.map(language => language.beskrivning), disabilities: disabilities && disabilities.funktionsnedsattningar.map(disability => mapResponseToDisability(disability)), + workExperiences: + workExperiences && + workExperiences.arbetslivserfarenheter.map(workExperience => mapResponseToWorkExperience(workExperience)), }; } diff --git a/apps/dafa-web/src/app/shared/models/disability.model.ts b/apps/dafa-web/src/app/shared/models/disability.model.ts index 9608b05..8999158 100644 --- a/apps/dafa-web/src/app/shared/models/disability.model.ts +++ b/apps/dafa-web/src/app/shared/models/disability.model.ts @@ -8,7 +8,6 @@ export interface Disability { export function mapResponseToDisability(data: DisabilityResponse): Disability { const { kod, funktionsnedsattning, beskrivning } = data; - return { code: kod, title: funktionsnedsattning, // TODO: Needed from API diff --git a/apps/dafa-web/src/app/shared/models/education.model.ts b/apps/dafa-web/src/app/shared/models/education.model.ts index 4dd0027..3187ec0 100644 --- a/apps/dafa-web/src/app/shared/models/education.model.ts +++ b/apps/dafa-web/src/app/shared/models/education.model.ts @@ -1,12 +1,12 @@ -import { formatToIsoDate } from '@dafa-utils/format-to-iso-date.util'; +import { formatToDate } from '@dafa-utils/format-to-date.util'; import { EducationResponse } from './api/education.response.model'; export interface Education { education: string; description: string; organizer: string; - dateFrom: string; - dateTo: string; + dateFrom: Date; + dateTo: Date; } export function mapResponseToEducation(data: EducationResponse): Education { @@ -16,7 +16,7 @@ export function mapResponseToEducation(data: EducationResponse): Education { education: utbildning, description: beskrivning, organizer: anordnare, - dateFrom: formatToIsoDate(period_from), - dateTo: formatToIsoDate(period_tom), + dateFrom: formatToDate(period_from), + dateTo: formatToDate(period_tom), }; } diff --git a/apps/dafa-web/src/app/shared/models/user.model.ts b/apps/dafa-web/src/app/shared/models/user.model.ts index e01aaa8..5c849b4 100644 --- a/apps/dafa-web/src/app/shared/models/user.model.ts +++ b/apps/dafa-web/src/app/shared/models/user.model.ts @@ -26,6 +26,7 @@ export interface UserApiResponseData { export function mapUserApiResponseToUser(data: UserApiResponseData): User { const { id, firstName, lastName, ssn, organizations, authorizations } = data; + return { id, firstName, diff --git a/apps/dafa-web/src/app/shared/models/work-experience.model.ts b/apps/dafa-web/src/app/shared/models/work-experience.model.ts index eb25bf3..ae9b018 100644 --- a/apps/dafa-web/src/app/shared/models/work-experience.model.ts +++ b/apps/dafa-web/src/app/shared/models/work-experience.model.ts @@ -1,12 +1,12 @@ -import { formatToIsoDate } from '@dafa-utils/format-to-iso-date.util'; +import { formatToDate } from '@dafa-utils/format-to-date.util'; import { WorkExperienceResponse } from './api/work-experience.response.model'; export interface WorkExperience { profession: string; description: string; employer: string; - dateFrom: string; - dateTo: string; + dateFrom: Date; + dateTo: Date; } export function mapResponseToWorkExperience(data: WorkExperienceResponse): WorkExperience { @@ -16,7 +16,7 @@ export function mapResponseToWorkExperience(data: WorkExperienceResponse): WorkE profession: yrke, description: beskrivning, employer: arbetsgivare, - dateFrom: formatToIsoDate(period_from), - dateTo: formatToIsoDate(period_tom), + dateFrom: formatToDate(period_from), + dateTo: formatToDate(period_tom), }; } diff --git a/apps/dafa-web/src/app/shared/services/api/deltagare.service.ts b/apps/dafa-web/src/app/shared/services/api/deltagare.service.ts index 5d1444d..3667a8d 100644 --- a/apps/dafa-web/src/app/shared/services/api/deltagare.service.ts +++ b/apps/dafa-web/src/app/shared/services/api/deltagare.service.ts @@ -18,7 +18,7 @@ import { Education, mapResponseToEducation } from '@dafa-models/education.model' import { HighestEducation, mapResponseToHighestEducation } from '@dafa-models/highest-education.model'; import { mapResponseToWorkExperience, WorkExperience } from '@dafa-models/work-experience.model'; import { combineLatest, Observable } from 'rxjs'; -import { map, tap } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; const API_HEADERS = { headers: environment.api.headers }; @@ -30,16 +30,10 @@ export class DeltagareService { private _fetchAllDeltagare: Observable = this.httpClient .get<{ data: DeltagareResponse[] }>(`${this._apiBaseUrl}`, { ...API_HEADERS }) - .pipe( - map(response => { - return response.data; - }) - ); + .pipe(map(response => response.data)); public allDeltagare$: Observable = this._fetchAllDeltagare.pipe( - map(data => { - return data.map(deltagare => mapResponseToDeltagare(deltagare)); - }) + map(data => data.map(deltagare => mapResponseToDeltagare(deltagare))) ); private _fetchContactInformation$(id: string): Observable { @@ -47,16 +41,19 @@ export class DeltagareService { .get<{ data: ContactInformationResponse }>(`${this._apiBaseUrl}/contact/${id}`, { ...API_HEADERS }) .pipe(map(response => mapResponseToContactInformation(response.data))); } + private _fetchDriversLicense$(id: string): Observable { return this.httpClient .get<{ data: DriversLicenseResponse }>(`${this._apiBaseUrl}/driverlicense/${id}`, { ...API_HEADERS }) .pipe(map(response => mapResponseToDriversLicense(response.data))); } + private _fetchHighestEducation$(id: string): Observable { return this.httpClient .get<{ data: HighestEducationResponse }>(`${this._apiBaseUrl}/education/highest/${id}`, { ...API_HEADERS }) .pipe(map(response => mapResponseToHighestEducation(response.data))); } + private _fetchEducations$(id: string): Observable { return this.httpClient .get<{ data: EducationsResponse }>(`${this._apiBaseUrl}/education/${id}`, { ...API_HEADERS }) @@ -68,21 +65,23 @@ export class DeltagareService { ) ); } + private _fetchTranslator$(id: string): Observable { return this.httpClient .get<{ data: TranslatorResponse }>(`${this._apiBaseUrl}/translator/${id}`, { ...API_HEADERS }) .pipe(map(response => (response.data.sprak ? response.data.sprak.beskrivning : null))); } + private _fetchWorkLanguages$(id: string): Observable { return this.httpClient .get<{ data: WorkLanguagesResponse }>(`${this._apiBaseUrl}/work/languages/${id}`, { ...API_HEADERS }) .pipe(map(response => (response.data.sprak ? response.data.sprak.map(sprak => sprak.beskrivning) : []))); } + private _fetchDisabilities$(id: string): Observable { return this.httpClient .get(`${this._apiBaseUrl}/work/disability/${id}`, { ...API_HEADERS }) .pipe( - tap(response => console.log(response)), map(response => response ? response[0].map(funktionsnedsattning => mapResponseToDisability(funktionsnedsattning)) : [] ) diff --git a/apps/dafa-web/src/app/shared/utils/format-to-iso-date.util.ts b/apps/dafa-web/src/app/shared/utils/format-to-date.util.ts similarity index 52% rename from apps/dafa-web/src/app/shared/utils/format-to-iso-date.util.ts rename to apps/dafa-web/src/app/shared/utils/format-to-date.util.ts index a1249e2..c7784f4 100644 --- a/apps/dafa-web/src/app/shared/utils/format-to-iso-date.util.ts +++ b/apps/dafa-web/src/app/shared/utils/format-to-date.util.ts @@ -1,5 +1,5 @@ // Takes either 6 or 8 characters string (YYYYMMDD) and formats it to ISO standard (YYYY-MM-DD). -export function formatToIsoDate(date: string): string { +export function formatToIsoString(date: string): string { if (date.length === 6) { return `${date.substring(0, 4)}-${date.substring(4)}`; } else if (date.length === 8) { @@ -8,3 +8,11 @@ export function formatToIsoDate(date: string): string { return date; } + +export function formatToDate(date: string): Date { + const year = date.substring(0, 4); + const month = date.substring(4, 6) || '01'; + const day = date.substring(6, 8) || '01'; + + return new Date(`${year}-${month}-${day}`); +} diff --git a/mock-api/dafa-web/scripts/deltagare.js b/mock-api/dafa-web/scripts/deltagare.js index dac34a4..c1a7b1d 100644 --- a/mock-api/dafa-web/scripts/deltagare.js +++ b/mock-api/dafa-web/scripts/deltagare.js @@ -4,6 +4,7 @@ import educationLevels from './education-levels.js'; import languages from './languages.js'; import sunKoder from './sun-koder.js'; import chooseRandom from './utils/choose-random.util.js'; +import workExperiences from './work-experiences.js'; faker.locale = 'sv'; @@ -12,6 +13,7 @@ const DRIVERS_LICENSES = ['AM', 'A1', 'A2', 'A', 'B', 'BE', 'B96', 'C1', 'C', 'C const EDUCATION_LEVELS = educationLevels.generate(); const SUN_KODER = sunKoder.generate(); const DISABILITIES = disabilities.generate(); +const WORK_EXPERIENCES = workExperiences.generate(); const EDUCATIONS = [ { utbildning: 'Lingvistik', @@ -107,6 +109,9 @@ function generateDeltagare(amount = 10) { disabilities: { funktionsnedsattningar: Math.random() > 0.3 ? chooseRandom(DISABILITIES, faker.datatype.number(3)) : [], }, + workExperiences: { + arbetslivserfarenheter: chooseRandom(WORK_EXPERIENCES, faker.datatype.number(WORK_EXPERIENCES.length)), + } }; if (Math.random() > 0.8) { deltagare.contact.adresser.push({ diff --git a/mock-api/dafa-web/scripts/work-experiences.js b/mock-api/dafa-web/scripts/work-experiences.js new file mode 100644 index 0000000..2f7eb5b --- /dev/null +++ b/mock-api/dafa-web/scripts/work-experiences.js @@ -0,0 +1,38 @@ +function generateWorkExperiences() { + console.info('Work experiences generated...'); + return [ + { + yrke: 'Revisorer m.fl.', + beskrivning: 'asasaf', + arbetsgivare: 'Jobbet AB', + period_from: '20090501', + period_tom: '20110430' + }, + { + yrke: 'Revisorer m.fl.', + beskrivning: 'asasaf', + arbetsgivare: 'Himmelsö AB', + period_from: '20130829', + period_tom: '20140128' + }, + { + yrke: 'Revisorer m.fl.', + beskrivning: 'asasaf', + arbetsgivare: 'Himmelsö AB', + period_from: '20140129', + period_tom: '20141126' + }, + { + yrke: 'Revisorer m.fl.', + beskrivning: 'AFAsdfasdf', + arbetsgivare: 'Distansutbildningsnämnden', + period_from: '20140527', + period_tom: '20141126' + }, + ]; + } + + export default { + generate: generateWorkExperiences, + }; + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 702846a..6a1b6fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@angular/platform-browser": "^11.2.0", "@angular/platform-browser-dynamic": "^11.2.0", "@angular/router": "^11.2.0", - "@digi/core": "^9.1.0", + "@digi/core": "^9.4.0", "@digi/styles": "^6.0.2", "@nrwl/angular": "11.5.1", "date-fns": "^2.22.1", @@ -2716,9 +2716,9 @@ } }, "node_modules/@digi/core": { - "version": "9.1.0", - "resolved": "http://nexus.arbetsformedlingen.se/repository/npm/@digi/core/-/core-9.1.0.tgz", - "integrity": "sha512-d2qTtSWPq0XfIwMaTsVIBdD5gnof7kJcUo4mHTGDaoN7tKD624u8CbbhaYaE3BF/0awuDEQkwxYSzuYiprJmUg==", + "version": "9.4.0", + "resolved": "http://nexus.arbetsformedlingen.se/repository/npm/@digi/core/-/core-9.4.0.tgz", + "integrity": "sha512-47n9gPOAatEKMDy5GPH0sM/xHCizPrKnyjxb9zAxeHntSQdqstsTvb5/03gntqxKY8YndpJd2ksPxhU6w1ri5g==", "license": "MIT" }, "node_modules/@digi/styles": { @@ -35654,9 +35654,9 @@ } }, "@digi/core": { - "version": "9.1.0", - "resolved": "http://nexus.arbetsformedlingen.se/repository/npm/@digi/core/-/core-9.1.0.tgz", - "integrity": "sha512-d2qTtSWPq0XfIwMaTsVIBdD5gnof7kJcUo4mHTGDaoN7tKD624u8CbbhaYaE3BF/0awuDEQkwxYSzuYiprJmUg==" + "version": "9.4.0", + "resolved": "http://nexus.arbetsformedlingen.se/repository/npm/@digi/core/-/core-9.4.0.tgz", + "integrity": "sha512-47n9gPOAatEKMDy5GPH0sM/xHCizPrKnyjxb9zAxeHntSQdqstsTvb5/03gntqxKY8YndpJd2ksPxhU6w1ri5g==" }, "@digi/styles": { "version": "6.0.2", diff --git a/package.json b/package.json index 15a4277..4bbc535 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@angular/platform-browser": "^11.2.0", "@angular/platform-browser-dynamic": "^11.2.0", "@angular/router": "^11.2.0", - "@digi/core": "^9.1.0", + "@digi/core": "^9.4.0", "@digi/styles": "^6.0.2", "@nrwl/angular": "11.5.1", "date-fns": "^2.22.1",