diff --git a/alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts b/alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts index 3106e4a4c..44be29867 100644 --- a/alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts +++ b/alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts @@ -263,7 +263,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { async prepareCertificateOfTitleUpload(uuid?: string) { this.source.setValue(DOCUMENT_SOURCE.APPLICANT); - + // If fixedParcel is provided, use it and don't require validation if (this.data.fixedParcel) { this.parcelId.setValue(this.data.fixedParcel.uuid); @@ -287,7 +287,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { this.parcelId.updateValueAndValidity(); return; } - + // We have parcels to select from now, so we will require it here this.parcelId.setValidators([Validators.required]); this.parcelId.updateValueAndValidity(); @@ -332,6 +332,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { async onDocTypeSelected($event?: DocumentTypeDto) { if (!$event) { + this.selectableParcels = []; return; } @@ -353,6 +354,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { this.parcelId.setValue(null); this.parcelId.setValidators([]); this.parcelId.updateValueAndValidity(); + this.selectableParcels = []; } if ($event.code === DOCUMENT_TYPE.CORPORATE_SUMMARY) {