mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4127] ProcessServicesCloud - add claim/unclaim directive (#4464)
* [ADF-4127] ProessServicesCloud - claim task directive * [ADF-4127] - fix doc * [ADF-4127] - revert docs changes * [ADF-4127] - revert doc changes * [ADF-4127] - fix doc and reset sourceLinker.js * [ADF-4127] - refractor task-cloud.service. add validation for claim/unclaim and fix unit tests * [ADF-4127] - fix docs files * [ADF-4127[ - add aditional complete task validation * [ADF-4127] - PR changes * [ADF-4127] - complete docs file * [ADF-4127] - more PR changes * [ADF-4127] - change Unclaim task name and wait for task to be claimed and unclaimed before emit the success event * [ADF-4127] - fix unit tests
This commit is contained in:
committed by
Maurizio Vitale
parent
0b1e5d31d8
commit
31658c0974
@@ -4,7 +4,13 @@
|
||||
<div class="adf-task-control">
|
||||
<button mat-button (click)="goBack()">Cancel</button>
|
||||
<button mat-button color="primary" *ngIf="canCompleteTask()" adf-cloud-complete-task [appName]="appName" [taskId]="taskId"
|
||||
(success)="onCompletedTask($event)">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.COMPLETE' | translate }}</button>
|
||||
(success)="onCompletedTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.COMPLETE' | translate }}</button>
|
||||
|
||||
<button mat-button color="primary" *ngIf="canClaimTask()" adf-cloud-claim-task [appName]="appName" [taskId]="taskId"
|
||||
(success)="onClaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.CLAIM' | translate }}</button>
|
||||
|
||||
<button mat-button color="primary" *ngIf="canUnClaimTask()" adf-cloud-unclaim-task [appName]="appName" [taskId]="taskId"
|
||||
(success)="onUnclaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.UNCLAIM' | translate }}</button>
|
||||
</div>
|
||||
|
||||
<adf-cloud-task-header class="adf-demop-card-container" [appName]="appName" [taskId]="taskId" [readOnly]="readOnly">
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { TaskCloudService, TaskDetailsCloudModel } from '@alfresco/adf-process-services-cloud';
|
||||
import { TaskDetailsCloudModel, TaskCloudService } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
@Component({
|
||||
templateUrl: './task-details-cloud-demo.component.html',
|
||||
@@ -47,26 +47,42 @@ export class TaskDetailsCloudDemoComponent implements OnInit {
|
||||
this.loadTaskDetailsById(this.appName, this.taskId);
|
||||
}
|
||||
|
||||
loadTaskDetailsById(appName: string, taskId: string): any {
|
||||
loadTaskDetailsById(appName: string, taskId: string) {
|
||||
this.taskCloudService.getTaskById(appName, taskId).subscribe(
|
||||
(taskDetails) => {
|
||||
(taskDetails: TaskDetailsCloudModel ) => {
|
||||
this.taskDetails = taskDetails;
|
||||
});
|
||||
}
|
||||
|
||||
isTaskValid() {
|
||||
return this.appName && this.taskId;
|
||||
isTaskValid(): boolean {
|
||||
return this.appName !== undefined && this.taskId !== undefined;
|
||||
}
|
||||
|
||||
canCompleteTask() {
|
||||
canCompleteTask(): boolean {
|
||||
return this.taskDetails && this.taskCloudService.canCompleteTask(this.taskDetails);
|
||||
}
|
||||
|
||||
canClaimTask(): boolean {
|
||||
return this.taskDetails && this.taskCloudService.canClaimTask(this.taskDetails);
|
||||
}
|
||||
|
||||
canUnClaimTask(): boolean {
|
||||
return this.taskDetails && this.taskCloudService.canUnclaimTask(this.taskDetails);
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.router.navigate([`/cloud/${this.appName}/`]);
|
||||
}
|
||||
|
||||
onCompletedTask(evt: any) {
|
||||
onCompletedTask() {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
onUnclaimTask() {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
onClaimTask() {
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user