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
42aaa2b9
Commit
42aaa2b9
authored
Sep 02, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redux: improved state handling
parent
3fd707f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
public/app/features/alerting/AlertRuleList.tsx
+10
-4
No files found.
public/app/features/alerting/AlertRuleList.tsx
View file @
42aaa2b9
...
@@ -41,14 +41,20 @@ export class AlertRuleList extends PureComponent<Props, State> {
...
@@ -41,14 +41,20 @@ export class AlertRuleList extends PureComponent<Props, State> {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
fetchRules
(
this
.
getStateFilter
());
console
.
log
(
'did mount'
);
this
.
fetchRules
();
}
componentDidUpdate
(
prevProps
:
Props
)
{
if
(
prevProps
.
stateFilter
!==
this
.
props
.
stateFilter
)
{
this
.
fetchRules
();
}
}
}
onStateFilterChanged
=
evt
=>
{
onStateFilterChanged
=
evt
=>
{
this
.
props
.
updateLocation
({
this
.
props
.
updateLocation
({
query
:
{
state
:
evt
.
target
.
value
},
query
:
{
state
:
evt
.
target
.
value
},
});
});
this
.
fetchRules
(
evt
.
target
.
value
);
};
};
getStateFilter
():
string
{
getStateFilter
():
string
{
...
@@ -59,8 +65,8 @@ export class AlertRuleList extends PureComponent<Props, State> {
...
@@ -59,8 +65,8 @@ export class AlertRuleList extends PureComponent<Props, State> {
return
'all'
;
return
'all'
;
}
}
async
fetchRules
(
stateFilter
:
string
)
{
async
fetchRules
()
{
await
this
.
props
.
getAlertRulesAsync
({
state
:
stateFilter
});
await
this
.
props
.
getAlertRulesAsync
({
state
:
this
.
getStateFilter
()
});
}
}
onOpenHowTo
=
()
=>
{
onOpenHowTo
=
()
=>
{
...
...
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