mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
Reservation end time, route perf overhaul, assignment search fix
- Add reservation_end_time field (DB migration, API, UI) - Split reservation form: separate date, start time, end time, status fields - Fix DateTimePicker forcing 00:00 when no time selected - Show end time across all reservation displays - Link-to-assignment and date on same row (50/50 layout) - Assignment search now shows day headers for filtered results - Auto-fill date when selecting a day assignment - Route segments: single OSRM request instead of N separate calls (~6s → ~1s) - Route labels visible from zoom level 12 (was 16) - Fix stale route labels after place deletion (useEffect triggers recalc) - AbortController cancels outdated route calculations
This commit is contained in:
@@ -172,7 +172,7 @@ export function CustomDateTimePicker({ value, onChange, placeholder, style = {}
|
||||
}
|
||||
const handleTimeChange = (t) => {
|
||||
const d = datePart || new Date().toISOString().split('T')[0]
|
||||
onChange(t ? `${d}T${t}` : `${d}T00:00`)
|
||||
onChange(t ? `${d}T${t}` : d)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -33,7 +33,29 @@ export default function CustomSelect({
|
||||
|
||||
const selected = options.find(o => o.value === value)
|
||||
const filtered = searchable && search
|
||||
? options.filter(o => o.label.toLowerCase().includes(search.toLowerCase()))
|
||||
? (() => {
|
||||
const q = search.toLowerCase()
|
||||
const result = []
|
||||
let currentHeader = null
|
||||
let headerAdded = false
|
||||
for (const o of options) {
|
||||
if (o.isHeader) {
|
||||
currentHeader = o
|
||||
headerAdded = false
|
||||
continue
|
||||
}
|
||||
// Match against label, searchLabel, or groupLabel
|
||||
const haystack = [o.label, o.searchLabel, o.groupLabel].filter(Boolean).join(' ').toLowerCase()
|
||||
if (haystack.includes(q)) {
|
||||
if (currentHeader && !headerAdded) {
|
||||
result.push(currentHeader)
|
||||
headerAdded = true
|
||||
}
|
||||
result.push(o)
|
||||
}
|
||||
}
|
||||
return result
|
||||
})()
|
||||
: options
|
||||
|
||||
const sm = size === 'sm'
|
||||
|
||||
Reference in New Issue
Block a user