diff --git a/lib/process-services/task-list/components/task-header.component.spec.ts b/lib/process-services/task-list/components/task-header.component.spec.ts index a2d25fb5cb..38f103ab7e 100644 --- a/lib/process-services/task-list/components/task-header.component.spec.ts +++ b/lib/process-services/task-list/components/task-header.component.spec.ts @@ -292,6 +292,21 @@ describe('TaskHeaderComponent', () => { }); })); + it('should set clickable to false if the task has already completed', async(() => { + component.taskDetails.endDate = new Date('05/05/2002'); + component.formName = 'test form'; + component.refreshData(); + fixture.detectChanges(); + + fixture.whenStable().then(() => { + const clickableForm = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-textitem-clickable-value')); + expect(clickableForm).toBeNull(); + + const readOnlyForm = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-textitem-ellipsis')); + expect(readOnlyForm.nativeElement.innerText).toBe('test form'); + }); + })); + it('should display the default parent value if is undefined', async(() => { component.taskDetails.processInstanceId = null; component.refreshData(); diff --git a/lib/process-services/task-list/components/task-header.component.ts b/lib/process-services/task-list/components/task-header.component.ts index f2bc4e8b14..1b2687dd2f 100644 --- a/lib/process-services/task-list/components/task-header.component.ts +++ b/lib/process-services/task-list/components/task-header.component.ts @@ -190,7 +190,7 @@ export class TaskHeaderComponent implements OnChanges, OnInit { value: this.formName, key: 'formName', default: this.translationService.instant('ADF_TASK_LIST.PROPERTIES.FORM_NAME_DEFAULT'), - clickable: !!this.formName, + clickable: this.isFormClickable(), icon: 'create' } ) @@ -311,6 +311,10 @@ export class TaskHeaderComponent implements OnChanges, OnInit { return this.taskDetails && !!this.taskDetails.endDate; } + isFormClickable(): boolean { + return !!this.formName && !this.isCompleted(); + } + getTaskDuration(): string { return this.taskDetails.duration ? `${this.taskDetails.duration} ms` : ''; }