Skip to content
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

Feat: HD path filter and patches #602

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Feat: HD path filter and patches #602

merged 2 commits into from
Nov 27, 2024

Conversation

MarceloRobert
Copy link
Collaborator

@MarceloRobert MarceloRobert commented Nov 25, 2024

  • Splits path filter between boots and tests, now one doesn't affect the other.
  • Adds filtering to hardwareDetails page;
  • Syncs filter listing and input field, after removing the path filter from the filter list the input field will also clear;
  • Fixes boot commit history graph not using the path filter.

Also refactors the sorting exhaustive-deps useMemo dependency just so eslint can complain if a useMemo dependency is missing

How to test

Go to a tree details page with boot and/or test data, scroll down and use the searchbox alongside the path column. Check the filtering of the table and the commit history graph. Compare this with the previous version currently on staging.
Also go to a hardware details page with boot and/or test data and see the same behavior as in tree details (except for the commit history graph, which isn't implemented yet).

Closes #578 and #582

Comment on lines 261 to 263
// TODO: there should be a filtering for the frontend before the backend
// that frontend filtering should consider the individual tests inside each test batch (the data from individualTestsTables),
// not only the rows of the external table (same for BootsTable)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are not using this approach anymore, we will just preserve the data, add a spinner until the fresh data is retrieved

Comment on lines +269 to +268
if (updatePathFilter === undefined) {
table.setGlobalFilter(String(e.target.value));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to set the global filter? since the filter is being added in the backend

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this case it is being used for tables such as within the buildDetails page, which doesn't have backend filtering for the page so the frontend filtering is being used

Copy link
Collaborator

@WilsonNet WilsonNet left a comment

Choose a reason for hiding this comment

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

Looks good, pre-approving, just left some minor improvements

Worked nice on my tests even the commit graph

Comment on lines 336 to 337
{/* TODO: remove this hidden div, this is just to force memoization reset when sorting changes (all tables) */}
<div className="hidden">{sorting.toString()}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make TableHead explicitly dependent on sorting

@MarceloRobert MarceloRobert self-assigned this Nov 27, 2024
Comment on lines 343 to 339
: // the header must change the icon when sorting changes, but just the column dependency won't trigger the rerender, so we pass an unused sorting prop here to force the useMemo dependency
flexRender(header.column.columnDef.header, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

break this comments in multiple lines

Splits path filter between boots and tests; Adds filtering to hardwareDetails; Syncs filter listing and input field; Fixes boot commit history graph not using the path filter. Closes #578 and Closes #582
Copy link
Collaborator

@Francisco2002 Francisco2002 left a comment

Choose a reason for hiding this comment

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

nice!!

@MarceloRobert MarceloRobert merged commit 9fc879a into main Nov 27, 2024
5 checks passed
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.

Fix (path filter): frontend filtering, path input sync, commit graph
4 participants