Skip to content

[BI-1613] - Add Term Type to Ontology Term Import#233

Merged
nickpalladino merged 12 commits intodevelopfrom
feature/BI-1613
Jan 18, 2023
Merged

[BI-1613] - Add Term Type to Ontology Term Import#233
nickpalladino merged 12 commits intodevelopfrom
feature/BI-1613

Conversation

@HMS17
Copy link
Contributor

@HMS17 HMS17 commented Dec 7, 2022

Description

Story: BI-1613 - Add Term Type to Ontology Term Import

Added TermTypeTranslator enum for ease of converting between user readable term type values and backend storage values
Added validation for term type in Ontology Import
Updated Ontology Import to save Term Type
Updated unit tests and corresponding files

Note: This is branched off of BI-1615, so until that is merged the changelist will include changes from that branch

Dependencies

bi-web/BI-1613

Testing

see 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 HMS17 marked this pull request as ready for review December 14, 2022 14:04
Copy link
Member

@timparsons timparsons left a comment

Choose a reason for hiding this comment

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

Small change request

Comment on lines +41 to +48
public static String nameFromUserDisplay(String userDisplay){
for (TermTypeTranslator term: values()){
if (term.userDisplay.equals(userDisplay)){
return term.name();
}
}
throw new IllegalArgumentException();
}
Copy link
Member

Choose a reason for hiding this comment

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

This can be simplified to return the enum that matches the userDisplay (and also remove the name from the enum terms)

Copy link
Member

Choose a reason for hiding this comment

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

I ended up just making a wrapper around a map and got rid of the additional enum which I think simplified things more. If in the future the conversion will go the other way, can iterate through or use a bidirectional map.

@nickpalladino nickpalladino merged commit e72a493 into develop Jan 18, 2023
@nickpalladino nickpalladino deleted the feature/BI-1613 branch January 18, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants