-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #1980: Evaluation Summaries not populating with data #2083
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great catch! From my testing, this fixes the bug.
@@ -62,7 +63,7 @@ class VariantInterpretationSummaryHeader extends Component { | |||
{classification ? | |||
<div> | |||
<dt>Date interpretation saved:</dt> | |||
<dd className="classificationSaved">{moment(getClassificationSavedDate(classification)).format("YYYY MMM DD, h:mm a")}</dd> | |||
<dd className="classificationSaved">{moment(lastSavedDate).format("YYYY MMM DD, h:mm a")}</dd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about conditionally rendering this, so that the user doesn't see "Invalid Date"?
{lastSavedDate ?
<dd>.......</dd>
: null}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion! I'll implement and push the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic fix looks good to me.
Issue #1980 :
Here are the steps to recreate the bug and test this issue -
After browsing Stackoverflow/Github, specifically here, there was a suggestion that an inconsistency with dates may be an issue when receiving the above error. Also, the date is the only data that is being rendered here, with it being the current time, not the date the classification was saved.
If you comment out line 65 (the call to
getClassificationSavedDate
inrender()
) in/src/clincoded/static/components/variant_interpretation_summary/header.js
, and keep the same network throttling in step 2, the error should not occur. If you pull in the changes from this branch, you will get the same result.I assigned the desired date to a conditional in which
getClassificationSavedDate
will only be called iflast_modified
exists in the classification object. This is because the moment library was returning the current time upon the initial render (due to classification being undefined), and if the users connection was too slow to resolve this inconsistency, the Summary would error out. This is why some users reported this issue while others may not have encountered the bug at all. I set theelse
condition to be null, because ifundefined
, moment will return the current time, instead of 'Invalid Date'.