mirror of
https://github.com/grafana/grafana.git
synced 2025-01-13 09:32:12 -06:00
Routing NG: Fix time range zoom not working when refresh enabled (#32023)
* Fix time range zoom not working when refresh enabled * Review update
This commit is contained in:
parent
bb8a703428
commit
e967ad9ca9
@ -42,6 +42,9 @@ type DashboardPageRouteSearchParams = {
|
||||
editview?: string;
|
||||
inspect?: string;
|
||||
kiosk?: UrlQueryValue;
|
||||
from?: string;
|
||||
to?: string;
|
||||
refresh?: string;
|
||||
};
|
||||
|
||||
export interface Props extends GrafanaRouteComponentProps<DashboardPageRouteParams, DashboardPageRouteSearchParams> {
|
||||
@ -138,9 +141,19 @@ export class DashboardPage extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
if (prevProps.location.search !== this.props.location.search) {
|
||||
getTimeSrv().updateTimeRangeFromUrl();
|
||||
const prevUrlParams = prevProps.queryParams;
|
||||
const urlParams = this.props.queryParams;
|
||||
|
||||
if (urlParams?.from !== prevUrlParams?.from && urlParams?.to !== prevUrlParams?.to) {
|
||||
getTimeSrv().updateTimeRangeFromUrl();
|
||||
}
|
||||
|
||||
if (!prevUrlParams?.refresh && urlParams?.refresh) {
|
||||
getTimeSrv().setAutoRefresh(urlParams.refresh);
|
||||
}
|
||||
|
||||
const templateVarChanges = findTemplateVarChanges(this.props.queryParams, prevProps.queryParams);
|
||||
|
||||
if (templateVarChanges) {
|
||||
templateVarsChangedInUrl(templateVarChanges);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user