| | |
| | | import { PHASE_1_COMPONENTS } from '../../router/adapters/backendMenuAdapter.js' |
| | | |
| | | const RELEASED_COMPONENT_PATHS = new Set(Object.values(PHASE_1_COMPONENTS)) |
| | | |
| | | function isIframe(url) { |
| | | return url.startsWith('/outside/iframe/') |
| | | } |
| | | |
| | | const isNavigableMenuItem = (menuItem) => { |
| | | if (!menuItem.path || !menuItem.path.trim()) { |
| | | return false |
| | |
| | | const normalizePath = (path) => { |
| | | return path.startsWith('/') ? path : `/${path}` |
| | | } |
| | | |
| | | const hasReleasedComponent = (menuItem) => { |
| | | if (!menuItem || typeof menuItem !== 'object') { |
| | | return false |
| | | } |
| | | const componentPath = typeof menuItem.component === 'string' ? menuItem.component.trim() : '' |
| | | return RELEASED_COMPONENT_PATHS.has(componentPath) |
| | | } |
| | | |
| | | const getFirstMenuPath = (menuList) => { |
| | | if (!Array.isArray(menuList) || menuList.length === 0) { |
| | | return '' |
| | |
| | | return childPath |
| | | } |
| | | } |
| | | return normalizePath(menuItem.path) |
| | | if (hasReleasedComponent(menuItem)) { |
| | | return normalizePath(menuItem.path) |
| | | } |
| | | } |
| | | return '' |
| | | } |