Fix issues #2-#6 and #8: searchable pickers, occupancy filter, asset UX, counts
- #2 #5: Replace plain <select> location pickers in NewTask and Assets with SearchSelect combobox — full-text search across name and category group - #3: Add "Unknown" checkbox on asset install date — disables the field and saves null instead of leaving an ambiguous blank - #4: Add inline "Add service task" form in asset detail modal — creates a recurring template pre-linked to the asset without leaving the page - #6: Fix unoccupied rooms filter — was always empty because (a) list_type was 'all' instead of 'staying' and (b) only checked b.site_id but NewBook returns booking_site_id on most account configs - #8: Add open-task count badges to category filter chips on Summary page Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2a3a226131
commit
859874f614
6 changed files with 268 additions and 39 deletions
|
|
@ -60,7 +60,7 @@ export async function fetchBookings(fromDate, toDate) {
|
|||
const res = await callApi('bookings_list', {
|
||||
period_from: `${fromDate} 00:00:00`,
|
||||
period_to: `${toDate} 23:59:59`,
|
||||
list_type: 'all',
|
||||
list_type: 'staying',
|
||||
})
|
||||
return res?.data ?? []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ async function fetchOccupiedSiteIds() {
|
|||
const bookings = await fetchBookings(today, today)
|
||||
const occupied = new Set()
|
||||
for (const b of bookings) {
|
||||
if (String(b.booking_status).toLowerCase() === 'arrived' && b.site_id != null) {
|
||||
occupied.add(String(b.site_id))
|
||||
}
|
||||
// NewBook returns booking_site_id on some account configurations, site_id on others
|
||||
const siteId = b.booking_site_id ?? b.site_id
|
||||
if (siteId != null) occupied.add(String(siteId))
|
||||
}
|
||||
return occupied
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue