-
Notifications
You must be signed in to change notification settings - Fork 4k
simplify props of cloud-manager-hoc #5198
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
simplify props of cloud-manager-hoc #5198
Conversation
rschamp
left a comment
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.
I think adding CloudManager.defaultProps is a good idea. However I think we should leave canSave as .isRequired, since previously we had decided to try to keep as many things as required as possible, unless they are explicitly not required. The strictness helps things from being overlooked as props change.
b1d4a7d to
9e8aaa5
Compare
Take a look now. I added |
src/lib/cloud-manager-hoc.jsx
Outdated
| } | ||
|
|
||
| CloudManager.propTypes = { | ||
| canSave: PropTypes.bool.isRequired, |
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.
Also confused why this is a prop for CloudManager, even though you haven't touched that.
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.
I don't know what you mean about having touched that. For why canSave is a prop here, see my comment above, at #5198 (comment)
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.
By "you haven't touched that", I was just acknowledging that this line isn't necessarily in scope for this PR since it's unchanged.
rschamp
left a comment
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.
While I see why it is the way it is, the way canSave is used is counterintuitive to me. I think it would be more understandable if shouldNotModifyCloudData was a prop for CloudManagerHOC.
src/lib/cloud-manager-hoc.jsx
Outdated
| } | ||
|
|
||
| CloudManager.propTypes = { | ||
| canSave: PropTypes.bool.isRequired, |
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.
By "you haven't touched that", I was just acknowledging that this line isn't necessarily in scope for this PR since it's unchanged.
|
Next steps:
|
f97e7c3 to
312c4ff
Compare
|
|
||
| CloudManager.propTypes = { | ||
| canSave: PropTypes.bool.isRequired, | ||
| canModifyCloudData: PropTypes.bool.isRequired, |
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.
note that I switched the boolean value of shouldNotModifyCloudData canModifyCloudData.
There's potential confusion with hasCloudPermission, which in www is set to isScratcher; I have ideas for further simplification here, but I think we should take it one step at a time.
1cdff8d to
a23dd3e
Compare
Proposed Changes
shouldNotModifyCloudDatafunction and replaces it with propcanModifyCloudData(with opposite boolean value)