mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4001] StartProcessCloud - Fix payload with name (#4241)
* Fix the startProcess payload * fix unit test
This commit is contained in:
committed by
Eugenio Romano
parent
fec2b89b2d
commit
bf832f0b1c
@@ -196,7 +196,7 @@ describe('StartProcessCloudComponent', () => {
|
||||
component.ngOnChanges({});
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.processPayloadCloud.processInstanceName).toBeNull();
|
||||
expect(component.processPayloadCloud.name).toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
|
@@ -169,8 +169,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
||||
startProcess() {
|
||||
this.isLoading = true;
|
||||
|
||||
this.processPayloadCloud.processInstanceName = this.processInstanceName.value;
|
||||
this.processPayloadCloud.payloadType = 'StartProcessPayload';
|
||||
this.processPayloadCloud.name = this.processInstanceName.value;
|
||||
if (this.variables) {
|
||||
this.processPayloadCloud.variables = this.variables;
|
||||
}
|
||||
|
@@ -50,6 +50,6 @@ export let fakeProcessDefinitions: ProcessDefinitionCloud[] = [
|
||||
|
||||
export let fakeProcessPayload = new ProcessPayloadCloud({
|
||||
processDefinitionKey: 'NewProcess:1',
|
||||
processInstanceName: 'NewProcess 1',
|
||||
name: 'NewProcess 1',
|
||||
payloadType: 'string'
|
||||
});
|
||||
|
@@ -17,16 +17,15 @@
|
||||
|
||||
export class ProcessPayloadCloud {
|
||||
processDefinitionKey: string;
|
||||
processInstanceName: string;
|
||||
name: string;
|
||||
businessKey: string;
|
||||
variables: Map<string, object>[];
|
||||
payloadType: string;
|
||||
payloadType: string = 'StartProcessPayload';
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.processDefinitionKey = obj && obj.processDefinitionKey ? obj.processDefinitionKey : null;
|
||||
this.processInstanceName = obj && obj.processInstanceName ? obj.processInstanceName : null;
|
||||
this.name = obj && obj.name ? obj.name : null;
|
||||
this.businessKey = obj && obj.businessKey ? obj.businessKey : null;
|
||||
this.variables = obj && obj.variables ? obj.variables : null;
|
||||
this.payloadType = obj && obj.valueUrl ? obj.payloadType : null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user