diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-overview/enrollee-overview.component.ts b/prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-overview/enrollee-overview.component.ts index ecc80c6411..1dc292bdd8 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-overview/enrollee-overview.component.ts +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-overview/enrollee-overview.component.ts @@ -1,8 +1,8 @@ import { Component, Inject, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { map } from 'rxjs/operators'; -import { forkJoin } from 'rxjs'; +import { catchError, exhaustMap, map } from 'rxjs/operators'; +import { forkJoin, of } from 'rxjs'; import { PermissionService } from '@auth/shared/services/permission.service'; import { ToastService } from '@core/services/toast.service'; @@ -75,14 +75,10 @@ export class EnrolleeOverviewComponent extends AdjudicationContainerComponent im .subscribe((enrollee: HttpEnrollee) => this.enrollee = enrollee); this.paperEnrolmentResource.getAdjudicationDocuments(+this.route.snapshot.params.id) - .subscribe(documents => { - this.documents = documents - }); + .subscribe(documents => this.documents = documents); this.enrolmentResource.getCurrentEnrolleeAbsence(+this.route.snapshot.params.id) - .subscribe((absence: EnrolleeAbsence) => { - this.absence = absence - }); + .subscribe((absence: EnrolleeAbsence) => this.absence = absence); } private loadEnrollee(enrolleeId: number): void { @@ -97,18 +93,25 @@ export class EnrolleeOverviewComponent extends AdjudicationContainerComponent im })) ), enrolleeNavigation: this.adjudicationResource.getAdjacentEnrolleeId(enrolleeId), - plrInfo: this.adjudicationResource.getPlrInfoByEnrolleeId(enrolleeId) - }) - .subscribe(({ enrollee, enrolleeNavigation, plrInfo }) => { - this.enrollee = enrollee.enrollee; - this.enrollees = [enrollee.enrolleeView]; - this.enrolment = enrollee.enrolment; - this.enrolleeNavigation = enrolleeNavigation; - this.plrInfo = plrInfo; - // hide the adjudication card if enrolment is editable and no 'reason for adjudication' - this.showAdjudication = !(enrollee.enrollee.currentStatus.statusCode === EnrolmentStatusEnum.EDITABLE - && !enrollee.enrollee.currentStatus.enrolmentStatusReasons?.length); - }); + }).pipe( + map( + ({ enrollee, enrolleeNavigation }) => { + // Complete this first before attempting to get PLR info, so user can see information rendered sooner + this.enrollee = enrollee.enrollee; + this.enrollees = [enrollee.enrolleeView]; + this.enrolment = enrollee.enrolment; + this.enrolleeNavigation = enrolleeNavigation; + // hide the adjudication card if enrolment is editable and no 'reason for adjudication' + this.showAdjudication = !(enrollee.enrollee.currentStatus.statusCode === EnrolmentStatusEnum.EDITABLE + && !enrollee.enrollee.currentStatus.enrolmentStatusReasons?.length); + return enrolleeId; + } + ), + exhaustMap((enrolleeId: number) => this.adjudicationResource.getPlrInfoByEnrolleeId(enrolleeId) + .pipe( + map((plrInfo: PlrInfo[]) => this.plrInfo = plrInfo), + catchError(_ => of([])))) + ).subscribe(); } private enrolmentAdapter(enrollee: HttpEnrollee): Enrolment { diff --git a/prime-dotnet-webapi/Services/PlrProviderService.cs b/prime-dotnet-webapi/Services/PlrProviderService.cs index a38f8a75bc..af5a97aebf 100644 --- a/prime-dotnet-webapi/Services/PlrProviderService.cs +++ b/prime-dotnet-webapi/Services/PlrProviderService.cs @@ -72,10 +72,12 @@ public async Task> GetPlrDataByCollegeIdsAsync(IEnumer .ProjectTo(_mapper.ConfigurationProvider, new { plrRoleTypes, plrStatusReasons }) .ToListAsync(); + // If a PlrViewModel has ExpertiseCodes, translate the codes to human-readable text // PlrProvider's Expertise array does not play well with automapper ProjectTo, map manually before return return plr.Select(p => { - p.Expertise = string.Join(", ", _context.Set().Where(e => p.ExpertiseCode.Contains(e.Code)).Select(e => e.Name)); + p.Expertise = string.Join(", ", _context.Set().Where(e => + (p.ExpertiseCode != null && p.ExpertiseCode.Contains(e.Code))).Select(e => e.Name)); return p; }); } diff --git a/utilities/PlrIntakeUtility/PRIME_Test_Data_PLR_IAT20210617_v2.0.xls b/utilities/PlrIntakeUtility/PRIME_Test_Data_PLR_IAT20210617_v2.0.xls new file mode 100644 index 0000000000..effc55943a Binary files /dev/null and b/utilities/PlrIntakeUtility/PRIME_Test_Data_PLR_IAT20210617_v2.0.xls differ diff --git a/utilities/PlrIntakeUtility/PlrIntakeUtility.csproj b/utilities/PlrIntakeUtility/PlrIntakeUtility.csproj index 9a6e84754f..fcd50fd6fa 100644 --- a/utilities/PlrIntakeUtility/PlrIntakeUtility.csproj +++ b/utilities/PlrIntakeUtility/PlrIntakeUtility.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0