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
a73af390
Commit
a73af390
authored
Jan 31, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: Add an optional className to the UserPicker and TeamPicker #10676
parent
20052150
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
+19
-6
public/app/core/components/Permissions/AddPermissions.tsx
+12
-2
public/app/core/components/Picker/TeamPicker.tsx
+3
-2
public/app/core/components/Picker/UserPicker.tsx
+3
-2
public/app/core/components/Picker/withPicker.tsx
+1
-0
No files found.
public/app/core/components/Permissions/AddPermissions.tsx
View file @
a73af390
...
...
@@ -103,13 +103,23 @@ class AddPermissions extends Component<IProps, any> {
{
newItem
.
type
===
'User'
?
(
<
div
className=
"gf-form"
>
<
UserPicker
backendSrv=
{
backendSrv
}
handlePicked=
{
this
.
userPicked
}
value=
{
newItem
.
userId
}
/>
<
UserPicker
backendSrv=
{
backendSrv
}
handlePicked=
{
this
.
userPicked
}
value=
{
newItem
.
userId
}
className=
"width-8"
/>
</
div
>
)
:
null
}
{
newItem
.
type
===
'Group'
?
(
<
div
className=
"gf-form"
>
<
TeamPicker
backendSrv=
{
backendSrv
}
handlePicked=
{
this
.
teamPicked
}
value=
{
newItem
.
teamId
}
/>
<
TeamPicker
backendSrv=
{
backendSrv
}
handlePicked=
{
this
.
teamPicked
}
value=
{
newItem
.
teamId
}
className=
"width-8"
/>
</
div
>
)
:
null
}
...
...
public/app/core/components/Picker/TeamPicker.tsx
View file @
a73af390
...
...
@@ -10,6 +10,7 @@ export interface IProps {
toggleLoading
:
any
;
handlePicked
:
(
user
)
=>
void
;
value
?:
string
;
className
?:
string
;
}
export
interface
Team
{
...
...
@@ -55,7 +56,7 @@ class TeamPicker extends Component<IProps, any> {
render
()
{
const
AsyncComponent
=
this
.
state
.
creatable
?
Select
.
AsyncCreatable
:
Select
.
Async
;
const
{
isLoading
,
handlePicked
,
value
}
=
this
.
props
;
const
{
isLoading
,
handlePicked
,
value
,
className
}
=
this
.
props
;
return
(
<
div
className=
"user-picker"
>
...
...
@@ -69,7 +70,7 @@ class TeamPicker extends Component<IProps, any> {
loadingPlaceholder=
"Loading..."
noResultsText=
"No teams found"
onChange=
{
handlePicked
}
className=
"width-12 gf-form-input gf-form-input--form-dropdown"
className=
{
`gf-form-input gf-form-input--form-dropdown ${className || ''}`
}
optionComponent=
{
PickerOption
}
placeholder=
"Choose"
value=
{
value
}
...
...
public/app/core/components/Picker/UserPicker.tsx
View file @
a73af390
...
...
@@ -10,6 +10,7 @@ export interface IProps {
toggleLoading
:
any
;
handlePicked
:
(
user
)
=>
void
;
value
?:
string
;
className
?:
string
;
}
export
interface
User
{
...
...
@@ -54,7 +55,7 @@ class UserPicker extends Component<IProps, any> {
render
()
{
const
AsyncComponent
=
this
.
state
.
creatable
?
Select
.
AsyncCreatable
:
Select
.
Async
;
const
{
isLoading
,
handlePicked
,
value
}
=
this
.
props
;
const
{
isLoading
,
handlePicked
,
value
,
className
}
=
this
.
props
;
return
(
<
div
className=
"user-picker"
>
<
AsyncComponent
...
...
@@ -67,7 +68,7 @@ class UserPicker extends Component<IProps, any> {
loadingPlaceholder=
"Loading..."
noResultsText=
"No users found"
onChange=
{
handlePicked
}
className=
"width-12 gf-form-input gf-form-input--form-dropdown"
className=
{
`gf-form-input gf-form-input--form-dropdown ${className || ''}`
}
optionComponent=
{
PickerOption
}
placeholder=
"Choose"
value=
{
value
}
...
...
public/app/core/components/Picker/withPicker.tsx
View file @
a73af390
...
...
@@ -4,6 +4,7 @@ export interface IProps {
backendSrv
:
any
;
handlePicked
:
(
data
)
=>
void
;
value
?:
string
;
className
?:
string
;
}
export
default
function
withPicker
(
WrappedComponent
)
{
...
...
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