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
7689e9bb
Commit
7689e9bb
authored
Oct 11, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle DescriptionPicker's initial state #13425
parent
a42227cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletions
+8
-1
public/app/core/components/PermissionList/DisabledPermissionListItem.tsx
+1
-0
public/app/core/components/PermissionList/PermissionListItem.tsx
+1
-0
public/app/core/components/Picker/DescriptionPicker.tsx
+6
-1
No files found.
public/app/core/components/PermissionList/DisabledPermissionListItem.tsx
View file @
7689e9bb
...
@@ -28,6 +28,7 @@ export default class DisabledPermissionListItem extends Component<Props, any> {
...
@@ -28,6 +28,7 @@ export default class DisabledPermissionListItem extends Component<Props, any> {
onSelected=
{
()
=>
{}
}
onSelected=
{
()
=>
{}
}
disabled=
{
true
}
disabled=
{
true
}
className=
{
'gf-form-select-box__control--menu-right'
}
className=
{
'gf-form-select-box__control--menu-right'
}
value=
{
item
.
permission
}
/>
/>
</
div
>
</
div
>
</
td
>
</
td
>
...
...
public/app/core/components/PermissionList/PermissionListItem.tsx
View file @
7689e9bb
...
@@ -79,6 +79,7 @@ export default class PermissionsListItem extends PureComponent<Props> {
...
@@ -79,6 +79,7 @@ export default class PermissionsListItem extends PureComponent<Props> {
onSelected=
{
this
.
onPermissionChanged
}
onSelected=
{
this
.
onPermissionChanged
}
disabled=
{
item
.
inherited
}
disabled=
{
item
.
inherited
}
className=
{
'gf-form-select-box__control--menu-right'
}
className=
{
'gf-form-select-box__control--menu-right'
}
value=
{
item
.
permission
}
/>
/>
</
div
>
</
div
>
</
td
>
</
td
>
...
...
public/app/core/components/Picker/DescriptionPicker.tsx
View file @
7689e9bb
...
@@ -16,15 +16,19 @@ export interface Props {
...
@@ -16,15 +16,19 @@ export interface Props {
onSelected
:
(
permission
)
=>
void
;
onSelected
:
(
permission
)
=>
void
;
disabled
:
boolean
;
disabled
:
boolean
;
className
?:
string
;
className
?:
string
;
value
?:
any
;
}
}
const
getSelectedOption
=
(
optionsWithDesc
,
value
)
=>
optionsWithDesc
.
find
(
option
=>
option
.
value
===
value
);
class
DescriptionPicker
extends
Component
<
Props
,
any
>
{
class
DescriptionPicker
extends
Component
<
Props
,
any
>
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
}
}
render
()
{
render
()
{
const
{
optionsWithDesc
,
onSelected
,
disabled
,
className
}
=
this
.
props
;
const
{
optionsWithDesc
,
onSelected
,
disabled
,
className
,
value
}
=
this
.
props
;
const
selectedOption
=
getSelectedOption
(
optionsWithDesc
,
value
);
return
(
return
(
<
div
className=
"permissions-picker"
>
<
div
className=
"permissions-picker"
>
<
Select
<
Select
...
@@ -42,6 +46,7 @@ class DescriptionPicker extends Component<Props, any> {
...
@@ -42,6 +46,7 @@ class DescriptionPicker extends Component<Props, any> {
onChange=
{
onSelected
}
onChange=
{
onSelected
}
getOptionValue=
{
i
=>
i
.
value
}
getOptionValue=
{
i
=>
i
.
value
}
getOptionLabel=
{
i
=>
i
.
label
}
getOptionLabel=
{
i
=>
i
.
label
}
value=
{
selectedOption
}
/>
/>
</
div
>
</
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