diff --git a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.html b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.html
index 9a5c83fc04..9125860c29 100644
--- a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.html
+++ b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.html
@@ -3,6 +3,7 @@
[appName]="appName"
[appVersion]="taskDetails.appVersion"
[taskId]="taskId"
+ [showTitle]="showTitle"
[processInstanceId]="taskDetails.processInstanceId"
[readOnly]="isReadOnly()"
[showRefreshButton]="showRefreshButton"
@@ -21,14 +22,11 @@
-
+
- {{taskDetails.name}}
-
- {{'FORM.FORM_RENDERER.NAMELESS_TASK' | translate}}
-
+ {{ taskDetails?.name || 'FORM.FORM_RENDERER.NAMELESS_TASK' | translate }}
diff --git a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.spec.ts
index c01b6f5ec0..ea27248913 100644
--- a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.spec.ts
@@ -416,4 +416,34 @@ describe('TaskFormCloudComponent', () => {
expect(loadingTemplate).toBeNull();
});
});
+
+ it('should display task name as title on no form template if showTitle is true', () => {
+ component.taskId = taskDetails.id;
+
+ fixture.detectChanges();
+ const noFormTemplateTitle = debugElement.query(By.css('.adf-form-title'));
+
+ expect(noFormTemplateTitle.nativeElement.innerText).toEqual('Task1');
+ });
+
+ it('should display default name as title on no form template if the task name empty/undefined', () => {
+ const mockTaskDetailsWithOutName = { id: 'mock-task-id', name: null, formKey: null };
+ getTaskSpy.and.returnValue(of(mockTaskDetailsWithOutName));
+ component.taskId = 'mock-task-id';
+
+ fixture.detectChanges();
+ const noFormTemplateTitle = debugElement.query(By.css('.adf-form-title'));
+
+ expect(noFormTemplateTitle.nativeElement.innerText).toEqual('FORM.FORM_RENDERER.NAMELESS_TASK');
+ });
+
+ it('should not display no form title if showTitle is set to false', () => {
+ component.taskId = taskDetails.id;
+ component.showTitle = false;
+
+ fixture.detectChanges();
+ const noFormTemplateTitle = debugElement.query(By.css('.adf-form-title'));
+
+ expect(noFormTemplateTitle).toBeNull();
+ });
});
diff --git a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts
index 05db0aa2fa..6afca55e11 100644
--- a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts
+++ b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts
@@ -41,6 +41,10 @@ export class TaskFormCloudComponent implements OnInit, OnChanges {
@Input()
taskId: string;
+ /** Toggle rendering of the form title. */
+ @Input()
+ showTitle: boolean = true;
+
/** Toggle rendering of the `Refresh` button. */
@Input()
showRefreshButton = false;