Skip to content

Conversation

oandregal
Copy link
Member

What?

Follow-up to this post-review comment https://github.com/WordPress/gutenberg/pull/70752/files#r2219070230

Prevent computing sorting unless we found the specific fields by extracting sortByField and groupByField logic out of the sort function.

Testing Instructions

Tests should pass:

npm install && npm run test:unit -- packages/dataviews/src/test/filter-and-sort-data-view.js

@oandregal oandregal requested a review from mcsf July 21, 2025 15:13
@oandregal oandregal self-assigned this Jul 21, 2025
Copy link

github-actions bot commented Jul 21, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@oandregal oandregal added [Type] Code Quality Issues or PRs that relate to code quality [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Jul 21, 2025
Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this :)

@oandregal oandregal changed the title Extract sortBy and groupBy logic filterSortAndPaginate: extract sortBy and groupBy logic Jul 22, 2025
@oandregal oandregal merged commit 211f769 into trunk Jul 22, 2025
84 of 88 checks passed
@oandregal oandregal deleted the update/improve-sortby-groupby branch July 22, 2025 06:21
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 22, 2025
@t-hamano t-hamano added the [Package] DataViews /packages/dataviews label Jul 23, 2025
USERSATOSHI pushed a commit to USERSATOSHI/gutenberg that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Package] DataViews /packages/dataviews [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants