mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACA-3416] Add Claim/Release actions on adf task form (#5753)
* [ACA-3255] FE - Claim a task * * Added unit tests * * Added unit tests * Changed cloud directive names * * Added/Updated documents * * Added showReleaseClaim button flag * Add unit test too * * Used claim/release directive in task-header component. * * Fixed unit test * * Fixed one comment * * After rebase * * Fixed comments
This commit is contained in:
@@ -23,12 +23,10 @@ import {
|
||||
CardViewMapItemModel,
|
||||
CardViewTextItemModel,
|
||||
CardViewBaseItemModel,
|
||||
LogService,
|
||||
TranslationService,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
import { TaskDescriptionValidator } from '../validators/task-description.validator';
|
||||
|
||||
@Component({
|
||||
@@ -46,6 +44,10 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
@Input()
|
||||
taskDetails: TaskDetailsModel;
|
||||
|
||||
/** Toggles display of the claim/release button. */
|
||||
@Input()
|
||||
showClaimRelease = true;
|
||||
|
||||
/** Emitted when the task is claimed. */
|
||||
@Output()
|
||||
claim: EventEmitter<any> = new EventEmitter<any>();
|
||||
@@ -62,10 +64,8 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
dateFormat: string;
|
||||
dateLocale: string;
|
||||
|
||||
constructor(private activitiTaskService: TaskListService,
|
||||
private bpmUserService: BpmUserService,
|
||||
constructor(private bpmUserService: BpmUserService,
|
||||
private translationService: TranslationService,
|
||||
private logService: LogService,
|
||||
private appConfig: AppConfigService) {
|
||||
this.dateFormat = this.appConfig.get('dateValues.defaultDateFormat');
|
||||
this.dateLocale = this.appConfig.get('dateValues.defaultDateLocale');
|
||||
@@ -281,28 +281,12 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
return (this.taskDetails && this.taskDetails.isCompleted()) ? 'Completed' : 'Running';
|
||||
}
|
||||
|
||||
/**
|
||||
* Claim task
|
||||
*
|
||||
* @param taskId
|
||||
*/
|
||||
claimTask(taskId: string) {
|
||||
this.activitiTaskService.claimTask(taskId).subscribe(() => {
|
||||
this.logService.info('Task claimed');
|
||||
this.claim.emit(taskId);
|
||||
});
|
||||
onClaimTask(taskId: string) {
|
||||
this.claim.emit(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unclaim task
|
||||
*
|
||||
* @param taskId
|
||||
*/
|
||||
unclaimTask(taskId: string) {
|
||||
this.activitiTaskService.unclaimTask(taskId).subscribe(() => {
|
||||
this.logService.info('Task unclaimed');
|
||||
this.unclaim.emit(taskId);
|
||||
});
|
||||
onUnclaimTask(taskId: string) {
|
||||
this.unclaim.emit(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user