summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js')
-rw-r--r--ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js27
1 files changed, 13 insertions, 14 deletions
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