X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-FE-common%2Fclient%2Fapp%2Fviews%2Faccount-onboarding%2Faccount-add-details%2Faccount-add-details.js;h=97e4b70374327248710f9baac6f72d8627387883;hb=refs%2Fchanges%2F89%2F8489%2F8;hp=2f9afd390ccc580c6c4827b17746acb76e825285;hpb=bc7350dce5b7b1dcd1c472a3922b42c4ea99809d;p=portal.git diff --git a/ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js b/ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js index 2f9afd39..97e4b703 100644 --- a/ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js +++ b/ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js @@ -1,14 +1,13 @@ 'use strict'; (function () { class AccountAddDetailsCtrl { - constructor($scope, $log, $interval, basicAuthAccountService, errorMessageByCode, ECOMP_URL_REGEX, $window, confirmBoxService, $cookies) { + constructor($scope, $log, $interval, basicAuthAccountService, errorMessageByCode, ECOMP_URL_REGEX, $window, confirmBoxService, $cookies,items) { this.addEndpoint = () => { this.account.endpointList.push({ valid: true }); } - let init = () => { this.account = []; this.account.endpointList = []; @@ -16,11 +15,11 @@ this.dupliateName = false; this.emptyAccountName = false; this.emptyAccountUsername = false; - this.accountList = $scope.ngDialogData.list; + this.accountList = items.list; - if ($scope.ngDialogData && $scope.ngDialogData.account) { + if (items&& items.account) { this.isEditMode = true; - this.account = _.clone($scope.ngDialogData.account); + this.account = _.clone(items.account); this.account.repassword = this.account.password; this.account.endpointList = this.account.endpoints; if(this.account.isActive == 'Y') @@ -42,9 +41,9 @@ }; - this.closeThisDialog = () => { + /* this.closeThisDialog = () => { $scope.closeThisDialog(true); - } + }*/ this.removeEndpointItem = (endpoint) => { for(var i = 0; i < this.account.endpointList.length; i++){ @@ -55,10 +54,6 @@ } } - this.confirmPassword = () => { - this.passwordMatched = true; - } - this.updateUsername = () => { this.emptyAccountUsername = false; } @@ -144,13 +139,17 @@ confirmBoxService.editItem(message).then(isConfirmed => { if(isConfirmed){ basicAuthAccountService.updateAccount(this.account.id, newAccount).then(() => { - $scope.closeThisDialog(true); + $scope.$dismiss('cancel'); + $window.location.reload(); + }); } }); }else{ basicAuthAccountService.createAccount(newAccount).then(() => { - $scope.closeThisDialog(true); + $scope.$dismiss('cancel'); + $window.location.reload(); + }); } } @@ -161,6 +160,6 @@ }); } } - AccountAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'basicAuthAccountService', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window', 'confirmBoxService', '$cookies']; + AccountAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'basicAuthAccountService', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window', 'confirmBoxService', '$cookies','items']; angular.module('ecompApp').controller('AccountAddDetailsCtrl', AccountAddDetailsCtrl); })(); \ No newline at end of file