diff options
author | marcinrzepeckiwroc <marcin.rzepecki@nokia.com> | 2020-10-05 14:17:30 +0200 |
---|---|---|
committer | marcinrzepeckiwroc <marcin.rzepecki@nokia.com> | 2020-10-05 14:17:30 +0200 |
commit | 30eb0655f49fd3565d737b91146baf9ce4e02f9d (patch) | |
tree | 7311c8791dc2ed4d4b602963b4d427a414d413c8 /vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js | |
parent | 40027d2cbfee31ecfec1c8a4189668f2c46c82ce (diff) |
Relax VNF Change Management filters for VNFs
Issue-ID: VID-837
Signed-off-by: marcinrzepeckiwroc <marcin.rzepecki@nokia.com>
Change-Id: I1b1a501897d013a9f2b54423100aa8de924e5a9d
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js')
-rw-r--r-- | vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js | 33 |
1 files changed, 23 insertions, 10 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 08791b2c4..3ebadda8d 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 @@ -3,6 +3,7 @@ * VID * ================================================================================ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020 Nokia Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -602,11 +603,9 @@ vm.vnfNames = []; vm.changeManagement.vnfNames = []; - var instances = vm.changeManagement.serviceType["service-instances"]["service-instance"]; - // var promiseArrOfGetVnfs = preparePromiseArrOfGetVnfs(instances); - vm.vnfs = []; vm.vfModules = []; + vm.genericVnfs = []; let nfRole = null; let cloudRegion = null; @@ -616,7 +615,7 @@ cloudRegion = vm.changeManagement.cloudRegion ? vm.changeManagement.cloudRegion : null; } - AaiService.getVnfsByCustomerIdAndServiceType( + return AaiService.getVnfsByCustomerIdAndServiceType( vm.changeManagement.subscriberId, vm.changeManagement.serviceType["service-type"], nfRole, @@ -629,11 +628,7 @@ if (vnfsData[i]) { const nodeType = vnfsData[i]['node-type']; if (nodeType === "generic-vnf") { - if (_.find(vnfsData[i]['related-to'], function (node) { - return node['node-type'] === 'vserver'; - }) !== undefined) { - vm.vnfs.push(vnfsData[i]); - } + vm.genericVnfs.push(vnfsData[i]); } else if (nodeType === "service-instance") { vm.serviceInstances.push(vnfsData[i]); } else if (nodeType === "vf-module") { @@ -642,6 +637,24 @@ } } + vm.genericVnfs.forEach(function (vnf) { + if (vnf['related-to'].find(function (node) {return node['node-type'] === 'vf-module';}) !== undefined) { + let vfModuleRel = vnf['related-to'].find(function (node) { + return node['node-type'] === 'vf-module' + }) + for (var i = 0; i < vm.vfModules.length; i++) { + const vfModule = vm.vfModules[i]; + if (vfModule['id'] === vfModuleRel['id']){ + if (vfModule['related-to'].find(function (node) {return node['node-type'] === 'vserver';}) !== undefined) { + vm.vnfs.push(vnf); + } + } + } + } else if (vnf['related-to'].find(function (node) {return node['node-type'] === 'vserver';}) !== undefined) { + vm.vnfs.push(vnf); + } + }); + vm.vnfs = _.flattenDeep( _.remove(vm.vnfs, function (vnf) { var nfRole = vnf.properties['nf-role']; @@ -1024,4 +1037,4 @@ init(); } -})();
\ No newline at end of file +})(); |