mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -15,8 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, Input, OnInit, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ActivitiStartForm } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
@@ -27,7 +28,7 @@ declare let componentHandler: any;
|
||||
templateUrl: './activiti-start-process.component.html',
|
||||
styleUrls: ['./activiti-start-process.component.css']
|
||||
})
|
||||
export class ActivitiStartProcessButton implements OnInit {
|
||||
export class ActivitiStartProcessButton implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
appId: string;
|
||||
@@ -35,6 +36,9 @@ export class ActivitiStartProcessButton implements OnInit {
|
||||
@ViewChild('dialog')
|
||||
dialog: any;
|
||||
|
||||
@ViewChild('startForm')
|
||||
startForm: ActivitiStartForm;
|
||||
|
||||
processDefinitions: any[] = [];
|
||||
|
||||
name: string;
|
||||
@@ -52,6 +56,10 @@ export class ActivitiStartProcessButton implements OnInit {
|
||||
this.load(this.appId);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
console.log('changes', changes);
|
||||
}
|
||||
|
||||
public load(appId: string) {
|
||||
this.activitiProcess.getProcessDefinitions(this.appId).subscribe(
|
||||
(res: any[]) => {
|
||||
@@ -87,4 +95,31 @@ export class ActivitiStartProcessButton implements OnInit {
|
||||
this.dialog.nativeElement.close();
|
||||
}
|
||||
}
|
||||
|
||||
hasFormKey() {
|
||||
return true;
|
||||
}
|
||||
|
||||
onFormSaved($event: Event) {
|
||||
$event.preventDefault();
|
||||
console.log('form saved');
|
||||
}
|
||||
|
||||
onFormCompleted($event: Event) {
|
||||
$event.preventDefault();
|
||||
console.log('form saved');
|
||||
}
|
||||
|
||||
onExecuteOutcome($event: Event) {
|
||||
$event.preventDefault();
|
||||
console.log('form outcome executed');
|
||||
}
|
||||
|
||||
onFormLoaded($event: Event) {
|
||||
console.log('form loaded', $event);
|
||||
}
|
||||
|
||||
onFormError($event: Event) {
|
||||
console.log('form error', $event);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user