Repository navigation
Jaden: Add Kitchen Reports and Analytics export buttons (DONE Jaden) - #5669
Conversation
Adds the Overview, Sustainability Dashboard, Preservation Efficiency, and Forecast Accuracy tabs with a date range filter, plus Export PDF and Export CSV buttons that call placeholder endpoints and trigger mock file downloads with loading and error states.
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Use link.remove() instead of parentNode.removeChild, and surface the actual error message in the toast instead of discarding it.
AaditTrivedi
left a comment
There was a problem hiding this comment.
Reviewed by Aadit Trivedi.
Reviewed the diff (6 files, no conflicts with development). The new Kitchen Reports page and useReportExport hook download the report as a blob, guard against empty files, and show success and error toasts, which is a solid approach.
Issue found
- The export buttons call
ENDPOINTS.KITCHEN_REPORTS_EXPORT_PDFandKITCHEN_REPORTS_EXPORT_CSV(/reports/export/pdfand/reports/export/csv), but HGNRest development has no such routes; the only export route is the education portal's/api/educator/reports/export. As is, both buttons will always fail. Please link the backend PR that adds these endpoints (and list it under Related PRs), or keep the buttons disabled until it exists.
Pointers, not blocking
- The paths are generic (
/reports/export/...); something kitchen-specific, such as/kitchen/reports/export/..., would avoid colliding with other report exports. window.URL.revokeObjectURL(downloadUrl)runs immediately afterlink.click(); some browsers can cancel the download, so deferring it withsetTimeout, as #5613 does, is safer.
Required action
Please add or link the backend endpoints for the exports. Happy to re-review once they exist.
RohSrik
left a comment
There was a problem hiding this comment.
I tested all four sections of the Reports and Analytics page, both in dark and light modes and found no issues. However, both the Export PDF and Export CSV buttons return a 404 error, and the files are not downloaded. I also couldn't find the corresponding API routes, such as reports/export/pdf and reports/export/csv in the local backend, and the frontend does not generate mock downloads independently.
…le exports until backend exists
|
rahulrubugunday
left a comment
There was a problem hiding this comment.
I have reviewed your PR locally (7c8e29d, backend on development) and it works as per requirement.
- /kitchenandinventory/reports loads with the Overview, Sustainability Dashboard, Preservation Efficiency and Forecast Accuracy tabs, and each tab switches correctly.
- The date range selector updates (This Month to Last 3 Months).
- Export PDF and Export CSV are disabled with the tooltip "Export is unavailable until the backend export endpoints are deployed", matching commit 908c0d7.
- Readable in dark and light mode. No conflicts with development.
Note: step 5 of the test steps (mock file download) no longer applies since exports are now disabled, so the description could be updated.
RevathiSrini
left a comment
There was a problem hiding this comment.
I reviewed and tested this PR locally using commit 7c8e29db8.The Reports & Analytics page loads successfully, all four tabs display their corresponding content, and the date-range dropdown works correctly. I also verified that the interface displays properly in dark mode. I noticed that the PDF and CSV export buttons are intentionally disabled until the backend endpoints are available, so the actual download functionality could not be tested. Everything else I tested worked as expected.
RohSrik
left a comment
There was a problem hiding this comment.
I reviewed PR #5669 locally using the latest commit 7c8e29d and verified the Kitchen Reports functionality.
- The Kitchen Reports page loads successfully with all four tabs: Overview, Sustainability Dashboard, Preservation Efficiency, and Forecast Accuracy. Navigation between the tabs works correctly.
- The date range filter responds properly when switching between different periods, including This Month and This Year.
- The Export PDF and Export CSV buttons are disabled and display the appropriate tooltip indicating that the backend export endpoints are not yet available.
- I also checked the page in both light and dark modes. The layout, text, and controls are displayed clearly without noticeable UI issues.
Overall, the functionality I tested behaves as expected and aligns with the PR requirements.
|
Thank you all, merging! |










Jaden: Add Kitchen Reports and Analytics export buttons (DONE Jaden)- #5669
Description
Implements the frontend for the Kitchen Reports and Analytics page (Phase 6) per the task spec: a tabbed Overview / Sustainability Dashboard / Preservation Efficiency / Forecast Accuracy interface with Export PDF and Export CSV buttons wired to placeholder API endpoints and mock file downloads.
Changes made
New page
Export logic
Styling
Code review fixes
How to test
vod.mov