Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

[1572] Convert User Profile to React #1579

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

esoterik
Copy link
Collaborator

@esoterik esoterik commented Jun 8, 2016

Resolves #1572.

This isn't 100% ready, but I think it's at a good point for someone else to look this over. Currently the "basic" (excluding login info, role, requirements, etc) user attributes are editable from the show with no reload!

Running npm i should install all of the required npm packages; run foreman start -f Procfile.dev instead of rails server.

Tests currently fail on Travis (see this discussion that I just found); I'm looking into fixing it.

I'm planning on converting the whole page except for the reservation history to JS in this issue. I'm not sure what should be done about the other user attributes--should they be left on a separate page because they're more sensitive? I'm not sure how to require a password for changes, either, but these are pretty basic ones so I figured that losing the password requirement isn't a big deal.

I'm also not super sure of how the JS is organized. I think I like the organization by resource better than the typical JS organization of organizing by file type (reducer/component/container/etc), and there's not really a community standard.

I've also enabled ESLint in Hound on this branch; I'm expecting lots of comments. Nevermind, it seems like it uses the config on master regardless, I've moved the config to #1577.

Edit
I've also only tested this in Firefox v46.0.1; I'm going to start testing in Chromium as well

@esoterik
Copy link
Collaborator Author

esoterik commented Jun 9, 2016

Okay, the reservation counts on the profile have been moved to react!

@esoterik
Copy link
Collaborator Author

esoterik commented Jun 13, 2016

Todo:

  • Install/configure ESLint
  • Refactor and use action creators
  • Fix Travis
  • Make sure reducer actions are named in a way that won't cause conflicts later
  • Figure out the best way to write tests before I create a monolith

return {
user: state.user,
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this and all functions like this can be simplified:

const mapStateToProps = (state) => ({
    user: state.user,
});

@esoterik
Copy link
Collaborator Author

also, note that with how the webpack server runs, we lose access to pry; I'm not sure how to fix that quite yet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert user profile to react.js
2 participants