Merge pull request #1261 from Alfresco/dev-wabson-1140

Check that the process has a start form before attempting to display it
This commit is contained in:
Mario Romano 2016-12-14 13:35:42 +00:00 committed by GitHub
commit 94124c2537
3 changed files with 10 additions and 6 deletions

View File

@ -28,7 +28,7 @@
{{ 'DETAILS.TASKS.NO_ACTIVE' | translate }} {{ 'DETAILS.TASKS.NO_ACTIVE' | translate }}
</div> </div>
<div *ngIf="processInstanceDetails && processInstanceDetails.startFormDefined"> <div *ngIf="hasStartFormDefined()">
<span class="activiti-label">{{ 'DETAILS.LABELS.START_FORM'|translate }}</span> <span class="activiti-label">{{ 'DETAILS.LABELS.START_FORM'|translate }}</span>
<!--IF START TASK COMPLETED --> <!--IF START TASK COMPLETED -->
@ -78,7 +78,7 @@
</div> </div>
</dialog> </dialog>
<dialog class="mdl-dialog task-details-dialog" #startDialog> <dialog *ngIf="hasStartFormDefined()" class="mdl-dialog task-details-dialog" #startDialog>
<h4 class="mdl-dialog__title">{{ 'DETAILS.LABELS.START_FORM'|translate }}</h4> <h4 class="mdl-dialog__title">{{ 'DETAILS.LABELS.START_FORM'|translate }}</h4>
<div class="mdl-dialog__content form__size"> <div class="mdl-dialog__content form__size">
<activiti-start-form [processId]="processId" [processDefinitionId]="processInstanceDetails?.processDefinitionId" <activiti-start-form [processId]="processId" [processDefinitionId]="processInstanceDetails?.processDefinitionId"

View File

@ -134,6 +134,10 @@ export class ActivitiProcessInstanceTasks implements OnInit, OnChanges {
} }
} }
hasStartFormDefined(): boolean {
return this.processInstanceDetails && this.processInstanceDetails.startFormDefined === true;
}
getUserFullName(user: any) { getUserFullName(user: any) {
if (user) { if (user) {
return (user.firstName && user.firstName !== 'null' return (user.firstName && user.firstName !== 'null'

View File

@ -18,10 +18,10 @@
<label class="mdl-textfield__label" for="processName">{{'START_PROCESS.DIALOG.LABEL.NAME'|translate}}</label> <label class="mdl-textfield__label" for="processName">{{'START_PROCESS.DIALOG.LABEL.NAME'|translate}}</label>
</div> </div>
<activiti-start-form *ngIf="hasStartForm()" [processDefinitionId]="currentProcessDef.id" <activiti-start-form *ngIf="hasStartForm()" [processDefinitionId]="currentProcessDef.id"
(formSaved)='onFormSaved($event)' (formSaved)="onFormSaved($event)"
(formCompleted)='onFormCompleted($event)' (formCompleted)="onFormCompleted($event)"
(formLoaded)='onFormLoaded($event)' (formLoaded)="onFormLoaded($event)"
(onError)='onFormError($event)'> (onError)="onFormError($event)">
</activiti-start-form> </activiti-start-form>
</div> </div>
<div class="mdl-card__actions mdl-card--border" *ngIf="showStartButton"> <div class="mdl-card__actions mdl-card--border" *ngIf="showStartButton">