Skip to content

Commit e148d44

Browse files
author
astroshim
committed
disallow the blank values of Credential on the front.
1 parent 9b0fb6e commit e148d44

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

zeppelin-web/src/app/credential/credential.controller.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, $
2121
$scope.credentialEntity = '';
2222
$scope.credentialUsername = '';
2323
$scope.credentialPassword = '';
24-
24+
2525
$scope.updateCredentials = function() {
26+
if (_.isEmpty($scope.credentialEntity.trim()) ||
27+
_.isEmpty($scope.credentialUsername.trim()) ||
28+
_.isEmpty($scope.credentialPassword.trim())) {
29+
BootstrapDialog.alert({
30+
closable: true,
31+
message: 'The values must be filled.'
32+
});
33+
return;
34+
}
35+
2636
$http.put(baseUrlSrv.getRestApiBase() + '/credential',
2737
{ 'entity': $scope.credentialEntity,
2838
'username': $scope.credentialUsername,
2939
'password': $scope.credentialPassword
3040
} ).
3141
success(function (data, status, headers, config) {
32-
alert('Successfully saved credentials');
42+
BootstrapDialog.alert({
43+
closable: true,
44+
message: 'Successfully saved credentials.'
45+
});
3346
$scope.credentialEntity = '';
3447
$scope.credentialUsername = '';
3548
$scope.credentialPassword = '';

0 commit comments

Comments
 (0)