From 6d3b6f3c2fd966d26cbc6d894e4c38306e42ac17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 5 Apr 2019 11:09:57 +0200 Subject: [PATCH] Fix: playlist now preserve the correct url query params (#16403) Fixes #16377 --- public/app/features/playlist/playlist_srv.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/app/features/playlist/playlist_srv.ts b/public/app/features/playlist/playlist_srv.ts index 158faa085de..448709b38be 100644 --- a/public/app/features/playlist/playlist_srv.ts +++ b/public/app/features/playlist/playlist_srv.ts @@ -9,6 +9,12 @@ import locationUtil from 'app/core/utils/location_util'; import kbn from 'app/core/utils/kbn'; import { store } from 'app/store/store'; +export const queryParamsToPreserve: { [key: string]: boolean } = { + kiosk: true, + autofitpanels: true, + orgId: true, +}; + export class PlaylistSrv { private cancelPromise: any; private dashboards: Array<{ url: string }>; @@ -41,9 +47,7 @@ export class PlaylistSrv { const dash = this.dashboards[this.index]; const queryParams = this.$location.search(); - const filteredParams = _.pickBy(queryParams, key => { - return key === 'kiosk' || key === 'autofitpanels' || key === 'orgId'; - }); + const filteredParams = _.pickBy(queryParams, (value: any, key: string) => queryParamsToPreserve[key]); const nextDashboardUrl = locationUtil.stripBaseFromUrl(dash.url); // this is done inside timeout to make sure digest happens after