feat: integrate ExpiryDashboard into inventory page (#69)
Some checks failed
Deploy to Coolify / Code Quality (pull_request) Has been cancelled
Deploy to Coolify / Run Tests (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Development (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Production (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Test (pull_request) Has been cancelled
Pull Request Checks / Validate PR (pull_request) Has been cancelled

This commit is contained in:
Pantry Lead Agent
2026-02-25 01:27:27 +00:00
parent 6eb3169be3
commit bf4d365357

View File

@@ -83,6 +83,14 @@
@updated="handleItemUpdated" @updated="handleItemUpdated"
/> />
<!-- Expiry Dashboard -->
<div class="mb-6">
<InventoryExpiryDashboard
:items="inventoryItems"
@view-item="editingItem = $event"
/>
</div>
<!-- Inventory List --> <!-- Inventory List -->
<InventoryList <InventoryList
ref="inventoryListRef" ref="inventoryListRef"
@@ -111,9 +119,21 @@ const inventoryListRef = ref()
const prefilledData = ref<any>(null) const prefilledData = ref<any>(null)
const selectedTagFilters = ref<string[]>([]) const selectedTagFilters = ref<string[]>([])
const searchQuery = ref('') const searchQuery = ref('')
const inventoryItems = ref<any[]>([])
// Load inventory for dashboard
const { getInventory } = useInventory()
const loadInventoryData = async () => {
const { data } = await getInventory()
inventoryItems.value = data || []
}
// Handle scan-to-add flow (Issue #25) // Handle scan-to-add flow (Issue #25)
onMounted(() => { onMounted(async () => {
// Load inventory for dashboard
await loadInventoryData()
if (route.query.action === 'add') { if (route.query.action === 'add') {
// Pre-fill data from query params (from scan) // Pre-fill data from query params (from scan)
prefilledData.value = { prefilledData.value = {
@@ -136,15 +156,17 @@ const handleCloseAddForm = () => {
prefilledData.value = null prefilledData.value = null
} }
const handleItemAdded = (item: any) => { const handleItemAdded = async (item: any) => {
showAddForm.value = false showAddForm.value = false
prefilledData.value = null prefilledData.value = null
// Reload the inventory list // Reload the inventory list and dashboard
inventoryListRef.value?.reload() inventoryListRef.value?.reload()
await loadInventoryData()
} }
const handleItemUpdated = (item: any) => { const handleItemUpdated = async (item: any) => {
editingItem.value = null editingItem.value = null
inventoryListRef.value?.reload() inventoryListRef.value?.reload()
await loadInventoryData()
} }
</script> </script>