mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-2118] Process Initiator should be able to complete a task (#2951)
* [ADF-2118] Process Initiator should be able to complete a task. * Fixed Process Initiator should be able to complete a task. * * Fixed Process Initiator should be able to complete a task. * * Removed extra space
This commit is contained in:
parent
6f81d7729e
commit
f828e8e847
@ -369,12 +369,18 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
|||||||
this.taskPage = this.taskListPagination.current - 1;
|
this.taskPage = this.taskListPagination.current - 1;
|
||||||
if (this.taskList) {
|
if (this.taskList) {
|
||||||
this.taskList.reload();
|
this.taskList.reload();
|
||||||
|
} else {
|
||||||
|
this.navigateToProcess();
|
||||||
}
|
}
|
||||||
if (this.processList) {
|
if (this.processList) {
|
||||||
this.processList.reload();
|
this.processList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
navigateToProcess(): void {
|
||||||
|
this.router.navigate([`/activiti/apps/${this.appId}/processes/`]);
|
||||||
|
}
|
||||||
|
|
||||||
onContentClick(content: any): void {
|
onContentClick(content: any): void {
|
||||||
this.fileShowed = true;
|
this.fileShowed = true;
|
||||||
this.content = content.contentBlob;
|
this.content = content.contentBlob;
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
[showTitle]="showFormTitle"
|
[showTitle]="showFormTitle"
|
||||||
[showRefreshButton]="showFormRefreshButton"
|
[showRefreshButton]="showFormRefreshButton"
|
||||||
[showCompleteButton]="showFormCompleteButton"
|
[showCompleteButton]="showFormCompleteButton"
|
||||||
[disableCompleteButton]="!isAssignedToMe()"
|
[disableCompleteButton]="!isCompleteButtonVisible()"
|
||||||
[showSaveButton]="showFormSaveButton"
|
[showSaveButton]="isSaveButtonVisible()"
|
||||||
[readOnly]="readOnlyForm"
|
[readOnly]="readOnlyForm"
|
||||||
[fieldValidators]="fieldValidators"
|
[fieldValidators]="fieldValidators"
|
||||||
(formSaved)='onFormSaved($event)'
|
(formSaved)='onFormSaved($event)'
|
||||||
|
@ -284,6 +284,22 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
|||||||
return this.taskDetails.assignee.email === this.authService.getBpmUsername();
|
return this.taskDetails.assignee.email === this.authService.getBpmUsername();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isCompleteButtonVisible(): boolean {
|
||||||
|
return this.isAssignedToMe() || this.canInitiatorComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
canInitiatorComplete(): boolean {
|
||||||
|
return this.taskDetails.initiatorCanCompleteTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
isSaveButtonVisible(): boolean {
|
||||||
|
return this.hasSaveButton() && (!this.canInitiatorComplete() || this.isAssignedToMe());
|
||||||
|
}
|
||||||
|
|
||||||
|
hasSaveButton(): boolean {
|
||||||
|
return this.showFormSaveButton;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the next open task
|
* Retrieve the next open task
|
||||||
* @param processInstanceId
|
* @param processInstanceId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user