diff --git a/src/app/features/account/collaboratorsCtrl.js b/src/app/features/account/collaboratorsCtrl.js index 7bd0feaa5be..88b9fab7782 100644 --- a/src/app/features/account/collaboratorsCtrl.js +++ b/src/app/features/account/collaboratorsCtrl.js @@ -8,7 +8,10 @@ function (angular) { module.controller('CollaboratorsCtrl', function($scope, $http, backendSrv) { - $scope.collaborator = {}; + $scope.collaborator = { + loginOrEmail: '', + role: 'Viewer', + }; $scope.init = function() { $scope.get(); @@ -17,7 +20,6 @@ function (angular) { $scope.get = function() { backendSrv.get('/api/account/collaborators').then(function(collaborators) { $scope.collaborators = collaborators; - console.log(collaborators); }); }; @@ -30,7 +32,7 @@ function (angular) { }; $scope.addCollaborator = function() { - if (!$scope.addCollaboratorForm.$valid) { + if (!$scope.form.$valid) { return; } diff --git a/src/app/features/account/partials/account.html b/src/app/features/account/partials/account.html index a278505c5c5..a69ddb7adb1 100644 --- a/src/app/features/account/partials/account.html +++ b/src/app/features/account/partials/account.html @@ -16,40 +16,38 @@
-
-
-
    -
  • - Name -
  • -
  • - -
  • -
-
-
-
-
    -
  • - Email -
  • -
  • - -
  • -
-
-
-
-
    -
  • - Username -
  • -
  • - -
  • -
-
-
+
+
    +
  • + Name +
  • +
  • + +
  • +
+
+
+
+
    +
  • + Email +
  • +
  • + +
  • +
+
+
+
+
    +
  • + Username +
  • +
  • + +
  • +
+

diff --git a/src/app/features/account/partials/collaborators.html b/src/app/features/account/partials/collaborators.html index 5f44a2f1b8c..d01928d5f56 100644 --- a/src/app/features/account/partials/collaborators.html +++ b/src/app/features/account/partials/collaborators.html @@ -1,6 +1,6 @@
-
+
@@ -12,15 +12,34 @@
-
- - - - +
+ +
+
    +
  • + Username or Email +
  • +
  • + +
  • +
  • + Role +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
diff --git a/src/app/services/backendSrv.js b/src/app/services/backendSrv.js index 843f24a0703..9a02ace4ff0 100644 --- a/src/app/services/backendSrv.js +++ b/src/app/services/backendSrv.js @@ -42,6 +42,11 @@ function (angular, _, config) { } return results.data; }, function(err) { + if (err.status === 422) { + alertSrv.set("Validation failed", "", "warning", 4000); + throw err.data; + } + var data = err.data || { message: 'Unexpected error' }; if (_.isString(data)) { diff --git a/src/css/less/tightform.less b/src/css/less/tightform.less index 0220b6d3e52..b51f98ab9da 100644 --- a/src/css/less/tightform.less +++ b/src/css/less/tightform.less @@ -23,6 +23,10 @@ } } +.tight-form-btn { + padding: 8px 12px; +} + // old graphite-segment-list .tight-form-list { list-style: none;