Merge pull request #140 in TEA/mina-sidor-fa-web from bugfix/TV-699 to next
Squashed commit of the following: commit 649afa24e8e5b1e99bc2c4bc7b5ac304bd79f7f1 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Tue Sep 28 09:30:43 2021 +0200 Fixed small linting issues and text-change after PR commit bc3716f037d3b1fce8b55fc875d9d68cb555e2c6 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Tue Sep 28 08:44:38 2021 +0200 Fixed issue with error state on handledare-select
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- **deltagare:** Now fetching data using "genomforandeReferens" instead of "sokandeId" to avoid wrong data. [TV-692](https://jira.arbetsformedlingen.se/browse/TV-692)
|
- **deltagare:** Now fetching data using "genomforandeReferens" instead of "sokandeId" to avoid wrong data. [TV-692](https://jira.arbetsformedlingen.se/browse/TV-692)
|
||||||
- **authorization:** Whenever the API throws a "403 Forbidden" error we now show an unauthorized message. [TV-695](https://jira.arbetsformedlingen.se/browse/TV-695)
|
- **authorization:** Whenever the API throws a "403 Forbidden" error we now show an unauthorized message. [TV-695](https://jira.arbetsformedlingen.se/browse/TV-695)
|
||||||
|
- **avrop:** Fixed error-state on handledare select. [TV-699](https://jira.arbetsformedlingen.se/browse/TV-699)
|
||||||
|
|
||||||
## [2.0.0](https://bitbucket.arbetsformedlingen.se/projects/tea/repos/mina-sidor-fa-web/compare/diff?targetBranch=refs%2Ftags%2Fv1.5.0&sourceBranch=refs%2Ftags%2Fv2.0.0) (2021-09-24)
|
## [2.0.0](https://bitbucket.arbetsformedlingen.se/projects/tea/repos/mina-sidor-fa-web/compare/diff?targetBranch=refs%2Ftags%2Fv1.5.0&sourceBranch=refs%2Ftags%2Fv2.0.0) (2021-09-24)
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,12 @@
|
|||||||
af-label="Välj handledare att tilldela"
|
af-label="Välj handledare att tilldela"
|
||||||
af-placeholder="Välj handledare"
|
af-placeholder="Välj handledare"
|
||||||
[afRequired]="true"
|
[afRequired]="true"
|
||||||
af-validation="error"
|
af-validation-text="Handledare måste väljas"
|
||||||
|
[afValidation]="(error$ | async) ? 'error' : 'neutral'"
|
||||||
(afOnChange)="changeHandledare($event.detail)"
|
(afOnChange)="changeHandledare($event.detail)"
|
||||||
>
|
>
|
||||||
<option
|
<option *ngFor="let handledare of availableHandledare" [value]="handledare.ciamUserId">
|
||||||
*ngFor="let availableHandledare of availableHandledare"
|
{{ handledare.fullName }}
|
||||||
[value]="availableHandledare.ciamUserId"
|
|
||||||
>
|
|
||||||
{{ availableHandledare.fullName }}
|
|
||||||
</option>
|
</option>
|
||||||
</digi-form-select>
|
</digi-form-select>
|
||||||
|
|
||||||
@@ -68,7 +66,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Välj deltagare att tilldela handledare</h3>
|
<h3 *ngIf="currentStep === 1">Välj deltagare att tilldela handledare</h3>
|
||||||
<msfa-avrop-list
|
<msfa-avrop-list
|
||||||
[availableAvrop]="avropData.data"
|
[availableAvrop]="avropData.data"
|
||||||
[paginationMeta]="avropData.meta"
|
[paginationMeta]="avropData.meta"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class AvropComponent {
|
|||||||
avropData$: Observable<AvropCompactData> = this.avropService.avropData$;
|
avropData$: Observable<AvropCompactData> = this.avropService.avropData$;
|
||||||
selectedAvrop$: Observable<AvropCompact[]> = this.avropService.selectedAvrop$;
|
selectedAvrop$: Observable<AvropCompact[]> = this.avropService.selectedAvrop$;
|
||||||
availableHandledare$: Observable<Handledare[]> = this.avropService.availableHandledare$;
|
availableHandledare$: Observable<Handledare[]> = this.avropService.availableHandledare$;
|
||||||
selectedHandledare$: Observable<Handledare> = this.avropService.selectedHandledare$;
|
selectedHandledare$: Observable<Handledare | null> = this.avropService.selectedHandledare$;
|
||||||
avropIsLocked$: Observable<boolean> = this.avropService.avropIsLocked$;
|
avropIsLocked$: Observable<boolean> = this.avropService.avropIsLocked$;
|
||||||
handledareConfirmed$: Observable<boolean> = this.avropService.handledareIsConfirmed$;
|
handledareConfirmed$: Observable<boolean> = this.avropService.handledareIsConfirmed$;
|
||||||
avropIsSubmitted$: Observable<boolean> = this.avropService.avropIsSubmitted$;
|
avropIsSubmitted$: Observable<boolean> = this.avropService.avropIsSubmitted$;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { AvropCompact, AvropCompactData } from '@msfa-models/avrop.model';
|
|||||||
import { Handledare } from '@msfa-models/handledare.model';
|
import { Handledare } from '@msfa-models/handledare.model';
|
||||||
import { AvropApiService } from '@msfa-services/api/avrop-api.service';
|
import { AvropApiService } from '@msfa-services/api/avrop-api.service';
|
||||||
import { MultiselectFilterOption } from '@msfa-shared/components/multiselect/multiselect-filter-option';
|
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';
|
import { filter, map, switchMap, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
type Step = 1 | 2 | 3 | 4;
|
type Step = 1 | 2 | 3 | 4;
|
||||||
@@ -34,12 +34,13 @@ export class AvropService {
|
|||||||
public filteredKommuner$: Observable<MultiselectFilterOption[]> = this._filteredKommuner$.asObservable();
|
public filteredKommuner$: Observable<MultiselectFilterOption[]> = this._filteredKommuner$.asObservable();
|
||||||
public selectedAvrop$: Observable<AvropCompact[]> = this._selectedAvrop$.asObservable();
|
public selectedAvrop$: Observable<AvropCompact[]> = this._selectedAvrop$.asObservable();
|
||||||
public avropIsLocked$: Observable<boolean> = this._avropIsLocked$.asObservable();
|
public avropIsLocked$: Observable<boolean> = this._avropIsLocked$.asObservable();
|
||||||
public selectedHandledare$: Observable<Handledare> = this._selectedHandledareId$.pipe(
|
public selectedHandledare$: Observable<Handledare | null> = this._selectedHandledareId$.pipe(
|
||||||
filter(selectedHandledare => !!selectedHandledare),
|
|
||||||
switchMap(handledareId =>
|
switchMap(handledareId =>
|
||||||
this.availableHandledare$.pipe(
|
handledareId
|
||||||
map(availableHandledare => availableHandledare.find(handledare => handledare.ciamUserId === handledareId))
|
? this.availableHandledare$.pipe(
|
||||||
)
|
map(availableHandledare => availableHandledare.find(handledare => handledare.ciamUserId === handledareId))
|
||||||
|
)
|
||||||
|
: of(null as null)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
public handledareIsConfirmed$: Observable<boolean> = this._handledareIsConfirmed$.asObservable();
|
public handledareIsConfirmed$: Observable<boolean> = this._handledareIsConfirmed$.asObservable();
|
||||||
@@ -201,6 +202,7 @@ export class AvropService {
|
|||||||
|
|
||||||
public unconfirmHandledare(): void {
|
public unconfirmHandledare(): void {
|
||||||
this.resetError();
|
this.resetError();
|
||||||
|
this._selectedHandledareId$.next(null);
|
||||||
this._handledareIsConfirmed$.next(false);
|
this._handledareIsConfirmed$.next(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +223,7 @@ export class AvropService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public assignHandledare(handledareId: string): void {
|
public assignHandledare(handledareId: string): void {
|
||||||
|
this.resetError();
|
||||||
this._selectedHandledareId$.next(handledareId);
|
this._selectedHandledareId$.next(handledareId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- **deltagare:** Now fetching data using "genomforandeReferens" instead of "sokandeId" to avoid wrong data. [TV-692](https://jira.arbetsformedlingen.se/browse/TV-692)
|
- **deltagare:** Now fetching data using "genomforandeReferens" instead of "sokandeId" to avoid wrong data. [TV-692](https://jira.arbetsformedlingen.se/browse/TV-692)
|
||||||
- **authorization:** Whenever the API throws a "403 Forbidden" error we now show an unauthorized message. [TV-695](https://jira.arbetsformedlingen.se/browse/TV-695)
|
- **authorization:** Whenever the API throws a "403 Forbidden" error we now show an unauthorized message. [TV-695](https://jira.arbetsformedlingen.se/browse/TV-695)
|
||||||
|
- **avrop:** Fixed error-state on handledare select. [TV-699](https://jira.arbetsformedlingen.se/browse/TV-699)
|
||||||
|
|
||||||
## [2.0.0](https://bitbucket.arbetsformedlingen.se/projects/tea/repos/mina-sidor-fa-web/compare/diff?targetBranch=refs%2Ftags%2Fv1.5.0&sourceBranch=refs%2Ftags%2Fv2.0.0) (2021-09-24)
|
## [2.0.0](https://bitbucket.arbetsformedlingen.se/projects/tea/repos/mina-sidor-fa-web/compare/diff?targetBranch=refs%2Ftags%2Fv1.5.0&sourceBranch=refs%2Ftags%2Fv2.0.0) (2021-09-24)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user