Convert the user detail view to react.

Review Request #9675 — Created Feb. 18, 2018 and submitted

Information

student-sonar
master
2da8f55...

Reviewers

Here's the big one. This change converts the entire user detail view to
react, meaning the only backbone view that's left is the main
application view shell. Because this is the most complex page in the
entire application, it's a somewhat large change, but hopefully nothing
in here is too surprising.

  • Verified that viewing and editing data in all sections of the user
    detail view worked correctly.
  • Switched between a bunch of different users and saw the correct data
    for each of them, even though it's no longer replacing the entire
    view.
Description From Last Updated

Since we're repeating this pattern, we may want to make this into a HOC function MentorRequired(ChildComponent) { const component = …

brenniebrennie
david
brennie
  1. 
      
  2. lib/frontend/application-view.js (Diff revision 2)
     
     
    Show all issues

    Since we're repeating this pattern, we may want to make this into a HOC

    function MentorRequired(ChildComponent) {
        const component = ({isMentor, loggedIn, ...props}) => {
            if (isMentor) {
                return <ChildComponent {...props} />;
            } else {
                return <PermissionDenied loggedIn={loggedIn} />;
            }
        };
        // https://www.npmjs.com/package/react-display-name
        component.displayName = `MentorRequired(${getDisplayName(Component)})`;
    
        return connect(state => { ... })(component);
    }
    

    then we would could export default MentorRequired(UserDetail); etc

    1. I think I'm going to do that in a separate change.

  3. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (a8b91ef)