mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
react: trying to get enzyme and mobx tests working
This commit is contained in:
@@ -25,19 +25,21 @@ export class AlertRuleList extends React.Component<AlertRuleListProps, any> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const store = this.props.store;
|
||||
|
||||
store.nav.load('alerting', 'alert-list');
|
||||
store.alertList.setStateFilter(store.view.query.get('state') || 'all');
|
||||
store.alertList.loadRules();
|
||||
this.props.store.nav.load('alerting', 'alert-list');
|
||||
this.fetchRules();
|
||||
}
|
||||
|
||||
onStateFilterChanged = evt => {
|
||||
this.props.store.alertList.setStateFilter(evt.target.value);
|
||||
this.props.store.view.updateQuery({ state: evt.target.value });
|
||||
this.props.store.alertList.loadRules();
|
||||
this.fetchRules();
|
||||
};
|
||||
|
||||
fetchRules() {
|
||||
this.props.store.alertList.loadRules({
|
||||
state: this.props.store.view.query.get('state') || 'all',
|
||||
});
|
||||
}
|
||||
|
||||
onOpenHowTo = () => {
|
||||
appEvents.emit('show-modal', {
|
||||
src: 'public/app/features/alerting/partials/alert_howto.html',
|
||||
@@ -48,6 +50,7 @@ export class AlertRuleList extends React.Component<AlertRuleListProps, any> {
|
||||
|
||||
render() {
|
||||
const { nav, alertList } = this.props.store;
|
||||
console.log('render', alertList.rules.length);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user