Skip to content

Commit

Permalink
[AAE-7376] Added process instance link in task details (#7544)
Browse files Browse the repository at this point in the history
* [AAE-7376] Added process instance link in task details

* [AAE-7376] removed redirect logic from ADF

* Trigger travis

* [AAE-7376] added unit test
  • Loading branch information
tomgny committed Mar 9, 2022
1 parent 6ce7bb7 commit 9fdefb5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/process-services-cloud/src/lib/i18n/en.json
Expand Up @@ -330,6 +330,8 @@
"CREATED": "Created",
"END_DATE": "End date",
"ID": "ID",
"PROCESS_INSTANCE_ID": "Process instance id",
"PROCESS_INSTANCE_ID_DEFAULT": "No process instance id",
"DESCRIPTION": "Description",
"DESCRIPTION_DEFAULT": "No description",
"FORM_NAME": "Form Name",
Expand Down
Expand Up @@ -152,6 +152,18 @@ describe('TaskHeaderCloudComponent', () => {
expect(valueEl.nativeElement.innerText.trim()).toBe(moment(assignedTaskDetailsCloudMock.dueDate, 'x').format('MMM D, Y, H:mm'));
});

it('should display process instance id', async () => {
fixture.detectChanges();
await fixture.whenStable();
fixture.detectChanges();

const labelEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-label-processInstanceId"]'));
const valueEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-processInstanceId"]'));

expect(labelEl.nativeElement.textContent.trim()).toBe('ADF_CLOUD_TASK_HEADER.PROPERTIES.PROCESS_INSTANCE_ID');
expect(valueEl.nativeElement.value).toBe('67c4z2a8f-01f3-11e9-8e36-0a58646002ad');
});

it('should display placeholder if no due date', async () => {
component.taskDetails.dueDate = null;
component.refreshData();
Expand Down
Expand Up @@ -78,6 +78,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
dateLocale: string;
displayDateClearAction = false;
isLoading = true;
processInstanceId: string;

private onDestroy$ = new Subject<boolean>();

Expand Down Expand Up @@ -129,6 +130,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
this.taskDetails = taskDetails;
this.candidateGroups = candidateGroups.map((user) => ({ icon: 'group', value: user } as CardViewArrayItem));
this.candidateUsers = candidateUsers.map((group) => ({ icon: 'person', value: group } as CardViewArrayItem));
this.processInstanceId = taskDetails.processInstanceId;
if (this.taskDetails.parentTaskId) {
this.loadParentName(`${this.taskDetails.parentTaskId}`);
} else {
Expand Down Expand Up @@ -230,6 +232,15 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
key: 'id'
}
),
new CardViewTextItemModel(
{
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PROCESS_INSTANCE_ID',
value: this.processInstanceId,
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.PROCESS_INSTANCE_ID_DEFAULT'),
key: 'processInstanceId',
clickable: true
}
),
new CardViewTextItemModel(
{
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION',
Expand Down
Expand Up @@ -54,7 +54,7 @@ export const assignedTaskDetailsCloudMock: TaskDetailsCloudModel = {
priority: 1,
category: null,
processDefinitionId: null,
processInstanceId: null,
processInstanceId: '67c4z2a8f-01f3-11e9-8e36-0a58646002ad',
status: 'ASSIGNED',
owner: 'ownerUser',
parentTaskId: null,
Expand Down

0 comments on commit 9fdefb5

Please sign in to comment.