PublicDashboards: Ignore time range input and changes on public dashboard (#55412)

* Ignore time range input and changes on public dashboard

* Use config instead of getConfig to access boot config
This commit is contained in:
Guilherme Caulada
2022-09-19 15:16:27 -03:00
committed by GitHub
parent 80ff9fc0ef
commit 3b1fc18692
@@ -148,6 +148,11 @@ export class TimeSrv {
}
private initTimeFromUrl() {
// If we are in a public dashboard ignore the time range in the url
if (config.isPublicDashboardView) {
return;
}
const params = locationService.getSearch();
if (params.get('time') && params.get('time.window')) {
@@ -275,6 +280,11 @@ export class TimeSrv {
}
setTime(time: RawTimeRange, updateUrl = true) {
// If we are in a public dashboard ignore time range changes
if (config.isPublicDashboardView) {
return;
}
extend(this.time, time);
// disable refresh if zoom in or zoom out