Skip to content

Commit 2b35d4b

Browse files
authored
Merge pull request #2639 from intersective/2.4.8/CORE-8166/filetype-question-fix
[CORE-8166] 2.4.8/filetype-question-fix
2 parents 8a3b7fe + 303ce04 commit 2b35d4b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

projects/v3/src/app/components/file-upload/file-upload.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ export class FileUploadComponent implements OnInit, OnDestroy {
248248
if (this.control) {
249249
this.control.setValue(this.innerValue);
250250
this.control.markAsTouched();
251+
this.control.markAsDirty();
251252
}
252253
this.triggerSave();
253254
}
@@ -279,6 +280,10 @@ export class FileUploadComponent implements OnInit, OnDestroy {
279280
if (this.control && !this.control.pristine) {
280281
this.innerValue = this.control.value;
281282
this.comment = this.control.value?.comment ?? this.review.comment;
283+
// restore uploadedFile from saved file data so template shows file after pagination
284+
if (this.innerValue?.file?.url) {
285+
this.uploadedFile = { ...this.innerValue.file, cdnUrl: this.innerValue.file.url } as TusFileResponse;
286+
}
282287
} else {
283288
this.innerValue = {
284289
answer: this.review.answer,
@@ -291,6 +296,10 @@ export class FileUploadComponent implements OnInit, OnDestroy {
291296
if ((this.submissionStatus === 'in progress') && (this.doAssessment)) {
292297
if (this.control && !this.control.pristine) {
293298
this.innerValue = this.control.value;
299+
// restore uploadedFile from saved file data so template shows file after pagination
300+
if (this.innerValue?.url) {
301+
this.uploadedFile = { ...this.innerValue, cdnUrl: this.innerValue.url } as TusFileResponse;
302+
}
294303
} else {
295304
this.innerValue = this.submission?.answer;
296305
}

0 commit comments

Comments
 (0)