From 303ce04b8db65c8485840f0647c9d98a2714e059 Mon Sep 17 00:00:00 2001 From: trtshen Date: Wed, 18 Mar 2026 14:28:23 +0800 Subject: [PATCH] [CORE-8166] fix: mark control as dirty and restore uploaded file data - mark control as dirty when setting value - restore uploadedFile from saved file data after pagination --- .../app/components/file-upload/file-upload.component.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/v3/src/app/components/file-upload/file-upload.component.ts b/projects/v3/src/app/components/file-upload/file-upload.component.ts index caf62b5bd..4508b7831 100644 --- a/projects/v3/src/app/components/file-upload/file-upload.component.ts +++ b/projects/v3/src/app/components/file-upload/file-upload.component.ts @@ -248,6 +248,7 @@ export class FileUploadComponent implements OnInit, OnDestroy { if (this.control) { this.control.setValue(this.innerValue); this.control.markAsTouched(); + this.control.markAsDirty(); } this.triggerSave(); } @@ -279,6 +280,10 @@ export class FileUploadComponent implements OnInit, OnDestroy { if (this.control && !this.control.pristine) { this.innerValue = this.control.value; this.comment = this.control.value?.comment ?? this.review.comment; + // restore uploadedFile from saved file data so template shows file after pagination + if (this.innerValue?.file?.url) { + this.uploadedFile = { ...this.innerValue.file, cdnUrl: this.innerValue.file.url } as TusFileResponse; + } } else { this.innerValue = { answer: this.review.answer, @@ -291,6 +296,10 @@ export class FileUploadComponent implements OnInit, OnDestroy { if ((this.submissionStatus === 'in progress') && (this.doAssessment)) { if (this.control && !this.control.pristine) { this.innerValue = this.control.value; + // restore uploadedFile from saved file data so template shows file after pagination + if (this.innerValue?.url) { + this.uploadedFile = { ...this.innerValue, cdnUrl: this.innerValue.url } as TusFileResponse; + } } else { this.innerValue = this.submission?.answer; }