clean form name in task header only when change task id (#2291)

This commit is contained in:
Eugenio Romano
2017-09-04 20:17:23 +02:00
committed by Mario Romano
parent 0ff268108f
commit 2cd3c9c233
3 changed files with 10 additions and 11 deletions

View File

@@ -102,7 +102,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
taskSchemaColumns: any [] = [];
taskPagination: Pagination = {
skipCount: 0,
maxItems: 2,
maxItems: 10,
totalItems: 0
};
taskPage: number = 0;

View File

@@ -1,4 +1,4 @@
<div class="form-container">
<activiti-form [form]="form">
</activiti-form>
<adf-form [form]="form">
</adf-form>
</div>

View File

@@ -164,6 +164,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
if (taskId && !taskId.currentValue) {
this.reset();
} else if (taskId && taskId.currentValue) {
this.taskFormName = null;
this.loadDetails(taskId.currentValue);
}
}
@@ -197,7 +198,9 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
private updateTaskDetails(updateNotification: UpdateNotification) {
this.activitiTaskList.updateTask(this.taskId, updateNotification.changed)
.subscribe(
() => { this.loadDetails(this.taskId); }
() => {
this.loadDetails(this.taskId);
}
);
}
@@ -214,7 +217,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
*/
private loadDetails(taskId: string) {
this.taskPeople = [];
this.taskFormName = null;
this.readOnlyForm = false;
if (taskId) {
@@ -242,7 +244,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
}
isAssignedToMe(): boolean {
return this.taskDetails.assignee.email === this.authService.getBpmUsername() ? true : false;
return this.taskDetails.assignee.email === this.authService.getBpmUsername();
}
/**
@@ -294,10 +296,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
}
onFormLoaded(form: FormModel): void {
this.taskFormName = null;
if (form && form.name) {
this.taskFormName = form.name;
}
this.taskFormName = (form && form.name ? form.name : null);
this.formLoaded.emit(form);
}