-
Notifications
You must be signed in to change notification settings - Fork 72
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
[BD-46] fix: correct PropTypes
for DataTable
#2749
[BD-46] fix: correct PropTypes
for DataTable
#2749
Conversation
Thanks for the pull request, @monteri! When this pull request is ready, tag your edX technical lead. |
✅ Deploy Preview for paragon-openedx ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2749 +/- ##
=======================================
Coverage 92.82% 92.83%
=======================================
Files 235 235
Lines 4237 4240 +3
Branches 1029 1029
=======================================
+ Hits 3933 3936 +3
Misses 300 300
Partials 4 4 ☔ View full report in Codecov by Sentry. |
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.
Looks good, just one clarifying question!
src/DataTable/TableFilters.jsx
Outdated
canFilter: PropTypes.bool, | ||
render: PropTypes.func.isRequired, | ||
})).isRequired, | ||
manualFilters: PropTypes.bool, | ||
onFilter: PropTypes.func, | ||
onFilter: PropTypes.elementType, |
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.
[clarification] Should onFilter
be an elementType
or remain as a function?
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.
Yes, I missed that it is onFilter
and not Filter
that in the index.jsx
. Thank you!
@monteri 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
🎉 This PR is included in version 21.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 22.0.0-alpha.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Checked whole
DataTable
component for suitablepropTypes
. Most of the focus was forCell
andoneOfType(PropTypes.func, PropTypes.element)
. I have validated that properPropType
isoneOfType(PropTypes.node, PropTypes.elementType)
so that it would cover all cases:({ row }) => <div>hello</div>
(function) -elementType
Component
-elementType
<div>hello</div>
(element) -node
string/number/bool/undefined/null
-node
node
node
Deploy Preview
https://deploy-preview-2749--paragon-openedx.netlify.app/components/datatable/
Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist