Merge branch 'next' into develop

This commit is contained in:
Erik Tiekstra
2021-09-28 09:34:29 +02:00
8 changed files with 36 additions and 27 deletions

View File

@@ -0,0 +1,6 @@
export enum TrackName {
A012SP1 = 'Nivå A',
A012SP2 = 'Nivå B',
A012SP3 = 'Nivå C',
UNKNOWN = 'Info saknas',
}

View File

@@ -1,3 +1,4 @@
import { TrackName } from '@msfa-enums/track-name.enum';
import { AvropResponse } from './api/avrop.response.model';
import { PaginationMeta } from './pagination-meta.model';
@@ -59,7 +60,7 @@ export function mapAvropResponseToAvrop(data: AvropResponse): Avrop {
sprakstod: sprakstod,
utforandeAdress: adress,
trackCode: sparkod,
trackName: sparNamn,
trackName: TrackName[sparkod] || TrackName.UNKNOWN,
genomforandeReferens,
participationFrequency: deltagandeGrad,
utforandeVerksamhet: utforandeverksamhet,

View File

@@ -4,7 +4,7 @@ import { AvropCompact, AvropCompactData } from '@msfa-models/avrop.model';
import { Handledare } from '@msfa-models/handledare.model';
import { AvropApiService } from '@msfa-services/api/avrop-api.service';
import { MultiselectFilterOption } from '@msfa-shared/components/multiselect/multiselect-filter-option';
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
import { BehaviorSubject, combineLatest, Observable, of } from 'rxjs';
import { filter, map, switchMap, tap } from 'rxjs/operators';
type Step = 1 | 2 | 3 | 4;
@@ -34,12 +34,13 @@ export class AvropService {
public filteredKommuner$: Observable<MultiselectFilterOption[]> = this._filteredKommuner$.asObservable();
public selectedAvrop$: Observable<AvropCompact[]> = this._selectedAvrop$.asObservable();
public avropIsLocked$: Observable<boolean> = this._avropIsLocked$.asObservable();
public selectedHandledare$: Observable<Handledare> = this._selectedHandledareId$.pipe(
filter(selectedHandledare => !!selectedHandledare),
public selectedHandledare$: Observable<Handledare | null> = this._selectedHandledareId$.pipe(
switchMap(handledareId =>
this.availableHandledare$.pipe(
map(availableHandledare => availableHandledare.find(handledare => handledare.ciamUserId === handledareId))
)
handledareId
? this.availableHandledare$.pipe(
map(availableHandledare => availableHandledare.find(handledare => handledare.ciamUserId === handledareId))
)
: of(null as null)
)
);
public handledareIsConfirmed$: Observable<boolean> = this._handledareIsConfirmed$.asObservable();
@@ -201,6 +202,7 @@ export class AvropService {
public unconfirmHandledare(): void {
this.resetError();
this._selectedHandledareId$.next(null);
this._handledareIsConfirmed$.next(false);
}
@@ -221,6 +223,7 @@ export class AvropService {
}
public assignHandledare(handledareId: string): void {
this.resetError();
this._selectedHandledareId$.next(handledareId);
}