[ADF-4968 ] [TaskHeaderCloudComponent] Allow Assignee property to be clickable if the task in CREATED, ASSIGNED, SUSPENDED states (#5191)

* [ADF-4968][TaskHeaderCloudComponent] Allow Assignee property to be clickable if the task in CREATED, ASSIGNED, SUSPENDED states

* * Added clickable to the parentName and ParentTask Id.

* * Fixed comments
This commit is contained in:
siva kumar 2019-10-29 02:26:35 +05:30 committed by Maurizio Vitale
parent 4885e6bcee
commit 1c6eb4d73d

View File

@ -106,6 +106,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy {
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.ASSIGNEE',
value: this.taskDetails.assignee,
key: 'assignee',
clickable: this.isClickable(),
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.ASSIGNEE_DEFAULT'),
icon: 'create'
}
@ -159,14 +160,16 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy {
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PARENT_NAME',
value: this.parentTaskName,
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.PARENT_NAME_DEFAULT'),
key: 'parentName'
key: 'parentName',
clickable: true
}
),
new CardViewTextItemModel(
{
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PARENT_TASK_ID',
value: this.taskDetails.parentTaskId,
key: 'parentTaskId'
key: 'parentTaskId',
clickable: true
}
),
new CardViewDateItemModel(
@ -254,6 +257,11 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy {
return this.taskCloudService.isTaskEditable(this.taskDetails);
}
isClickable(): boolean {
const states = [TaskStatusEnum.ASSIGNED, TaskStatusEnum.CREATED, TaskStatusEnum.SUSPENDED];
return states.includes(this.taskDetails.status);
}
private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean {
return filteredProperties ? filteredProperties.indexOf(cardItem.key) >= 0 : true;
}