aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-05-28 18:41:21 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-28 18:41:21 +0000
commit34284c67127f09e6583384f40b3bc5d3ea7b0ce1 (patch)
tree9eb65da13c5545338e88e82993fc2a5b1940af41
parentfa799d03d45db86ff372444a3604f4a018629fc4 (diff)
parent8140332ee31a1cde9cd60d7ffe6ddb01af8f6037 (diff)
Merge "fetch parameters for native workflows" into dublin
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js7
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js47
2 files changed, 53 insertions, 1 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index c6a5b31af..9709e8f32 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -742,7 +742,12 @@
vm.loadRemoteWorkFlowsParameters = function () {
vm.remoteWorkflowsParameters = new Map();
vm.remoteWorkflows.forEach(function(workflow) {
- vm.loadRemoteWorkFlowParameters(workflow);
+ if (workflow.source ==='SDC' || workflow.source === 'sdc' ){
+ vm.loadRemoteWorkFlowParameters(workflow);
+ } else {
+ vm.localWorkflowsParameters = new Map();
+ vm.loadLocalWorkFlowParameters(workflow.name);
+ }
});
};
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
index afc643993..709e8ca00 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
@@ -357,4 +357,51 @@ describe('Testing workFlows from SO', () => {
expect(internalWorkFlowParameters).toEqual(result);
});
});
+
+ test('Verify get remote workflow should call internal service for params when workflow is native', () =>{
+ let getWorkflowsStub = Promise.resolve({"data": {"workflows": ["workflow 0"]}})
+ let getLocalWorkflowsParametersStub = Promise.resolve({"data":{
+ "parameterDefinitions": [
+ {
+ "id": 1,
+ "name": "Configuration Parameters",
+ "required": true,
+ "type": "text",
+ "pattern": ".*",
+ "msgOnPatternError": null,
+ "msgOnContentError": null,
+ "acceptableFileType": null
+ }
+ ],
+ }});
+ let getSOWorkflowsPromiseStub = Promise.resolve({"data":[{
+
+ "id": "ab6478e4-ea33-3346-ac12-ab121484a333",
+ "workflowName": "inPlaceSoftwareUpdate",
+ "name": "inPlaceSoftwareUpdate",
+ "source": "native",
+ "workflowInputParameters": [
+ ]
+ }]
+ });
+
+ $controller.changeManagement.vnfNames = [{modelVersionId: 'test1', name:'test'}];
+ $changeManagementService.getWorkflows = () => getWorkflowsStub;
+ $changeManagementService.getLocalWorkflowParameter = () => getLocalWorkflowsParametersStub;
+ $changeManagementService.getSOWorkflows = () => getSOWorkflowsPromiseStub;
+
+ return $controller.loadWorkFlows().then(() => {
+ expect($controller.workflows).toContain('inPlaceSoftwareUpdate');
+ expect($controller.localWorkflowsParameters.get('inPlaceSoftwareUpdate')).toEqual([{
+ "id": 1,
+ "name": "Configuration Parameters",
+ "required": true,
+ "type": "text",
+ "pattern": ".*",
+ "msgOnPatternError": null,
+ "msgOnContentError": null,
+ "acceptableFileType": null
+ }]);
+ });
+});
});