This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HAWKULAR-59 - Added feature to invite users to organization.
- Loading branch information
1 parent
4a2557d
commit 9bd5c49
Showing
9 changed files
with
142 additions
and
8 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
console/src/main/scripts/plugins/accounts/html/organization-accept-invitation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="row"> | ||
<div class="col-md-12" ng-controller="HawkularAccounts.InvitationController as controller"> | ||
<ol class="breadcrumb"> | ||
<li><a data-ng-href="/hawkular-ui/organizations">« All organizations</a></li> | ||
</ol> | ||
|
||
<h1 class="text-center" ng-show="controller.success">Invitation for {{controller.invitation.organization.name}}</h1> | ||
<h1 class="text-center" ng-show="!controller.success">Invitation</h1> | ||
|
||
<div class="progress-description" ng-show="controller.loading"> | ||
<div class="spinner spinner-xs spinner-inline"></div> | ||
<strong>Loading:</strong> processing invitation | ||
</div> | ||
|
||
<div class="row text-center" ng-show="!controller.loading && controller.success"> | ||
<i class="fa fa-users" id="accepted-invitation-icon"></i> | ||
<h2>Invitation accepted</h2> | ||
<p> | ||
You can now use Hawkular as {{controller.invitation.organization.name}}. To do that, just select | ||
'{{controller.invitation.organization.name}}' from the account switcher, on the top-right corner of this screen. | ||
</p> | ||
</div> | ||
|
||
<div class="row text-center" ng-show="!controller.loading && !controller.success"> | ||
<i class="fa fa-users" id="error-accepted-invitation-icon"></i> | ||
<h2>Error</h2> | ||
<p> | ||
Something went wrong while processing your invitation. | ||
</p> | ||
</div> | ||
|
||
</div> | ||
<!-- /col --> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
console/src/main/scripts/plugins/accounts/ts/invitation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/// | ||
/// Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
/// and other contributors as indicated by the @author tags. | ||
/// | ||
/// Licensed under the Apache License, Version 2.0 (the "License"); | ||
/// you may not use this file except in compliance with the License. | ||
/// You may obtain a copy of the License at | ||
/// | ||
/// http://www.apache.org/licenses/LICENSE-2.0 | ||
/// | ||
/// Unless required by applicable law or agreed to in writing, software | ||
/// distributed under the License is distributed on an "AS IS" BASIS, | ||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
/// See the License for the specific language governing permissions and | ||
/// limitations under the License. | ||
/// | ||
|
||
/// <reference path='accountsPlugin.ts'/> | ||
|
||
module HawkularAccounts { | ||
|
||
export class InvitationController { | ||
public static $inject = ['$log', '$routeParams', 'HawkularAccount', 'NotificationsService']; | ||
public invitation:IInvitation; | ||
public loading:boolean; | ||
public success:boolean; | ||
|
||
constructor(private $log:ng.ILogService, | ||
private $routeParams:any, | ||
private HawkularAccount:any, | ||
private NotificationsService:INotificationsService) { | ||
|
||
this.loading = true; | ||
this.success = false; | ||
HawkularAccount.OrganizationInvitation.update({token: $routeParams.token}, | ||
(response:IInvitation) => { | ||
this.invitation = response; | ||
this.$log.debug('Invitation object available:'); | ||
this.$log.debug(this.invitation); | ||
this.success = true; | ||
this.loading = false; | ||
}, | ||
(error:IErrorPayload) => { | ||
this.success = false; | ||
this.loading = false; | ||
this.NotificationsService.warning(`An error occurred while processing the invitation: ${error.data.message}`); | ||
this.$log.debug(`Error while trying to process the invitation: ${error.data.message}`); | ||
} | ||
); | ||
} | ||
} | ||
|
||
_module.controller('HawkularAccounts.InvitationController', InvitationController); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters