-
Notifications
You must be signed in to change notification settings - Fork 380
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
refactor(react-grid): extract table column extension #586
Conversation
})); | ||
export const tableColumnsWithDataRows = (columns, columnExtensions) => | ||
columns.map((column) => { | ||
const columnExtension = getColumnExtension(columnExtensions, column.name); |
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.
The column.name
field is used twice and can be extracted.
|
||
expect(tableColumnsWithDataRows(columns, columnExtensions)[0]) | ||
.toMatchObject({ align: 'right' }); | ||
}); |
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.
Should we add one more test that checks that only the width
and align
fields will be applied?
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.
No, I think that these tests are enough
tableColumnExtensions: [ | ||
{ columnName: 'amount', align: 'right', cellComponent: HighlightedCell }, | ||
{ columnName: 'discount', cellComponent: ProgressBarCell }, | ||
], |
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.
Why there isn't the width
extension as in the prev version?
BREAKING CHANGES:
In order to improve API readability, we extracted the
width
andalign
column properties that the Table and VirtualTable plugins handle into a separate property. Now, thewidth
andalign
properties in the Gridcolumns
are no longer supported. Use a TableColumnExtension instead:Before:
After: