Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-1977: Update tests table to use LeafyGreen #2213

Merged
merged 9 commits into from
Jan 18, 2024

Conversation

sophstad
Copy link
Contributor

@sophstad sophstad commented Jan 8, 2024

DEVPROD-1977

Description

  • Update tests table to use LeafyGreen, add handling for sort and filter
  • Multi-sort will be implemented in DEVPROD-944

Screenshots

Testing

  • Update existing integration tests

Copy link

cypress bot commented Jan 8, 2024

1 failed and 5 flaky tests on run #15285 ↗︎

1 542 10 2 Flakiness 5
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Address CR comments
Project: Spruce Commit: c22b01fda6
Status: Failed Duration: 18:56 💡
Started: Jan 18, 2024 4:18 PM Ended: Jan 18, 2024 4:37 PM

Review all test suite changes for PR #2213 ↗︎

@sophstad sophstad marked this pull request as ready for review January 9, 2024 22:57
@sophstad sophstad requested a review from a team January 16, 2024 14:55
@khelif96
Copy link
Contributor

Should the title be tests table?

@sophstad sophstad changed the title DEVPROD-1977: Update tasks table to use LeafyGreen DEVPROD-1977: Update tests table to use LeafyGreen Jan 16, 2024
Copy link
Contributor

@minnakt minnakt left a comment

Choose a reason for hiding this comment

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

idw block you since you've been waiting on this for a while! Let me know if you need another look!


const queryVariables = getQueryVariables(search, task.id);
const { limitNum, pageNum, sort } = queryVariables;
const [queryParams, setQueryParams] = useQueryParams();
const { execution, limitNum, pageNum, sort } = queryVariables;
const cat = sort?.[0]?.sortBy;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really part of your changes, but could we rename this cat variable to be more clear what it represents? :o

Comment on lines 44 to 45
header: () => (
<>{task.versionMetadata.isPatch ? "Base" : "Previous"} Status</>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be:

  header: () =>
      `${task.versionMetadata.isPatch ? "Base" : "Previous"} Status`

table.resetColumnFilters();
table.resetSorting();
setQueryParams({
...queryParams,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to pass queryParams here if we are just going to clear them? If there's something specific we want to preserve, it might make sense to use updateQueryParams instead

Suggested change
...queryParams,

};
}
updateQueryParams(queryParams);
const clearQueryParams = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed some flaky behavior on this button where sometimes the filters didn't actually clear (this is on beta, with only original PR changes applied). I couldn't really tell why this happens though... 🤔

Screen.Recording.2024-01-16.at.11.59.56.AM.mov

Comment on lines 69 to +71
updateQueryParams({
[RequiredQueryParams.Category]: TestSortCategory.Status,
[RequiredQueryParams.Sort]: SortDirection.Asc,
[TableQueryParams.SortBy]: TestSortCategory.Status,
[TableQueryParams.SortDir]: SortDirection.Asc,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's also possible to set execution here using the execution from the task prop, not sure if that's a good option though, just wanted to mention it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since all of the task tabs require an execution I think it's preferable to include it in a higher level shared component!

@sophstad sophstad merged commit 33f292e into evergreen-ci:main Jan 18, 2024
2 of 6 checks passed
@sophstad sophstad deleted the DEVPROD-1977 branch January 18, 2024 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants