-
Notifications
You must be signed in to change notification settings - Fork 409
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(structure): fixing incorrect way of setting col visibility #6716
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated May 21, 2024 9:44 AM (UTC)
|
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.
don't have full context of what is going on here, probably makes more sense for Pedro to give a ✅
@@ -20,7 +21,7 @@ describe('useDocumentSheetColumns', () => { | |||
{name: 'email', type: {name: 'string'}}, | |||
{name: 'age', type: {name: 'number'}}, | |||
{ | |||
name: 'address', | |||
name: 'address.place', |
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.
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.
- tests don't need to test with dot notation
@@ -156,17 +160,19 @@ export function useDocumentSheetColumns(documentSchemaType?: ObjectSchemaType) { | |||
() => | |||
flatColumns(columns).reduce<[VisibilityState, number]>( | |||
([accCols, countAllowedVisible], column) => { | |||
const visibilityKey = String(column.id) |
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.
Column id is possibly undefined according to the tanstack column definition and accessor functions, thinking on throwing an error if it doesn't have a column.id
We are controlling this, but in case something changes in the future it will be simpler to identify the problem if for some case the id is missing.
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.
- throw if there's not an ID on a column
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.
Thanks @jordanl17 looks good to me
Description
Fixes an issue introduced in EDX-1308 (#6661) where tanstack col visibility expects field separator as
_
but incorrectly.
was being used for our definitionsWhat to review
Defining an id for all cols which is used in flatColumns.
Selected column now a display column
Testing
Updated test case
Notes for release
Not relevant - this feature is not yet user facing