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

Master React, Quick Code tutorial. Part 8 #9

Open
4 of 7 tasks
atherdon opened this issue Jun 12, 2018 · 29 comments
Open
4 of 7 tasks

Master React, Quick Code tutorial. Part 8 #9

atherdon opened this issue Jun 12, 2018 · 29 comments
Assignees

Comments

@atherdon
Copy link
Member

atherdon commented Jun 12, 2018

https://medium.com/quick-code/lets-learn-react-chapter-8-react-forms-f3137a5c07c7

Expected result

  • Read this tutorial chapter
  • follow code steps
  • move your code to this repository(at least one commit per day)
  • explain to me, what did you learn from it in a few sentences(not less than 5)
  • pass the test section
  • after reviewing your progress and closing this issue - you can move to the next chapter.

Test

  • right now form looks very simple.
    And usually Meal form have more fields. So let's add them.

By using this database schema: https://github.com/ChickenKyiv/recipe-api-only/blob/master/Recipe-ChickenKyiv-Release%231%20Schema%20%20%20SqlDBM.png
We'll advance this form. I'm pretty sure that when you'll add all fields in this form, you'll realize that it's better to create a sub-components for each form field.
So, Meal is a similar Model to Recipe.
so we'll add all important things to that form.

  • Each recipe has attributes: diets, allergies, etc. - text field for each one
  • Each recipe has a weekday field(like today i have chicken, tomorrow i'll eat soup) - i assume it'll be checkbox.
  • Nutritions is a sub-array with a few fields() - text fields
  • Ingredients is a sub-array with a few ingredients inside(like chichen brests, salt, pepper, etc.) Let's have 4 ingredients per meal.

And, make it works :) this is when a real ES6 is coming into the scene.
and don't forget that each field will also have an id field(later it can be useful, when you'll grab data from database)

#1

@atherdon
Copy link
Member Author

For me personally, this is a most important chapter of this course, because it really starting to intersect with our main project...

@atherdon
Copy link
Member Author

Btw, i think knowledge, that you gain in graphQL part about database schemes that we have will help you a bit here.

@sanchit94
Copy link
Collaborator

@atherdon Link to database schema has expired.

@atherdon
Copy link
Member Author

Yeah, I've made big changes at the documentation, since i post this task.
Please take a look here: https://chickenkyiv.gitbook.io/documentation/database-schemes/chickenkyiv-schema

@sanchit94
Copy link
Collaborator

Thanks @atherdon But what do you think about #8?

@atherdon
Copy link
Member Author

replied, thank you for helping me. a bit overwhelmed right now and can miss something

@sanchit94
Copy link
Collaborator

Hehe... I can understand as you have a lot of things to manage yourself.

@atherdon
Copy link
Member Author

xxx

@sanchit94
Copy link
Collaborator

sanchit94 commented Jul 15, 2018

@atherdon Something wrong with the link you gave. It's not showing the image. Yesterday it was showing. Please check, or is this glitch just in my system?
image

@atherdon
Copy link
Member Author

No it's me :) i'm always trying to rearrange and update things. I just moved pictures into separated folder :)

@atherdon
Copy link
Member Author

fixed

@sanchit94
Copy link
Collaborator

Okay what do you suggest we stick to modals, or create a new page for adding meals? I feel just one modal is too much data at one place so it can be something like a wizard. Please suggest @atherdon

@atherdon
Copy link
Member Author

i'm ok with modals, but separated page is more what i'll adore. main idea is to re-use your code later, so you like building a set of components that we'll export and then import as separated module into other projects

@sanchit94
Copy link
Collaborator

Alright! I too like the idea of creating a separate page for now and having modularised code because later we can do whatever we want with it! :)

@atherdon
Copy link
Member Author

yeah - that's a plan. Btw, feel free if you have questions - maybe i can help you with this chapter

@sanchit94
Copy link
Collaborator

Well, I had a gazillion questions when I first looked at this, so my plan is -> Write code and push it -> Then we can make specific changes, and any of my question can be better addressed!

@atherdon
Copy link
Member Author

atherdon commented Jul 17, 2018 via email

@sanchit94
Copy link
Collaborator

Just this question is coming to my mind, in Ingredients.js, I declare multiVal in the starting to capture data for the state variable multivalue and transfer it to parent MealPlan.js using multiVal variable. Is there a better way to do this, I used this approach just to make it work and it is 0% elegant. I cannot do event.target.value in handleIngredients() because that won't work.

@atherdon
Copy link
Member Author

atherdon commented Jul 17, 2018 via email

@sanchit94
Copy link
Collaborator

Yes exactly!

@atherdon
Copy link
Member Author

atherdon commented Jul 17, 2018 via email

@sanchit94
Copy link
Collaborator

Great, so I won't worry about this for now and focus on this issue!! Thanks :)

@atherdon
Copy link
Member Author

atherdon commented Jul 17, 2018 via email

@sanchit94
Copy link
Collaborator

Sure, please provide me a link to that @atherdon

@atherdon
Copy link
Member Author

atherdon commented Jul 18, 2018 via email

@sanchit94
Copy link
Collaborator

Looks pretty cool. So when do you suggest we include this in our project?

@atherdon
Copy link
Member Author

atherdon commented Jul 18, 2018 via email

@sanchit94
Copy link
Collaborator

Well, currently I'm working on adding all the additional fields according on the database schema on the meal and that is almost done. I'll push it and once that is finalised somehow then I'll use this to create form for Recipy!

@atherdon
Copy link
Member Author

atherdon commented Jul 18, 2018 via email

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

No branches or pull requests

2 participants