Skip to content

Commit 8689fc5

Browse files
authored
2618 Document Upload QA (#2695)
* fix: addressed qa fix for certificate of title document upload * chore: format fix
1 parent a91415f commit 8689fc5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,26 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy {
270270
this.parcelId.updateValueAndValidity();
271271
return;
272272
}
273-
274-
this.parcelId.setValidators([Validators.required]);
275-
this.parcelId.updateValueAndValidity();
276273

277274
if (!this.data.parcelService) {
275+
// No parcel service, so no parcels, we will not require it
276+
this.parcelId.clearValidators();
277+
this.parcelId.updateValueAndValidity();
278278
return;
279279
}
280280

281281
this.selectableParcels = await this.data.parcelService.fetchParcels(this.data.fileId);
282282

283283
if (this.selectableParcels.length < 1) {
284+
// No parcels available, we will not require it
285+
this.parcelId.clearValidators();
286+
this.parcelId.updateValueAndValidity();
284287
return;
285288
}
289+
290+
// We have parcels to select from now, so we will require it here
291+
this.parcelId.setValidators([Validators.required]);
292+
this.parcelId.updateValueAndValidity();
286293

287294
const selectedParcel = this.selectableParcels.find((parcel) => parcel.certificateOfTitleUuid === uuid);
288295
if (selectedParcel) {

0 commit comments

Comments
 (0)