[ACS-8635] ADW: View button not working on create process (#10121)

* [ACS-8635] ADW: View button not working on create process

* [ACS-8635] ADW: View button not working on create process
This commit is contained in:
dominikiwanekhyland 2024-08-29 17:07:38 +02:00 committed by GitHub
parent ac317f82d1
commit 26daed958f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -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));

View File

@ -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);