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