mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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;
|
editview?: string;
|
||||||
inspect?: string;
|
inspect?: string;
|
||||||
kiosk?: UrlQueryValue;
|
kiosk?: UrlQueryValue;
|
||||||
|
from?: string;
|
||||||
|
to?: string;
|
||||||
|
refresh?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface Props extends GrafanaRouteComponentProps<DashboardPageRouteParams, DashboardPageRouteSearchParams> {
|
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) {
|
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);
|
const templateVarChanges = findTemplateVarChanges(this.props.queryParams, prevProps.queryParams);
|
||||||
|
|
||||||
if (templateVarChanges) {
|
if (templateVarChanges) {
|
||||||
templateVarsChangedInUrl(templateVarChanges);
|
templateVarsChangedInUrl(templateVarChanges);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user