From ff6b9bb17545dcd535322bcf0b2fa1c73338cf4b Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Wed, 18 Dec 2019 16:11:09 +0200 Subject: while ng1 view/edit - get aai service if they are not exist yet Issue-ID: VID-732 Change-Id: I6fd9866fb84eb07be7ea3c0bfc7cdfc0b3ea6084 Signed-off-by: Eylon Malin --- .../webapp/app/vid/scripts/controller/aaiSubscriberController.js | 7 +++++++ .../app/vid/scripts/controller/aaiSubscriberController.test.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'vid-app-common/src') diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js index 110f24ec6..2701e3e9e 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js @@ -539,6 +539,12 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", var serviceNetworkVlans = []; var vnfNetworksAndVlans = []; + function fetchServiceIfMissing() { + if (_.isEmpty(DataService.getServiceIdList())) { + $scope.fetchServices(); + } + } + $scope.getComponentList = function (event, request) { $scope.isSpinnerVisible = true; @@ -569,6 +575,7 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", }) .then(resolveModelDataIfMissing) .then($scope.prepareScopeWithModel) + .then(fetchServiceIfMissing) .then(function () { return AaiService.getVlansByNetworksMapping($scope.globalCustomerId, $scope.serviceType, $scope.serviceInstanceId, $scope.service.model.service.uuid); }) diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js index af3c2186a..03a299877 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js @@ -223,6 +223,7 @@ describe('aaiSubscriberController testing', () => { includes(array, status){ return array.includes(status); }, + isEmpty(something) {return true;}, }; let mockedLog = {}; @@ -1502,4 +1503,4 @@ describe('aaiSubscriberController testing', () => { }); -}); \ No newline at end of file +}); -- cgit 1.2.3-korg