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

Initial front-end setup and user authentication flows #3

Merged
merged 57 commits into from
Jan 28, 2016

Conversation

oliverroick
Copy link
Member

Do not merge yet, using this for review and discussions.

This is a huge PR that adds a front-end to Cadasta platform.

It introduces:

Open issues that will be addressed be merging:

  • The HTTP implemention does not handle network errors.
  • Djoser's implementation to update user profiles neither validates duplicate email addresses nor updates usernames. There is a separate endpoint to update the user name. I would suggest to integrate that into PUT /account/me/, otherwise we end up having two requests to update a user profile.
  • Implement "remember me" when logging in, token should be stored in SessionStorage when unticked.
  • Refactoring. Several components need refactoring to prepare for when the front-end gets more complex.
    • Reducer should be more modular. Each module should be responsible for updating only one aspect of the store.
    • Router should be more modular. Each module should be responsible for one part of the app.
  • Change email text for account verification, etc.
  • Replace model instantiation in tests with factories (use FactoryBoy)
  • Add front-end tests to Travis
  • Document steps to install and run front-end parts
  • Document how to use wrappers and Mixin (HTTP requests, DismissMessageMixin for now)

oliverroick and others added 30 commits December 7, 2015 15:43
Extends djoser functionality to implement custom functionality for
email verification
Redirects to login page when user accesses a page that requires login.
Redirects to dashboard, when user is logged in and access landing page
Removes boilerplate code from actions by wrapping fetch API calls into
request library
Refactored the registration form into a dedicated component that is
imported in both the landing page and the registration page
It wraps XMLHttpRequest in a Promise. The Promise is resolved upon
successful requests (HTTP code 200 - 299) and rejected otherwise.

Use:

```
return Request.get('/')
  .then(
    (success => handleSuccess(success),
    (error => handleError(error))
  )
```
Removing redirects from actions improves action testability and
separation of concerns
@ian-ross
Copy link
Contributor

@oliverroick Should we just merge this now? You've ticked all the tickboxes!

@oliverroick
Copy link
Member Author

@ian-ross I wanted to fix the imports before merging. We're importing the complete libraries at the moment, which results in massive bundles. I'm going to change it so we import what we actually need.

@ian-ross
Copy link
Contributor

@oliverroick OK! That makes sense. I just had a feeling that I ought to have merged this, since you'd done so much work on it. We'll merge it as soon as you're happy with it though.

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