Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ef5180ba
Commit
ef5180ba
authored
Oct 03, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed toggle buttons
parent
45113e6c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
17 deletions
+54
-17
public/app/features/datasources/__snapshots__/DataSourcesListPage.test.tsx.snap
+1
-1
public/app/features/plugins/__snapshots__/PluginListPage.test.tsx.snap
+1
-1
public/app/features/users/UsersActionBar.test.tsx
+1
-0
public/app/features/users/UsersActionBar.tsx
+24
-5
public/app/features/users/UsersListPage.tsx
+1
-1
public/app/features/users/__snapshots__/UsersActionBar.test.tsx.snap
+24
-8
public/app/features/users/__snapshots__/UsersListPage.test.tsx.snap
+2
-1
No files found.
public/app/features/datasources/__snapshots__/DataSourcesListPage.test.tsx.snap
View file @
ef5180ba
...
...
@@ -17,8 +17,8 @@ exports[`Render should render action bar and datasources 1`] = `
"title": "Add data source",
}
}
onSetLayoutMode={[Function]}
searchQuery=""
setLayoutMode={[Function]}
setSearchQuery={[Function]}
/>
<DataSourcesList
...
...
public/app/features/plugins/__snapshots__/PluginListPage.test.tsx.snap
View file @
ef5180ba
...
...
@@ -16,8 +16,8 @@ exports[`Render should render component 1`] = `
"title": "Find more plugins on Grafana.com",
}
}
onSetLayoutMode={[Function]}
searchQuery=""
setLayoutMode={[Function]}
setSearchQuery={[Function]}
/>
<PluginList
...
...
public/app/features/users/UsersActionBar.test.tsx
View file @
ef5180ba
...
...
@@ -11,6 +11,7 @@ const setup = (propOverrides?: object) => {
canInvite
:
false
,
externalUserMngLinkUrl
:
''
,
externalUserMngLinkName
:
''
,
showInvites
:
false
,
};
Object
.
assign
(
props
,
propOverrides
);
...
...
public/app/features/users/UsersActionBar.tsx
View file @
ef5180ba
import
React
,
{
PureComponent
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
classNames
from
'classnames/bind'
;
import
{
setUsersSearchQuery
}
from
'./state/actions'
;
import
{
getInviteesCount
,
getUsersSearchQuery
}
from
'./state/selectors'
;
...
...
@@ -9,6 +10,7 @@ export interface Props {
onShowInvites
:
()
=>
void
;
pendingInvitesCount
:
number
;
canInvite
:
boolean
;
showInvites
:
boolean
;
externalUserMngLinkUrl
:
string
;
externalUserMngLinkName
:
string
;
}
...
...
@@ -23,8 +25,21 @@ export class UsersActionBar extends PureComponent<Props> {
pendingInvitesCount
,
setUsersSearchQuery
,
onShowInvites
,
showInvites
,
}
=
this
.
props
;
const
pendingInvitesButtonStyle
=
classNames
({
btn
:
true
,
'toggle-btn'
:
true
,
active
:
showInvites
,
});
const
usersButtonStyle
=
classNames
({
btn
:
true
,
'toggle-btn'
:
true
,
active
:
!
showInvites
,
});
return
(
<
div
className=
"page-action-bar"
>
<
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"
/>
</
label
>
<
div
className=
"page-action-bar__spacer"
/>
{
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
&&
(
<
a
className=
"btn btn-success"
href=
"org/users/invite"
>
<
i
className=
"fa fa-plus"
/>
...
...
public/app/features/users/UsersListPage.tsx
View file @
ef5180ba
...
...
@@ -82,7 +82,7 @@ export class UsersListPage extends PureComponent<Props, State> {
<
div
>
<
PageHeader
model=
{
navModel
}
/>
<
div
className=
"page-container page-body"
>
<
UsersActionBar
onShowInvites=
{
this
.
onShowInvites
}
/>
<
UsersActionBar
onShowInvites=
{
this
.
onShowInvites
}
showInvites=
{
this
.
state
.
showInvites
}
/>
{
externalUserMngInfo
&&
(
<
div
className=
"grafana-info-box"
>
<
span
>
{
externalUserMngInfo
}
</
span
>
...
...
public/app/features/users/__snapshots__/UsersActionBar.test.tsx.snap
View file @
ef5180ba
...
...
@@ -50,16 +50,32 @@ exports[`Render should render pending invites button 1`] = `
/>
</label>
<div
style={
Object {
"marginLeft": "1rem",
}
}
>
<button
className="btn toggle-btn active"
key="users"
onClick={[MockFunction]}
>
Users
</button>
<button
className="btn toggle-btn"
key="pending-invites"
onClick={[MockFunction]}
>
Pending Invites (
5
)
</button>
</div>
<div
className="page-action-bar__spacer"
/>
<button
className="btn btn-inverse"
onClick={[MockFunction]}
>
Pending Invites (
5
)
</button>
</div>
</div>
`;
...
...
public/app/features/users/__snapshots__/UsersListPage.test.tsx.snap
View file @
ef5180ba
...
...
@@ -9,7 +9,8 @@ exports[`Render should render component 1`] = `
className="page-container page-body"
>
<Connect(UsersActionBar)
showInvites={[Function]}
onShowInvites={[Function]}
showInvites={false}
/>
<UsersTable
onRemoveUser={[Function]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment