import { schema } from '@osd/config-schema' ; import { i18n } from '@osd/i18n' ; import { isRelativeUrl } from '@osd/std' ; import { UiSettingsParams } from '../../../types' ; export const getNavigationSettings = ( ) : Record < string , UiSettingsParams > => { return { defaultRoute : { name : i18n . translate ( 'core.ui_settings.params.defaultRoute.defaultRouteTitle' , { defaultMessage : 'Default route' , } ) , value : '/app/home' , schema : schema . string ( { validate ( value ) { if ( ! value . startsWith ( '/' ) || ! isRelativeUrl ( value ) ) { return i18n . translate ( 'core.ui_settings.params.defaultRoute.defaultRouteIsRelativeValidationMessage' , { defaultMessage : 'Must be a relative URL.' , } ) ; } } , } ) , description : i18n . translate ( 'core.ui_settings.params.defaultRoute.defaultRouteText' , { defaultMessage : 'This setting specifies the default route when opening OpenSearch Dashboards, ' + 'You can use this setting to modify the landing page when opening OpenSearch Dashboards, ' + 'The route must be a relative URL.' , } ) , } , pageNavigation : { name : i18n . translate ( 'core.ui_settings.params.pageNavigationName' , { defaultMessage : 'Side nav style' , } ) , value : 'modern' , description : i18n . translate ( 'core.ui_settings.params.pageNavigationDesc' , { defaultMessage : 'Change the style of navigation' , } ) , type : 'select' , options : [ 'modern' , 'legacy' ] , optionLabels : { modern : i18n . translate ( 'core.ui_settings.params.pageNavigationModern' , { defaultMessage : 'Modern' , } ) , legacy : i18n . translate ( 'core.ui_settings.params.pageNavigationLegacy' , { defaultMessage : 'Legacy' , } ) , } , schema : schema . oneOf ( [ schema . literal ( 'modern' ) , schema . literal ( 'legacy' ) ] ) , } , } ; } ;