Fix basepath routing dashboards

pull/10616/head
Delmer Reed 2018-07-09 18:16:27 -04:00
parent 6376673fcb
commit 92ac98420a
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import {hydrateTemplate, isTemplateNested} from 'src/tempVars/apis'
import {notify} from 'src/shared/actions/notifications' import {notify} from 'src/shared/actions/notifications'
import {errorThrown} from 'src/shared/actions/errors' import {errorThrown} from 'src/shared/actions/errors'
import {stripPrefix} from 'src/utils/basepath'
import { import {
applyLocalSelections, applyLocalSelections,
@ -364,6 +365,7 @@ export const setActiveCell = (activeCellID: string): SetActiveCellAction => ({
export const updateQueryParams = (updatedQueryParams: object): RouterAction => { export const updateQueryParams = (updatedQueryParams: object): RouterAction => {
const {search, pathname} = window.location const {search, pathname} = window.location
const strippedPathname = stripPrefix(pathname)
const newQueryParams = _.pickBy( const newQueryParams = _.pickBy(
{ {
@ -374,7 +376,7 @@ export const updateQueryParams = (updatedQueryParams: object): RouterAction => {
) )
const newSearch = qs.stringify(newQueryParams) const newSearch = qs.stringify(newQueryParams)
const newLocation = {pathname, search: `?${newSearch}`} const newLocation = {pathname: strippedPathname, search: `?${newSearch}`}
return replace(newLocation) return replace(newLocation)
} }