aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src')
-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
+ }]);
+ });
+});
});