[ADF-3237] Change and remove form from a task (#3597)

* button added for task standalone

* rebase fixed

* review fix

* test added & fixes

* refresh task details

* change and remove form added

* localize & documentation work

* tests added

* tests fixes

* tests fixes
This commit is contained in:
bbcodrin
2018-07-18 12:14:54 +03:00
committed by Eugenio Romano
parent c6c573bcfb
commit 54380fd693
13 changed files with 160 additions and 65 deletions

View File

@@ -21,7 +21,6 @@ import {
CardViewUpdateService,
ClickNotification,
LogService,
FormService,
UpdateNotification,
FormRenderingService,
CommentsComponent
@@ -97,7 +96,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
/** Toggles rendering of the form title. */
@Input()
showFormTitle: boolean = true;
showFormTitle: boolean = false;
/** Toggles rendering of the `Complete` outcome button. */
@Input()
@@ -175,6 +174,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
noTaskDetailsTemplateComponent: TemplateRef<any>;
showAssignee: boolean = false;
showAttachForm: boolean = false;
private peopleSearchObserver: Observer<UserProcessModel[]>;
public errorDialogRef: MatDialogRef<TemplateRef<any>>;
@@ -187,7 +187,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
private authService: AuthenticationService,
private peopleProcessService: PeopleProcessService,
private formRenderingService: FormRenderingService,
private formService: FormService,
private logService: LogService,
private cardViewUpdateService: CardViewUpdateService,
private dialog: MatDialog) {
@@ -259,6 +258,9 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
if (clickNotification.target.key === 'assignee') {
this.showAssignee = true;
}
if (clickNotification.target.key === 'formName') {
this.showAttachForm = true;
}
}
/**
@@ -290,7 +292,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
}
isAssigned(): boolean {
return this.taskDetails.assignee ? true : false;
return !!this.taskDetails.assignee;
}
private hasEmailAddress(): boolean {
@@ -364,11 +366,17 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
);
}
onFormAttached() {
this.formService.getTaskForm(this.taskId)
.subscribe((res) => {
this.loadDetails(this.taskId);
}, error => this.logService.error('Could not load forms'));
onShowAttachForm() {
this.showAttachForm = true;
}
onCancelAttachForm() {
this.showAttachForm = false;
}
onCompleteAttachForm() {
this.showAttachForm = false;
this.loadDetails(this.taskId);
}
onFormContentClick(content: ContentLinkModel): void {