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
e8a6b9db
Unverified
Commit
e8a6b9db
authored
Sep 21, 2020
by
Dominik Prokop
Committed by
GitHub
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mismatch in field config editor types (#27657)
parent
e32aa99f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
packages/grafana-data/src/types/fieldOverrides.ts
+1
-1
packages/grafana-ui/src/components/OptionsUI/color.tsx
+3
-3
packages/grafana-ui/src/components/OptionsUI/select.tsx
+2
-3
packages/grafana-ui/src/components/OptionsUI/string.tsx
+1
-1
No files found.
packages/grafana-data/src/types/fieldOverrides.ts
View file @
e8a6b9db
...
...
@@ -37,7 +37,7 @@ export interface FieldOverrideContext extends StandardEditorContext<any> {
}
export
interface
FieldConfigEditorProps
<
TValue
,
TSettings
>
extends
Omit
<
StandardEditorProps
<
TValue
,
TSettings
>
,
'item'
>
{
item
:
FieldConfigPropertyItem
<
TValue
,
TSettings
>
;
// The property info
item
:
FieldConfigPropertyItem
<
any
,
TValue
,
TSettings
>
;
// The property info
value
:
TValue
;
context
:
FieldOverrideContext
;
onChange
:
(
value
?:
TValue
)
=>
void
;
...
...
packages/grafana-ui/src/components/OptionsUI/color.tsx
View file @
e8a6b9db
...
...
@@ -23,7 +23,7 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<string, ColorFiel
const
color
=
value
||
(
item
.
defaultValue
as
string
)
||
theme
.
colors
.
panelBg
;
return
(
<
ColorPicker
color=
{
color
}
onChange=
{
onChange
}
enableNamedColors=
{
!
settings
.
disableNamedColors
}
>
<
ColorPicker
color=
{
color
}
onChange=
{
onChange
}
enableNamedColors=
{
!
settings
?
.
disableNamedColors
}
>
{
({
ref
,
showColorPicker
,
hideColorPicker
})
=>
{
return
(
<
div
className=
{
styles
.
spot
}
onBlur=
{
hideColorPicker
}
>
...
...
@@ -36,9 +36,9 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<string, ColorFiel
/>
</
div
>
<
div
className=
{
styles
.
colorText
}
onClick=
{
showColorPicker
}
>
{
value
??
settings
.
textWhenUndefined
??
'Pick Color'
}
{
value
??
settings
?
.
textWhenUndefined
??
'Pick Color'
}
</
div
>
{
value
&&
settings
.
allowUndefined
&&
(
{
value
&&
settings
?
.
allowUndefined
&&
(
<
Icon
className=
{
styles
.
trashIcon
}
name=
"trash-alt"
onClick=
{
()
=>
onChange
(
undefined
)
}
/>
)
}
</
div
>
...
...
packages/grafana-ui/src/components/OptionsUI/select.tsx
View file @
e8a6b9db
...
...
@@ -24,7 +24,7 @@ export class SelectValueEditor<T> extends React.PureComponent<Props<T>, State<T>
const
now
=
this
.
props
.
item
?.
settings
;
if
(
old
!==
now
)
{
this
.
updateOptions
();
}
else
if
(
now
.
getOptions
)
{
}
else
if
(
now
?
.
getOptions
)
{
const
old
=
oldProps
.
context
?.
data
;
const
now
=
this
.
props
.
context
?.
data
;
if
(
old
!==
now
)
{
...
...
@@ -53,7 +53,6 @@ export class SelectValueEditor<T> extends React.PureComponent<Props<T>, State<T>
const
{
value
,
onChange
,
item
}
=
this
.
props
;
const
{
settings
}
=
item
;
const
{
allowCustomValue
}
=
settings
;
let
current
=
options
.
find
(
v
=>
v
.
value
===
value
);
if
(
!
current
&&
value
)
{
current
=
{
...
...
@@ -66,7 +65,7 @@ export class SelectValueEditor<T> extends React.PureComponent<Props<T>, State<T>
isLoading=
{
isLoading
}
value=
{
current
}
defaultValue=
{
value
}
allowCustomValue=
{
allowCustomValue
}
allowCustomValue=
{
settings
?.
allowCustomValue
}
onChange=
{
e
=>
onChange
(
e
.
value
)
}
options=
{
options
}
/
>
...
...
packages/grafana-ui/src/components/OptionsUI/string.tsx
View file @
e8a6b9db
...
...
@@ -31,7 +31,7 @@ export const StringValueEditor: React.FC<FieldConfigEditorProps<string, StringFi
<
Component
placeholder=
{
item
.
settings
?.
placeholder
}
defaultValue=
{
value
||
''
}
rows=
{
item
.
settings
?.
useTextarea
&&
item
.
settings
.
rows
}
rows=
{
(
item
.
settings
?.
useTextarea
&&
item
.
settings
.
rows
)
||
5
}
onBlur=
{
onValueChange
}
onKeyDown=
{
onValueChange
}
/>
...
...
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