import type { ControlStyle } from '../../controls/public' ; export const DASHBOARD_STATE_STORAGE_KEY = '_a' ; export const DashboardConstants = { LANDING_PAGE_PATH : '/list' , CREATE_NEW_DASHBOARD_URL : '/create' , VIEW_DASHBOARD_URL : '/view' , PRINT_DASHBOARD_URL : '/print' , ADD_EMBEDDABLE_ID : 'addEmbeddableId' , ADD_EMBEDDABLE_TYPE : 'addEmbeddableType' , DASHBOARDS_ID : 'dashboards' , DASHBOARD_ID : 'dashboard' , SEARCH_SESSION_ID : 'searchSessionId' , CHANGE_CHECK_DEBOUNCE : 100 , CHANGE_APPLY_DEBOUNCE : 50 , } ; export const getDefaultDashboardControlGroupInput = ( ) => ( { controlStyle : 'oneLine' as ControlStyle , panels : { } , } ) ; export function createDashboardEditUrl ( id ? , editMode ? ) { if ( ! id ) { return `${ DashboardConstants . CREATE_NEW_DASHBOARD_URL }` ; } const edit = editMode ? `?${ DASHBOARD_STATE_STORAGE_KEY }=(viewMode:edit)` : '' ; return `${ DashboardConstants . VIEW_DASHBOARD_URL }/${ id }${ edit }` ; } export function createDashboardListingFilterUrl ( filter ) { return filter ? `${ DashboardConstants . LANDING_PAGE_PATH }?filter="${ filter }"` : DashboardConstants . LANDING_PAGE_PATH ; }