Repository: zeppelin Updated Branches: refs/heads/master 63dfa0f4c -> 3a338e01e
BugFix-blocking of blank values insertion on the Credential page. ### What is this PR for? This PR blocks the blank values insertion on the Credential page and changes the success message box to zeppelin's dialog box. ### What type of PR is it? Bug Fix ### How should this be tested? Try to save with blank values on the Credential page. ### Screenshots (if appropriate) - before  - after   ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: astroshim <[email protected]> Closes #1064 from astroshim/feat/checkCredentialValues and squashes the following commits: 63bc385 [astroshim] allow blank password. e148d44 [astroshim] disallow the blank values of Credential on the front. Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/3a338e01 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/3a338e01 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/3a338e01 Branch: refs/heads/master Commit: 3a338e01e89a332188ac79e6b6a5ab8b6f0cb669 Parents: 63dfa0f Author: astroshim <[email protected]> Authored: Wed Jun 22 20:38:45 2016 +0900 Committer: Alexander Bezzubov <[email protected]> Committed: Thu Jun 30 16:45:30 2016 +0900 ---------------------------------------------------------------------- .../src/app/credential/credential.controller.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3a338e01/zeppelin-web/src/app/credential/credential.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/credential/credential.controller.js b/zeppelin-web/src/app/credential/credential.controller.js index 11dff3e..32562b8 100644 --- a/zeppelin-web/src/app/credential/credential.controller.js +++ b/zeppelin-web/src/app/credential/credential.controller.js @@ -21,15 +21,27 @@ angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, $ $scope.credentialEntity = ''; $scope.credentialUsername = ''; $scope.credentialPassword = ''; - + $scope.updateCredentials = function() { + if (_.isEmpty($scope.credentialEntity.trim()) || + _.isEmpty($scope.credentialUsername.trim())) { + BootstrapDialog.alert({ + closable: true, + message: 'Username \\ Entity can not be empty.' + }); + return; + } + $http.put(baseUrlSrv.getRestApiBase() + '/credential', { 'entity': $scope.credentialEntity, 'username': $scope.credentialUsername, 'password': $scope.credentialPassword } ). success(function (data, status, headers, config) { - alert('Successfully saved credentials'); + BootstrapDialog.alert({ + closable: true, + message: 'Successfully saved credentials.' + }); $scope.credentialEntity = ''; $scope.credentialUsername = ''; $scope.credentialPassword = '';
