-
Notifications
You must be signed in to change notification settings - Fork 0
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
WP-66: refactor data files components 2 #885
Conversation
Codecov Report
@@ Coverage Diff @@
## main #885 +/- ##
=======================================
Coverage 63.44% 63.44%
=======================================
Files 427 427
Lines 12215 12215
Branches 2510 2510
=======================================
Hits 7750 7750
Misses 4259 4259
Partials 206 206
Flags with carried forward coverage won't be shown. Click here to find out 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.
LGTM 👍
I've spent a little time to see if we can catch this in linting or unit testing. I looked over https://github.com/jsx-eslint/eslint-plugin-react but can't find any rule that matches this scenario (i.e. using a prop that doesn't exist). sounds like there is no rule due to the use case where a React component might want to forward extra props to child components.
My only other comment to consider, before mering, is marking the property projectId
from https://github.com/TACC/Core-Portal/pull/876/files#r1350565668 isRequired
(and thanks for catching that the property was missing 💯 ).
Out of scope for here (and it wouldn't have caught systemId/systemAndHomeDirId), but it feels like we should configure eslintrc to be more strict on props, like:
|
Thank you!! Added the PropType I went into the rabbit hole to see if there was a library we could use with Jest. It might be possible with Enzyme and a complex test to catch if a component is using a prop that is undefined (doesn't exist, like systemId in this case, after being renamed to systemAndHomeDirId). Not sure if this will be efficient, however. |
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, toolbar functions and input selector working!
Overview
Updated
systemId
prop tosystemAndHomeDirId
in all of the the DataFiles components where it is used to make the prop more descriptive.Related
Changes
DataFilesSelectModal.jsx
andDataFilesCopyModal.jsx
Testing
UI
No visible UI change
Notes
Previous PR was #876. In this PR, updated prop names to two more files.