'use strict';
(function () {
class MicroserviceAddDetailsCtrl {
- constructor($scope, $log, $interval, widgetsCatalogService, applicationsService, adminsService, microserviceService, errorMessageByCode, ECOMP_URL_REGEX, $window,userProfileService, confirmBoxService, $cookies) {
+ constructor($scope, $log, $interval, widgetsCatalogService, applicationsService, adminsService, microserviceService, errorMessageByCode, ECOMP_URL_REGEX, $window,userProfileService, confirmBoxService, $cookies,items) {
-
+ $scope.ngDialogData=items;
let getAvailableApps = () => {
applicationsService.getAppsForSuperAdminAndAccountAdmin().then(apps => {
this.availableApps=[];
};
this.addParameter = () => {
- document.getElementById('microservice-scroll-end').scrollIntoView();
this.service.parameterList.push({});
}
userProfileService.getUserProfile()
.then(profile=> {
$log.info('AppDetailsModalCtrl::emptyCookies profile: ', profile);
- $scope.attuid = profile.attuid;
- $log.info('user has the following attuid: ' + profile.attuid);
- if ($cookies.getObject($scope.attuid + '_widget') != undefined && $cookies.getObject($scope.attuid + '_widget') != null) {
- $cookies.remove($scope.attuid + '_widget');
+ $scope.orgUserId = profile.orgUserId;
+ $log.info('user has the following orgUserId: ' + profile.orgUserId);
+ if ($cookies.getObject($scope.orgUserId + '_widget') != undefined && $cookies.getObject($scope.orgUserId + '_widget') != null) {
+ $cookies.remove($scope.orgUserId + '_widget');
}
});
};
if(isConfirmed){
microserviceService.updateService(this.service.id, newService).then(() => {
// TODO: result validation check
- this.closeThisDialog();
+ //this.closeThisDialog();
+ $scope.$dismiss('cancel');
});
}
});
}else{
microserviceService.createService(newService).then(() => {
// TODO: result validation check
- $scope.closeThisDialog(true);
+ //$scope.closeThisDialog(true);
+ $scope.$dismiss('cancel');
});
}
});
}
}
- MicroserviceAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'widgetsCatalogService', 'applicationsService', 'adminsService', 'microserviceService', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window','userProfileService', 'confirmBoxService', '$cookies'];
+ MicroserviceAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'widgetsCatalogService', 'applicationsService', 'adminsService', 'microserviceService', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window','userProfileService', 'confirmBoxService', '$cookies','items'];
angular.module('ecompApp').controller('MicroserviceAddDetailsCtrl', MicroserviceAddDetailsCtrl);
})();