Some checks failed
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m46s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Ersetzt die Vorhaben-Tab-Navigation durch Cockpit/Ausführen/Planen/Kontrolle/Team, Deep Links für APs/Projekte/Gates und Programm-Scope im Header. Co-authored-by: Cursor <cursoragent@cursor.com>
62 lines
2.0 KiB
JavaScript
62 lines
2.0 KiB
JavaScript
import { Navigate, useParams, useSearchParams } from 'react-router-dom'
|
|
import { actionPath, gatePath, projectPath, scopedPath } from '../utils/routes.js'
|
|
|
|
export function WorkspaceRedirect() {
|
|
return <Navigate to="/cockpit" replace />
|
|
}
|
|
|
|
export function MyActionsRedirect() {
|
|
return <Navigate to="/work/mine" replace />
|
|
}
|
|
|
|
export function InitiativeRootRedirect() {
|
|
const { id } = useParams()
|
|
return <Navigate to={scopedPath('/control/status', { initiativeId: id })} replace />
|
|
}
|
|
|
|
export function InitiativePlanRedirect() {
|
|
const { id } = useParams()
|
|
return <Navigate to={scopedPath('/plan/gates', { initiativeId: id })} replace />
|
|
}
|
|
|
|
export function InitiativeExecutionRedirect() {
|
|
const { id } = useParams()
|
|
return <Navigate to={scopedPath('/plan/structure', { initiativeId: id })} replace />
|
|
}
|
|
|
|
export function InitiativeInboxRedirect() {
|
|
const { id } = useParams()
|
|
return <Navigate to={scopedPath('/plan/inbox', { initiativeId: id })} replace />
|
|
}
|
|
|
|
export function InitiativeJourneyRedirect() {
|
|
const { id } = useParams()
|
|
return <Navigate to={scopedPath('/control/journey', { initiativeId: id })} replace />
|
|
}
|
|
|
|
export function InitiativeGateRedirect() {
|
|
const { itemId } = useParams()
|
|
return <Navigate to={gatePath(itemId)} replace />
|
|
}
|
|
|
|
export function InitiativeProjectRedirect() {
|
|
const { projectId } = useParams()
|
|
return <Navigate to={projectPath(projectId)} replace />
|
|
}
|
|
|
|
export function InitiativeActionRedirect() {
|
|
const { actionId } = useParams()
|
|
return <Navigate to={actionPath(actionId)} replace />
|
|
}
|
|
|
|
export function ProjectNewRedirect() {
|
|
const [searchParams] = useSearchParams()
|
|
const initiativeId = searchParams.get('initiative') || ''
|
|
const parent = searchParams.get('parent') || ''
|
|
const params = new URLSearchParams()
|
|
if (initiativeId) params.set('initiative', initiativeId)
|
|
if (parent) params.set('parent', parent)
|
|
const qs = params.toString()
|
|
return <Navigate to={qs ? `/projects/new?${qs}` : '/projects/new'} replace />
|
|
}
|