feat(avrop): Updated Avrop response model and fixed mappings. (TV-873)
Squashed commit of the following: commit a03d179cd05a2266b11ac01acb2f2e07f9bb943d Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Nov 4 08:31:59 2021 +0100 Updated name of AvropData model to AvropAndMeta commit d5e40567c991c15b23ac5b0978b3cc9c7084d697 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Nov 4 08:26:42 2021 +0100 Updated Avrop response model and mapping function
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, OnDestroy } from '@angular/core';
|
||||
import { AvropCompact, AvropCompactData } from '@msfa-models/avrop.model';
|
||||
import { Avrop, AvropAndMeta } from '@msfa-models/avrop.model';
|
||||
import { Handledare } from '@msfa-models/handledare.model';
|
||||
import { AvropService } from '@msfa-services/avrop.service';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -14,8 +14,8 @@ export class AvropComponent implements OnDestroy {
|
||||
readonly totalAmountOfSteps = 3;
|
||||
currentStep$: Observable<number> = this.avropService.currentStep$;
|
||||
error$: Observable<string> = this.avropService.error$;
|
||||
avropData$: Observable<AvropCompactData> = this.avropService.avropData$;
|
||||
selectedAvrop$: Observable<AvropCompact[]> = this.avropService.selectedAvrop$;
|
||||
avropData$: Observable<AvropAndMeta> = this.avropService.avropData$;
|
||||
selectedAvrop$: Observable<Avrop[]> = this.avropService.selectedAvrop$;
|
||||
availableHandledare$: Observable<Handledare[]> = this.avropService.availableHandledare$;
|
||||
selectedHandledare$: Observable<Handledare | null> = this.avropService.selectedHandledare$;
|
||||
avropIsLocked$: Observable<boolean> = this.avropService.avropIsLocked$;
|
||||
@@ -30,7 +30,7 @@ export class AvropComponent implements OnDestroy {
|
||||
this.returnToStep1();
|
||||
}
|
||||
|
||||
updateSelectedAvrop(deltagareList: AvropCompact[], currentStep: number): void {
|
||||
updateSelectedAvrop(deltagareList: Avrop[], currentStep: number): void {
|
||||
if (currentStep !== 1 && !deltagareList.length) {
|
||||
this.avropService.goToStep1();
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Avrop, AvropCompact } from '@msfa-models/avrop.model';
|
||||
import { Avrop } from '@msfa-models/avrop.model';
|
||||
import { Handledare } from '@msfa-models/handledare.model';
|
||||
import { PaginationMeta } from '@msfa-models/pagination-meta.model';
|
||||
|
||||
@@ -10,18 +10,18 @@ import { PaginationMeta } from '@msfa-models/pagination-meta.model';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AvropListComponent {
|
||||
@Input() availableAvrop: AvropCompact[];
|
||||
@Input() availableAvrop: Avrop[];
|
||||
@Input() paginationMeta: PaginationMeta;
|
||||
@Input() selectedAvrop: AvropCompact[];
|
||||
@Input() selectedAvrop: Avrop[];
|
||||
@Input() handledare: Handledare;
|
||||
@Input() isLocked: boolean;
|
||||
@Input() isSubmitted: boolean;
|
||||
@Input() handledareConfirmed: boolean;
|
||||
@Input() avropLoading: boolean;
|
||||
@Output() selectionChanged = new EventEmitter<AvropCompact[]>();
|
||||
@Output() selectionChanged = new EventEmitter<Avrop[]>();
|
||||
@Output() paginated = new EventEmitter<number>();
|
||||
|
||||
get avropRows(): AvropCompact[] {
|
||||
get avropRows(): Avrop[] {
|
||||
return this.isLocked ? this.selectedAvrop : this.availableAvrop;
|
||||
}
|
||||
get currentPage(): number {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ButtonVariation } from '@af/digi-ng/_button/button';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { AvropCompact } from '@msfa-models/avrop.model';
|
||||
import { Avrop } from '@msfa-models/avrop.model';
|
||||
import { Handledare } from '@msfa-models/handledare.model';
|
||||
|
||||
@Component({
|
||||
@@ -10,7 +10,7 @@ import { Handledare } from '@msfa-models/handledare.model';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AvropRowComponent {
|
||||
@Input() avrop: AvropCompact;
|
||||
@Input() avrop: Avrop;
|
||||
@Input() isSelected: boolean;
|
||||
@Input() isLocked: boolean;
|
||||
@Input() isSubmitted: boolean;
|
||||
|
||||
Reference in New Issue
Block a user