Skip to content

#322 implement create account page#402

Merged
alex-anakin merged 8 commits intodevelopmentfrom
#322-implement-create-account-page
Nov 17, 2020
Merged

#322 implement create account page#402
alex-anakin merged 8 commits intodevelopmentfrom
#322-implement-create-account-page

Conversation

@ChrxsCrxss
Copy link
Contributor

Fixes #322.

Copy link
Member

@OlgaBilogurova OlgaBilogurova left a comment

Choose a reason for hiding this comment

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

Hey @ChrxsCrxss ,

Please, pull changes from development branch and resolve conflicts by:

  • applying changes from development branch for components/common/button/button.js
  • applying your changes + changes from development branch for routes/index.js

Because tasks #386 and #322 have pretty similar functionality. It will be great to reuse code, utils, and service from merged PR #401.

Please, reuse:

  • utils/validation.js to validate email
  • services/user.service.js to fetch data from API
  • existing components <Title /> , <Button />, <Input />, <ErrorMessage />

Also, please rename the component name on CreateAccount, and path on /create-account. Because in MVP (v0.4) Requirements this page name's Create Account.

Please, let me know if you have any questions. And after applying these changes I'll provide a full code review.

@OlgaBilogurova OlgaBilogurova self-assigned this Nov 10, 2020
@ChrxsCrxss
Copy link
Contributor Author

Hey @OlgaBilogurova ,

I have completed everything above. However, there is an issue. When I use services/user.service.js to fetch data from API, I get a 401 error response even though the custom request header is included in the request. I checked the network request headers, and it shows x-customrequired-header as undefined. This is the case for fetches from the login page and createAccount page.

@OlgaBilogurova
Copy link
Member

OlgaBilogurova commented Nov 14, 2020

@ChrxsCrxss , x-customrequired-header exists in user.service.js:

const headers = {
'Content-Type': 'application/json',
'x-customrequired-header': process.env.REACT_APP_CUSTOM_REQUEST_HEADER,
};

Please, update your .env variables and make sure that you have file src/setupProxy.js.
Everything works for me.
Please, push your changes I'll take a look at the code.

@OlgaBilogurova
Copy link
Member

@ChrxsCrxss ,
I pulled your changes, installed npm modules with yarn install, and added env. vars.
Then I run client-mvp-04 and everything works for me.

I'm able to fetch data from API for Login and CreateAccount pages.

I just removed a line:
props.dispatch(setUser(userData));
because you don't need to store data. But even with dispatch, I got data from API with the error at the end.

https://drive.google.com/file/d/1O2Jk8UhHUdeyQJr7VCL61IwvTRv0UWZf/view?usp=sharing

Please, double-check .env (for backend, client, client-mvp-04) and reinstall npm modules (for root, backend, client, client-mvp-04). If it still doesn't work, let's set up a meeting on Monday.

Copy link
Member

@OlgaBilogurova OlgaBilogurova left a comment

Choose a reason for hiding this comment

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

@ChrxsCrxss , please, resolve my comments or response if you have another opinion.

Also, it would be great to cover CreateAccountContainer functionality with tests. You can create a separate task for this.

Please, use prettier locally during development. It helps to automate the cleanup, spacing of code, typos, empty line at the end of the file, and all code formatting.

@OlgaBilogurova
Copy link
Member

@alex-anakin merge, please.

@alex-anakin alex-anakin merged commit 226ad8b into development Nov 17, 2020
@akibrhast akibrhast deleted the #322-implement-create-account-page branch May 9, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement "Create account" page

3 participants