mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #1084 from Alfresco/dev-mromano-1058
Dev mromano 1058
This commit is contained in:
commit
200260b69e
@ -84,9 +84,6 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
|||||||
static COMPLETE_OUTCOME_ID: string = '$complete';
|
static COMPLETE_OUTCOME_ID: string = '$complete';
|
||||||
static CUSTOM_OUTCOME_ID: string = '$custom';
|
static CUSTOM_OUTCOME_ID: string = '$custom';
|
||||||
|
|
||||||
@Input()
|
|
||||||
processId: string;
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
taskId: string;
|
taskId: string;
|
||||||
|
|
||||||
@ -196,11 +193,6 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.processId) {
|
|
||||||
this.loadStartForm(this.processId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.nodeId) {
|
if (this.nodeId) {
|
||||||
this.loadFormForEcmNode();
|
this.loadFormForEcmNode();
|
||||||
} else {
|
} else {
|
||||||
@ -230,12 +222,6 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
|||||||
this.getFormDefinitionByFormName(formName.currentValue);
|
this.getFormDefinitionByFormName(formName.currentValue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let processId = changes['processId'];
|
|
||||||
if (processId && processId.currentValue) {
|
|
||||||
this.loadStartForm(processId.currentValue);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -330,21 +316,6 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadStartForm(processId: string) {
|
|
||||||
this.formService
|
|
||||||
.getStartFormInstance(processId)
|
|
||||||
.subscribe(
|
|
||||||
form => {
|
|
||||||
this.formName = form.name;
|
|
||||||
this.form = this.parseForm(form);
|
|
||||||
this.formLoaded.emit(this.form);
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
this.handleError(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFormDefinitionByFormId(formId: string) {
|
getFormDefinitionByFormId(formId: string) {
|
||||||
this.formService
|
this.formService
|
||||||
.getFormDefinitionById(formId)
|
.getFormDefinitionById(formId)
|
||||||
|
@ -57,9 +57,15 @@ export class ActivitiStartForm extends ActivitiForm implements OnInit, AfterView
|
|||||||
@Input()
|
@Input()
|
||||||
processDefinitionId: string;
|
processDefinitionId: string;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
processId: string;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
showOutcomeButtons: boolean = false;
|
showOutcomeButtons: boolean = false;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
showRefreshButton: boolean = true;
|
||||||
|
|
||||||
@ViewChild('outcomesContainer', {})
|
@ViewChild('outcomesContainer', {})
|
||||||
outcomesContainer: ElementRef = null;
|
outcomesContainer: ElementRef = null;
|
||||||
|
|
||||||
@ -70,7 +76,11 @@ export class ActivitiStartForm extends ActivitiForm implements OnInit, AfterView
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loadForm();
|
if (this.processId) {
|
||||||
|
this.loadStartForm(this.processId);
|
||||||
|
}else {
|
||||||
|
this.loadForm();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.translate) {
|
if (this.translate) {
|
||||||
this.translate.addTranslationFolder('node_modules/ng2-activiti-form/src');
|
this.translate.addTranslationFolder('node_modules/ng2-activiti-form/src');
|
||||||
@ -78,9 +88,15 @@ export class ActivitiStartForm extends ActivitiForm implements OnInit, AfterView
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
let processId = changes['processDefinitionId'];
|
let processDefinitionId = changes['processDefinitionId'];
|
||||||
if (processId && processId.currentValue) {
|
if (processDefinitionId && processDefinitionId.currentValue) {
|
||||||
this.getStartFormDefinition(processId.currentValue);
|
this.getStartFormDefinition(processDefinitionId.currentValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let processId = changes['processId'];
|
||||||
|
if (processId && processId.currentValue) {
|
||||||
|
this.loadStartForm(processId.currentValue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,6 +108,23 @@ export class ActivitiStartForm extends ActivitiForm implements OnInit, AfterView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadStartForm(processId: string) {
|
||||||
|
this.formService
|
||||||
|
.getStartFormInstance(processId)
|
||||||
|
.subscribe(
|
||||||
|
form => {
|
||||||
|
this.formName = form.name;
|
||||||
|
form.processDefinitionId = this.processDefinitionId;
|
||||||
|
this.form = this.parseForm(form);
|
||||||
|
// this.form.processDefinitionId = this.processDefinitionId;
|
||||||
|
this.formLoaded.emit(this.form);
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
this.handleError(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getStartFormDefinition(processId: string) {
|
getStartFormDefinition(processId: string) {
|
||||||
this.formService
|
this.formService
|
||||||
.getStartFormDefinition(processId)
|
.getStartFormDefinition(processId)
|
||||||
|
@ -34,7 +34,7 @@ export class FormModel {
|
|||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly taskId: string;
|
readonly taskId: string;
|
||||||
readonly taskName: string = FormModel.UNSET_TASK_NAME;
|
readonly taskName: string = FormModel.UNSET_TASK_NAME;
|
||||||
readonly processDefinitionId: string;
|
processDefinitionId: string;
|
||||||
private _isValid: boolean = true;
|
private _isValid: boolean = true;
|
||||||
|
|
||||||
get isValid(): boolean {
|
get isValid(): boolean {
|
||||||
|
@ -38,7 +38,8 @@
|
|||||||
<span class="mdl-list__item-primary-content" (click)="clickStartTask($event)">
|
<span class="mdl-list__item-primary-content" (click)="clickStartTask($event)">
|
||||||
<i class="material-icons mdl-list__item-icon">assignment</i>
|
<i class="material-icons mdl-list__item-icon">assignment</i>
|
||||||
<span>{{ 'DETAILS.LABELS.START_FORM'|translate }}</span>
|
<span>{{ 'DETAILS.LABELS.START_FORM'|translate }}</span>
|
||||||
|
<span class="mdl-list__item-sub-title">{{ 'DETAILS.LABELS.TASK_SUBTITLE' | translate:{user:
|
||||||
|
getUserFullName(processInstanceDetails.startedBy), created: getFormatDate(processInstanceDetails.started, 'mediumDate') } }}</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -80,9 +81,9 @@
|
|||||||
<dialog class="mdl-dialog task-details-dialog" #startDialog>
|
<dialog 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">
|
<div class="mdl-dialog__content">
|
||||||
<activiti-form [processId]="processId" [showSaveButton]="false" [showCompleteButton]="false" [showDebugButton]="false"
|
<activiti-start-form [processId]="processId" [processDefinitionId]="processInstanceDetails.processDefinitionId"
|
||||||
[showRefreshButton]="false">
|
[showOutcomeButtons]="false" [showRefreshButton]="false">
|
||||||
</activiti-form>
|
</activiti-start-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-dialog__actions">
|
<div class="mdl-dialog__actions">
|
||||||
<button type="button" (click)="closeSartDialog()" class="mdl-button close">{{ 'DETAILS.TASKS.TASK_CLOSE' | translate }}</button>
|
<button type="button" (click)="closeSartDialog()" class="mdl-button close">{{ 'DETAILS.TASKS.TASK_CLOSE' | translate }}</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user