avoid history spamming
This commit is contained in:
parent
905f34d04a
commit
70320b40a5
@ -3,7 +3,7 @@ import {debounce} from 'underscore'
|
|||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
import {push} from 'react-router-redux'
|
import {replace} from 'react-router-redux'
|
||||||
|
|
||||||
import PageHeader from 'components/page-header'
|
import PageHeader from 'components/page-header'
|
||||||
import Details from './details'
|
import Details from './details'
|
||||||
@ -31,7 +31,7 @@ class RouteserversPage extends React.Component {
|
|||||||
this.props.dispatch(setFilterValue(value));
|
this.props.dispatch(setFilterValue(value));
|
||||||
|
|
||||||
// Update location delayed
|
// Update location delayed
|
||||||
this.dispatchDebounced(push(
|
this.dispatchDebounced(replace(
|
||||||
makeQueryLinkProps(
|
makeQueryLinkProps(
|
||||||
this.props.routing,
|
this.props.routing,
|
||||||
value,
|
value,
|
||||||
@ -39,13 +39,6 @@ class RouteserversPage extends React.Component {
|
|||||||
this.props.sortOrder)));
|
this.props.sortOrder)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
// Reset Filters
|
|
||||||
this.props.dispatch(setFilterValue(""));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return(
|
return(
|
||||||
<div className="routeservers-page">
|
<div className="routeservers-page">
|
||||||
|
@ -110,7 +110,7 @@ class NeighborColumnHeader extends React.Component {
|
|||||||
// Render link with sorting indicator
|
// Render link with sorting indicator
|
||||||
if (active) {
|
if (active) {
|
||||||
const nextOrder = (this.props.order == 'asc') ? 'desc' : 'asc';
|
const nextOrder = (this.props.order == 'asc') ? 'desc' : 'asc';
|
||||||
const url = `${baseUrl}?s=${sortColumn}&o=${nextOrder}`;
|
const url = `${baseUrl}?s=${sortColumn}&o=${nextOrder}&q=${this.props.query}`;
|
||||||
let indicator = <i className="fa fa-arrow-circle-up"></i>;
|
let indicator = <i className="fa fa-arrow-circle-up"></i>;
|
||||||
|
|
||||||
cls += 'col-neighbor-active ';
|
cls += 'col-neighbor-active ';
|
||||||
@ -126,7 +126,7 @@ class NeighborColumnHeader extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Column is not active, just present a link:
|
// Column is not active, just present a link:
|
||||||
const url = `${baseUrl}?s=${sortColumn}&o=${this.props.order}`
|
const url = `${baseUrl}?s=${sortColumn}&o=${this.props.order}&q=${this.props.query}`
|
||||||
return(
|
return(
|
||||||
<th className={cls}>
|
<th className={cls}>
|
||||||
<Link to={url}>{name}</Link>
|
<Link to={url}>{name}</Link>
|
||||||
@ -243,7 +243,8 @@ class NeighboursTableView extends React.Component {
|
|||||||
rsId={this.props.routeserverId}
|
rsId={this.props.routeserverId}
|
||||||
columns={columns} column={col}
|
columns={columns} column={col}
|
||||||
sort={this.props.sortColumn}
|
sort={this.props.sortColumn}
|
||||||
order={this.props.sortOrder} />
|
order={this.props.sortOrder}
|
||||||
|
query={this.props.filterQuery} />
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -307,6 +308,7 @@ const NeighboursTable = connect(
|
|||||||
|
|
||||||
sortColumn: state.neighbors.sortColumn,
|
sortColumn: state.neighbors.sortColumn,
|
||||||
sortOrder: state.neighbors.sortOrder,
|
sortOrder: state.neighbors.sortOrder,
|
||||||
|
filterQuery: state.neighbors.filterQuery,
|
||||||
})
|
})
|
||||||
)(NeighboursTableView);
|
)(NeighboursTableView);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import React from 'react'
|
|||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
|
|
||||||
import {Link} from 'react-router'
|
import {Link} from 'react-router'
|
||||||
import {push} from 'react-router-redux'
|
import {push, replace} from 'react-router-redux'
|
||||||
|
|
||||||
import Details from '../details'
|
import Details from '../details'
|
||||||
import Status from '../status'
|
import Status from '../status'
|
||||||
@ -106,7 +106,7 @@ class RoutesPage extends React.Component {
|
|||||||
setFilterQueryValue(value)
|
setFilterQueryValue(value)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.debouncedDispatch(push(makeQueryLinkProps(
|
this.debouncedDispatch(replace(makeQueryLinkProps(
|
||||||
this.props.routing, value, this.props.loadNotExported
|
this.props.routing, value, this.props.loadNotExported
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user