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
pull/55489/head
Guilherme Caulada 3 years ago committed by GitHub
parent 80ff9fc0ef
commit 3b1fc18692
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      public/app/features/dashboard/services/TimeSrv.ts

@ -148,6 +148,11 @@ export class TimeSrv {
} }
private initTimeFromUrl() { private initTimeFromUrl() {
// If we are in a public dashboard ignore the time range in the url
if (config.isPublicDashboardView) {
return;
}
const params = locationService.getSearch(); const params = locationService.getSearch();
if (params.get('time') && params.get('time.window')) { if (params.get('time') && params.get('time.window')) {
@ -275,6 +280,11 @@ export class TimeSrv {
} }
setTime(time: RawTimeRange, updateUrl = true) { setTime(time: RawTimeRange, updateUrl = true) {
// If we are in a public dashboard ignore time range changes
if (config.isPublicDashboardView) {
return;
}
extend(this.time, time); extend(this.time, time);
// disable refresh if zoom in or zoom out // disable refresh if zoom in or zoom out

Loading…
Cancel
Save