diff --git a/lib/core/form/services/process-content.service.spec.ts b/lib/core/form/services/process-content.service.spec.ts index 2ef8c9d320..3340e8987f 100644 --- a/lib/core/form/services/process-content.service.spec.ts +++ b/lib/core/form/services/process-content.service.spec.ts @@ -196,5 +196,4 @@ describe('ProcessContentService', () => { done(); }); }); - }); diff --git a/lib/core/form/services/process-content.service.ts b/lib/core/form/services/process-content.service.ts index 9505f863d1..cbde48c632 100644 --- a/lib/core/form/services/process-content.service.ts +++ b/lib/core/form/services/process-content.service.ts @@ -128,10 +128,11 @@ export class ProcessContentService { /** * Gets related content items for a process instance. * @param processId ID of the target process + * @param opts Options supported by JS-API * @returns Metadata for the content */ - getProcessRelatedContent(processId: string): Observable { - return from(this.contentApi.getRelatedContentForProcessInstance(processId)) + getProcessRelatedContent(processId: string, opts?: any): Observable { + return from(this.contentApi.getRelatedContentForProcessInstance(processId, opts)) .pipe(catchError((err) => this.handleError(err))); } diff --git a/lib/process-services/attachment/process-attachment-list.component.spec.ts b/lib/process-services/attachment/process-attachment-list.component.spec.ts index 3bb2a2b8f6..4e572552d2 100644 --- a/lib/process-services/attachment/process-attachment-list.component.spec.ts +++ b/lib/process-services/attachment/process-attachment-list.component.spec.ts @@ -240,6 +240,15 @@ describe('ProcessAttachmentListComponent', () => { }); })); + it('should call getProcessRelatedContent with opt isRelatedContent=true', () => { + getProcessRelatedContentSpy.and.returnValue(of(mockAttachment)); + const change = new SimpleChange(null, '123', true); + const isRelatedContent = 'true'; + component.ngOnChanges({'processInstanceId': change}); + expect(getProcessRelatedContentSpy).toHaveBeenCalled(); + expect(getProcessRelatedContentSpy).toHaveBeenCalledWith('123', isRelatedContent); + }); + describe('change detection', () => { let change = new SimpleChange('123', '456', true); @@ -254,7 +263,7 @@ describe('ProcessAttachmentListComponent', () => { it('should fetch new attachments when processInstanceId changed', () => { component.ngOnChanges({ 'processInstanceId': change }); - expect(getProcessRelatedContentSpy).toHaveBeenCalledWith('456'); + expect(getProcessRelatedContentSpy).toHaveBeenCalledWith('456', 'true'); }); it('should NOT fetch new attachments when empty changeset made', () => { diff --git a/lib/process-services/attachment/process-attachment-list.component.ts b/lib/process-services/attachment/process-attachment-list.component.ts index 6c1e8ef908..3f23d324be 100644 --- a/lib/process-services/attachment/process-attachment-list.component.ts +++ b/lib/process-services/attachment/process-attachment-list.component.ts @@ -111,7 +111,8 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn if (processInstanceId) { this.reset(); this.isLoading = true; - this.activitiContentService.getProcessRelatedContent(processInstanceId).subscribe( + const opts: string = 'true'; + this.activitiContentService.getProcessRelatedContent(processInstanceId, opts).subscribe( (res: any) => { res.data.forEach((content) => { this.attachments.push({