mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[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:
parent
ac317f82d1
commit
26daed958f
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user