mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #1043 from Alfresco/dev-mvitale-1035
Fix process definition by appId
This commit is contained in:
commit
3c7817a44e
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild, DebugElement } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild, DebugElement, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ActivitiStartForm } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
@ -29,7 +29,7 @@ declare let dialogPolyfill: 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;
|
||||
@ -57,6 +57,14 @@ export class ActivitiStartProcessButton implements OnInit {
|
||||
this.load(this.appId);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
let appId = changes['appId'];
|
||||
if (appId && (appId.currentValue || appId.currentValue === null)) {
|
||||
this.load(appId.currentValue);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public load(appId: string) {
|
||||
this.activitiProcess.getProcessDefinitions(this.appId).subscribe(
|
||||
(res: any[]) => {
|
||||
|
@ -217,7 +217,7 @@ export class ActivitiProcessService {
|
||||
getProcessDefinitions(appId: string) {
|
||||
let opts = appId ? {
|
||||
latest: true,
|
||||
appId: appId
|
||||
appDefinitionId: appId
|
||||
} : {
|
||||
latest: true
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user