-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(ui): flux sort no longer being overidden by default FE sort #16235
Conversation
e1cb7e3
to
74599fc
Compare
return ( | ||
<div | ||
style={this.style} | ||
className={this.class} | ||
onClick={this.handleClick} | ||
data-column-index={columnIndex} | ||
data-row-index={rowIndex} | ||
{...(rowIndex === 0 ? {'data-testID': `${data}-table-header`} : {})} // conditionally adds test-ID for tableCell header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dang this is ugly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya but it’s less that conditionally rendering a component with 1 added prop / adding a testID unnecessarily and sullying the DOM
} | ||
const headers = table.data[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was the initial default statement set for filtering. While the intention of it is not clear to me, the function of it is to set the default sort to undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird
fix(ui): flux sort no longer being overidden by default FE sort
Closes #15980
Problem
The previous implementation was setting a default FE sort for columns if they existed without considering whether the results were already sorted
Solution
Removed the default sort assignment so that values are returned based on the flux query sorting. Added tests to ensure that default values are automatically sorted by
_value