mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7376] Added process instance link in task details (#7544)
* [AAE-7376] Added process instance link in task details * [AAE-7376] removed redirect logic from ADF * Trigger travis * [AAE-7376] added unit test
This commit is contained in:
@@ -330,6 +330,8 @@
|
|||||||
"CREATED": "Created",
|
"CREATED": "Created",
|
||||||
"END_DATE": "End date",
|
"END_DATE": "End date",
|
||||||
"ID": "ID",
|
"ID": "ID",
|
||||||
|
"PROCESS_INSTANCE_ID": "Process instance id",
|
||||||
|
"PROCESS_INSTANCE_ID_DEFAULT": "No process instance id",
|
||||||
"DESCRIPTION": "Description",
|
"DESCRIPTION": "Description",
|
||||||
"DESCRIPTION_DEFAULT": "No description",
|
"DESCRIPTION_DEFAULT": "No description",
|
||||||
"FORM_NAME": "Form Name",
|
"FORM_NAME": "Form Name",
|
||||||
|
@@ -152,6 +152,18 @@ describe('TaskHeaderCloudComponent', () => {
|
|||||||
expect(valueEl.nativeElement.innerText.trim()).toBe(moment(assignedTaskDetailsCloudMock.dueDate, 'x').format('MMM D, Y, H:mm'));
|
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 () => {
|
it('should display placeholder if no due date', async () => {
|
||||||
component.taskDetails.dueDate = null;
|
component.taskDetails.dueDate = null;
|
||||||
component.refreshData();
|
component.refreshData();
|
||||||
|
@@ -78,6 +78,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
|
|||||||
dateLocale: string;
|
dateLocale: string;
|
||||||
displayDateClearAction = false;
|
displayDateClearAction = false;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
processInstanceId: string;
|
||||||
|
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
@@ -129,6 +130,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
|
|||||||
this.taskDetails = taskDetails;
|
this.taskDetails = taskDetails;
|
||||||
this.candidateGroups = candidateGroups.map((user) => ({ icon: 'group', value: user } as CardViewArrayItem));
|
this.candidateGroups = candidateGroups.map((user) => ({ icon: 'group', value: user } as CardViewArrayItem));
|
||||||
this.candidateUsers = candidateUsers.map((group) => ({ icon: 'person', value: group } as CardViewArrayItem));
|
this.candidateUsers = candidateUsers.map((group) => ({ icon: 'person', value: group } as CardViewArrayItem));
|
||||||
|
this.processInstanceId = taskDetails.processInstanceId;
|
||||||
if (this.taskDetails.parentTaskId) {
|
if (this.taskDetails.parentTaskId) {
|
||||||
this.loadParentName(`${this.taskDetails.parentTaskId}`);
|
this.loadParentName(`${this.taskDetails.parentTaskId}`);
|
||||||
} else {
|
} else {
|
||||||
@@ -230,6 +232,15 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
|
|||||||
key: 'id'
|
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(
|
new CardViewTextItemModel(
|
||||||
{
|
{
|
||||||
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION',
|
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION',
|
||||||
|
@@ -54,7 +54,7 @@ export const assignedTaskDetailsCloudMock: TaskDetailsCloudModel = {
|
|||||||
priority: 1,
|
priority: 1,
|
||||||
category: null,
|
category: null,
|
||||||
processDefinitionId: null,
|
processDefinitionId: null,
|
||||||
processInstanceId: null,
|
processInstanceId: '67c4z2a8f-01f3-11e9-8e36-0a58646002ad',
|
||||||
status: 'ASSIGNED',
|
status: 'ASSIGNED',
|
||||||
owner: 'ownerUser',
|
owner: 'ownerUser',
|
||||||
parentTaskId: null,
|
parentTaskId: null,
|
||||||
|
Reference in New Issue
Block a user