aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-12-18 16:11:09 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-12-19 10:03:20 +0200
commitff6b9bb17545dcd535322bcf0b2fa1c73338cf4b (patch)
treef84c9b5d828c160d0c161e89f4cdcf6fc6eef702 /vid-app-common
parent2e263cc66539a814502590365cf844b093115942 (diff)
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 <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js7
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js3
2 files changed, 9 insertions, 1 deletions
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
+});