Repository: zeppelin Updated Branches: refs/heads/branch-0.6 c7b93e6ef -> 85b34c610
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. (cherry picked from commit 3a338e01e89a332188ac79e6b6a5ab8b6f0cb669) Signed-off-by: Mina Lee <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/85b34c61 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/85b34c61 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/85b34c61 Branch: refs/heads/branch-0.6 Commit: 85b34c6104d1c792b0651c18ef8858acdc1edc5e Parents: c7b93e6 Author: astroshim <[email protected]> Authored: Wed Jun 22 20:38:45 2016 +0900 Committer: Mina Lee <[email protected]> Committed: Mon Jul 18 15:20:21 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/85b34c61/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 = '';
