diff options
author | Lorraine Welch <lb2391@att.com> | 2019-06-17 21:20:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-17 21:20:46 +0000 |
commit | 4d0b6c18868e0a5fdbd876d4e0fdb18ae5b4573e (patch) | |
tree | d7372c74c7291787dd8926d60270fca2dc3b39ef /ecomp-portal-FE-os/client/src/views/applications/applications.controller.js | |
parent | 8b67487fa29e61ad15ac961231ebb3b6621d39dc (diff) | |
parent | b75f35b0a1824aab32b4329fa62076b0f0307853 (diff) |
Merge "Application Onboarding page changes "
Diffstat (limited to 'ecomp-portal-FE-os/client/src/views/applications/applications.controller.js')
-rw-r--r-- | ecomp-portal-FE-os/client/src/views/applications/applications.controller.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js b/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js index 76121a08..0bcc1eb8 100644 --- a/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js +++ b/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js @@ -40,8 +40,9 @@ class ApplicationsCtrl { constructor($log, $cookies, conf, ngDialog, - applicationsService, confirmBoxService, userProfileService, utilsService,$modal) { + applicationsService, confirmBoxService, userProfileService, utilsService,$modal,$scope) { this.emptyImgForPreview = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; + $scope.isAdmin = false; let getOnboardingApps = () => { this.isLoadingTable = true; applicationsService.getOnboardingApps() @@ -54,6 +55,10 @@ appsList[i].imageLink = appsList[i].imageLink+'?' + new Date().getTime(); } } + if(appsList.length == 0) + { + confirmBoxService.showInformation('You do not have applications to edit').then(isConfirmed => {}); + } this.appsList = appsList; }).catch(err => { confirmBoxService.showInformation('There was a problem retrieving the Applications. ' + @@ -64,8 +69,21 @@ }); }; + let checkIfUserIsSuperAdmin = () => { + applicationsService.checkIfUserIsSuperAdmin().then(res => { + if(res) { + $scope.isAdmin = true; + } + }).catch(err => { + $log.error('ApplicationsCtrl.checkIfUserIsSuperAdmin:: Failed - ' + err); + }).finally(()=> { + this.isSaving = false; + }); + }; + let init = () => { this.isLoadingTable = false; + checkIfUserIsSuperAdmin(); getOnboardingApps(); this.searchString = ''; this.appsTableHeaders = [ @@ -143,6 +161,6 @@ } } ApplicationsCtrl.$inject = ['$log', '$cookies', 'conf', 'ngDialog', - 'applicationsService', 'confirmBoxService', 'userProfileService', 'utilsService','$modal']; + 'applicationsService', 'confirmBoxService', 'userProfileService', 'utilsService','$modal', '$scope']; angular.module('ecompApp').controller('ApplicationsCtrl', ApplicationsCtrl); })(); |