|
@@ -1,5 +1,6 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
import React, { PureComponent } from 'react';
|
|
|
import { connect } from 'react-redux';
|
|
import { connect } from 'react-redux';
|
|
|
|
|
+import classNames from 'classnames/bind';
|
|
|
import { setUsersSearchQuery } from './state/actions';
|
|
import { setUsersSearchQuery } from './state/actions';
|
|
|
import { getInviteesCount, getUsersSearchQuery } from './state/selectors';
|
|
import { getInviteesCount, getUsersSearchQuery } from './state/selectors';
|
|
|
|
|
|
|
@@ -9,6 +10,7 @@ export interface Props {
|
|
|
onShowInvites: () => void;
|
|
onShowInvites: () => void;
|
|
|
pendingInvitesCount: number;
|
|
pendingInvitesCount: number;
|
|
|
canInvite: boolean;
|
|
canInvite: boolean;
|
|
|
|
|
+ showInvites: boolean;
|
|
|
externalUserMngLinkUrl: string;
|
|
externalUserMngLinkUrl: string;
|
|
|
externalUserMngLinkName: string;
|
|
externalUserMngLinkName: string;
|
|
|
}
|
|
}
|
|
@@ -23,8 +25,21 @@ export class UsersActionBar extends PureComponent<Props> {
|
|
|
pendingInvitesCount,
|
|
pendingInvitesCount,
|
|
|
setUsersSearchQuery,
|
|
setUsersSearchQuery,
|
|
|
onShowInvites,
|
|
onShowInvites,
|
|
|
|
|
+ showInvites,
|
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
+ const pendingInvitesButtonStyle = classNames({
|
|
|
|
|
+ btn: true,
|
|
|
|
|
+ 'toggle-btn': true,
|
|
|
|
|
+ active: showInvites,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const usersButtonStyle = classNames({
|
|
|
|
|
+ btn: true,
|
|
|
|
|
+ 'toggle-btn': true,
|
|
|
|
|
+ active: !showInvites,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="page-action-bar">
|
|
<div className="page-action-bar">
|
|
|
<div className="gf-form gf-form--grow">
|
|
<div className="gf-form gf-form--grow">
|
|
@@ -38,13 +53,17 @@ export class UsersActionBar extends PureComponent<Props> {
|
|
|
/>
|
|
/>
|
|
|
<i className="gf-form-input-icon fa fa-search" />
|
|
<i className="gf-form-input-icon fa fa-search" />
|
|
|
</label>
|
|
</label>
|
|
|
-
|
|
|
|
|
- <div className="page-action-bar__spacer" />
|
|
|
|
|
{pendingInvitesCount > 0 && (
|
|
{pendingInvitesCount > 0 && (
|
|
|
- <button className="btn btn-inverse" onClick={onShowInvites}>
|
|
|
|
|
- Pending Invites ({pendingInvitesCount})
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <div style={{ marginLeft: '1rem' }}>
|
|
|
|
|
+ <button className={usersButtonStyle} key="users" onClick={onShowInvites}>
|
|
|
|
|
+ Users
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button className={pendingInvitesButtonStyle} onClick={onShowInvites} key="pending-invites">
|
|
|
|
|
+ Pending Invites ({pendingInvitesCount})
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
)}
|
|
)}
|
|
|
|
|
+ <div className="page-action-bar__spacer" />
|
|
|
{canInvite && (
|
|
{canInvite && (
|
|
|
<a className="btn btn-success" href="org/users/invite">
|
|
<a className="btn btn-success" href="org/users/invite">
|
|
|
<i className="fa fa-plus" />
|
|
<i className="fa fa-plus" />
|