diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserController.js index 0ac0b9a779f4604f1521d743d212127753715e65..48111ff90f9fc878d80823a38e299144dc2cc56d 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserController.js @@ -24,6 +24,8 @@ function CreateUserController() { this.createUser = function() { var _this = this; + this._createUserView.disableAccept(); + var createUser = function() { mainController.serverFacade.createELNUser(_this._createUserModel.userId, function(isRegistered, message) { if(isRegistered) { @@ -31,10 +33,13 @@ function CreateUserController() { location.reload(); }); } else if (message.indexOf("Following persons already exist") !== -1){ - Util.showError(message); + Util.showError(message, function() { + _this._createUserView.enableAccept(); + }, true); } else { _this._createUserView.showPasswordField(); _this._createUserModel.isPasswordRequired = true; + _this._createUserView.enableAccept(); } }); } @@ -50,11 +55,13 @@ function CreateUserController() { if(isRegistered) { createUser(); } else { - Util.showError("User can't be created, check with your administator."); + Util.showError("User can't be created, check with your administator.", function() { + _this._createUserView.enableAccept(); + }, true); } }); } else { - Util.showError("Passwords are not equal.", function() {}, true); + Util.showError("Passwords are not equal.", function() { _this._createUserView.enableAccept(); }, true); } } diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserView.js index d432e82cf5b08e34b7f30c5eeef36d8dbc095c90..576f0eccba0c2abc3e30875d93e417e2e5cb79c0 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserManager/modal/CreateUserView.js @@ -22,6 +22,15 @@ function CreateUserView(createUserController, createUserModel) { this._passwordGroup = null; this._passFieldRepeat = null; this._passwordGroupRepeat = null; + this._$btnAccept = $('<input>', { 'type': 'submit', 'class' : 'btn btn-primary', 'value' : 'Accept' }); + + this.disableAccept = function() { + this._$btnAccept.attr("disabled", ""); + } + + this.enableAccept = function() { + this._$btnAccept.removeAttr("disabled"); + } this.showPasswordField = function() { this._passField.removeAttr('disabled'); @@ -93,14 +102,12 @@ function CreateUserView(createUserController, createUserModel) { // // Buttons // - var $btnAccept = $('<input>', { 'type': 'submit', 'class' : 'btn btn-primary', 'value' : 'Accept' }); - var $btnCancel = $('<a>', { 'class' : 'btn btn-default' }).append('Cancel'); $btnCancel.click(function() { Util.unblockUI(); }); - $window.append($btnAccept).append(' ').append($btnCancel); + $window.append(this._$btnAccept).append(' ').append($btnCancel); var css = { 'text-align' : 'left',