-
Notifications
You must be signed in to change notification settings - Fork 78
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
Assessment edit page fixes #2163
Assessment edit page fixes #2163
Conversation
errorText: PropTypes.string, | ||
}; | ||
|
||
export default createComponent( |
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 some basic documentation for this?
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.
You mean document the create component or ? it was imported from another file. I will add some comments to the second argument.
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 added some detailed documentations to createComponent
: https://github.com/Coursemology/coursemology2/pull/2163/files#diff-11a9ab91f987979d52cac0660ae4b0d5R7
Hope this helps for understanding.
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.
Ah ok - I meant the documentation for the toggle component, like how to use it and what props to pass in. But maybe there is no need to since it seems quite straightforward, what do you think?
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.
Hmm, I think it's unnecessary because the usage is exactly same as the original material UI component, you can find an example here.
The code here is for integrating with redux-form, so it can be put in Field
.
e69a866
to
a46af11
Compare
import mapError from './mapError'; | ||
|
||
const errorStyle = { | ||
color: 'red', |
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.
For consistency, maybe we can import and use red500 from http://www.material-ui.com/#/customization/colors?
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.
OK !
}, | ||
...props | ||
}) => ({ | ||
// Take our the required fields and send the rest of the props to mapError(). |
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.
Take our out
context: { intl }, | ||
childContextTypes: { intl: intlShape }, | ||
} | ||
).first().shallow(); |
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.
As discussed, we should .shallow()
again and test one level deeper
4aa2b56
to
dadc9a6
Compare
Tests added and updated ! |
4640f22
to
75e48fa
Compare
Could we add test for Other than that, LGTM! |
@kxmbrian How about I test |
Yeah, test |
75e48fa
to
96f22b0
Compare
@kxmbrian Tests for |
96f22b0
to
5069782
Compare
LGTM - @kxmbrian ? |
3aba80e
to
5069782
Compare
Don't merge yet, pending to add tests