mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
#724 correctly handle 'formKey' property
due to some reason Activiti stores/serializes null as a “null” string rather than value for a ‘formKey’ property; added checks for this case
This commit is contained in:
parent
76b5faf63b
commit
c36d430fc8
@ -1,4 +1,4 @@
|
|||||||
<div *ngIf="!taskDetails">
|
<div *ngIf="!hasFormKey()">
|
||||||
<template *ngIf="noTaskDetailsTemplateComponent" ngFor [ngForOf]="[data]"
|
<template *ngIf="noTaskDetailsTemplateComponent" ngFor [ngForOf]="[data]"
|
||||||
[ngForTemplate]="noTaskDetailsTemplateComponent">
|
[ngForTemplate]="noTaskDetailsTemplateComponent">
|
||||||
{{ 'TASK_DETAILS.MESSAGES.NONE' | translate }}
|
{{ 'TASK_DETAILS.MESSAGES.NONE' | translate }}
|
||||||
@ -7,7 +7,7 @@
|
|||||||
{{ 'TASK_DETAILS.MESSAGES.NONE' | translate }}
|
{{ 'TASK_DETAILS.MESSAGES.NONE' | translate }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="taskDetails">
|
<div *ngIf="hasFormKey()">
|
||||||
<h2 class="mdl-card__title-text">{{taskDetails.name}}</h2>
|
<h2 class="mdl-card__title-text">{{taskDetails.name}}</h2>
|
||||||
<activiti-task-header [taskDetails]="taskDetails" #activitiheader></activiti-task-header>
|
<activiti-task-header [taskDetails]="taskDetails" #activitiheader></activiti-task-header>
|
||||||
<div class="mdl-grid">
|
<div class="mdl-grid">
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<activiti-checklist [taskId]="taskId" #activitichecklist></activiti-checklist>
|
<activiti-checklist [taskId]="taskId" #activitichecklist></activiti-checklist>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<activiti-form *ngIf="taskDetails.formKey" [taskId]="taskId"
|
<activiti-form *ngIf="hasFormKey()" [taskId]="taskId"
|
||||||
[showTitle]="showTitle"
|
[showTitle]="showTitle"
|
||||||
[showRefreshButton]="showRefreshButton"
|
[showRefreshButton]="showRefreshButton"
|
||||||
[showCompleteButton]="showCompleteButton"
|
[showCompleteButton]="showCompleteButton"
|
||||||
|
@ -117,6 +117,12 @@ export class ActivitiTaskDetails implements OnInit {
|
|||||||
this.taskDetails = null;
|
this.taskDetails = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasFormKey() {
|
||||||
|
return this.taskDetails
|
||||||
|
&& this.taskDetails.formKey
|
||||||
|
&& this.taskDetails.formKey !== 'null';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the activiti task details
|
* Load the activiti task details
|
||||||
* @param taskId
|
* @param taskId
|
||||||
@ -130,26 +136,24 @@ export class ActivitiTaskDetails implements OnInit {
|
|||||||
this.taskDetails = res;
|
this.taskDetails = res;
|
||||||
|
|
||||||
let endDate: any = res.endDate;
|
let endDate: any = res.endDate;
|
||||||
if (endDate && !isNaN(endDate.getTime())) {
|
this.readOnly = !!(endDate && !isNaN(endDate.getTime()));
|
||||||
this.readOnly = true;
|
|
||||||
} else {
|
|
||||||
this.readOnly = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.taskDetails && this.taskDetails.involvedPeople) {
|
if (this.hasFormKey()) {
|
||||||
this.taskDetails.involvedPeople.forEach((user) => {
|
if (this.taskDetails && this.taskDetails.involvedPeople) {
|
||||||
this.taskPeople.push(new User(user.id, user.email, user.firstName, user.lastName));
|
this.taskDetails.involvedPeople.forEach((user) => {
|
||||||
});
|
this.taskPeople.push(new User(user.id, user.email, user.firstName, user.lastName));
|
||||||
|
});
|
||||||
|
|
||||||
if (this.activiticomments) {
|
if (this.activiticomments) {
|
||||||
this.activiticomments.load(this.taskDetails.id);
|
this.activiticomments.load(this.taskDetails.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.activitichecklist) {
|
if (this.activitichecklist) {
|
||||||
this.activitichecklist.load(this.taskDetails.id);
|
this.activitichecklist.load(this.taskDetails.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
console.log(this.taskDetails);
|
||||||
}
|
}
|
||||||
console.log(this.taskDetails);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user