SNPRC Scheduler project updates#858
SNPRC Scheduler project updates#858labkey-martyp wants to merge 37 commits intorelease25.7-SNAPSHOTfrom
Conversation
…fb_scheduler_updates
…fb_scheduler_updates
…fb_scheduler_updates
…fb_scheduler_updates
…fb_scheduler_updates
| "addTimelineItem(timelineId: " + | ||
| timeline.TimelineId + | ||
| ", animalId: " + | ||
| id + |
There was a problem hiding this comment.
What is this id variable? I don't see it declared
There was a problem hiding this comment.
Must have been a copy paste error. Fixed now.
| timeline.setStudyDayNotes(studyDayNotes); | ||
| // Re-query all child collections from the database to ensure DB-generated | ||
| // values (e.g., TimelineItemId identity column) are properly populated | ||
| timeline.setTimelineItems(SNPRC_schedulerManager.get().getTimelineItems(c, u, timeline.getObjectId(), null)); |
There was a problem hiding this comment.
The re-query of child collections happens after transaction.commit() (line 308). If any re-query fails (DB connection issue etc), the catch (RuntimeException) at line 337 adds to errors, but responseJson
remains an empty JSON and is returned.
There was a problem hiding this comment.
Good catch. I wrapped this in it's own try/catch that will log a warning if it fails but will still return the timeline that is stored in memory, it just may be a little stale.
| INNER JOIN ehr.project as ep on p.ReferenceId = ep.project | ||
| INNER JOIN study.assignment as a on ep.protocol = a.protocol | ||
| LEFT JOIN study.deaths as d on d.Id = a.Id | ||
| LEFT JOIN study.departure as dep on dep.Id = a.Id |
There was a problem hiding this comment.
If an animal has multiple departure records, a left join could be bringing back multiple rows for one animal
There was a problem hiding this comment.
Ok got it. I didn't know you guys supported multiple departures. I updated this to grab the most recent departure. Let me know if that's not what you'd want to see.
Rationale
Bring SNPRC Scheduler React project up to date with update packages and webpack build.
Changes