Commit 024c1129 by Torkel Ödegaard

feat(invite): redesign for pending invite list, added revoke button and link,…

feat(invite): redesign for pending invite list, added revoke button and link, copy invite also works now, #2353
parent 3242354a
......@@ -16,6 +16,10 @@ func GetPendingOrgInvites(c *middleware.Context) Response {
return ApiError(500, "Failed to get invites from db", err)
}
for _, invite := range query.Result {
invite.Url = setting.ToAbsUrl("invite/" + invite.Code)
}
return Json(200, query.Result)
}
......
......@@ -75,6 +75,7 @@ type TempUserDTO struct {
Role string `json:"role"`
InvitedBy string `json:"invitedBy"`
Code string `json:"code"`
Url string `json:"url"`
EmailSent bool `json:"emailSent"`
EmailSentOn time.Time `json:"emailSentOn"`
Created time.Time `json:"createdOn"`
......
......@@ -54,6 +54,7 @@ func GetTempUsersForOrg(query *m.GetTempUsersForOrgQuery) error {
tu.email as email,
tu.name as name,
tu.role as role,
tu.code as code,
tu.email_sent as email_sent,
tu.email_sent_on as email_sent_on,
tu.created as created,
......
......@@ -38,10 +38,15 @@ function (angular) {
backendSrv.delete('/api/org/users/' + user.userId).then($scope.get);
};
$scope.revokeInvite = function(invite) {
$scope.revokeInvite = function(invite, evt) {
evt.stopPropagation();
backendSrv.patch('/api/org/invites/' + invite.id + '/revoke').then($scope.get);
};
$scope.copyInviteToClipboard = function(evt) {
evt.stopPropagation();
};
$scope.openInviteModal = function() {
var modalScope = $scope.$new();
modalScope.invitesSent = function() {
......
......@@ -55,7 +55,7 @@
<div style="text-align: left; margin-top: 6px;">
<a ng-click="addInvite()">+ Invite another</a>
<div class="form-inline" style="margin-top: 20px">
<editor-checkbox text="Skip sending emails" model="options.skipEmails" change="targetBlur()"></editor-checkbox>
<editor-checkbox text="Skip sending invite email" model="options.skipEmails" change="targetBlur()"></editor-checkbox>
</div>
</div>
......
......@@ -44,7 +44,7 @@
{{invite.email}}
<span ng-show="invite.name" style="padding-left: 20px"> {{invite.name}}</span>
<span class="pull-right">
<button class="btn btn-inverse btn-mini " data-clipboard-text="{{invite.url}}" clipboard-button>
<button class="btn btn-inverse btn-mini " data-clipboard-text="{{invite.url}}" clipboard-button ng-click="copyInviteToClipboard($event)"
<i class="fa fa-clipboard"></i> Copy Invite
</button>
&nbsp;
......@@ -54,6 +54,7 @@
</a>
</span>
<div ng-show="invite.expanded">
<a href="{{invite.url}}">{{invite.url}}</a><br>
<button class="btn btn-inverse btn-mini">
<i class="fa fa-envelope-o"></i> Resend invite
</button>
......
......@@ -97,7 +97,7 @@ define([
templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl',
})
.when('/signup/invited', {
.when('/invite/:code', {
templateUrl: 'app/partials/signup_invited.html',
controller : 'InvitedCtrl',
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment