Skip to content

[BI-1375] Make GIDs clickable links#177

Merged
HMS17 merged 9 commits intodevelopfrom
feature/BI-1375
May 11, 2022
Merged

[BI-1375] Make GIDs clickable links#177
HMS17 merged 9 commits intodevelopfrom
feature/BI-1375

Conversation

@HMS17
Copy link
Contributor

@HMS17 HMS17 commented Apr 13, 2022

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:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <please include a link to TAF run>

HMS17 added 4 commits April 14, 2022 13:37
…/bi-api into feature/BI-1375

� Conflicts:
�	src/main/java/org/breedinginsight/brapi/v2/dao/BrAPIGermplasmDAO.java
…into feature/BI-1375

� Conflicts:
�	src/main/java/org/breedinginsight/brapi/v2/dao/BrAPIGermplasmDAO.java
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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you split this into multiple lines? It is hard to read when chained on a one liner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, what happens if the filter returns no results. Will your findFirst error out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@HMS17 HMS17 removed the request for review from dmeidlin May 3, 2022 15:04
@HMS17 HMS17 requested review from a team, dmeidlin and nickpalladino and removed request for a team and dmeidlin May 3, 2022 15:04
@HMS17 HMS17 requested a review from ctucker3 May 3, 2022 16:15
Copy link
Contributor

@ctucker3 ctucker3 left a comment

Choose a reason for hiding this comment

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

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)).
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@HMS17 HMS17 marked this pull request as ready for review May 3, 2022 21:16
@HMS17 HMS17 merged commit f67b4b2 into develop May 11, 2022
@HMS17 HMS17 deleted the feature/BI-1375 branch May 11, 2022 16:15
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