-
Notifications
You must be signed in to change notification settings - Fork 103
fix(AnalyticalTable): Each column can have groupable, sortable, filte… #264
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
Conversation
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.
Hi @iamuan,
thanks for submitting this PR, great idea to add this feature on column level!
Could you please update the code to use the NullishCoalesingOperator
instead of the 'manual' undefined check? This would increase the readability in my opinion.
Thanks!
Hi, @MarcusNotheis. As we know, the "undefined" usually means the property or argument is not provided by the caller. So I thought it's better that if the property is not provided at column level, then the property at table level should be considered. For increasing readability, how about add getProvidedArgument function like below. function getProvidedArgument(...args){
return args.reduce((result,arg)=>{
if(arg !== undefined && result !== undefined){
result = arg;
}
return result;
},undefined)
}
groupable={getProvidedArgument(column.groupable, props.groupable)}
sortable={getProvidedArgument(column.sortable, props.sortable)} |
Hi @iamuan ,
So it is basically the same as the function you proposed, but JS-native and handling |
Hi, @MarcusNotheis . I think the "undefined" and "null" have different meanings. But also It's up to your choice, I would follow that. Thanks. |
Hi @iamuan , I see your point, but I would still go for the |
Co-Authored-By: Marcus Notheis <[email protected]>
Co-Authored-By: Marcus Notheis <[email protected]>
Co-Authored-By: Marcus Notheis <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
======================================
Coverage 73.9% 73.9%
======================================
Files 161 161
Lines 3533 3533
Branches 613 613
======================================
Hits 2611 2611
Misses 720 720
Partials 202 202
Continue to review full report at Codecov.
|
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.
LGTM. Thank you for your contribution!
fix(AnalyticalTable): Each column can have groupable, sortable, filterable options