import { parseUrl , stringifyUrl } from 'query-string' ; import { DashboardConstants } from '../index' ; param url param embeddableId param embeddableType export function addEmbeddableToDashboardUrl ( dashboardUrl , embeddableId , embeddableType ) { const { url , query , fragmentIdentifier } = parseUrl ( dashboardUrl , { parseFragmentIdentifier : true , } ) ; if ( embeddableId ) { query [ DashboardConstants . ADD_EMBEDDABLE_TYPE ] = embeddableType ; query [ DashboardConstants . ADD_EMBEDDABLE_ID ] = embeddableId ; } return stringifyUrl ( { url , query , fragmentIdentifier } ) ; }