Merge branch 'feat/system-notices' into dev

This commit is contained in:
Julien G.
2026-04-16 14:38:14 +02:00
committed by GitHub
46 changed files with 3538 additions and 50 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useState, useRef } from 'react'
import { useNavigate } from 'react-router-dom'
import { useNavigate, useSearchParams } from 'react-router-dom'
import { tripsApi } from '../api/client'
import { tripRepo } from '../repo/tripRepo'
import { useAuthStore } from '../store/authStore'
@@ -689,6 +689,7 @@ export default function DashboardPage(): React.ReactElement {
}
const navigate = useNavigate()
const [searchParams, setSearchParams] = useSearchParams()
const toast = useToast()
const { t, locale } = useTranslation()
const { demoMode, user } = useAuthStore()
@@ -709,6 +710,13 @@ export default function DashboardPage(): React.ReactElement {
return () => { document.body.style.overflow = '' }
}, [showWidgetSettings])
useEffect(() => {
if (searchParams.get('create') === '1') {
setShowForm(true)
setSearchParams({}, { replace: true })
}
}, [searchParams])
useEffect(() => { loadTrips() }, [])
const loadTrips = async () => {
+7
View File
@@ -0,0 +1,7 @@
import { registerNoticeAction } from '../../components/SystemNotices/noticeActions.js';
// Opens the new-trip creation modal on DashboardPage via URL param.
// DashboardPage reads ?create=1 on mount and calls setShowForm(true).
registerNoticeAction('open:trip-create', ({ navigate }) => {
navigate('/dashboard?create=1');
});