Skip to content
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

Merged

Conversation

allenwq
Copy link
Member

@allenwq allenwq commented Mar 17, 2017

  • Display errors on toggle
  • Hide EXP fields if the course is gamified

Don't merge yet, pending to add tests

screen shot 2017-03-17 at 4 29 42 pm

errorText: PropTypes.string,
};

export default createComponent(
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

@allenwq allenwq force-pushed the allen/assessment-edit branch 2 times, most recently from e69a866 to a46af11 Compare March 17, 2017 16:18
import mapError from './mapError';

const errorStyle = {
color: 'red',
Copy link
Contributor

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?

Copy link
Member Author

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().
Copy link
Contributor

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();
Copy link
Contributor

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

@allenwq allenwq force-pushed the allen/assessment-edit branch 3 times, most recently from 4aa2b56 to dadc9a6 Compare March 20, 2017 11:16
@allenwq
Copy link
Member Author

allenwq commented Mar 20, 2017

Tests added and updated !

@allenwq allenwq force-pushed the allen/assessment-edit branch 3 times, most recently from 4640f22 to 75e48fa Compare March 21, 2017 02:17
@kxmbrian
Copy link
Contributor

Could we add test for until, similar to enzymejs/enzyme#539 (comment) ?

Other than that, LGTM!

@allenwq
Copy link
Member Author

allenwq commented Mar 21, 2017

@kxmbrian How about I test shallowUntil instead? until is a private method and not supposed to be exported and used. :: operator is a proposal feature and not used by us.

@kxmbrian
Copy link
Contributor

Yeah, test shallowUntil in order to test until!

@allenwq allenwq force-pushed the allen/assessment-edit branch from 75e48fa to 96f22b0 Compare March 21, 2017 11:09
@allenwq
Copy link
Member Author

allenwq commented Mar 21, 2017

@kxmbrian Tests for shallowUntil are added

@allenwq allenwq force-pushed the allen/assessment-edit branch from 96f22b0 to 5069782 Compare March 22, 2017 06:48
@weiqingtoh
Copy link
Member

LGTM - @kxmbrian ?

@kxmbrian kxmbrian force-pushed the allen/assessment-edit branch from 3aba80e to 5069782 Compare March 23, 2017 02:46
@kxmbrian kxmbrian merged commit d529ab2 into Coursemology:master Mar 23, 2017
@allenwq allenwq deleted the allen/assessment-edit branch March 27, 2017 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants