diff --git a/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.spec.ts b/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.spec.ts index 0f8db079f43..da9e177eba7 100644 --- a/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.spec.ts +++ b/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.spec.ts @@ -517,6 +517,19 @@ describe('AttachFileWidgetComponent', () => { await fixture.whenStable(); }); + it('should raise formContentClicked event when file has sourceId', async () => { + const testFile = { + sourceId: '12345', + id: '12345', + contentAvailable: true + }; + formService.formContentClicked.subscribe((file) => { + expect(file).not.toBeNull(); + expect(file).toBe(testFile); + }); + fixture.componentInstance.onAttachFileClicked(testFile); + }); + it('should not display the show button file when is an external file', async () => { fakePngAnswer.isExternal = true; spyOn(processContentService, 'getFileRawContent').and.returnValue(of(fakePngAnswer)); diff --git a/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.ts b/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.ts index 5a95623ab51..26bbb711469 100644 --- a/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.ts +++ b/lib/process-services/src/lib/form/widgets/content-widget/attach-file-widget.component.ts @@ -170,7 +170,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements if (file.isExternal || !file.contentAvailable) { return; } - if (this.isTemporaryFile(file)) { + if (this.isTemporaryFile(file) || file.sourceId) { this.formService.formContentClicked.next(file); } else { this.fileClicked(file);