DataViews: Update: Sort descending button may be wrongly pressed. #64547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.