Commit Graph

63 Commits

Author SHA1 Message Date
Adam Butterworth
a3fd3ec5f8 Adding i18n 2019-03-01 14:17:53 -05:00
Adam Butterworth
a03a063179 Add languageProficiencies 2019-03-01 14:17:53 -05:00
Adam Butterworth
2064141e63 Combine Visibility Display and Select. i18n for both 2019-03-01 13:10:11 -05:00
Adam Butterworth
8063c0453d Clean up message ids 2019-03-01 13:10:11 -05:00
Adam Butterworth
e7da0132c5 Flip buttons and put visibility on new line 2019-03-01 13:10:11 -05:00
Adam Butterworth
f5c440c93b Add account settings url to age message. 2019-02-28 17:09:58 -05:00
Adam Butterworth
6f4753b7db Add "member since 2017" (#44)
* Add date joined

* Create a Date object to get the year

* Add date joined

* Create a Date object to get the year

* add i18n

* Update 18n key
2019-02-28 16:08:09 -05:00
albemarle
30f158d109 i18n all the things (#41) 2019-02-28 10:53:39 -05:00
Adam Butterworth
a4534551e9 yearOfBirth and requiresParentalConsent were missing from redux state. Adding to the clientServer key map 2019-02-28 10:00:12 -05:00
Adam Butterworth
41339d8d6e Collapse redux log groups in the console 2019-02-28 09:59:58 -05:00
David Joy
baf6e83f73 Re-re-rewire data/form state up to redux (#40)
This PR rewires how our forms get their data. It also folds in changes from #35 because @abutterworth and I had a pretty hefty conflict between our two branches.

This turned into a broader effort than I intended, admittedly.

The original goal was to take our form state out of component state and put it into redux state for all six forms on the profile page. This has been done, but doing so begged a bit of broader refactoring and renaming as well.

In no particular order:

1. We were referring to our forms as fields - that language has been fixed.  They're forms now.
2. We were putting 'draft' form values in component state - that state has been moved up to the redux level.
3. The fetchProfile action is now responsible for making several underlying calls to the system for the profile's account information, preferences (if it's your own account), and certificates.  Before, we had multiple actions responsible for each part, and coordination was hard.
4. `react-router-redux` has been replaced with `connected-react-router`.  This is admittedly not something that ultimately needed to be in this PR - I _thought_ I was going to need it, but after the work was done, the need for the change fell out and it's essentially unrelated.  That said, `react-router-redux` is deprecated and no longer supported, and `connected-react-router` has taken its place.  I didn't see any reason to throw away the work, so here it is.
5. I updated some packages as part of number 4 above which didn't strictly need to be updated.  I _thought_ I needed to update them w/r/t changing the router, but I didn't.  As above, didn't see any reason to throw away the work, though.
6. Introduced `reselect` to handle derived state.  This helps keep components clean.
7. Directly connected the forms to the store.  This makes ProfilePage.jsx a lot cleaner.
8. The ProfilePage.jsx file still manages calling action creators to put stuff in redux - the forms are connected for their data, but are otherwise "dumb" about how the data gets back into redux.  It felt weird, for instance, to have the Name.jsx component call an action creator called `saveProfile`... just seemed above its pay grade.  Admittedly this is a bit asymmetrical, but it allowed ProfilePage.jsx to be a lot shorter/have less responsibility for passing data down.
2019-02-27 16:23:41 -05:00
Adam Butterworth
3a0564e8a8 Add age message 2019-02-27 15:16:14 -05:00
Adam Butterworth
0c95e46741 Avatar no longer squishes on mobile 2019-02-27 15:16:14 -05:00
Adam Butterworth
6a03a056d0 Fix fetching profile data call after saving a photo 2019-02-27 15:16:14 -05:00
David Joy
0e1a3356aa First pass - realigning/simplifying/refactoring (#33)
Realigning and simplifying directories and naming.

- Combining “containers” into “components”.
- Flattening out “data” into “reducers” and “config” to consolidate configuration-like files in one place and to make reducers a peer of its teammates (components, actions, sagas, and services).
- Creating dev/prod-specific redux configurations.
- Converting “index.jsx” files into files named for their contents.
- Splitting up the top-level “index.jsx” file into an entry point and an “App” component.
- Renaming SCSS file to “index.scss” to keep it consistent with where it’s imported.
- Renaming/simplifying some variables.
2019-02-25 15:36:24 -05:00
Adam Butterworth
6e41a0a928 Adding button type attribute to button 2019-02-25 10:27:37 -05:00
Adam Butterworth
984e5c6730 Update empty states to match UX recommendation 2019-02-25 10:27:37 -05:00
Adam Butterworth
9cb663991d Change name of a prop 2019-02-25 10:27:20 -05:00
Adam Butterworth
50d0a4edba delete extra space 2019-02-25 10:27:20 -05:00
Adam Butterworth
0b8aaae9a4 further 2019-02-25 10:27:20 -05:00
Adam Butterworth
2598934db9 wip 2019-02-25 10:27:20 -05:00
Adam Butterworth
ff756bd4ec Comment out certificate data 2019-02-22 15:09:34 -05:00
Adam Butterworth
0e6883b5c9 Add certificates to initial state so visibility can save
It currently fails to save, likely because it's an invalid key
2019-02-22 15:09:34 -05:00
Adam Butterworth
16ebda0761 Add course certificates stub 2019-02-22 15:09:34 -05:00
Adam Butterworth
dd0da80cb8 Set height to null after enter finish
Since we've added the ability for transition replace to have no content, we can't guarantee an onChildExited event will fire resetting the hieght to null
2019-02-22 14:35:00 -05:00
Adam Butterworth
cbf9c99585 Provide saved preferences data in Promise resolve rather than in Saga 2019-02-21 16:21:27 -05:00
Adam Butterworth
85d3ae2ff1 Merge save states of profile and preferences 2019-02-21 16:21:27 -05:00
Adam Butterworth
76967c540a Save only non-null values 2019-02-21 16:21:27 -05:00
David Joy
c417a331d5 Properly display fields on other users profiles.
If a field isn’t present in another users profile (they either haven’t set it, or it’s not publicly visible), then hide it.  If the field is present, then show it in a static way.
2019-02-21 14:09:47 -05:00
Adam Butterworth
2efdc78ace Import only lodash set and defaults deep 2019-02-21 13:55:03 -05:00
Adam Butterworth
a3b7999627 Break out utils functions and move preferences api calls to profileapiservice 2019-02-21 13:55:03 -05:00
Adam Butterworth
64c8a78c65 Simplify unflattening 2019-02-21 13:55:03 -05:00
Adam Butterworth
54998166e3 Update test to pass 2019-02-21 13:55:03 -05:00
Adam Butterworth
a0e78d1f8b Minor edit to onSave method 2019-02-21 13:55:03 -05:00
Adam Butterworth
b7764236ce Implement saving 2019-02-21 13:55:03 -05:00
Adam Butterworth
3ce48b7cff Fix linting 2019-02-21 13:55:03 -05:00
Adam Butterworth
5deff373ed Pull data down to UI 2019-02-21 13:55:03 -05:00
Adam Butterworth
5fe9494189 Fetching and saving preferences working 2019-02-21 13:55:03 -05:00
Adam Butterworth
9585e0a1ef Add get request 2019-02-21 13:55:03 -05:00
David Joy
c46d8506e4 Viewing others profiles and naming refactor.
This PR has a refactoring of our actions/sagas/services.  Rather than continue to put profile-related API actions into the frontend-auth project, we decided (against prior decision) to put them in this app, as that feels more correct, long term.  This also let us unroll the service creation and decouple the services from the components.

The “fetchProfile” API is hitting the same ‘accounts’ API as fetchUserAccount from frontend-auth.  This is an intentional abstraction for clarity of purpose and assuming they may diverge. It also lets us group all the profile app’s API methods together, letting the ‘session’ API stay in frontend-auth.

We also decided to do some renaming:
- “user profile” -> “profile” cause there’s no other type of profile here.
- The saga handlers are prefixed with “handle”
- The API methods use proper HTTP verbs.
- The actions keep fetch and save as verbs as they’re clearer in components than “get” and “patch”
- The goal here is to differentiate different parts of the code, making it easier to remember where you are.
2019-02-20 14:09:14 -05:00
Adam Butterworth
e7ffc6fe0c Add saving of profile photo (#19)
* Add saving of profile photo

* Add removal of profile photo

Needs work on knowing when a default photo has been supplied.

* Add action creator tests

* Fix some reference issues after merge

* Fix broken test
2019-02-20 11:44:47 -05:00
Adam Butterworth
f1b6af4975 Commit package-lock 2019-02-15 16:36:22 -05:00
Adam Butterworth
f359cee2a4 Add icons to social links 2019-02-15 16:36:22 -05:00
Adam Butterworth
e48e4a71c3 Fix call to save user profile to have proper fieldName 2019-02-15 16:36:22 -05:00
albemarle
12db5859bf set up i18n 2019-02-15 15:34:18 -05:00
Adam Butterworth
103d05a4fe Break sections out into files 2019-02-15 14:29:34 -05:00
Adam Butterworth
1f1ecef6fc Remove unneeded Boolean cast 2019-02-15 14:29:34 -05:00
Adam Butterworth
aaf1c5f1ea Add empty state cases for each section. Update SwitchContent to handle forwarding of cases. 2019-02-15 14:29:34 -05:00
David Joy
174d8de17d Is getting codecov to work as easy as this? 2019-02-15 13:47:25 -05:00
David Joy
9149451941 Updating test setup for mapDataForRequest
… to match what socialLinks really looks like.
2019-02-15 13:45:16 -05:00