Skip to content

Commit

Permalink
Fix: Enrolment Overview Error Miss Reporting (#2141)
Browse files Browse the repository at this point in the history
Enrolment errors should only represent states that mean the overview is false, not just helper methods for deciding error messaging. Not having a cert is not an error but just used in the review page for message logic.
  • Loading branch information
hogmann committed Apr 25, 2022
1 parent b787bd7 commit 62fbc79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export class OverviewComponent extends BaseEnrolmentPage implements OnInit {
*/
private getEnrolmentErrors(enrolment: Enrolment): ValidationErrors {
return {
certificate: !enrolment.certifications?.length,
certificateOrOboSite: !enrolment.certifications?.length && !enrolment.oboSites?.length,
deviceProvider: enrolment.careSettings.some((careSetting) => careSetting.careSettingCode === CareSettingEnum.DEVICE_PROVIDER)
&& !enrolment.deviceProviderIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@

<app-enrollee-property *ngIf="!hasCertification"
title="College Certification"
[hasError]="enrolmentErrors?.certificateOrOboSite && enrolmentErrors?.certificate"
[hasError]="enrolmentErrors?.certificateOrOboSite"
errorMessage="Must have a college certificate or job site information"
[makeBold]="true">
None
Expand Down Expand Up @@ -316,9 +316,9 @@
title="Job Sites"
[hasError]="enrolmentErrors?.certificateOrOboSite || enrolmentErrors?.deviceProviderOrOboSite"
errorMessage="Must have a {{
enrolmentErrors?.certificate && enrolmentErrors?.deviceProvider
!hasCertification && enrolmentErrors?.deviceProvider
? 'college certificate and a device provider ID'
: enrolmentErrors?.certificate
: !hasCertification
? 'college certificate'
: 'device provider ID'
}} or job site information"
Expand Down

0 comments on commit 62fbc79

Please sign in to comment.