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

DataViews: Update: Sort descending button may be wrongly pressed. #64547

Conversation

jorgefilipecosta
Copy link
Member

In the view config UI for patterns, although the sort descending button appears as pressed, the patterns are not actually sorted in descending order. This PR addresses and fixes this issue.

Before, if a sorting direction was not set, a default of descending was applied. However, if there was no sort field, sorting wouldn't occur and the default would be incorrect. This PR fixes the issue by only adding the default sorting direction of descending if a sort field is set.

Testing Instructions

I went to the patterns page.
I opened the view config popover.
I verified that neither the ascending nor descending buttons were pressed.
I clicked these buttons and verified sorting worked as expected and the buttons become pressed.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Aug 15, 2024
Copy link

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: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>

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

@jorgefilipecosta jorgefilipecosta merged commit 294b888 into trunk Aug 15, 2024
64 checks passed
@jorgefilipecosta jorgefilipecosta deleted the fix/patterns-view-starts-unsorted-but--sort-descending-button-is-wrongly-shown-as-pressed branch August 15, 2024 15:41
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 15, 2024
@artemiomorales artemiomorales added the [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond label Aug 21, 2024
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants