feat: replace calendar day modal with dedicated day-view page
Calendar day clicks now navigate to /experiments/:id/day/:date (with ?field= param). ExperimentDayView shows a sticky-column table of all subjects with data that day, inline edit via modal, and a session-metrics bar chart from analysis_summary. Subject name links to /daily-statuses/:id. Backend adds ?date= filtering to GET /experiments/:id/daily-statuses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -349,8 +349,14 @@ router.get('/:id/daily-statuses', async (req, res, next) => {
|
||||
const exp = await prisma.experiment.findUnique({ where: { id: req.params.id } });
|
||||
if (!exp) return res.status(404).json({ error: 'Experiment not found' });
|
||||
|
||||
const where = { animal: { experiment_id: req.params.id } };
|
||||
if (req.query.date) {
|
||||
const d = new Date(req.query.date + 'T00:00:00.000Z');
|
||||
const next = new Date(d); next.setUTCDate(next.getUTCDate() + 1);
|
||||
where.date = { gte: d, lt: next };
|
||||
}
|
||||
const statuses = await prisma.dailyStatus.findMany({
|
||||
where: { animal: { experiment_id: req.params.id } },
|
||||
where,
|
||||
select: {
|
||||
id: true,
|
||||
animal_id: true,
|
||||
|
||||
Reference in New Issue
Block a user