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

Fix import screen toggles #668

Merged
merged 8 commits into from
Feb 8, 2018
Merged

Fix import screen toggles #668

merged 8 commits into from
Feb 8, 2018

Conversation

haraldox
Copy link
Contributor

@haraldox haraldox commented Feb 8, 2018

Description

import screen toggles did not work because of missing nested fields: property in form instance of mobx-react-form. also removed prepareForm() and moved form definition to componentWillMount()

Motivation and Context

user should be able to select which services to import

How Has This Been Tested?

manually during signup and using route #auth/signup/import

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project (run $ yarn lint).

- fix toggle double click event (nested `fields` property)
- do not call `prepareForm` for every render but only on init (otherwise all toggles reset to `default: true`
moved form definition to `componentWillMount`
@haraldox haraldox requested a review from adlk February 8, 2018 09:08
@haraldox haraldox changed the base branch from master to develop February 8, 2018 09:23
default: true,
options: s,
import: [...this.props.services.filter(s => s.recipe).map(s => ({
fields: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that did the trick :)

@@ -74,7 +74,6 @@ export default class Import extends Component {
}

render() {
this.form = this.prepareForm();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would otherwise reset toggles to true on submit

Copy link
Contributor

@adlk adlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 great, thanks for taking care of this!

@adlk adlk merged commit 1220e2c into develop Feb 8, 2018
@adlk adlk deleted the fix/import-screen-toggles branch February 8, 2018 19:34
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.

2 participants