-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: filter tree details origin #1276
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
base: main
Are you sure you want to change the base?
Conversation
Double underlines should represent getting data from another table, test_origin is just a rename of origin so it should only have one underline
Adds origin filtering capability per tab, using the diffFilter structure Part of #1251
66882ae
to
dbaabc4
Compare
@@ -165,6 +166,11 @@ const BootsTab = ({ treeDetailsLazyLoaded }: BootsTabProps): JSX.Element => { | |||
} | |||
}, [isEmptySummary, summaryBootsData]); | |||
|
|||
const showOriginCard = useMemo( |
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 is being used in other components and has the same logic, can this be moved to an utils file (or a hook to use the memo) to share this logic?
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 I could, but now that I look at it again, I think I can even move it to the MemoizedOriginsCard
component itself
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.
Sounds good!
@@ -209,6 +215,13 @@ const BootsTab = ({ treeDetailsLazyLoaded }: BootsTabProps): JSX.Element => { | |||
environmentCompatible={hardwareData} | |||
diffFilter={diffFilter} | |||
/> | |||
{showOriginCard && summaryBootsData && ( |
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.
Doesn't showOriginCard
already checks for falsy values for summaryBootsData
?
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.
Yes but typescript can't guarantee that summaryBootsData
wasn't reassigned to undefined, so it shows an error in summaryBootsData.origins
in the lines below if I don't use && summaryBootsData
The tree details page can have tests or builds from different origins than the checkout, so there should be a possibility to filter the origin of each tab in the tree details.
Changes
tests__origin
->tests_origin
)How to test
Closes #1251