Skip to content

SNPRC Scheduler project updates#858

Open
labkey-martyp wants to merge 37 commits intorelease25.7-SNAPSHOTfrom
25.7_fb_scheduler_updates
Open

SNPRC Scheduler project updates#858
labkey-martyp wants to merge 37 commits intorelease25.7-SNAPSHOTfrom
25.7_fb_scheduler_updates

Conversation

@labkey-martyp
Copy link
Copy Markdown
Contributor

@labkey-martyp labkey-martyp commented Nov 18, 2025

Rationale

Bring SNPRC Scheduler React project up to date with update packages and webpack build.

Changes

  • Factor out unnecessary and unsupported packages
  • Update all other packages to latest versions (including react, redux and react-dnd)
  • Update webpack build to use standard @labkey/build
  • Update entrypoint and production/dev server entry points
  • Many refactors associated with package updates including bootstrap and react-data-grid updates
  • Refactor all grids using react-bootstrap-table to instead use react-data-grid
  • Start conversion of JS and JSX files to TS and TSX
  • Update jest tests to new libraries and webpack

@labkey-martyp labkey-martyp self-assigned this Nov 19, 2025
@labkey-robert labkey-robert added this to the 25.07 milestone Jan 2, 2026
"addTimelineItem(timelineId: " +
timeline.TimelineId +
", animalId: " +
id +
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this id variable? I don't see it declared

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an animal has multiple departure records, a left join could be bringing back multiple rows for one animal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants