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
d53a430c
Commit
d53a430c
authored
Jan 29, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with explore changeTime redux action not being hooked up, fixes #15115
parent
0216f087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
public/app/features/explore/GraphContainer.tsx
+10
-5
No files found.
public/app/features/explore/GraphContainer.tsx
View file @
d53a430c
import
React
,
{
PureComponent
}
from
'react'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
TimeRange
,
Raw
TimeRange
}
from
'@grafana/ui'
;
import
{
ExploreId
,
ExploreItemState
}
from
'app/types/explore'
;
import
{
StoreState
}
from
'app/types'
;
import
{
toggleGraph
}
from
'./state/actions'
;
import
{
toggleGraph
,
changeTime
}
from
'./state/actions'
;
import
Graph
from
'./Graph'
;
import
Panel
from
'./Panel'
;
interface
GraphContainerProps
{
onChangeTime
:
(
range
:
TimeRange
)
=>
void
;
exploreId
:
ExploreId
;
graphResult
?:
any
[];
loading
:
boolean
;
...
...
@@ -20,6 +19,7 @@ interface GraphContainerProps {
showingTable
:
boolean
;
split
:
boolean
;
toggleGraph
:
typeof
toggleGraph
;
changeTime
:
typeof
changeTime
;
}
export
class
GraphContainer
extends
PureComponent
<
GraphContainerProps
>
{
...
...
@@ -27,8 +27,12 @@ export class GraphContainer extends PureComponent<GraphContainerProps> {
this
.
props
.
toggleGraph
(
this
.
props
.
exploreId
);
};
onChangeTime
=
(
timeRange
:
TimeRange
)
=>
{
this
.
props
.
changeTime
(
this
.
props
.
exploreId
,
timeRange
);
};
render
()
{
const
{
exploreId
,
graphResult
,
loading
,
onChangeTime
,
showingGraph
,
showingTable
,
range
,
split
}
=
this
.
props
;
const
{
exploreId
,
graphResult
,
loading
,
showingGraph
,
showingTable
,
range
,
split
}
=
this
.
props
;
const
graphHeight
=
showingGraph
&&
showingTable
?
'200px'
:
'400px'
;
if
(
!
graphResult
)
{
...
...
@@ -41,7 +45,7 @@ export class GraphContainer extends PureComponent<GraphContainerProps> {
data=
{
graphResult
}
height=
{
graphHeight
}
id=
{
`explore-graph-${exploreId}`
}
onChangeTime=
{
onChangeTime
}
onChangeTime=
{
this
.
onChangeTime
}
range=
{
range
}
split=
{
split
}
/>
...
...
@@ -61,6 +65,7 @@ function mapStateToProps(state: StoreState, { exploreId }) {
const
mapDispatchToProps
=
{
toggleGraph
,
changeTime
,
};
export
default
hot
(
module
)(
connect
(
mapStateToProps
,
mapDispatchToProps
)(
GraphContainer
));
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