import { ApplicationStart , IBasePath } from 'opensearch-dashboards/public' ; import { ForwardDefinition } from '../index' ; import { normalizePath } from './normalize_path' ; export const navigateToLegacyOpenSearchDashboardsUrl = ( path , forwards , basePath , application ) : { navigated : boolean ; } => { const normalizedPath = normalizePath ( path ) ; const relevantForward = forwards . find ( ( forward ) => normalizedPath . startsWith ( `/${ forward . legacyAppId }` ) ) ; if ( ! relevantForward ) { return { navigated : false } ; } const targetAppPath = relevantForward . rewritePath ( normalizedPath ) ; const targetAppId = relevantForward . newAppId ; application . navigateToApp ( targetAppId , { path : targetAppPath , replace : true } ) ; return { navigated : true } ; } ;