mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix hasForm problem
This commit is contained in:
@@ -15,13 +15,13 @@
|
|||||||
<activiti-people [people]="taskPeople"></activiti-people>
|
<activiti-people [people]="taskPeople"></activiti-people>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
<div class="mdl-cell mdl-cell--4-col">
|
||||||
<activiti-comments [taskId]="taskId" #activiticomments></activiti-comments>
|
<activiti-comments [taskId]="taskDetails.id" #activiticomments></activiti-comments>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
<div class="mdl-cell mdl-cell--4-col">
|
||||||
<activiti-checklist [taskId]="taskId" #activitichecklist></activiti-checklist>
|
<activiti-checklist [taskId]="taskDetails.id" #activitichecklist></activiti-checklist>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<activiti-form *ngIf="hasFormKey()" [taskId]="taskId"
|
<activiti-form *ngIf="hasFormKey()" [taskId]="taskDetails.id"
|
||||||
[showTitle]="showTitle"
|
[showTitle]="showTitle"
|
||||||
[showRefreshButton]="showRefreshButton"
|
[showRefreshButton]="showRefreshButton"
|
||||||
[showCompleteButton]="showCompleteButton"
|
[showCompleteButton]="showCompleteButton"
|
||||||
|
@@ -10,9 +10,5 @@
|
|||||||
{{taskDetails?.dueDate ? taskDetails.dueDate : ('TASK_DETAILS.DUE.NONE' |translate) }}
|
{{taskDetails?.dueDate ? taskDetails.dueDate : ('TASK_DETAILS.DUE.NONE' |translate) }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
|
||||||
<span class="activiti-label">{{ 'TASK_DETAILS.LABELS.FORM' | translate }}</span>:
|
|
||||||
{{taskForm?.name ? taskForm.name : ('TASK_DETAILS.FORM.NONE' | translate) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@@ -15,10 +15,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||||
import { TaskDetailsModel } from '../models/task-details.model';
|
import { TaskDetailsModel } from '../models/task-details.model';
|
||||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
|
||||||
|
|
||||||
declare let componentHandler: any;
|
declare let componentHandler: any;
|
||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
@@ -27,23 +26,19 @@ declare let __moduleName: string;
|
|||||||
selector: 'activiti-task-header',
|
selector: 'activiti-task-header',
|
||||||
moduleId: __moduleName,
|
moduleId: __moduleName,
|
||||||
templateUrl: './activiti-task-header.component.html',
|
templateUrl: './activiti-task-header.component.html',
|
||||||
styleUrls: ['./activiti-task-header.component.css'],
|
styleUrls: ['./activiti-task-header.component.css']
|
||||||
providers: [ FormService ]
|
|
||||||
})
|
})
|
||||||
export class ActivitiTaskHeader implements OnInit, OnChanges {
|
export class ActivitiTaskHeader implements OnInit {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
taskDetails: TaskDetailsModel;
|
taskDetails: TaskDetailsModel;
|
||||||
|
|
||||||
taskForm: FormModel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param auth
|
* @param auth
|
||||||
* @param translate
|
* @param translate
|
||||||
*/
|
*/
|
||||||
constructor(private auth: AlfrescoAuthenticationService,
|
constructor(private auth: AlfrescoAuthenticationService,
|
||||||
private activitiForm: FormService,
|
|
||||||
private translate: AlfrescoTranslationService) {
|
private translate: AlfrescoTranslationService) {
|
||||||
|
|
||||||
if (translate) {
|
if (translate) {
|
||||||
@@ -52,29 +47,7 @@ export class ActivitiTaskHeader implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.taskDetails && this.taskDetails.formKey) {
|
|
||||||
this.load(this.taskDetails.id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(change) {
|
|
||||||
if (this.taskDetails && this.taskDetails.formKey) {
|
|
||||||
this.load(this.taskDetails.id);
|
|
||||||
} else {
|
|
||||||
this.taskForm = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public load(taskId: string) {
|
|
||||||
if (taskId) {
|
|
||||||
this.activitiForm.getTaskForm(taskId).subscribe(
|
|
||||||
(response) => {
|
|
||||||
this.taskForm = response;
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user