-
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
KANBAN-591 #1391
base: test
Are you sure you want to change the base?
KANBAN-591 #1391
Conversation
…nteractionDetailTable, and phenotypeTable
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.
Left a few thoughts, but overall looks pretty straight forward (although I am sure it looks much more straightforward than it was to actually upgrade everything).
src/components/OrthologPicker.js
Outdated
@@ -108,7 +109,7 @@ const OrthologPicker =({ | |||
selectedOrthologs = selectedOrthologs?.filter(bySpecies(selectedSpecies)); | |||
} | |||
} | |||
onChange(selectedOrthologs); | |||
onChange(selectedOrthologs || []); |
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.
I think you can get away with:
if (checkboxValue && orthology.data.results)
on line 102. That should also let you get rid of the "?" chains for lines 103, 106, and 109.
@@ -58,7 +58,7 @@ const ExpressionComparisonRibbon = ({ | |||
let updatedSummary; | |||
if (summary.data) { | |||
const taxonIdYeast = 'NCBITaxon:559292'; | |||
const categories = summary.data.categories.filter(category => !( | |||
const categories = summary.data?.categories?.filter(category => !( |
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.
A few thoughts here:
-
Since this is wrapped in
if (summary.data)
, then you shouldn't need the first "?" (i.e. `summary.data.categories?..." -
"categories" can be undefined if
data.categories
is undefined. Just curious if this is intentional. -
This is a pretty minor optimization, but both "selectedOrthologs" and "geneTaxon" are not dependant on the categories array, meaning
selectedOrthologs.length === 0 && geneTaxon === taxonIdYeast
will be the same for every category. Rewriting it this way will reduce the number of times the comparison will be made to 1 (or O(1) to be fancy):
let updatedSummary;
if (summary.data) {
const taxonIdYeast = 'NCBITaxon:559292';
let categories = summary.data.categories;
if (categories && selectedOrthologs.length === 0 && geneTaxon === taxonIdYeast) {
categories = categories.filter(category => !category.id.startsWith('UBERON:');
}
...
}
- Lastly,
updatedSummary = summary.data;
will be a pointer reference, meaningupdatedSummary.categories = categories;
will change the value for both "summary" and "updatedSummary". I don't recall if react query supports this, but either way, if this isn't intentional, I would change to this instead:
updatedSummary = {
...summary.data,
categories
};
isLoading, | ||
} = tableProps; | ||
|
||
const data = useMemo(() => { | ||
return resolvedData ? resolvedData.results?.map(allele => ({ | ||
return resolvedData ? resolvedData?.map(allele => ({ |
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.
Here's a little shorthand if you like avoiding ternaries:
return (resolvedData || []).map(allele => ... );
@sethrcamp Pushed out code to address your comments. Thanks! |
TESTING -- DO NOT MERGE