You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/06/30 07:45:35 UTC

zeppelin git commit: BugFix-blocking of blank values insertion on the Credential page.

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
![out](https://cloud.githubusercontent.com/assets/3348133/16255783/c5d19378-3887-11e6-9eec-5fcac42ee276.gif)

  - after
![image](https://cloud.githubusercontent.com/assets/3348133/16255706/18967912-3887-11e6-8823-21683c17082d.png)

![image](https://cloud.githubusercontent.com/assets/3348133/16255722/55c9f494-3887-11e6-84f8-857a7f5380d6.png)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: astroshim <hs...@nflabs.com>

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 <hs...@nflabs.com>
Authored: Wed Jun 22 20:38:45 2016 +0900
Committer: Alexander Bezzubov <bz...@apache.org>
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 = '';