From c3a5822a401bfe10232d61009a754e06ecc45cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 16 Jul 2015 12:38:49 +0200 Subject: [PATCH] feat(user invite): progress on user invite feature, #2353 --- public/app/features/org/all.js | 1 + public/app/features/org/orgUsersCtrl.js | 2 +- public/app/features/org/partials/invite.html | 68 ++++++++++++++++++++ public/app/features/org/userInviteCtrl.js | 33 ++++++++++ public/app/partials/invite_users.html | 55 ---------------- public/css/less/tightform.less | 2 +- 6 files changed, 104 insertions(+), 57 deletions(-) create mode 100644 public/app/features/org/partials/invite.html create mode 100644 public/app/features/org/userInviteCtrl.js delete mode 100644 public/app/partials/invite_users.html diff --git a/public/app/features/org/all.js b/public/app/features/org/all.js index ba51b99369b..d03d270709d 100644 --- a/public/app/features/org/all.js +++ b/public/app/features/org/all.js @@ -3,6 +3,7 @@ define([ './datasourceEditCtrl', './orgUsersCtrl', './newOrgCtrl', + './userInviteCtrl', './orgApiKeysCtrl', './orgDetailsCtrl', ], function () {}); diff --git a/public/app/features/org/orgUsersCtrl.js b/public/app/features/org/orgUsersCtrl.js index d5756b5f025..bc124856bab 100644 --- a/public/app/features/org/orgUsersCtrl.js +++ b/public/app/features/org/orgUsersCtrl.js @@ -39,7 +39,7 @@ function (angular) { $scope.openInviteModal = function() { $scope.appEvent('show-modal', { - src: './app/partials/invite_users.html', + src: './app/features/org/partials/invite.html', modalClass: 'modal-no-header invite-modal', scope: $scope.$new() }); diff --git a/public/app/features/org/partials/invite.html b/public/app/features/org/partials/invite.html new file mode 100644 index 00000000000..53290bd6c30 --- /dev/null +++ b/public/app/features/org/partials/invite.html @@ -0,0 +1,68 @@ + + + diff --git a/public/app/features/org/userInviteCtrl.js b/public/app/features/org/userInviteCtrl.js new file mode 100644 index 00000000000..b93611d6df4 --- /dev/null +++ b/public/app/features/org/userInviteCtrl.js @@ -0,0 +1,33 @@ +define([ + 'angular', + 'lodash', +], +function (angular, _) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('UserInviteCtrl', function($scope) { + + $scope.invites = [ + {name: '', email: '', role: 'Editor'}, + ]; + + $scope.init = function() { + }; + + $scope.addInvite = function() { + $scope.invites.push({name: '', email: '', role: 'Editor'}); + }; + + $scope.removeInvite = function(invite) { + $scope.invites = _.without($scope.invites, invite); + }; + + $scope.sendInvites = function() { + if (!$scope.inviteForm.$valid) { return; } + + $scope.dismiss(); + }; + }); +}); diff --git a/public/app/partials/invite_users.html b/public/app/partials/invite_users.html deleted file mode 100644 index 0299baae403..00000000000 --- a/public/app/partials/invite_users.html +++ /dev/null @@ -1,55 +0,0 @@ - - diff --git a/public/css/less/tightform.less b/public/css/less/tightform.less index 71457a62141..a85e852bcbc 100644 --- a/public/css/less/tightform.less +++ b/public/css/less/tightform.less @@ -165,7 +165,7 @@ select.tight-form-input { margin: 0px; border-radius: 0; height: 36px; - padding: 8px 3px; + padding: 9px 3px; &.last { border-right: none; }