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.
Merge pull request #505 from jpkrohling/HAWKULAR-59-ListUsersInOrgAnd…
…InviteUsers HAWKULAR-59 - Listing users in organization.
- Loading branch information
Showing
9 changed files
with
213 additions
and
17 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
console/src/main/scripts/plugins/accounts/html/organization-invite.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,27 @@ | ||
<div class="modal-header"> | ||
<button type="button" class="close" dismiss="modal" aria-label="Close" ng-click="inviteModal.cancel()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
<h4 class="modal-title">Invite people</h4> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
<form role="form" class="form-horizontal"> | ||
<div class="form-group"> | ||
<label for="emails" class="col-md-4 control-label">Invite via email</label> | ||
<div class="col-md-6"> | ||
<input type="text" class="form-control" id="emails" placeholder="Emails, separated by comma or space"> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" dismiss="modal" ng-click="inviteModal.cancel()" | ||
id="inviteToOrganizationFormCancelBtn"> | ||
Cancel | ||
</button> | ||
<button type="button" class="btn btn-primary" id="inviteToOrganizationFormBtn" ng-click="inviteModal.invite()"> | ||
Invite | ||
</button> | ||
</div> |
62 changes: 62 additions & 0 deletions
62
console/src/main/scripts/plugins/accounts/html/organization-memberships.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,62 @@ | ||
<div class="row"> | ||
<div class="col-md-12" ng-controller="HawkularAccounts.OrganizationMembershipController as controller"> | ||
<ol class="breadcrumb"> | ||
<li><a data-ng-href="/hawkular-ui/organizations">« All organizations</a></li> | ||
</ol> | ||
|
||
<h1 class="text-center">Organization {{controller.organization.name}}</h1> | ||
|
||
<div class="pull-right" ng-show="controller.memberships.length && !controller.loading && controller.foundOrganization"> | ||
<button class="btn btn-primary" type="button" role="button" ng-click="controller.showInviteModal()"> | ||
Invite People | ||
</button> | ||
</div> | ||
<h2>Members</h2> | ||
|
||
<div class="progress-description" ng-show="controller.loading"> | ||
<div class="spinner spinner-xs spinner-inline"></div> | ||
<strong>Loading:</strong> Organization members | ||
</div> | ||
|
||
<div ng-show="!controller.loading && controller.foundOrganization"> | ||
<div class="row text-center" ng-show="!controller.memberships.length"> | ||
<i class="fa fa-users" id="empty-organizations-icon"></i> | ||
<h2>No members for this organization (not even you?). Found organization: {{controller.foundOrganization}}</h2> | ||
<p> | ||
With organizations, multiple users can have access<br/> | ||
to the same resources, with multiple roles. | ||
</p> | ||
<button class="btn btn-primary" type="button" role="button" ng-click="controller.showInviteModal()"> | ||
Invite People | ||
</button> | ||
</div> | ||
|
||
<div ng-show="controller.memberships.length"> | ||
<table class="table table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Role</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="membership in controller.memberships"> | ||
<td>{{membership.member.name}}</td> | ||
<td>{{membership.role.name}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
|
||
<div class="row text-center" ng-show="!controller.loading && !controller.foundOrganization"> | ||
<i class="fa fa-users" id="organization-not-found-icon"></i> | ||
<h2>Organization not found.</h2> | ||
<p> | ||
The requested organization could not be found. | ||
</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
92 changes: 92 additions & 0 deletions
92
console/src/main/scripts/plugins/accounts/ts/organizationMembership.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,92 @@ | ||
/// | ||
/// 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 OrganizationMembershipController { | ||
public static $inject = ['$log', '$routeParams', '$modal', 'HawkularAccount', 'NotificationsService']; | ||
|
||
public loading:boolean; | ||
public foundOrganization:boolean; | ||
public memberships:Array<IPersona>; | ||
public organization:IOrganization; | ||
|
||
constructor(private $log:ng.ILogService, | ||
private $routeParams:any, | ||
private $modal:any, | ||
private HawkularAccount:any, | ||
private NotificationsService:INotificationsService) { | ||
|
||
$log.debug('Loading memberships for this organization'); | ||
this.loading = true; | ||
this.foundOrganization = false; | ||
this.organization = HawkularAccount.Organization.get({id: $routeParams.organizationId}, | ||
() => { | ||
this.foundOrganization = true; | ||
this.memberships = HawkularAccount.OrganizationMembership.query({organizationId:$routeParams.organizationId}, | ||
() => { | ||
this.loading = false; | ||
$log.debug(`Finished loading members. Size: ${this.memberships.length}`); | ||
}, | ||
() => { | ||
NotificationsService.info('List of organizations could NOT be retrieved.'); | ||
$log.warn('List of organizations could NOT be retrieved.'); | ||
this.loading = false; | ||
} | ||
); | ||
}, | ||
() => { | ||
NotificationsService.warning('Organization not found.'); | ||
$log.warn(`The requested organization doesn't exist: ${$routeParams.organizationId}`); | ||
this.loading = false; | ||
} | ||
); | ||
} | ||
|
||
public showInviteModal():void { | ||
let createFormModal = this.$modal.open({ | ||
controller: 'HawkularAccounts.OrganizationInviteModalController as inviteModal', | ||
templateUrl: 'plugins/accounts/html/organization-invite.html' | ||
}); | ||
|
||
} | ||
} | ||
|
||
export class OrganizationInviteModalController { | ||
public static $inject = ['$log', '$modalInstance', 'HawkularAccount', 'NotificationsService']; | ||
|
||
constructor(private $log:ng.ILogService, | ||
private $modalInstance:any, | ||
private HawkularAccount:any, | ||
private NotificationsService:INotificationsService) { | ||
} | ||
|
||
public cancel():void { | ||
this.$modalInstance.dismiss('cancel'); | ||
} | ||
|
||
public invite():void { | ||
this.NotificationsService.warning('Invitation is not implemented yet. Stay tuned.'); | ||
this.$modalInstance.close(); | ||
} | ||
} | ||
|
||
_module.controller('HawkularAccounts.OrganizationMembershipController', OrganizationMembershipController); | ||
_module.controller('HawkularAccounts.OrganizationInviteModalController', OrganizationInviteModalController); | ||
} |
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