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
cb7ffb44
Commit
cb7ffb44
authored
Dec 14, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
select refactor fixes
parent
ae76ddcc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
21 deletions
+10
-21
public/app/core/components/PermissionList/AddPermission.tsx
+1
-0
public/app/core/components/PermissionList/DisabledPermissionListItem.tsx
+2
-1
public/app/core/components/PermissionList/PermissionListItem.tsx
+2
-1
public/app/core/components/Select/DataSourcePicker.tsx
+1
-1
public/app/core/components/Select/Select.tsx
+1
-1
public/app/core/components/Select/TeamPicker.tsx
+3
-17
No files found.
public/app/core/components/PermissionList/AddPermission.tsx
View file @
cb7ffb44
...
...
@@ -122,6 +122,7 @@ class AddPermissions extends Component<Props, NewDashboardAclItem> {
<
div
className=
"gf-form"
>
<
Select
isSearchable=
{
false
}
options=
{
dashboardPermissionLevels
}
onChange=
{
this
.
onPermissionChanged
}
className=
"gf-form-select-box__control--menu-right"
...
...
public/app/core/components/PermissionList/DisabledPermissionListItem.tsx
View file @
cb7ffb44
...
...
@@ -9,6 +9,7 @@ export interface Props {
export
default
class
DisabledPermissionListItem
extends
Component
<
Props
,
any
>
{
render
()
{
const
{
item
}
=
this
.
props
;
const
currentPermissionLevel
=
dashboardPermissionLevels
.
find
(
dp
=>
dp
.
value
===
item
.
permission
);
return
(
<
tr
className=
"gf-form-disabled"
>
...
...
@@ -28,7 +29,7 @@ export default class DisabledPermissionListItem extends Component<Props, any> {
onChange=
{
()
=>
{}
}
isDisabled=
{
true
}
className=
"gf-form-select-box__control--menu-right"
value=
{
item
.
permission
}
value=
{
currentPermissionLevel
}
/>
</
div
>
</
td
>
...
...
public/app/core/components/PermissionList/PermissionListItem.tsx
View file @
cb7ffb44
...
...
@@ -50,6 +50,7 @@ export default class PermissionsListItem extends PureComponent<Props> {
render
()
{
const
{
item
,
folderInfo
}
=
this
.
props
;
const
inheritedFromRoot
=
item
.
dashboardId
===
-
1
&&
!
item
.
inherited
;
const
currentPermissionLevel
=
dashboardPermissionLevels
.
find
(
dp
=>
dp
.
value
===
item
.
permission
);
return
(
<
tr
className=
{
setClassNameHelper
(
item
.
inherited
)
}
>
...
...
@@ -80,7 +81,7 @@ export default class PermissionsListItem extends PureComponent<Props> {
onChange=
{
this
.
onPermissionChanged
}
isDisabled=
{
item
.
inherited
}
className=
"gf-form-select-box__control--menu-right"
value=
{
item
.
permission
}
value=
{
currentPermissionLevel
}
/>
</
div
>
</
td
>
...
...
public/app/core/components/Select/DataSourcePicker.tsx
View file @
cb7ffb44
...
...
@@ -51,8 +51,8 @@ export class DataSourcePicker extends PureComponent<Props> {
<
div
className=
"gf-form-inline"
>
<
Select
isMulti=
{
false
}
backspaceRemovesValue=
{
false
}
isClearable=
{
false
}
backspaceRemovesValue=
{
false
}
onChange=
{
this
.
onChange
}
options=
{
options
}
autoFocus=
{
autoFocus
}
...
...
public/app/core/components/Select/Select.tsx
View file @
cb7ffb44
...
...
@@ -25,7 +25,7 @@ interface CommonProps {
onChange
:
(
item
:
SelectOptionItem
)
=>
{}
|
void
;
placeholder
?:
string
;
width
?:
number
;
value
?:
any
;
value
?:
SelectOptionItem
;
className
?:
string
;
components
:
object
;
isDisabled
?:
boolean
;
...
...
public/app/core/components/Select/TeamPicker.tsx
View file @
cb7ffb44
import
React
,
{
Component
}
from
'react'
;
import
AsyncSelect
from
'react-select/lib/Async'
;
import
PickerOption
from
'./PickerOption'
;
import
{
AsyncSelect
}
from
'./Select'
;
import
{
debounce
}
from
'lodash'
;
import
{
getBackendSrv
}
from
'app/core/services/backend_srv'
;
import
ResetStyles
from
'./ResetStyles'
;
import
IndicatorsContainer
from
'./IndicatorsContainer'
;
import
NoOptionsMessage
from
'./NoOptionsMessage'
;
export
interface
Team
{
id
:
number
;
...
...
@@ -45,6 +41,7 @@ export class TeamPicker extends Component<Props, State> {
const
teams
=
result
.
teams
.
map
(
team
=>
{
return
{
id
:
team
.
id
,
value
:
team
.
id
,
label
:
team
.
name
,
name
:
team
.
name
,
imgUrl
:
team
.
avatarUrl
,
...
...
@@ -62,24 +59,13 @@ export class TeamPicker extends Component<Props, State> {
return
(
<
div
className=
"user-picker"
>
<
AsyncSelect
classNamePrefix=
{
`gf-form-select-box`
}
isMulti=
{
false
}
isLoading=
{
isLoading
}
defaultOptions=
{
true
}
loadOptions=
{
this
.
debouncedSearch
}
onChange=
{
onSelected
}
className=
{
`gf-form-input gf-form-input--form-dropdown ${className || ''}`
}
styles=
{
ResetStyles
}
components=
{
{
Option
:
PickerOption
,
IndicatorsContainer
,
NoOptionsMessage
,
}
}
className=
{
className
}
placeholder=
"Select a team"
loadingMessage=
{
()
=>
'Loading...'
}
noOptionsMessage=
{
()
=>
'No teams found'
}
getOptionValue=
{
i
=>
i
.
id
}
getOptionLabel=
{
i
=>
i
.
label
}
/>
</
div
>
);
...
...
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