[Biobank] Include Visit Label in Specimen Entity#10665
Open
HenriRabalais wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a front-end crash when viewing a specimen whose collection session is
at a site the user doesn't have access to. The specimen is visible (the user
has access to its container site), but its session is correctly never
provisioned to the front end. The front end then tried to look up the session
label in
options.sessionsand read.labeloffundefined, throwing.The fix provisions the session's visit label directly onto the specimen
entity, so the label can be displayed without depending on the
access-filtered session options. The hyperlink to the session is now rendered
only when the session is present in
options.sessions(i.e. the user canaccess it); otherwise the visit label is shown as plain text.
Changes
specimendao.class.inc: Addeds.Visit_label as SessionLabelto theexisting session join in the specimen select, and set it on the specimen in
_getInstanceFromSQL.specimen.class.inc: Added asessionLabelproperty withsetter/getter, and included it in
jsonSerialize.<display view file>: Read the visit label fromspecimen.sessionLabelinstead of
options.sessions[sessionId].label, and made the session linkconditional on the session being present in
options.sessions.specimenForm.js: CarriedsessionLabelacross from the parentspecimen in
componentDidUpdate, and read the label fromcurrentinsteadof
options.sessionsinrenderGlobalFields.