Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MarceloRobert
Copy link
Collaborator

@MarceloRobert MarceloRobert commented Jun 6, 2025

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

  • (piggybacking) Fixes a typo in the hardware query (tests__origin -> tests_origin)
  • Adds filter handlers for each tab origin in the backend
  • Syncs type in the frontend to include origin in tests and builds
  • Adds new component OriginsCard
  • Uses the component in the treeDetails tabs

How to test

Closes #1251

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
@MarceloRobert MarceloRobert force-pushed the feat/filter-tree-details-origin branch from 66882ae to dbaabc4 Compare June 9, 2025 17:06
@MarceloRobert MarceloRobert marked this pull request as ready for review June 9, 2025 17:23
@MarceloRobert MarceloRobert changed the title WIP Feat: filter tree details origin Feat: filter tree details origin Jun 9, 2025
@@ -165,6 +166,11 @@ const BootsTab = ({ treeDetailsLazyLoaded }: BootsTabProps): JSX.Element => {
}
}, [isEmptySummary, summaryBootsData]);

const showOriginCard = useMemo(

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?

Copy link
Collaborator Author

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

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 && (

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?

Copy link
Collaborator Author

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

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.

TreeDetails: Add test origin card and filter by test origin
2 participants