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
18d72ab3
Unverified
Commit
18d72ab3
authored
Oct 29, 2019
by
Andrej Ocenas
Committed by
GitHub
Oct 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some typings for react events (#20038)
parent
5165e85f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
14 deletions
+13
-14
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
+1
-1
public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx
+2
-2
public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx
+5
-5
public/app/plugins/panel/graph2/GraphLegendEditor.tsx
+5
-6
No files found.
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
View file @
18d72ab3
...
...
@@ -30,7 +30,7 @@ export class AliasBy extends Component<Props, State> {
}
}
onChange
=
(
e
:
any
)
=>
{
onChange
=
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
this
.
setState
({
value
:
e
.
target
.
value
});
this
.
propagateOnChange
(
e
.
target
.
value
);
};
...
...
public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx
View file @
18d72ab3
import
React
,
{
FC
}
from
'react'
;
import
React
,
{
ChangeEvent
,
FC
}
from
'react'
;
interface
Props
{
onValueChange
:
(
e
:
any
)
=>
void
;
onValueChange
:
(
e
:
ChangeEvent
<
HTMLSelectElement
>
)
=>
void
;
options
:
any
[];
value
:
string
;
label
:
string
;
...
...
public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx
View file @
18d72ab3
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
ChangeEvent
,
PureComponent
}
from
'react'
;
import
{
VariableQueryProps
}
from
'app/types/plugins'
;
import
SimpleSelect
from
'./SimpleSelect'
;
import
{
getMetricTypes
,
getLabelKeys
,
extractServicesFromMetricDescriptors
}
from
'../functions'
;
...
...
@@ -63,7 +63,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
this
.
setState
(
state
);
}
async
onQueryTypeChange
(
event
:
any
)
{
async
onQueryTypeChange
(
event
:
ChangeEvent
<
HTMLSelectElement
>
)
{
const
state
:
any
=
{
selectedQueryType
:
event
.
target
.
value
,
...(
await
this
.
getLabels
(
this
.
state
.
selectedMetricType
,
event
.
target
.
value
)),
...
...
@@ -71,7 +71,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
this
.
setState
(
state
);
}
async
onServiceChange
(
event
:
any
)
{
async
onServiceChange
(
event
:
ChangeEvent
<
HTMLSelectElement
>
)
{
const
{
metricTypes
,
selectedMetricType
}
=
getMetricTypes
(
this
.
state
.
metricDescriptors
,
this
.
state
.
selectedMetricType
,
...
...
@@ -87,12 +87,12 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
this
.
setState
(
state
);
}
async
onMetricTypeChange
(
event
:
any
)
{
async
onMetricTypeChange
(
event
:
ChangeEvent
<
HTMLSelectElement
>
)
{
const
state
:
any
=
{
selectedMetricType
:
event
.
target
.
value
,
...(
await
this
.
getLabels
(
event
.
target
.
value
))
};
this
.
setState
(
state
);
}
onLabelKeyChange
(
event
:
any
)
{
onLabelKeyChange
(
event
:
ChangeEvent
<
HTMLSelectElement
>
)
{
this
.
setState
({
labelKey
:
event
.
target
.
value
});
}
...
...
public/app/plugins/panel/graph2/GraphLegendEditor.tsx
View file @
18d72ab3
...
...
@@ -23,17 +23,16 @@ export const GraphLegendEditor: React.FunctionComponent<GraphLegendEditorProps>
});
};
const
onOptionToggle
=
(
option
:
keyof
LegendOptions
)
=>
(
event
?:
React
.
Synthetic
Event
<
HTMLInputElement
>
)
=>
{
const
newOption
=
{};
const
onOptionToggle
=
(
option
:
keyof
LegendOptions
)
=>
(
event
?:
React
.
Change
Event
<
HTMLInputElement
>
)
=>
{
const
newOption
:
Partial
<
LegendOptions
>
=
{};
if
(
!
event
)
{
return
;
}
// TODO: fix the ignores
// @ts-ignore
newOption
[
option
]
=
event
.
target
.
checked
;
if
(
option
===
'placement'
)
{
// @ts-ignore
newOption
[
option
]
=
event
.
target
.
checked
?
'right'
:
'under'
;
}
else
{
newOption
[
option
]
=
event
.
target
.
checked
;
}
onChange
({
...
...
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