Conversation
6 tasks
…into feature/BI-1375 � Conflicts: � src/main/java/org/breedinginsight/brapi/v2/dao/BrAPIGermplasmDAO.java
ctucker3
suggested changes
Apr 21, 2022
| if (programGermplasmByFullName.containsKey(parents.get(0))) { | ||
| newPedigreeString = programGermplasmByFullName.get(parents.get(0)).getAccessionNumber(); | ||
| namePedigreeString = programGermplasmByFullName.get(parents.get(0)).getDefaultDisplayName(); | ||
| uuidPedigreeString = programGermplasmByFullName.get(parents.get(0)).getExternalReferences().stream().filter(ref -> ref.getReferenceSource().equals(referenceSource)).map(ref -> ref.getReferenceID()).findFirst().get(); |
Contributor
There was a problem hiding this comment.
Can you split this into multiple lines? It is hard to read when chained on a one liner.
Contributor
There was a problem hiding this comment.
Also, what happens if the filter returns no results. Will your findFirst error out?
Contributor
Author
There was a problem hiding this comment.
Split into multiple lines, and good point! Switched to using an orElse clause to set the value to “” if nothing is found, which leads to a GID with no link
ctucker3
approved these changes
May 3, 2022
Contributor
ctucker3
left a comment
There was a problem hiding this comment.
Approved, one small question/suggestion.
| newPedigreeString = programGermplasmByFullName.get(parents.get(0)).getAccessionNumber(); | ||
| namePedigreeString = programGermplasmByFullName.get(parents.get(0)).getDefaultDisplayName(); | ||
| uuidPedigreeString = programGermplasmByFullName.get(parents.get(0)).getExternalReferences(). | ||
| stream().filter(ref -> ref.getReferenceSource().equals(referenceSource)). |
Contributor
There was a problem hiding this comment.
Looks good! Did you mean to have the . on a separate line from the map and stream? I usually have seen it on the same line. If it's a style choice, feel free to keep it.
nickpalladino
approved these changes
May 11, 2022
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.
Description
Story: BI-1375 - Make GIDs clickable links
Added pedigreeByUUID in additionalInfo for germplasm to simplify retrieval of parent UUIDs for germplasm details page links
Dependencies
bi-web/feature/BI-1375
Testing
See testing in bi-web
Checklist: