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 [] = []; taskSchemaColumns: any [] = [];
taskPagination: Pagination = { taskPagination: Pagination = {
skipCount: 0, skipCount: 0,
maxItems: 2, maxItems: 10,
totalItems: 0 totalItems: 0
}; };
taskPage: number = 0; taskPage: number = 0;

View File

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

View File

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