mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACA-3942] Enable assignee edit button only when userTask shared among the candidates (#6113)
* [ACA-3942] Enable assignee edit button only when user task shared among the candidates * * Moved logic to service level
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
CardViewDatetimeItemModel,
|
||||
CardViewArrayItem
|
||||
} from '@alfresco/adf-core';
|
||||
import { TaskDetailsCloudModel, TaskStatus } from '../../start-task/models/task-details-cloud.model';
|
||||
import { TaskDetailsCloudModel } from '../../start-task/models/task-details-cloud.model';
|
||||
import { TaskCloudService } from '../../services/task-cloud.service';
|
||||
import { NumericFieldValidator } from '../../../validators/numeric-field.validator';
|
||||
|
||||
@@ -141,7 +141,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
|
||||
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.ASSIGNEE',
|
||||
value: this.taskDetails.assignee,
|
||||
key: 'assignee',
|
||||
clickable: this.isClickable(),
|
||||
clickable: this.isAssigneePropertyClickable(),
|
||||
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.ASSIGNEE_DEFAULT'),
|
||||
icon: 'create'
|
||||
}
|
||||
@@ -318,9 +318,8 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges {
|
||||
return this.taskCloudService.isTaskEditable(this.taskDetails);
|
||||
}
|
||||
|
||||
isClickable(): boolean {
|
||||
const states: TaskStatus[] = ['ASSIGNED', 'CREATED'];
|
||||
return states.includes(this.taskDetails.status);
|
||||
isAssigneePropertyClickable(): boolean {
|
||||
return this.taskCloudService.isAssigneePropertyClickable(this.taskDetails, this.candidateUsers, this.candidateGroups);
|
||||
}
|
||||
|
||||
private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean {
|
||||
|
Reference in New Issue
Block a user