-
Notifications
You must be signed in to change notification settings - Fork 89
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
add selectedMOIs to saved search #4570
Conversation
I can pair on this with you if you want, but at a high level I think changing the behavior for onChange the way you did is probably not the right direction to get it to populate properly. For the issue with initial form population you mention, I think you need to change the |
@hanars I implemented the Screen.Recording.2025-01-07.at.4.49.05.PM.movI logged the value inside of the |
Try looking into the |
@hanars I got this to work!! had to really understand what was happening during the lifecycle methods to see when and where the |
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.
yay so excited this is working! One intr suggestion on syntax but otherwise looks awesome!
ui/shared/utils/panelAppUtils.ts
Outdated
const filteredItems = items.filter((item) => { | ||
if (!selectedMOIs || selectedMOIs.length === 0) { | ||
return true | ||
} | ||
const initials = moiToMoiInitials(item.pagene?.modeOfInheritance, false) | ||
return selectedMOIs.some((moi) => initials.includes(moi)) | ||
}) | ||
|
||
return filteredItems.reduce((acc, item) => { |
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 would be slightly neater as a single reduce
with a helper method
const filteredItems = items.filter((item) => { | |
if (!selectedMOIs || selectedMOIs.length === 0) { | |
return true | |
} | |
const initials = moiToMoiInitials(item.pagene?.modeOfInheritance, false) | |
return selectedMOIs.some((moi) => initials.includes(moi)) | |
}) | |
return filteredItems.reduce((acc, item) => { | |
const hasSelectedMoi = (item, selectedMOIs) => { | |
if (!selectedMOIs || selectedMOIs.length === 0) { | |
return true | |
} | |
const initials = moiToMoiInitials(item.pagene?.modeOfInheritance, false) | |
return selectedMOIs.some((moi) => initials.includes(moi)) | |
} | |
... | |
return items.reduce((acc, item) => { | |
if (!hasSelectedMoi(item, selectedMOIs) { | |
return acc | |
} | |
... |
it works!
selectedmoi.mov