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
4c402743
Commit
4c402743
authored
Jan 16, 2019
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming after pr feedback
parent
83fbf52a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
23 deletions
+23
-23
packages/grafana-ui/src/components/FormGroup/FormField.test.tsx
+2
-2
packages/grafana-ui/src/components/FormGroup/FormField.tsx
+5
-5
packages/grafana-ui/src/components/FormLabel/FormLabel.tsx
+1
-1
packages/grafana-ui/src/components/index.ts
+2
-2
public/app/features/dashboard/panel_editor/QueryOptions.tsx
+2
-2
public/app/plugins/panel/gauge/GaugeOptionsEditor.tsx
+3
-3
public/app/plugins/panel/gauge/MappingRow.tsx
+4
-4
public/app/plugins/panel/gauge/ValueOptions.tsx
+4
-4
No files found.
packages/grafana-ui/src/components/FormGroup/Form
Group
.test.tsx
→
packages/grafana-ui/src/components/FormGroup/Form
Field
.test.tsx
View file @
4c402743
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
Form
Group
,
Props
}
from
'./FormGroup
'
;
import
{
Form
Field
,
Props
}
from
'./FormField
'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
@@ -14,7 +14,7 @@ const setup = (propOverrides?: object) => {
...
@@ -14,7 +14,7 @@ const setup = (propOverrides?: object) => {
Object
.
assign
(
props
,
propOverrides
);
Object
.
assign
(
props
,
propOverrides
);
return
shallow
(<
Form
Group
{
...
props
}
/>);
return
shallow
(<
Form
Field
{
...
props
}
/>);
};
};
describe
(
'Render'
,
()
=>
{
describe
(
'Render'
,
()
=>
{
...
...
packages/grafana-ui/src/components/FormGroup/Form
Group
.tsx
→
packages/grafana-ui/src/components/FormGroup/Form
Field
.tsx
View file @
4c402743
import
React
,
{
SFC
}
from
'react'
;
import
React
,
{
InputHTMLAttributes
,
FunctionComponent
}
from
'react'
;
import
{
Label
}
from
'..'
;
import
{
Label
}
from
'..'
;
export
interface
Props
{
export
interface
Props
{
label
:
string
;
label
:
string
;
inputProps
:
{}
;
inputProps
:
InputHTMLAttributes
<
HTMLInputElement
>
;
labelWidth
?:
number
;
labelWidth
?:
number
;
inputWidth
?:
number
;
inputWidth
?:
number
;
}
}
...
@@ -14,7 +14,7 @@ const defaultProps = {
...
@@ -14,7 +14,7 @@ const defaultProps = {
inputWidth
:
12
,
inputWidth
:
12
,
};
};
const
Form
Group
:
SFC
<
Props
>
=
({
label
,
labelWidth
,
inputProps
,
inputWidth
})
=>
{
const
Form
Field
:
FunctionComponent
<
Props
>
=
({
label
,
labelWidth
,
inputProps
,
inputWidth
})
=>
{
return
(
return
(
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
Label
width=
{
labelWidth
}
>
{
label
}
</
Label
>
<
Label
width=
{
labelWidth
}
>
{
label
}
</
Label
>
...
@@ -23,5 +23,5 @@ const FormGroup: SFC<Props> = ({ label, labelWidth, inputProps, inputWidth }) =>
...
@@ -23,5 +23,5 @@ const FormGroup: SFC<Props> = ({ label, labelWidth, inputProps, inputWidth }) =>
);
);
};
};
Form
Group
.
defaultProps
=
defaultProps
;
Form
Field
.
defaultProps
=
defaultProps
;
export
{
Form
Group
};
export
{
Form
Field
};
packages/grafana-ui/src/components/
GfFormLabel/Gf
FormLabel.tsx
→
packages/grafana-ui/src/components/
FormLabel/
FormLabel.tsx
View file @
4c402743
...
@@ -9,7 +9,7 @@ interface Props {
...
@@ -9,7 +9,7 @@ interface Props {
isInvalid
?:
boolean
;
isInvalid
?:
boolean
;
}
}
export
const
Gf
FormLabel
:
SFC
<
Props
>
=
({
children
,
isFocused
,
isInvalid
,
className
,
htmlFor
,
...
rest
})
=>
{
export
const
FormLabel
:
SFC
<
Props
>
=
({
children
,
isFocused
,
isInvalid
,
className
,
htmlFor
,
...
rest
})
=>
{
const
classes
=
classNames
(
'gf-form-label'
,
className
,
{
const
classes
=
classNames
(
'gf-form-label'
,
className
,
{
'gf-form-label--is-focused'
:
isFocused
,
'gf-form-label--is-focused'
:
isFocused
,
'gf-form-label--is-invalid'
:
isInvalid
,
'gf-form-label--is-invalid'
:
isInvalid
,
...
...
packages/grafana-ui/src/components/index.ts
View file @
4c402743
...
@@ -10,8 +10,8 @@ export { NoOptionsMessage } from './Select/NoOptionsMessage';
...
@@ -10,8 +10,8 @@ export { NoOptionsMessage } from './Select/NoOptionsMessage';
export
{
default
as
resetSelectStyles
}
from
'./Select/resetSelectStyles'
;
export
{
default
as
resetSelectStyles
}
from
'./Select/resetSelectStyles'
;
// Forms
// Forms
export
{
GfFormLabel
}
from
'./GfFormLabel/Gf
FormLabel'
;
export
{
FormLabel
}
from
'./FormLabel/
FormLabel'
;
export
{
Form
Group
}
from
'./FormGroup/FormGroup
'
;
export
{
Form
Field
}
from
'./FormGroup/FormField
'
;
export
{
Label
}
from
'./Label/Label'
;
export
{
Label
}
from
'./Label/Label'
;
export
{
LoadingPlaceholder
}
from
'./LoadingPlaceholder/LoadingPlaceholder'
;
export
{
LoadingPlaceholder
}
from
'./LoadingPlaceholder/LoadingPlaceholder'
;
...
...
public/app/features/dashboard/panel_editor/QueryOptions.tsx
View file @
4c402743
...
@@ -10,7 +10,7 @@ import { Input } from 'app/core/components/Form';
...
@@ -10,7 +10,7 @@ import { Input } from 'app/core/components/Form';
import
{
EventsWithValidation
}
from
'app/core/components/Form/Input'
;
import
{
EventsWithValidation
}
from
'app/core/components/Form/Input'
;
import
{
InputStatus
}
from
'app/core/components/Form/Input'
;
import
{
InputStatus
}
from
'app/core/components/Form/Input'
;
import
DataSourceOption
from
'./DataSourceOption'
;
import
DataSourceOption
from
'./DataSourceOption'
;
import
{
Gf
FormLabel
}
from
'@grafana/ui'
;
import
{
FormLabel
}
from
'@grafana/ui'
;
// Types
// Types
import
{
PanelModel
}
from
'../panel_model'
;
import
{
PanelModel
}
from
'../panel_model'
;
...
@@ -164,7 +164,7 @@ export class QueryOptions extends PureComponent<Props, State> {
...
@@ -164,7 +164,7 @@ export class QueryOptions extends PureComponent<Props, State> {
{
this
.
renderOptions
()
}
{
this
.
renderOptions
()
}
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
GfFormLabel
>
Relative time
</
Gf
FormLabel
>
<
FormLabel
>
Relative time
</
FormLabel
>
<
Input
<
Input
type=
"text"
type=
"text"
className=
"width-6"
className=
"width-6"
...
...
public/app/plugins/panel/gauge/GaugeOptionsEditor.tsx
View file @
4c402743
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
{
GaugeOptions
,
PanelOptionsProps
,
PanelOptionsGroup
}
from
'@grafana/ui'
;
import
{
GaugeOptions
,
PanelOptionsProps
,
PanelOptionsGroup
}
from
'@grafana/ui'
;
import
{
Switch
}
from
'app/core/components/Switch/Switch'
;
import
{
Switch
}
from
'app/core/components/Switch/Switch'
;
import
{
Form
Group
}
from
'@grafana/ui/src'
;
import
{
Form
Field
}
from
'@grafana/ui/src'
;
export
default
class
GaugeOptionsEditor
extends
PureComponent
<
PanelOptionsProps
<
GaugeOptions
>>
{
export
default
class
GaugeOptionsEditor
extends
PureComponent
<
PanelOptionsProps
<
GaugeOptions
>>
{
onToggleThresholdLabels
=
()
=>
onToggleThresholdLabels
=
()
=>
...
@@ -21,12 +21,12 @@ export default class GaugeOptionsEditor extends PureComponent<PanelOptionsProps<
...
@@ -21,12 +21,12 @@ export default class GaugeOptionsEditor extends PureComponent<PanelOptionsProps<
return
(
return
(
<
PanelOptionsGroup
title=
"Gauge"
>
<
PanelOptionsGroup
title=
"Gauge"
>
<
Form
Group
<
Form
Field
label=
"Min value"
label=
"Min value"
labelWidth=
{
8
}
labelWidth=
{
8
}
inputProps=
{
{
onChange
:
event
=>
this
.
onMinValueChange
(
event
),
value
:
minValue
}
}
inputProps=
{
{
onChange
:
event
=>
this
.
onMinValueChange
(
event
),
value
:
minValue
}
}
/>
/>
<
Form
Group
<
Form
Field
label=
"Max value"
label=
"Max value"
labelWidth=
{
8
}
labelWidth=
{
8
}
inputProps=
{
{
onChange
:
event
=>
this
.
onMaxValueChange
(
event
),
value
:
maxValue
}
}
inputProps=
{
{
onChange
:
event
=>
this
.
onMaxValueChange
(
event
),
value
:
maxValue
}
}
...
...
public/app/plugins/panel/gauge/MappingRow.tsx
View file @
4c402743
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
Form
Group
,
Label
,
MappingType
,
RangeMap
,
Select
,
ValueMap
}
from
'@grafana/ui'
;
import
{
Form
Field
,
Label
,
MappingType
,
RangeMap
,
Select
,
ValueMap
}
from
'@grafana/ui'
;
interface
Props
{
interface
Props
{
mapping
:
ValueMap
|
RangeMap
;
mapping
:
ValueMap
|
RangeMap
;
...
@@ -61,7 +61,7 @@ export default class MappingRow extends PureComponent<Props, State> {
...
@@ -61,7 +61,7 @@ export default class MappingRow extends PureComponent<Props, State> {
if
(
type
===
MappingType
.
RangeToText
)
{
if
(
type
===
MappingType
.
RangeToText
)
{
return
(
return
(
<>
<>
<
Form
Group
<
Form
Field
label=
"From"
label=
"From"
labelWidth=
{
4
}
labelWidth=
{
4
}
inputProps=
{
{
inputProps=
{
{
...
@@ -71,7 +71,7 @@ export default class MappingRow extends PureComponent<Props, State> {
...
@@ -71,7 +71,7 @@ export default class MappingRow extends PureComponent<Props, State> {
}
}
}
}
inputWidth=
{
8
}
inputWidth=
{
8
}
/>
/>
<
Form
Group
<
Form
Field
label=
"To"
label=
"To"
labelWidth=
{
4
}
labelWidth=
{
4
}
inputProps=
{
{
inputProps=
{
{
...
@@ -96,7 +96,7 @@ export default class MappingRow extends PureComponent<Props, State> {
...
@@ -96,7 +96,7 @@ export default class MappingRow extends PureComponent<Props, State> {
return
(
return
(
<>
<>
<
Form
Group
<
Form
Field
label=
"Value"
label=
"Value"
labelWidth=
{
4
}
labelWidth=
{
4
}
inputProps=
{
{
inputProps=
{
{
...
...
public/app/plugins/panel/gauge/ValueOptions.tsx
View file @
4c402743
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
Form
Group
,
Label
,
GaugeOptions
,
PanelOptionsProps
,
PanelOptionsGroup
,
Select
}
from
'@grafana/ui'
;
import
{
Form
Field
,
Label
,
GaugeOptions
,
PanelOptionsProps
,
PanelOptionsGroup
,
Select
}
from
'@grafana/ui'
;
import
UnitPicker
from
'app/core/components/Select/UnitPicker'
;
import
UnitPicker
from
'app/core/components/Select/UnitPicker'
;
const
statOptions
=
[
const
statOptions
=
[
...
@@ -51,7 +51,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
...
@@ -51,7 +51,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
<
Label
width=
{
labelWidth
}
>
Unit
</
Label
>
<
Label
width=
{
labelWidth
}
>
Unit
</
Label
>
<
UnitPicker
defaultValue=
{
unit
}
onChange=
{
this
.
onUnitChange
}
/>
<
UnitPicker
defaultValue=
{
unit
}
onChange=
{
this
.
onUnitChange
}
/>
</
div
>
</
div
>
<
Form
Group
<
Form
Field
label=
"Decimals"
label=
"Decimals"
labelWidth=
{
labelWidth
}
labelWidth=
{
labelWidth
}
inputProps=
{
{
inputProps=
{
{
...
@@ -61,7 +61,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
...
@@ -61,7 +61,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
type
:
'number'
,
type
:
'number'
,
}
}
}
}
/>
/>
<
Form
Group
<
Form
Field
label=
"Prefix"
label=
"Prefix"
labelWidth=
{
labelWidth
}
labelWidth=
{
labelWidth
}
inputProps=
{
{
inputProps=
{
{
...
@@ -69,7 +69,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
...
@@ -69,7 +69,7 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
value
:
prefix
||
''
,
value
:
prefix
||
''
,
}
}
}
}
/>
/>
<
Form
Group
<
Form
Field
label=
"Suffix"
label=
"Suffix"
labelWidth=
{
labelWidth
}
labelWidth=
{
labelWidth
}
inputProps=
{
{
inputProps=
{
{
...
...
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