From b23709676f8b98e39170a21c6cc3ee8ca84eceab Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Wed, 23 Aug 2017 20:22:23 -0400 Subject: [PATCH 001/105] Delete example .env file --- .env.example | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 56b7539..0000000 --- a/.env.example +++ /dev/null @@ -1,8 +0,0 @@ -// GitHub credentials -CLIENT_ID=... -CLIENT_SECRET=... -// neo4j credentials -NEO4J_USERNAME=... -NEO4J_PASSWORD=... -// OAuth callback URL -CALLBACK_URL=... \ No newline at end of file From 869d23aa50c128f831530e272ac82b531d8847d2 Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Thu, 24 Aug 2017 20:24:59 -0400 Subject: [PATCH 002/105] Create mypartners component and render when drawer button is clicked --- client/components/App.jsx | 3 ++ client/components/AppDrawer.jsx | 4 ++- client/components/MyPartners.jsx | 59 ++++++++++++++++++++++++++++++++ client/store/index.js | 7 +++- client/store/reducers.js | 3 ++ 5 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 client/components/MyPartners.jsx diff --git a/client/components/App.jsx b/client/components/App.jsx index 218d479..af5f06b 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -33,6 +33,7 @@ import ProjectList from './ProjectList'; import Questionnaire from './Questionnaire'; import NotFound from './NotFound'; import MyProjects from './MyProjects'; +import MyPartners from './MyPartners'; class App extends React.Component { constructor(props) { @@ -125,6 +126,7 @@ class App extends React.Component { + {/* given this path render this component and pass down the loggedIn state as user props @@ -133,6 +135,7 @@ class App extends React.Component { render={() => () } /> + diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 38056ac..457fdc2 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -34,7 +34,9 @@ function AppDrawer(props) {
}/> - + + +
diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx new file mode 100644 index 0000000..ced69b5 --- /dev/null +++ b/client/components/MyPartners.jsx @@ -0,0 +1,59 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import { connect } from 'react-redux'; +import Paper from 'material-ui/Paper'; +import { + Table, + TableBody, + TableHeader, + TableHeaderColumn, + TableRow, + TableRowColumn, +} from 'material-ui/Table'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; +import {Card, CardText } from 'material-ui/Card'; + +const MyPartners = (props) => { + return ( + + + + + + + + + + + Name + Language + Experience + + + + {props.users.map(user => + ( + { user.name } + { user.language } + { user.experience } + ) + )} + +
+
+
+ ); +}; + +const mapStateToProps = (state) => { + return { + users: state.users.filter(user => user.paired.length > 0) + }; +}; + + +export default connect(mapStateToProps)(MyPartners); diff --git a/client/store/index.js b/client/store/index.js index 278725f..ce277f3 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -4,6 +4,11 @@ import reducer from './reducers'; /* grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. */ -const store = createStore(reducer); +const store = createStore( + reducer, /* preloadedState, */ + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +); + +console.log('this is the store', store) export default store; diff --git a/client/store/reducers.js b/client/store/reducers.js index 58913bd..dcdec34 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -37,6 +37,7 @@ const users = (state, action) => { inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button */ const projects = (state, action) => { + if (state === undefined) { return []; } else if (action.type === 'LIST_PROJECTS') { @@ -56,6 +57,8 @@ const projects = (state, action) => { return project; }); } + console.log('this is the state from projects', state) + return state; }; From 1f512c0c5818fc2987da9865a7d0d3154f659245 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Thu, 24 Aug 2017 16:41:19 -0700 Subject: [PATCH 003/105] Update redux dev tool --- client/store/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/store/index.js b/client/store/index.js index ce277f3..8783c26 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -9,6 +9,5 @@ const store = createStore( window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() ); -console.log('this is the store', store) export default store; From 3e02e4c21d34a455e9ef04bff6952ae103c29787 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Thu, 24 Aug 2017 17:49:48 -0700 Subject: [PATCH 004/105] Update pop up window for user profile --- client/components/UserDetails.jsx | 96 +++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 18 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index e6a3e73..0220020 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -13,6 +13,16 @@ import ActionDone from 'material-ui/svg-icons/action/done'; import ContentSend from 'material-ui/svg-icons/content/send'; import TextField from 'material-ui/TextField'; +/* for Dialog */ +import Dialog from 'material-ui/Dialog'; +import FlatButton from 'material-ui/FlatButton'; +const customContentStyle = { + width: '80%', + maxWidth: 'none', +}; +/* for Dialog */ + + class UserDetails extends React.Component { constructor(props) { @@ -20,6 +30,8 @@ class UserDetails extends React.Component { this.state = { expanded: false, message: '', + //for popUp window + open: false, } this.paired = false; this.expandCard = () => { @@ -27,6 +39,8 @@ class UserDetails extends React.Component { } this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); + this.handleOpen = this.handleOpen.bind(this); + this.handleClose = this.handleClose.bind(this); this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { axios.post('/API/messages', { @@ -56,6 +70,17 @@ class UserDetails extends React.Component { }); } + /* dialog handler*/ + handleOpen() { + console.log("clicked") + this.setState({open: true}); + }; + + handleClose() { + this.setState({open: false}); + }; + /* dialog handler end*/ + pairButton() { if (this.props.user.paired.length > 0) { return , + , + ]; + return ( @@ -96,25 +134,47 @@ class UserDetails extends React.Component { project.project).join(' ')}/>
{ this.pairButton() } - } onClick={this.expandCard} secondary={true} /> -
-
- -
-
- } secondary={true}/> - { this.props.messages.map((message, index) => - - { message.sender ? 'You' : this.props.user.name } - { message.text } - - )} + } onClick={this.handleOpen} secondary={true} />
+ + {/*dialog for message*/} +
+ + + This dialog spans the entire width of the screen. + +
+ {/*dialog for message end*/} + + + {/* should be deleted */} + // { + //
+ // + //
+ //
+ // } secondary={true}/> + // { this.props.messages.map((message, index) => + // + // { message.sender ? 'You' : this.props.user.name } + // { message.text } + // + // )} + //
+ // {/* should be deleted end*/} + } +
); From eef368112db31580e5cb878c85de331eb2719116 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 23 Aug 2017 21:36:05 -0700 Subject: [PATCH 005/105] Add nodemon --inspect to package.json and correct spelling "errors" --- CONTRIBUTING.md | 2 +- package.json | 1 + server/README.md | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3eac9f..0832d55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ Use github’s interface to make a fork of the repo, then add that repo as an upstream remote: ``` -git remote add upstream https://github.com/cranebaes/gitbud.git +git remote add upstream https://github.com/Toucans456/gitpal.git ``` ### Cut a namespaced feature branch from master diff --git a/package.json b/package.json index e3bc35d..edb1d1f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "webpack-dev-server": "webpack-dev-server --progress --hot --inline", "dev": "webpack -w", + "dev2": "nodemon --inspect server.js -i client/ -i dist/", "postInstall": "webpack -p", "start": "nodemon server.js -i client/ -i dist/", "seed": "node server/db/seed.js" diff --git a/server/README.md b/server/README.md index e7bb841..339ef57 100644 --- a/server/README.md +++ b/server/README.md @@ -1,8 +1,8 @@ # GitBud Server Code -> Most server code is clearly modularised and heavily (perhaps excessively) annotated for the benefit of teams wishing to inherit this codebase. On the understanding that comments can become inaccurate over time and that people may want to udnerstand the what module does what before jumping in, we're providing short notes here. -> We prefer each file to fulfill one role so modules with diverse responsibilities (_e.g._ the _routes_ module, which exports request handlers for _/API/_ and _/auth/_ routes) will generally have one file fo each responsibility and a short _index.js_ that draws together exports functionality from the module's distinct files. -> This modularisation was intended to be clear, not perfect. You may wish to reorgniase some code; for instance, the distinction between request-handler and routes is a little confusing and perhaps artificial. +> Most server code is clearly modularized and heavily (perhaps excessively) annotated for the benefit of teams wishing to inherit this codebase. On the understanding that comments can become inaccurate over time and that people may want to understand the what module does what before jumping in, we're providing short notes here. +> We prefer each file to fulfill one role so modules with diverse responsibilities (_e.g._ the _routes_ module, which exports request handlers for _/API/_ and _/auth/_ routes) will generally have one file for each responsibility and a short _index.js_ that draws together exports functionality from the module's distinct files. +> This modularization was intended to be clear, not perfect. You may wish to reorganize some code; for instance, the distinction between request-handler and routes is a little confusing and perhaps artificial. __Note:__ We've aimed to use the names of React components in this documentation, which will hopefully make it easier to cross-reference with the front-end code. Components are marked by JSX style tags (_e.g._ component). ## Table of Contents @@ -39,7 +39,7 @@ This depends heavily on the nature of the request, so we've provided two example #### New user When a new user clicks on _'Sign in with GitHub'_ on the component with which all users are greeted the following things happen: 1. The user is redirected to GitHub's OAuth page and (after successful authorisation) punted back to _/auth/github/callback_. -1. Their _req_ hits _server.js_ and is handed on (with a request and a response object) to the the handler function exported from the _request-handler_ module. +1. Their _req_ hits _server.js_ and is handed on (with a request and a response object) to the handler function exported from the _request-handler_ module. 1. This functions tests in the order above and finds that the user has requested an _/auth/_ route, checks whether or not the object exported by _/server/routes/auth.js/_ has a _github_ function and invokes it with the _req_ and _res_ objects. 1. The _github_ function verifies that this is an OAuth callback and invokes the appropriate middleware exported from the authentication module. 1. This middleware (_exports.callback_) mostly defers to other passport functionality, redirecting back to _/_ on failure and _/projects_ on successful authentication, so at this point the _req_ is handled and _res_ (a redirect) has been sent. From 1981872a3c3c4783f4187e13e66e68bc5082b315 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 24 Aug 2017 15:25:04 -0700 Subject: [PATCH 006/105] Deploy --- .env.example | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6f29248 --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +// GitHub credentials +CLIENT_ID=... +CLIENT_SECRET=... +// neo4j credentials +NEO4J_USERNAME=... +NEO4J_PASSWORD=... +// OAuth callback URL +CALLBACK_URL=... +//bolt credentials +GRAPHENEDB_BOLT_URL=... +GRAPHENEDB_BOLT_USERNAME=... +GRAPHENEDB_BOLT_PASSWORD=... From fc328d7eda7ed0ea928831ff11393ae130aed57a Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 24 Aug 2017 16:44:17 -0700 Subject: [PATCH 007/105] Ready for Heroku deploy --- .env.example | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.env.example b/.env.example index 6f29248..059f4ef 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,3 @@ NEO4J_USERNAME=... NEO4J_PASSWORD=... // OAuth callback URL CALLBACK_URL=... -//bolt credentials -GRAPHENEDB_BOLT_URL=... -GRAPHENEDB_BOLT_USERNAME=... -GRAPHENEDB_BOLT_PASSWORD=... From b7f59d9f0f33d8d56c43a613f2b1a97c428645e6 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 24 Aug 2017 18:03:49 -0700 Subject: [PATCH 008/105] Change "like" to "interested" in ProjectDetails.jsx --- client/components/ProjectDetails.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index e45b381..09277f2 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -71,7 +71,7 @@ class ProjectDetails extends React.Component { - + From 67e408791dae2fcbd0b008453bdb94a2a95d7729 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 24 Aug 2017 19:26:48 -0700 Subject: [PATCH 009/105] Replace GitBud with GitPal --- PRESS_RELEASE.md | 10 +++++----- README.md | 8 ++++---- client/components/App.jsx | 2 +- client/components/AppDrawer.jsx | 2 +- client/components/Landing.jsx | 2 +- client/components/Questionnaire.jsx | 4 ++-- dist/index.html | 2 +- package-lock.json | 2 +- package.json | 8 ++++---- server.js | 6 +++--- server/README.md | 2 +- server/authentication/index.js | 2 +- server/db/seed.js | 8 ++++---- server/profiling/matching.js | 2 +- server/request-handler/index.js | 4 ++-- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/PRESS_RELEASE.md b/PRESS_RELEASE.md index f5cbf36..256e021 100644 --- a/PRESS_RELEASE.md +++ b/PRESS_RELEASE.md @@ -1,8 +1,8 @@ -## Gitbud +## GitPal ### Sub-Heading -> Gitbud is an application that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. +> GitPal is an application that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. ### Summary @@ -18,15 +18,15 @@ ### Quote from You -> "GitBud provides new coders with their first real challenge; pushing them beyond tutorials on syntax and online games like CodeWars. It gets developers' hands dirty with their first real project or experience with with real-world code". +> "GitPal provides new coders with their first real challenge; pushing them beyond tutorials on syntax and online games like CodeWars. It gets developers' hands dirty with their first real project or experience with with real-world code". ### How to Get Started -> Login to Gitbud with your Github account. From there, navigate through the list of projects and select a project that you want to get started on. Inside the project's detail, you can find a list of users who are also interested. Feel free to message them and let them know you want to pair up with them. Once the two of you are paired up, you can begin on the project. +> Login to GitPal with your Github account. From there, navigate through the list of projects and select a project that you want to get started on. Inside the project's detail, you can find a list of users who are also interested. Feel free to message them and let them know you want to pair up with them. Once the two of you are paired up, you can begin on the project. ### Customer Quote -> "Gitbud helped me get started on my first open source project with ease." +> "GitPal helped me get started on my first open source project with ease." ### Closing and Call to Action diff --git a/README.md b/README.md index 43a54fc..50f9a33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# GitBud +# GitPal -> GitBud is an application that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. +> GitPal is an application that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. ## Team @@ -20,7 +20,7 @@ ## Usage -> __Environment Variables__ GitBud has hardcoded a username of 'neo4j' and a password of 'neo' for neo4j. You can change these in the code or override them by setting the appropriate environment variables. You will also need a GitHub Client ID and Client Secret to use the GitHub API. These, too, are set as environment variables. We have used the .env package, which allows environment variables to be set easily with the .env file in the root directory of the project. An example of the necessary variables for GitBud been provided here in this repo. +> __Environment Variables__ GitPal has hardcoded a username of 'neo4j' and a password of 'neo' for neo4j. You can change these in the code or override them by setting the appropriate environment variables. You will also need a GitHub Client ID and Client Secret to use the GitHub API. These, too, are set as environment variables. We have used the .env package, which allows environment variables to be set easily with the .env file in the root directory of the project. An example of the necessary variables for GitPal been provided here in this repo. - Fork and clone the repo - Install dependencies from the root of the repo by running @@ -63,7 +63,7 @@ npm install ### Roadmap -View the project roadmap [here](https://github.com/cranebaes/gitbud/issues) +View the project roadmap [here](https://github.com/cranebaes/GitPal/issues) ## Contributing diff --git a/client/components/App.jsx b/client/components/App.jsx index af5f06b..0574136 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -110,7 +110,7 @@ class App extends React.Component { return (
- }/> + }/> {/* opens and closes side menu */} this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 457fdc2..cc0e96a 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -18,7 +18,7 @@ import DeviceDeveloperMode from 'material-ui/svg-icons/device/developer-mode'; function AppDrawer(props) { return ( - +
diff --git a/client/components/Landing.jsx b/client/components/Landing.jsx index e76ea26..97f825b 100644 --- a/client/components/Landing.jsx +++ b/client/components/Landing.jsx @@ -14,7 +14,7 @@ const style = { function Landing(props) { return ( - + diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index 7997fcb..91017f8 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -53,7 +53,7 @@ class Questionnaire extends React.Component {

Welcome, {this.props.user.name}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam varius quam id quam aliquot, quis varius est euismod.


-

Select your preferred language to use with other GitBud members:

+

Select your preferred language to use with other GitPal members:

this.onLanguageSelect(val)}> @@ -68,7 +68,7 @@ class Questionnaire extends React.Component {
-

Write a short introduction about yourself that other GitBud members can see:

+

Write a short introduction about yourself that other GitPal members can see:

this.onDescriptionChange(val)} />
this.onButtonClick()} /> diff --git a/dist/index.html b/dist/index.html index fd052a5..8af357a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,7 +6,7 @@ - GitBud + GitPal diff --git a/package-lock.json b/package-lock.json index 381b9d4..0fcbe45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "gitbud", + "name": "GitPal", "version": "1.0.0", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index edb1d1f..71f0998 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "gitbud", + "name": "GitPal", "version": "1.0.0", "description": "An application to help programmers begin working on open source projects.", "main": "server.js", @@ -14,14 +14,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/cranebaes/gitbud.git" + "url": "git+https://github.com/Toucans456/GitPal.git" }, "author": "haque-kim-ngo-warner-medley", "license": "ISC", "bugs": { - "url": "https://github.com/cranebaes/gitbud/issues" + "url": "https://github.com/Toucans456/GitPal/issues" }, - "homepage": "https://github.com/cranebaes/gitbud#readme", + "homepage": "https://github.com/Toucans456/GitPal#readme", "devDependencies": { "eslint": "^4.4.1", "eslint-config-airbnb": "^15.1.0", diff --git a/server.js b/server.js index 87eac32..2460360 100644 --- a/server.js +++ b/server.js @@ -1,9 +1,9 @@ /* * ENTRY POINT TO ALL THE SERVER SIDE CODE - * + * * Most of the server code is clearly modularised, so this * is mostly uncontroversial requires and uses. - * + * * The other server modules are: * request-handler * --Sends correct response to each URL (mostly by calling appropriate function from routes) @@ -25,7 +25,7 @@ const path = require('path'); const bodyParser = require('body-parser'); // Libraries for authentication and sessions const session = require('express-session'); -// GitBud modules +// GitPal modules const passport = require('./server/authentication').passport; const requestHandler = require('./server/request-handler'); diff --git a/server/README.md b/server/README.md index 339ef57..4f4581d 100644 --- a/server/README.md +++ b/server/README.md @@ -1,4 +1,4 @@ -# GitBud Server Code +# GitPal Server Code > Most server code is clearly modularized and heavily (perhaps excessively) annotated for the benefit of teams wishing to inherit this codebase. On the understanding that comments can become inaccurate over time and that people may want to understand the what module does what before jumping in, we're providing short notes here. > We prefer each file to fulfill one role so modules with diverse responsibilities (_e.g._ the _routes_ module, which exports request handlers for _/API/_ and _/auth/_ routes) will generally have one file for each responsibility and a short _index.js_ that draws together exports functionality from the module's distinct files. diff --git a/server/authentication/index.js b/server/authentication/index.js index 2e6f7bc..40be308 100644 --- a/server/authentication/index.js +++ b/server/authentication/index.js @@ -1,7 +1,7 @@ // Libraries for authentication const passport = require('passport'); const GitHubStrategy = require('passport-github2').Strategy; -// GitBud modules +// GitPal modules const db = require('../db'); const profiling = require('../profiling'); diff --git a/server/db/seed.js b/server/db/seed.js index d684dfe..4cd64d0 100644 --- a/server/db/seed.js +++ b/server/db/seed.js @@ -41,7 +41,7 @@ function addUsers() { const addProjectsQueryString = ` CREATE - (:Project {project: 'Hello GitBud', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/hello-gitbud', description: "Get familiar with contributing to open source projects by making a first pull request. In this project, you will learn to use CDN and make pull request.", structure: '[{"text":"Need to add jQuery to application","hint":"Hint: Look up what a content delivery network (CDN) is","complete":false},{"text":"Make your first pull request","hint":"Hint: Refer to the README.md in the repository","complete":false}]'}), + (:Project {project: 'Hello GitPal', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/hello-GitPal', description: "Get familiar with contributing to open source projects by making a first pull request. In this project, you will learn to use CDN and make pull request.", structure: '[{"text":"Need to add jQuery to application","hint":"Hint: Look up what a content delivery network (CDN) is","complete":false},{"text":"Make your first pull request","hint":"Hint: Refer to the README.md in the repository","complete":false}]'}), (:Project {project: 'Random Quote Machine', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/random-quote-machine', description: "Learn to work with pre-written code to analyze and debug possible issues. In this project, you will learn to locate and solve minor bugs in an existing codebase.", structure: '[{"text":"Missing jQuery library","hint":"Hint: Remember CDN?","complete":false},{"text":"script.js and styles.css are not being loaded","complete":false},{"text":"Quote Me button is not functioning","hint":"Hint: Which function is invoked on button click?","complete":false},{"text":"Quote Me button is not being stylized correctly","complete":false},{"text":"Typo in title of index.html","complete":false},{"text":"Dummy quote that was used for testing is included","complete":false}, {"text":"Make a pull request","hint":"Hint: Remember to end your files with a newline","complete":false}]'}), (:Project {project: 'Tic Tac Toe', language: 'JavaScript', experience: 'Intermediate', link: 'https://github.com/cranebaes/tic-tac-toe', description: "Start thinking algorithmically as you deal with complicated problems involving multiple large steps. In this project, you will learn to implement logic in a classic paper-and-pencil game.", structure: '[{"text":"script.js and styles.css are not being loaded","complete":false},{"text":"gameboard is not defined","hint":"Hint: Trace back where gameboard is used","complete":false},{"text":"clearBoard does not clear blue player","hint":"Hint: How about red player?","complete":false},{"text":"Implement checkForWin function that takes in moves and outputs a boolean based on game condition","complete":false},{"text":"resetScores does not clear board","hint":"Hint: Which function clears board?","complete":false}]'}), (:Project {project: 'The Grey Marble', language: 'JavaScript', experience: 'Advanced', link: 'https://github.com/francisngo/the_grey_marble', description: "Try your hands at contributing to a real world project made by one of our developers. In this project, you will learn to navigate through a full stack app and help improve the project.", structure: '[{"text":"Webpack environment is not set up for Heroku","complete":false}]'}) @@ -65,11 +65,11 @@ const addInterestedInRelationshipsQueryString = ` MATCH (arya:User) WHERE arya.name = "Arya Stark" MATCH (jon:User) WHERE jon.name = "Jon Snow" MATCH (bran:User) WHERE bran.name = "Bran Stark" - MATCH (helloGitBud:Project) WHERE helloGitBud.project = "Hello GitBud" + MATCH (helloGitPal:Project) WHERE helloGitPal.project = "Hello GitPal" MATCH (randomQuoteMachine:Project) WHERE randomQuoteMachine.project = "Random Quote Machine" CREATE - (robb)-[:INTERESTED_IN]->(helloGitBud), - (arya)-[:INTERESTED_IN]->(helloGitBud), + (robb)-[:INTERESTED_IN]->(helloGitPal), + (arya)-[:INTERESTED_IN]->(helloGitPal), (jon)-[:INTERESTED_IN]->(randomQuoteMachine), (bran)-[:INTERESTED_IN]->(randomQuoteMachine) `; diff --git a/server/profiling/matching.js b/server/profiling/matching.js index d4413a5..2be66a8 100644 --- a/server/profiling/matching.js +++ b/server/profiling/matching.js @@ -24,7 +24,7 @@ const forEach = require('lodash/forEach'); const map = require('lodash/map'); const union = require('lodash/union'); -// GitBud modules +// GitPal modules const db = require('../db'); module.exports = function compareUser(dbSession, ghId) { diff --git a/server/request-handler/index.js b/server/request-handler/index.js index 20be048..cd979f8 100644 --- a/server/request-handler/index.js +++ b/server/request-handler/index.js @@ -12,7 +12,7 @@ * * This order should mean that the quickest or simplest * requests are handled first. - * + * * Many of these functions make db queries. There's more information on these in the * db module, but importantly you will notice that with neo4j, we can extract the various * aliased fields of a response with the .get() method of a record. This is extremely useful @@ -22,7 +22,7 @@ // Node librares const fs = require('fs'); const path = require('path'); -// GitBud module with methods for various endpoints +// GitPal module with methods for various endpoints const routes = require('../routes'); // Cache index.html to serve quickly on React routes and invalid URLs From a6a4e1aeaef106d315cdb13643685ce4e3198720 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 24 Aug 2017 19:38:19 -0700 Subject: [PATCH 010/105] Add gitbud to seed --- server/db/seed.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/db/seed.js b/server/db/seed.js index 4cd64d0..d684dfe 100644 --- a/server/db/seed.js +++ b/server/db/seed.js @@ -41,7 +41,7 @@ function addUsers() { const addProjectsQueryString = ` CREATE - (:Project {project: 'Hello GitPal', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/hello-GitPal', description: "Get familiar with contributing to open source projects by making a first pull request. In this project, you will learn to use CDN and make pull request.", structure: '[{"text":"Need to add jQuery to application","hint":"Hint: Look up what a content delivery network (CDN) is","complete":false},{"text":"Make your first pull request","hint":"Hint: Refer to the README.md in the repository","complete":false}]'}), + (:Project {project: 'Hello GitBud', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/hello-gitbud', description: "Get familiar with contributing to open source projects by making a first pull request. In this project, you will learn to use CDN and make pull request.", structure: '[{"text":"Need to add jQuery to application","hint":"Hint: Look up what a content delivery network (CDN) is","complete":false},{"text":"Make your first pull request","hint":"Hint: Refer to the README.md in the repository","complete":false}]'}), (:Project {project: 'Random Quote Machine', language: 'JavaScript', experience: 'Beginner', link: 'https://github.com/cranebaes/random-quote-machine', description: "Learn to work with pre-written code to analyze and debug possible issues. In this project, you will learn to locate and solve minor bugs in an existing codebase.", structure: '[{"text":"Missing jQuery library","hint":"Hint: Remember CDN?","complete":false},{"text":"script.js and styles.css are not being loaded","complete":false},{"text":"Quote Me button is not functioning","hint":"Hint: Which function is invoked on button click?","complete":false},{"text":"Quote Me button is not being stylized correctly","complete":false},{"text":"Typo in title of index.html","complete":false},{"text":"Dummy quote that was used for testing is included","complete":false}, {"text":"Make a pull request","hint":"Hint: Remember to end your files with a newline","complete":false}]'}), (:Project {project: 'Tic Tac Toe', language: 'JavaScript', experience: 'Intermediate', link: 'https://github.com/cranebaes/tic-tac-toe', description: "Start thinking algorithmically as you deal with complicated problems involving multiple large steps. In this project, you will learn to implement logic in a classic paper-and-pencil game.", structure: '[{"text":"script.js and styles.css are not being loaded","complete":false},{"text":"gameboard is not defined","hint":"Hint: Trace back where gameboard is used","complete":false},{"text":"clearBoard does not clear blue player","hint":"Hint: How about red player?","complete":false},{"text":"Implement checkForWin function that takes in moves and outputs a boolean based on game condition","complete":false},{"text":"resetScores does not clear board","hint":"Hint: Which function clears board?","complete":false}]'}), (:Project {project: 'The Grey Marble', language: 'JavaScript', experience: 'Advanced', link: 'https://github.com/francisngo/the_grey_marble', description: "Try your hands at contributing to a real world project made by one of our developers. In this project, you will learn to navigate through a full stack app and help improve the project.", structure: '[{"text":"Webpack environment is not set up for Heroku","complete":false}]'}) @@ -65,11 +65,11 @@ const addInterestedInRelationshipsQueryString = ` MATCH (arya:User) WHERE arya.name = "Arya Stark" MATCH (jon:User) WHERE jon.name = "Jon Snow" MATCH (bran:User) WHERE bran.name = "Bran Stark" - MATCH (helloGitPal:Project) WHERE helloGitPal.project = "Hello GitPal" + MATCH (helloGitBud:Project) WHERE helloGitBud.project = "Hello GitBud" MATCH (randomQuoteMachine:Project) WHERE randomQuoteMachine.project = "Random Quote Machine" CREATE - (robb)-[:INTERESTED_IN]->(helloGitPal), - (arya)-[:INTERESTED_IN]->(helloGitPal), + (robb)-[:INTERESTED_IN]->(helloGitBud), + (arya)-[:INTERESTED_IN]->(helloGitBud), (jon)-[:INTERESTED_IN]->(randomQuoteMachine), (bran)-[:INTERESTED_IN]->(randomQuoteMachine) `; From 2ab9ef69aa44f1d11dcfdadda8d42d0179f3fcf8 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Fri, 25 Aug 2017 13:06:18 -0700 Subject: [PATCH 011/105] Update front end to display instant messages to all users --- client/components/App.jsx | 1 + client/components/MyPartners.jsx | 2 ++ client/components/UserDetails.jsx | 51 ++++++++++++++++++++++++++++--- dist/index.html | 1 + package.json | 2 ++ server.js | 35 +++++++++++++++++++-- 6 files changed, 85 insertions(+), 7 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 0574136..f80bf93 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -35,6 +35,7 @@ import NotFound from './NotFound'; import MyProjects from './MyProjects'; import MyPartners from './MyPartners'; + class App extends React.Component { constructor(props) { super(props); diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index ced69b5..55df0ce 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -17,6 +17,8 @@ import { } from 'material-ui/Toolbar'; import {Card, CardText } from 'material-ui/Card'; + + const MyPartners = (props) => { return ( diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 0220020..479f397 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -22,6 +22,8 @@ const customContentStyle = { }; /* for Dialog */ +import io from 'socket.io-client'; +const socket = io(); class UserDetails extends React.Component { @@ -29,7 +31,11 @@ class UserDetails extends React.Component { super(props); this.state = { expanded: false, - message: '', + partnerName: '', + message: 'placeholder', + chatBox: [], + myMessage: 'myMessage', + receivedMessage:'receivedMessage', //for popUp window open: false, } @@ -37,10 +43,17 @@ class UserDetails extends React.Component { this.expandCard = () => { this.setState({ expanded: true }); } + + socket.on('chat message', (msg) => this.renderMessages(msg)); + //receive messages + this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); this.handleClose = this.handleClose.bind(this); + + this.handleSubmit = this.handleSubmit.bind(this); + this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { axios.post('/API/messages', { @@ -99,7 +112,29 @@ class UserDetails extends React.Component { onClick={ this.togglePair } primary={ true } /> } - } + }; + + handleSubmit(event) { + event.preventDefault(); + // socket.emit('chat message', ); + var newMessage = { + message: this._message.value, + username: this.props.user.name + } + this.setState({ + myMessage: 'me:' + newMessage.message + }); + + socket.emit('chat message', newMessage); //send msg + console.log(newMessage); + }; + + + renderMessages(msg) { + this.setState({ + receivedMessage: msg.username + ":" + msg.message + }); + }; render() { const actions = [ @@ -141,20 +176,26 @@ class UserDetails extends React.Component {
- This dialog spans the entire width of the screen. +
    +

    {this.state.myMessage}


    +

    {this.state.receivedMessage}


    +
    + this._message = message} id="newMessage" type="text"/> + +
    {/*dialog for message end*/} {/* should be deleted */} - // { + { //
    //
    + diff --git a/package.json b/package.json index 71f0998..1042dd7 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "lodash": "^4.17.4", "material-ui": "^0.19.0", "neo4j-driver": "^1.4.0", + "open": "0.0.5", "passport": "^0.4.0", "passport-github2": "^0.1.10", "react": "^15.6.1", @@ -53,6 +54,7 @@ "react-redux": "^5.0.6", "react-router-dom": "^4.1.2", "redux": "^3.7.2", + "socket.io": "^2.0.3", "webpack": "^3.5.3" } } diff --git a/server.js b/server.js index 2460360..7948cb1 100644 --- a/server.js +++ b/server.js @@ -19,6 +19,7 @@ // Allows storing of environment variables // in .env of root directory. require('dotenv').config(); +const open = require('open'); // Libraries for handling requests const express = require('express'); const path = require('path'); @@ -32,10 +33,40 @@ const requestHandler = require('./server/request-handler'); // Make express server const app = express(); const port = process.env.PORT || 8080; -app.listen(port, () => { - console.log(`Listening on port: ${port}`); + +const server = app.listen(port, function(err) { + if (err) { + console.log(err); + } else { + open(`http://localhost:${port}`); + } +}); + +const io = require('socket.io')(server); + +io.on('connection', (socket) => { + console.log('a user connected'); + + // // when the client emits 'new message', this listens and executes + // socket.on('new message', function (data) { + // // we tell the client to execute 'new message' + // socket.broadcast.emit('new message', { + // username: socket.username, + // message: data + // }); + // }); + + socket.on('chat message', function(msg) { + console.log(msg); + socket.broadcast.emit('chat message', msg); + }); + + socket.on('disconnect', () => { + console.log('user disconnected'); + }); }); + // Save sessions // NOTE: This is using a bad memory store // https://www.npmjs.com/package/express-session#sessionoptions From e06de6dfd242546511debcee2252f2102d5548f9 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Fri, 25 Aug 2017 19:18:46 -0700 Subject: [PATCH 012/105] Update chat box --- client/components/App.jsx | 2 ++ client/components/ChatBox.jsx | 0 client/components/Project.jsx | 4 +++ client/components/UserDetails.jsx | 48 ++++++++++++++++++++++--------- 4 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 client/components/ChatBox.jsx diff --git a/client/components/App.jsx b/client/components/App.jsx index f80bf93..e8d9778 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -75,8 +75,10 @@ class App extends React.Component { //gets authentication checkAuthenticated() { + console.log("am i running??????") axios.get('/auth/authenticated') .then((res) => { + console.log("ami ", res.data) this.setState({ loggedIn: res.data }); this.getMessages(); this.getProjects(); diff --git a/client/components/ChatBox.jsx b/client/components/ChatBox.jsx new file mode 100644 index 0000000..e69de29 diff --git a/client/components/Project.jsx b/client/components/Project.jsx index 2376cc3..a29c921 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -9,6 +9,9 @@ class Project extends React.Component { constructor(props) { super(props); this.POSTprogress = this.POSTprogress.bind(this); + console.log("paried length..............", this.props) + + this.props.project.paired = this.props.project.paired || [] if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { this.GETprogress(); } @@ -33,6 +36,7 @@ class Project extends React.Component { } render() { + this.props.project.paired = this.props.project.paired || [] if (this.props.project.paired.length > 0) { return } else { diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 479f397..d1e5199 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -2,6 +2,8 @@ import React from 'react'; import { connect } from 'react-redux'; import axios from 'axios'; +import chatBox from './MyPartners'; + import Paper from 'material-ui/Paper'; import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; @@ -18,6 +20,7 @@ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; const customContentStyle = { width: '80%', + height: '100%', maxWidth: 'none', }; /* for Dialog */ @@ -121,8 +124,17 @@ class UserDetails extends React.Component { message: this._message.value, username: this.props.user.name } + + var myMessage = { + username: "me: ", + message: this._message.value + } + + var updatedChatBox = this.state.chatBox + updatedChatBox.push(myMessage) + this.setState({ - myMessage: 'me:' + newMessage.message + chatBox: updatedChatBox }); socket.emit('chat message', newMessage); //send msg @@ -131,23 +143,27 @@ class UserDetails extends React.Component { renderMessages(msg) { + console.log("asdadadadasd", this.state.chatBox) + var updatedChatBox= this.state.chatBox; + updatedChatBox.push(msg); this.setState({ - receivedMessage: msg.username + ":" + msg.message + chatBox: updatedChatBox }); }; render() { const actions = [ +
    +
    + this._message = message} id="newMessage" type="text"/> + Send +
    +
    , , - , + /> ]; return ( @@ -181,14 +197,18 @@ class UserDetails extends React.Component { modal={true} contentStyle={customContentStyle} open={this.state.open} + autoScrollBodyContent={true} >
      -

      {this.state.myMessage}


      -

      {this.state.receivedMessage}


      -
      - this._message = message} id="newMessage" type="text"/> - -
      + {this.state.chatBox.map((chat, index) => { + return( +
      + {chat.username} +

      {chat.message}

      + +
      + )} + )}
      {/*dialog for message end*/} From 74f7bc94bd9d63ea694f11698e0d609d443a1921 Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Fri, 25 Aug 2017 23:17:49 -0400 Subject: [PATCH 013/105] Fix myPartners button to show paired partners --- client/components/MyPartners.jsx | 4 ++-- client/components/UserDetails.jsx | 19 ++++++++++++++++++- client/store/reducers.js | 16 ++++++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 55df0ce..bf09403 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -37,7 +37,7 @@ const MyPartners = (props) => { - {props.users.map(user => + {props.pairedUsers.map(user => ( { user.name } { user.language } @@ -53,7 +53,7 @@ const MyPartners = (props) => { const mapStateToProps = (state) => { return { - users: state.users.filter(user => user.paired.length > 0) + pairedUsers: state.pairedUsers }; }; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index d1e5199..279070a 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -50,6 +50,7 @@ class UserDetails extends React.Component { socket.on('chat message', (msg) => this.renderMessages(msg)); //receive messages + this.addPair = this.addPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); @@ -72,6 +73,21 @@ class UserDetails extends React.Component { }; } + addPair() { + axios.post('/API/pair', { + partnered: this.props.user.id, + project: this.props.match.params.projectId, + }) + .then((response) => { + console.log('this is props from clicking', this.props); + this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience); + console.log(response); + }) + .catch((error) => { + console.log(error); + }); + } + togglePair() { axios.post('/API/pair', { partnered: this.props.user.id, @@ -112,7 +128,7 @@ class UserDetails extends React.Component { label='Work With Me' fullWidth={true} icon={ } - onClick={ this.togglePair } + onClick={ this.addPair } primary={ true } /> } }; @@ -255,6 +271,7 @@ const mapStateToProps = (state, props) => { const mapDispatchToProps = dispatch => ({ + createPairing: (name, language, experience) => dispatch({ type: 'ADD_PAIRING', name, language, experience }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), }); diff --git a/client/store/reducers.js b/client/store/reducers.js index dcdec34..99dd0cf 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -22,7 +22,8 @@ const users = (state, action) => { } else if (action.type === 'CHANGE_USER_PAIRING') { return state.map((user) => { if (user.id === action.userId) { - return Object.assign({}, user, { paired: user.paired.concat(action.projectId) }); + const object = Object.assign({}, user, { paired: user.paired.concat(action.projectId) }); + return object; } return user; }); @@ -30,6 +31,17 @@ const users = (state, action) => { return state; }; +const pairedUsers = (state, action) => { + if (state === undefined) { + return []; + } else if (action.type === 'ADD_PAIRING') { + return state.concat([{name: action.name, language: action.language, experience: action.experience}]); + // const object = Object.assign({}, ) + // return state.concat(action.) + } + return state; +} + /* first condition is the initial state inside App component we dispatch 'LIST_PROJECTS' to display list of projects @@ -57,7 +69,6 @@ const projects = (state, action) => { return project; }); } - console.log('this is the state from projects', state) return state; }; @@ -119,5 +130,6 @@ export default combineReducers({ users, projects, messages, + pairedUsers, projectProgress, }); From 46a3b896cbbab55845951c5bcfc618a2c1a69f4e Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Fri, 25 Aug 2017 20:48:56 -0700 Subject: [PATCH 014/105] Refresh bug --- client/components/App.jsx | 14 ++++++++++++-- client/components/MyPartners.jsx | 2 ++ client/components/Project.jsx | 14 +++++++++++--- client/components/ProjectDetails.jsx | 3 ++- client/components/ProjectList.jsx | 2 ++ client/store/reducers.js | 4 +++- server/routes/auth.js | 3 ++- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index e8d9778..bde24b1 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -39,12 +39,13 @@ import MyPartners from './MyPartners'; class App extends React.Component { constructor(props) { super(props); + //console.log('App.jsx PROPS', props); + //console.log(this); this.state = { loggedIn: false, drawerOpen: false, partyMode: false, } - this.checkAuthenticated(); this.navTap = this.navTap.bind(this); @@ -78,9 +79,13 @@ class App extends React.Component { console.log("am i running??????") axios.get('/auth/authenticated') .then((res) => { - console.log("ami ", res.data) + console.log('SETTInG the STATE', this); + + //console.log('AUTH get Messages'); this.setState({ loggedIn: res.data }); this.getMessages(); + + //console.log('AUTH get Projects'); this.getProjects(); }); } @@ -103,6 +108,7 @@ class App extends React.Component { } render() { + //console.log('App render this: ', this); /* Condition: If user is registered and logs render all the components. @@ -110,6 +116,7 @@ class App extends React.Component { If user is not logged in (logged out) display landing page */ if (this.state.loggedIn.language) { + console.log('App rendering', this.state.loggedIn); return (
      @@ -150,6 +157,7 @@ class App extends React.Component { } else if (this.state.loggedIn) { return ; } else { + console.log('LOGGING ON', this.state); return ; } } @@ -159,6 +167,7 @@ class App extends React.Component { Allows App component to have message and project state */ const mapStateToProps = (state) => { + //console.log('APP state: ', state); return { message: state.message, projects: state.projects, @@ -170,6 +179,7 @@ const mapStateToProps = (state) => { Dispatch can be found in store/reducers.js */ const mapDispatchToProps = (dispatch) => { + //console.log('APP dispatch: ', dispatch); return { changeString: () => dispatch({ type: 'CHANGE_STRING', diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index bf09403..659e3e0 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -20,6 +20,8 @@ import {Card, CardText } from 'material-ui/Card'; const MyPartners = (props) => { + //debugger; + console.log('MyPartners props', props); return ( diff --git a/client/components/Project.jsx b/client/components/Project.jsx index a29c921..09414c4 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -8,15 +8,20 @@ import ProjectStatus from './ProjectStatus'; class Project extends React.Component { constructor(props) { super(props); + //debugger; this.POSTprogress = this.POSTprogress.bind(this); - console.log("paried length..............", this.props) - - this.props.project.paired = this.props.project.paired || [] + console.log('Project.jsx PROPS: ', this.props); + // if (this.props.project === undefined) { + // setTimeout + // } if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { this.GETprogress(); } + } + + //post user's progress POSTprogress() { axios.post('/API/progress', { @@ -49,8 +54,11 @@ class Project extends React.Component { Allows Project component to have project and projectID state */ const mapStateToProps = (state, props) => { + //debugger; + console.log('Project.jsx state: ', state); const projectId = Number(props.match.params.id); const project = state.projects.filter(project => project.id === projectId)[0]; + console.log('Project.jsx project: ', project); return { project, progress: state.projectProgress[projectId] || [], diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 09277f2..dcd6b69 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -15,9 +15,10 @@ import RaisedButton from 'material-ui/RaisedButton'; import UserList from './UserList'; class ProjectDetails extends React.Component { + constructor(props) { super(props); - + console.log('project details props', props); this.state = { interest: false, }; diff --git a/client/components/ProjectList.jsx b/client/components/ProjectList.jsx index 581ba7b..5fa5144 100644 --- a/client/components/ProjectList.jsx +++ b/client/components/ProjectList.jsx @@ -19,6 +19,7 @@ import { import {Card, CardText } from 'material-ui/Card'; const ProjectList = (props) => { + console.log('ProjectList.jsx Props', props); return ( @@ -51,6 +52,7 @@ const ProjectList = (props) => { }; const mapStateToProps = (state) => { + console.log('project list state: ', state); return { projects: state.projects, }; diff --git a/client/store/reducers.js b/client/store/reducers.js index 99dd0cf..e5b6478 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -18,6 +18,7 @@ const users = (state, action) => { if (state === undefined) { return []; } else if (action.type === 'USERS_ADD') { + console.log('ADDING USERS', action); return action.users; } else if (action.type === 'CHANGE_USER_PAIRING') { return state.map((user) => { @@ -49,7 +50,8 @@ const pairedUsers = (state, action) => { inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button */ const projects = (state, action) => { - + console.log('projects state: ', state); + console.log('projects action: ', action); if (state === undefined) { return []; } else if (action.type === 'LIST_PROJECTS') { diff --git a/server/routes/auth.js b/server/routes/auth.js index 97722ee..f4a0bbb 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -1,6 +1,6 @@ /* * REQUEST HANDLERS FOR AUTHENTICATION ROUTES - * + * * These handlers deal with the response directly by convenience, not by good design. */ @@ -14,6 +14,7 @@ module.exports = { GET: { signout: function signout(req, res) { // destroy session and redirect to home + console.log('LOGGING OUT', req.logout); req.logout(); res.redirect('/'); }, From 0b596dd2ef9e30c7aab9cb3c533a34ddf07a0d64 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Fri, 25 Aug 2017 22:56:29 -0700 Subject: [PATCH 015/105] Add local storage --- client/store/index.js | 25 +++++++++++++++++++------ package.json | 2 ++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/client/store/index.js b/client/store/index.js index 8783c26..8d60c33 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -1,13 +1,26 @@ -import { createStore } from 'redux'; -import reducer from './reducers'; - /* grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. */ -const store = createStore( - reducer, /* preloadedState, */ - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +import * as storage from 'redux-storage'; +import {createStore, applyMiddleware, combineReducers} from 'redux'; +import * as reducers from '/.reducers'; + +const reducer = storage.reducer(combineReducers(reducers)); + +import createEngine from 'redux-storage-engine-localstorage'; +const engine = createEngine('my-save-key'); + +const middleware = storage.createMiddleware(engine); + +const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); +const store = createStoreWithMiddleware( + reducers, /* preloadedState, */ + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() ); +const load = storage.createLoader(engine); +load(store) + .then((newState) => console.log('Loaded state:', newState)) + .catch(() => console.log('Failed to load previous state')); export default store; diff --git a/package.json b/package.json index 1042dd7..d0216ad 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,8 @@ "react-redux": "^5.0.6", "react-router-dom": "^4.1.2", "redux": "^3.7.2", + "redux-storage": "^4.1.2", + "redux-storage-engine-localstorage": "^1.1.4", "socket.io": "^2.0.3", "webpack": "^3.5.3" } From a74d978c48470d713705757af5a85895844c5cdf Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Fri, 25 Aug 2017 23:31:05 -0700 Subject: [PATCH 016/105] Refactoring reducers.js --- client/components/App.jsx | 4 ++-- client/store/index.js | 40 +++++++++++++++++++-------------------- client/store/reducers.js | 21 ++++++++++++++++++++ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index bde24b1..872e66a 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -76,10 +76,10 @@ class App extends React.Component { //gets authentication checkAuthenticated() { - console.log("am i running??????") + console.log("Getting authentication") axios.get('/auth/authenticated') .then((res) => { - console.log('SETTInG the STATE', this); + console.log('Setting the STATE', this); //console.log('AUTH get Messages'); this.setState({ loggedIn: res.data }); diff --git a/client/store/index.js b/client/store/index.js index 8d60c33..df47404 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -1,26 +1,26 @@ -/* - grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. - */ -import * as storage from 'redux-storage'; -import {createStore, applyMiddleware, combineReducers} from 'redux'; -import * as reducers from '/.reducers'; + import * as storage from 'redux-storage' -const reducer = storage.reducer(combineReducers(reducers)); + import reducers from './reducers'; + import { createStore, applyMiddleware, combineReducers } from 'redux'; -import createEngine from 'redux-storage-engine-localstorage'; -const engine = createEngine('my-save-key'); + const reducer = storage.reducer(combineReducers(reducers)); -const middleware = storage.createMiddleware(engine); + import createEngine from 'redux-storage-engine-localstorage'; + const engine = createEngine('my-save-key'); -const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); -const store = createStoreWithMiddleware( - reducers, /* preloadedState, */ - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() -); + const middleware = storage.createMiddleware(engine); + const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); + /* + grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. + */ + const store = createStoreWithMiddleware( + reducers, /* preloadedState, */ + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() + ); -const load = storage.createLoader(engine); -load(store) - .then((newState) => console.log('Loaded state:', newState)) - .catch(() => console.log('Failed to load previous state')); + const load = storage.createLoader(engine); + load(store) + .then((newState) => console.log('Loaded state:', newState)) + .catch(() => console.log('Failed to load previous state')); -export default store; + export default store; diff --git a/client/store/reducers.js b/client/store/reducers.js index e5b6478..ff5ca92 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -15,6 +15,8 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ const users = (state, action) => { + console.log('users state: ', state); + console.log('users action: ', action); if (state === undefined) { return []; } else if (action.type === 'USERS_ADD') { @@ -28,13 +30,21 @@ const users = (state, action) => { } return user; }); + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('Users load'); + // return action.payload.projects[0]; } return state; }; const pairedUsers = (state, action) => { + console.log('pairedUsers state: ', state); + console.log('pairedUsers action: ', action); if (state === undefined) { return []; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('pairedUsers load'); + // return action.payload.projects[0]; } else if (action.type === 'ADD_PAIRING') { return state.concat([{name: action.name, language: action.language, experience: action.experience}]); // const object = Object.assign({}, ) @@ -54,6 +64,9 @@ const projects = (state, action) => { console.log('projects action: ', action); if (state === undefined) { return []; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('Project load'); + // return action.payload.projects[0]; } else if (action.type === 'LIST_PROJECTS') { return action.projects; } else if (action.type === 'CHANGE_PROJECT_INTEREST') { @@ -84,8 +97,13 @@ const projects = (state, action) => { SUGGESTION: implement socket.io */ const messages = (state, action) => { + console.log('messages state: ', state); + console.log('messages action: ', action); if (state === undefined) { return {}; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('messages load'); + // return action.payload.projects[0]; } else if (action.type === 'MESSAGE_SEND') { const newMessages = {}; newMessages[action.userId] = state[action.userId] ? [action.message].concat(state[action.userId]) : [action.message]; @@ -104,6 +122,9 @@ const messages = (state, action) => { const projectProgress = (state, action) => { if (state === undefined) { return {}; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('Project progress load'); + // return action.payload.projects[0]; } else if (action.type === 'PROGRESS_LOAD_ITEMS') { return action.progress; } else if (action.type === 'PROGRESS_CHANGE_ITEM') { From 823984c14ea3f2c9d8e9ce00567e8e9a411d1c21 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Fri, 25 Aug 2017 23:43:12 -0700 Subject: [PATCH 017/105] GitPal handles front-end refresh --- client/store/reducers.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/client/store/reducers.js b/client/store/reducers.js index ff5ca92..4592584 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -31,8 +31,8 @@ const users = (state, action) => { return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Users load'); - // return action.payload.projects[0]; + console.log('Users load:', action.payload.users); + return action.payload.users; } return state; }; @@ -42,13 +42,13 @@ const pairedUsers = (state, action) => { console.log('pairedUsers action: ', action); if (state === undefined) { return []; - } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('pairedUsers load'); - // return action.payload.projects[0]; } else if (action.type === 'ADD_PAIRING') { return state.concat([{name: action.name, language: action.language, experience: action.experience}]); // const object = Object.assign({}, ) // return state.concat(action.) + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('pairedUsers load:', action.payload.pairedUsers); + return action.payload.pairedUsers; } return state; } @@ -64,9 +64,6 @@ const projects = (state, action) => { console.log('projects action: ', action); if (state === undefined) { return []; - } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Project load'); - // return action.payload.projects[0]; } else if (action.type === 'LIST_PROJECTS') { return action.projects; } else if (action.type === 'CHANGE_PROJECT_INTEREST') { @@ -83,6 +80,9 @@ const projects = (state, action) => { } return project; }); + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('Project load:', action.payload.projects); + return action.payload.projects; } return state; @@ -101,15 +101,15 @@ const messages = (state, action) => { console.log('messages action: ', action); if (state === undefined) { return {}; - } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('messages load'); - // return action.payload.projects[0]; } else if (action.type === 'MESSAGE_SEND') { const newMessages = {}; newMessages[action.userId] = state[action.userId] ? [action.message].concat(state[action.userId]) : [action.message]; return Object.assign({}, state, newMessages); } else if (action.type === 'MESSAGES_LOAD') { return action.messages; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('messages load', action.payload.messages); + return action.payload.messages; } return state; }; @@ -122,9 +122,6 @@ const messages = (state, action) => { const projectProgress = (state, action) => { if (state === undefined) { return {}; - } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Project progress load'); - // return action.payload.projects[0]; } else if (action.type === 'PROGRESS_LOAD_ITEMS') { return action.progress; } else if (action.type === 'PROGRESS_CHANGE_ITEM') { @@ -135,6 +132,9 @@ const projectProgress = (state, action) => { updatedProject[action.itemIndex] = Object.assign({}, stateProject[action.itemIndex]); updatedProject[action.itemIndex].complete = !updatedProject[action.itemIndex].complete; return newProgress; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('Project progress load', action.payload.projectProgress); + return action.payload.projectProgress; } return state; }; From a298efc4a4ab5bd18d065888d7c157b84c68dbe5 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Fri, 25 Aug 2017 23:45:02 -0700 Subject: [PATCH 018/105] Clean up code --- client/components/App.jsx | 8 -------- client/components/MyPartners.jsx | 2 -- client/components/Project.jsx | 5 ----- 3 files changed, 15 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 872e66a..c024b71 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -39,8 +39,6 @@ import MyPartners from './MyPartners'; class App extends React.Component { constructor(props) { super(props); - //console.log('App.jsx PROPS', props); - //console.log(this); this.state = { loggedIn: false, drawerOpen: false, @@ -76,16 +74,10 @@ class App extends React.Component { //gets authentication checkAuthenticated() { - console.log("Getting authentication") axios.get('/auth/authenticated') .then((res) => { - console.log('Setting the STATE', this); - - //console.log('AUTH get Messages'); this.setState({ loggedIn: res.data }); this.getMessages(); - - //console.log('AUTH get Projects'); this.getProjects(); }); } diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 659e3e0..bf09403 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -20,8 +20,6 @@ import {Card, CardText } from 'material-ui/Card'; const MyPartners = (props) => { - //debugger; - console.log('MyPartners props', props); return ( diff --git a/client/components/Project.jsx b/client/components/Project.jsx index 09414c4..59c9f37 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -8,12 +8,7 @@ import ProjectStatus from './ProjectStatus'; class Project extends React.Component { constructor(props) { super(props); - //debugger; this.POSTprogress = this.POSTprogress.bind(this); - console.log('Project.jsx PROPS: ', this.props); - // if (this.props.project === undefined) { - // setTimeout - // } if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { this.GETprogress(); } From f592384799232e01f0e5976b4fe6fa91dd4fc59f Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Sat, 26 Aug 2017 14:23:41 -0400 Subject: [PATCH 019/105] Commit package.json with new changes before rebase --- package-lock.json | 255 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) diff --git a/package-lock.json b/package-lock.json index 0fcbe45..fc765d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,11 @@ } } }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, "ajv": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz", @@ -175,6 +180,11 @@ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=" + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -877,22 +887,45 @@ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz", "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==" }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + }, "base64-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" }, + "base64id": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" + }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", "dev": true }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "requires": { + "callsite": "1.0.0" + } + }, "big.js": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz", @@ -903,6 +936,11 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz", "integrity": "sha1-ZlBsFs5vTWkopbPNajPKQelB43s=" }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -1109,6 +1147,11 @@ "callsites": "0.2.0" } }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + }, "callsites": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", @@ -1267,6 +1310,21 @@ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + }, "compressible": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.11.tgz", @@ -1677,6 +1735,51 @@ "iconv-lite": "0.4.18" } }, + "engine.io": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.0.tgz", + "integrity": "sha1-XKQ4486f28kVxKIcjdnhJmcG5X4=", + "requires": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.6.8", + "engine.io-parser": "2.1.1", + "uws": "0.14.5", + "ws": "2.3.1" + } + }, + "engine.io-client": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz", + "integrity": "sha1-QVqYUrrbFPoAj6PvHjFgjbZ2EyU=", + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.6.8", + "engine.io-parser": "2.1.1", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "2.3.1", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + } + }, + "engine.io-parser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.1.tgz", + "integrity": "sha1-4Ps/DgRi9/WLt3waUun1p+JuRmg=", + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary2": "1.0.2" + } + }, "enhanced-resolve": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", @@ -3394,6 +3497,26 @@ "ansi-regex": "2.1.1" } }, + "has-binary2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz", + "integrity": "sha1-6D26SfC5vk0CbSc2U1DZ8D9Uvpg=", + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + }, "has-flag": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", @@ -4507,6 +4630,11 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, "object-keys": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", @@ -4558,6 +4686,11 @@ "mimic-fn": "1.1.0" } }, + "open": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", + "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=" + }, "opn": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", @@ -4698,6 +4831,30 @@ "error-ex": "1.3.1" } }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "requires": { + "better-assert": "1.0.2" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "requires": { + "better-assert": "1.0.2" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "requires": { + "better-assert": "1.0.2" + } + }, "parseurl": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", @@ -5541,6 +5698,62 @@ "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, + "socket.io": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz", + "integrity": "sha1-Q1nwaiSTOua9CHeYr3jGgOrjReM=", + "requires": { + "debug": "2.6.8", + "engine.io": "3.1.0", + "object-assign": "4.1.1", + "socket.io-adapter": "1.1.1", + "socket.io-client": "2.0.3", + "socket.io-parser": "3.1.2" + } + }, + "socket.io-adapter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", + "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" + }, + "socket.io-client": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz", + "integrity": "sha1-bK9K/5+FsZ/ZG2zhPWmttWT4hzs=", + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.6.8", + "engine.io-client": "3.1.1", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "3.1.2", + "to-array": "0.1.4" + } + }, + "socket.io-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz", + "integrity": "sha1-28IoIVH8T6675Aru3Ady66YZ9/I=", + "requires": { + "component-emitter": "1.2.1", + "debug": "2.6.8", + "has-binary2": "1.0.2", + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + } + } + }, "sockjs": { "version": "0.3.18", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz", @@ -5827,6 +6040,11 @@ "os-tmpdir": "1.0.2" } }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -5930,6 +6148,11 @@ "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" }, + "ultron": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz", + "integrity": "sha1-sHoualQagV/Go0zNRTO67DB8qGQ=" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -6005,6 +6228,12 @@ "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", "dev": true }, + "uws": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz", + "integrity": "sha1-Z6rzPEaypYel9mZtAPdpEyjxSdw=", + "optional": true + }, "v8flags": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", @@ -6502,6 +6731,27 @@ "mkdirp": "0.5.1" } }, + "ws": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", + "integrity": "sha1-a5Sz5EfLajY/eF6vlK9jWejoHIA=", + "requires": { + "safe-buffer": "5.0.1", + "ultron": "1.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=" + } + } + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=" + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -6588,6 +6838,11 @@ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" } } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" } } } From 31db8aeb056aa3b13be6513b3c1cb421fcc87e18 Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Sat, 26 Aug 2017 14:25:47 -0400 Subject: [PATCH 020/105] commit package.json --- package-lock.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/package-lock.json b/package-lock.json index fc765d4..9313b84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4181,6 +4181,16 @@ "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", "dev": true }, + "lodash.isfunction": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.8.tgz", + "integrity": "sha1-TbcJ/IG8So/XEnpFilNGxc3OLGs=" + }, + "lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=" + }, "lodash.merge": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", @@ -5359,6 +5369,11 @@ "strip-indent": "1.0.1" } }, + "reduce-reducers": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/reduce-reducers/-/reduce-reducers-0.1.2.tgz", + "integrity": "sha1-+htHGLxSkqcd3R5dg5yb6pdw8Us=" + }, "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", @@ -5370,6 +5385,40 @@ "symbol-observable": "1.0.4" } }, + "redux-actions": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/redux-actions/-/redux-actions-0.10.1.tgz", + "integrity": "sha1-u0Qu433ZZDqUkz5AceCJ9DVYcTU=", + "requires": { + "reduce-reducers": "0.1.2" + } + }, + "redux-storage": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/redux-storage/-/redux-storage-4.1.2.tgz", + "integrity": "sha1-4G9L3u4mKurZEy/J9+rcZ+n5vqI=", + "requires": { + "lodash.isfunction": "3.0.8", + "lodash.isobject": "3.0.2", + "loose-envify": "1.3.1", + "redux-actions": "0.10.1", + "redux-storage-merger-simple": "1.0.5" + } + }, + "redux-storage-engine-localstorage": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/redux-storage-engine-localstorage/-/redux-storage-engine-localstorage-1.1.4.tgz", + "integrity": "sha1-KEknjXiXDww/Xz1HJ8qjwweD7Uk=" + }, + "redux-storage-merger-simple": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/redux-storage-merger-simple/-/redux-storage-merger-simple-1.0.5.tgz", + "integrity": "sha1-KaKIaw53DZtwgRrKgAqo766J+3M=", + "requires": { + "lodash.isobject": "3.0.2", + "lodash.merge": "4.6.0" + } + }, "regenerate": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", From 7110be535ee383ded5f6a7dff3bb0a51fe4b6590 Mon Sep 17 00:00:00 2001 From: Scott Schaefer Date: Sat, 26 Aug 2017 14:56:00 -0400 Subject: [PATCH 021/105] Toggle paired button when clicked and make each user clickable --- client/components/UserDetails.jsx | 13 ++++++++----- client/store/reducers.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 279070a..d28136e 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -31,8 +31,10 @@ const socket = io(); class UserDetails extends React.Component { constructor(props) { + console.log('this is props of UserDetails', props); super(props); this.state = { + buttonClicked: false, expanded: false, partnerName: '', message: 'placeholder', @@ -80,8 +82,9 @@ class UserDetails extends React.Component { }) .then((response) => { console.log('this is props from clicking', this.props); - this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience); + this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); console.log(response); + this.setState({buttonClicked: !this.state.buttonClicked}); }) .catch((error) => { console.log(error); @@ -114,7 +117,7 @@ class UserDetails extends React.Component { /* dialog handler end*/ pairButton() { - if (this.props.user.paired.length > 0) { + if (this.state.buttonClicked) { return } - onClick={ this.togglePair } /> - } else if (this.props.match.params.projectId) { + onClick={ this.addPair } /> + } else if (!this.state.buttonClicked) { return { const mapDispatchToProps = dispatch => ({ - createPairing: (name, language, experience) => dispatch({ type: 'ADD_PAIRING', name, language, experience }), + createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), }); diff --git a/client/store/reducers.js b/client/store/reducers.js index 4592584..106ddbf 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -43,7 +43,7 @@ const pairedUsers = (state, action) => { if (state === undefined) { return []; } else if (action.type === 'ADD_PAIRING') { - return state.concat([{name: action.name, language: action.language, experience: action.experience}]); + return state.concat([{ name: action.name, language: action.language, experience: action.experience, id: action.id }]); // const object = Object.assign({}, ) // return state.concat(action.) } else if (action.type === 'REDUX_STORAGE_LOAD') { From 3f222bb36ec011186a25e078d2d2b6bdc2f58b51 Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Sat, 26 Aug 2017 13:56:38 -0500 Subject: [PATCH 022/105] Add get pairs request --- client/components/App.jsx | 13 +++++++++++++ server/routes/api.js | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index c024b71..6bd88e2 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -50,6 +50,15 @@ class App extends React.Component { this.togglePartyMode = this.togglePartyMode.bind(this); } +getPairs() { + axios.get('/API/pairs') + .then((pairs) => { + this.props.addPairsList(pairs.data); + console.log(this.props); + }) + .catch(console.error); + } + //gets list of projects getProjects() { axios.get('/API/projects/') @@ -185,6 +194,10 @@ const mapDispatchToProps = (dispatch) => { type: 'MESSAGES_LOAD', messages, }), + addPairsList: pairs => dispatch({ + type: 'ADD_PAIRING', + pairs, + }) }; }; diff --git a/server/routes/api.js b/server/routes/api.js index fc25eeb..f7749eb 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -2,7 +2,7 @@ * Request handlers for API routes. * These are stored on an object for easy lookup in the request-handler module and are indexed * first by method then by route. - * + * * THINGS TO FIX: * There's a lot of repeated code in the db queries. You may find it helpful to create better helper functions * here, simply modularise the db functionality better or both. @@ -137,7 +137,7 @@ module.exports = { RETURN false as pairs, false as interested, project `) .then((res) => { - resolve(res.records.map(project => + resolve(res.records.map(project => new db.models.Project(project.get('project'), project.get('pairs'), project.get('interested')) )); }) @@ -159,7 +159,7 @@ module.exports = { RETURN pair `) .then((res) => { - resolve(res.records.map(project => + resolve(res.records.map(project => res.records.map(user => new db.models.User(user.get('pair'))) )); }) From e29a513945d7a2b4f3c05e330908067b6c2bc465 Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Sat, 26 Aug 2017 18:49:47 -0500 Subject: [PATCH 023/105] Update MyPartners view with data from the databases --- client/components/App.jsx | 14 ++++++++------ client/components/AppDrawer.jsx | 4 ++-- client/components/MyPartners.jsx | 4 ++-- client/components/UserDetails.jsx | 2 ++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 6bd88e2..7e42b6a 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -42,7 +42,7 @@ class App extends React.Component { this.state = { loggedIn: false, drawerOpen: false, - partyMode: false, + partyMode: false } this.checkAuthenticated(); @@ -50,11 +50,14 @@ class App extends React.Component { this.togglePartyMode = this.togglePartyMode.bind(this); } +componentDidMount() { + this.getPairs() +} + getPairs() { axios.get('/API/pairs') .then((pairs) => { - this.props.addPairsList(pairs.data); - console.log(this.props); + this.setState({myPartners: pairs.data}) }) .catch(console.error); } @@ -124,7 +127,7 @@ getPairs() { }/> {/* opens and closes side menu */} - this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> + this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -137,8 +140,7 @@ getPairs() { - - + ()} /> {/* given this path render this component and pass down the loggedIn state as user props */} diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index cc0e96a..0cc8691 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Link } from 'react-router-dom'; +import { Link, Route } from 'react-router-dom'; import { Card, CardHeader } from 'material-ui/Card'; // menus and toolbars etc. @@ -35,7 +35,7 @@ function AppDrawer(props) {
      }/> - +
      diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index bf09403..83b732a 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -37,7 +37,7 @@ const MyPartners = (props) => { - {props.pairedUsers.map(user => + {(props.currentPartners[0] ? props.currentPartners[0] : []).map(user => ( { user.name } { user.language } @@ -53,7 +53,7 @@ const MyPartners = (props) => { const mapStateToProps = (state) => { return { - pairedUsers: state.pairedUsers + // pairedUsers: state.pairedUsers }; }; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index d28136e..cb9c27f 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -85,6 +85,8 @@ class UserDetails extends React.Component { this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); + window.location.reload(); + }) .catch((error) => { console.log(error); From d7c8920d1513be01830712f25d8d6f6e55f1e4d0 Mon Sep 17 00:00:00 2001 From: Christine Zimmerman Date: Thu, 24 Aug 2017 19:23:09 -0700 Subject: [PATCH 024/105] Explores the codebase and makes comments --- client/components/AppDrawer.jsx | 1 + client/components/UserList.jsx | 2 ++ client/store/reducers.js | 2 +- server/request-handler/index.js | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 0cc8691..a78c608 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -33,6 +33,7 @@ function AppDrawer(props) {
      + // Wrap both raised buttons in a Link tag with to="endpoint" }/> diff --git a/client/components/UserList.jsx b/client/components/UserList.jsx index 816672f..e0b3d00 100644 --- a/client/components/UserList.jsx +++ b/client/components/UserList.jsx @@ -1,3 +1,5 @@ +/* Not currently connected to FIND PARTNER button */ +/* Used to show All Users */ import React from 'react'; import { Link } from 'react-router-dom'; diff --git a/client/store/reducers.js b/client/store/reducers.js index 106ddbf..982e865 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -57,7 +57,7 @@ const pairedUsers = (state, action) => { first condition is the initial state inside App component we dispatch 'LIST_PROJECTS' to display list of projects inside ProjectDetails component we dispatch 'CHANGE_PROJECT_INTEREST' when user selects 'they are interested' - inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button + inside UserDetails component we dispatch 'CHANGE_USER' when user select 'WORK WITH ME' button */ const projects = (state, action) => { console.log('projects state: ', state); diff --git a/server/request-handler/index.js b/server/request-handler/index.js index cd979f8..d2b2a42 100644 --- a/server/request-handler/index.js +++ b/server/request-handler/index.js @@ -87,4 +87,4 @@ exports.handler = function handler(req, res) { res.statusCode = 404; res.end(exports.index); } -} +}; From 71e10f8967d7f4d4d0d91d8f7a14d47bd015a2c4 Mon Sep 17 00:00:00 2001 From: Christine Zimmerman Date: Thu, 24 Aug 2017 20:28:10 -0700 Subject: [PATCH 025/105] More code exploration and pairing with Scotts on Partners table view --- client/components/MyPartners.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 83b732a..762aa04 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -20,6 +20,7 @@ import {Card, CardText } from 'material-ui/Card'; const MyPartners = (props) => { + console.log('This is the props from MyPartners ', props); return ( From 8726619da8f9d54017b484be45c46e051c180bb9 Mon Sep 17 00:00:00 2001 From: Christine Zimmerman Date: Fri, 25 Aug 2017 20:31:15 -0700 Subject: [PATCH 026/105] contain a redux reducer to update props on a MyPartners component --- client/components/AppDrawer.jsx | 2 -- client/components/MyPartners.jsx | 1 + client/components/UserDetails.jsx | 22 +--------------------- client/store/reducers.js | 13 +++---------- 4 files changed, 5 insertions(+), 33 deletions(-) diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index a78c608..2a1abf2 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -33,8 +33,6 @@ function AppDrawer(props) {
      - // Wrap both raised buttons in a Link tag with to="endpoint" - }/> diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 762aa04..1e74969 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -53,6 +53,7 @@ const MyPartners = (props) => { }; const mapStateToProps = (state) => { + console.log('State is: ', state); return { // pairedUsers: state.pairedUsers }; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index cb9c27f..40f4dea 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -14,7 +14,6 @@ import ActionBuild from 'material-ui/svg-icons/action/build'; import ActionDone from 'material-ui/svg-icons/action/done'; import ContentSend from 'material-ui/svg-icons/content/send'; import TextField from 'material-ui/TextField'; - /* for Dialog */ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -29,7 +28,6 @@ import io from 'socket.io-client'; const socket = io(); class UserDetails extends React.Component { - constructor(props) { console.log('this is props of UserDetails', props); super(props); @@ -51,7 +49,6 @@ class UserDetails extends React.Component { socket.on('chat message', (msg) => this.renderMessages(msg)); //receive messages - this.addPair = this.addPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); @@ -74,7 +71,6 @@ class UserDetails extends React.Component { }); }; } - addPair() { axios.post('/API/pair', { partnered: this.props.user.id, @@ -92,7 +88,6 @@ class UserDetails extends React.Component { console.log(error); }); } - togglePair() { axios.post('/API/pair', { partnered: this.props.user.id, @@ -106,18 +101,15 @@ class UserDetails extends React.Component { console.log(error); }); } - /* dialog handler*/ handleOpen() { console.log("clicked") this.setState({open: true}); }; - handleClose() { this.setState({open: false}); }; /* dialog handler end*/ - pairButton() { if (this.state.buttonClicked) { return ]; - return ( @@ -208,10 +199,8 @@ class UserDetails extends React.Component { { this.pairButton() } } onClick={this.handleOpen} secondary={true} />
      - {/*dialog for message*/}
      -
      {/*dialog for message end*/} - - {/* should be deleted */} { //
      @@ -256,13 +243,11 @@ class UserDetails extends React.Component { //
      // {/* should be deleted end*/} } -
      ); } } - const mapStateToProps = (state, props) => { const userId = Number(props.match.params.id); const user = state.users.filter(user => user.id === userId)[0]; @@ -273,18 +258,13 @@ const mapStateToProps = (state, props) => { messages: state.messages[userId] || [], }; }; - const mapDispatchToProps = dispatch => ({ createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), }); - export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); - - - /* }> - */ + */ \ No newline at end of file diff --git a/client/store/reducers.js b/client/store/reducers.js index 982e865..42f81f3 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -1,14 +1,10 @@ /* Reducers - decides how the change a state after receiving an action, and thus can be considered the entrance of a state change. A reducer is comprised of functions and it changes states by taking an action as argument, in which it then returns a new state. - The actions get sent to App component and other parent component where they can be pass through as props. */ - import { combineReducers } from 'redux'; - // does nothing - implemented to test connecting Redux to React const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' ? action.text : state; - /* first condition is the initial state inside ProjectDetails component, we dispatch 'addUsers' to display users at initial load @@ -23,11 +19,13 @@ const users = (state, action) => { console.log('ADDING USERS', action); return action.users; } else if (action.type === 'CHANGE_USER_PAIRING') { + console.log('this is state before CHANGE_USER_PAIRING ', state) return state.map((user) => { if (user.id === action.userId) { const object = Object.assign({}, user, { paired: user.paired.concat(action.projectId) }); return object; } + console.log('this is the user from reducers ', user) return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { @@ -57,7 +55,7 @@ const pairedUsers = (state, action) => { first condition is the initial state inside App component we dispatch 'LIST_PROJECTS' to display list of projects inside ProjectDetails component we dispatch 'CHANGE_PROJECT_INTEREST' when user selects 'they are interested' - inside UserDetails component we dispatch 'CHANGE_USER' when user select 'WORK WITH ME' button + inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button */ const projects = (state, action) => { console.log('projects state: ', state); @@ -84,15 +82,12 @@ const projects = (state, action) => { console.log('Project load:', action.payload.projects); return action.payload.projects; } - return state; }; - /* first condition is the initial state inside UserDetails component we dispatch 'MESSAGE_SEND' when user sends a message to pairing user inside UserDetails component we dispatch 'MESSAGE_LOAD' when user refreshes page to view new incoming messages - THINGS TO FIX: change messaging features to appear when sent SUGGESTION: implement socket.io */ @@ -113,7 +108,6 @@ const messages = (state, action) => { } return state; }; - /* first condition is the initial state inside Project component, we dispatch 'PROGRESS_LOAD_ITEMS' to load the user's latest progress on project @@ -138,7 +132,6 @@ const projectProgress = (state, action) => { } return state; }; - /* hands off state/dispatch to React components with mapStateToProps and mapDispatchToProps combineReducers function creates a single object that contains all the reducers From 9230a7630793f42df8c6f3f84e2cee838abd5d16 Mon Sep 17 00:00:00 2001 From: Christine Zimmerman Date: Sat, 26 Aug 2017 11:55:27 -0700 Subject: [PATCH 027/105] Starts to implement get request from database to make MyPartners table data persist --- client/components/App.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/App.jsx b/client/components/App.jsx index 7e42b6a..af15869 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -91,6 +91,7 @@ getPairs() { this.setState({ loggedIn: res.data }); this.getMessages(); this.getProjects(); + this.getPairs(); }); } From c64900fc6e0a6bc2f5f7124761fffda27a01b97a Mon Sep 17 00:00:00 2001 From: Christine Zimmerman Date: Sat, 26 Aug 2017 17:06:56 -0700 Subject: [PATCH 028/105] have no more party mode --- client/components/App.jsx | 39 ++++++++------------------------- client/components/AppDrawer.jsx | 1 + 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index af15869..addd092 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -21,7 +21,6 @@ import ActionHome from 'material-ui/svg-icons/action/home'; import IconButton from 'material-ui/IconButton'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import { fullWhite } from 'material-ui/styles/colors'; -import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; import AppDrawer from './AppDrawer'; import Landing from './Landing'; @@ -42,19 +41,17 @@ class App extends React.Component { this.state = { loggedIn: false, drawerOpen: false, - partyMode: false } this.checkAuthenticated(); this.navTap = this.navTap.bind(this); - this.togglePartyMode = this.togglePartyMode.bind(this); } -componentDidMount() { - this.getPairs() -} + componentDidMount() { + this.getPairs() + } -getPairs() { + getPairs() { axios.get('/API/pairs') .then((pairs) => { this.setState({myPartners: pairs.data}) @@ -95,23 +92,6 @@ getPairs() { }); } - //party mode - togglePartyMode() { - const colors = ['blue', 'green', 'red', 'yellow', 'lilac']; - if (this.state.partyMode) { - clearInterval(this.state.partyMode); - document.body.setAttribute('style', `background-color:white`); - this.setState({ partyMode: false }); - } else { - this.setState({partyMode: - setInterval(() => { - const randomNum = Math.floor(Math.random() * colors.length); - document.body.setAttribute('style', `background-color:${colors[randomNum]}`); - }, 200), - }); - } - } - render() { //console.log('App render this: ', this); /* @@ -152,8 +132,7 @@ getPairs() { - - +
      @@ -197,10 +176,10 @@ const mapDispatchToProps = (dispatch) => { type: 'MESSAGES_LOAD', messages, }), - addPairsList: pairs => dispatch({ - type: 'ADD_PAIRING', - pairs, - }) + // addPairsList: pairs => dispatch({ + // type: 'ADD_PAIRING', + // pairs, + // }) }; }; diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 2a1abf2..3265e89 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -16,6 +16,7 @@ import ActionFace from 'material-ui/svg-icons/action/face'; import DeviceDeveloperMode from 'material-ui/svg-icons/device/developer-mode'; function AppDrawer(props) { + console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', props); return ( From 05ead35d3a6fb49bc41479896b5427b2c25fc99f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 00:08:58 -0700 Subject: [PATCH 029/105] Remove refresh debugging console logs --- client/components/App.jsx | 3 +-- client/store/index.js | 44 +++++++++++++++++++++------------------ client/store/reducers.js | 18 ++++++++-------- package.json | 2 +- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 7e42b6a..87b9931 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -160,8 +160,7 @@ getPairs() { } else if (this.state.loggedIn) { return ; } else { - console.log('LOGGING ON', this.state); - return ; + return ; } } } diff --git a/client/store/index.js b/client/store/index.js index df47404..ea7bcd1 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -1,26 +1,30 @@ - import * as storage from 'redux-storage' +/* +First we load all the reducer files. In our case there is only one. +We combine these reducers into one single "file", but this is unnecessary +for this project's size. +*/ - import reducers from './reducers'; - import { createStore, applyMiddleware, combineReducers } from 'redux'; +import * as storage from 'redux-storage'; +import reducers from './reducers'; +import { createStore, applyMiddleware, combineReducers } from 'redux'; +import createEngine from 'redux-storage-engine-localstorage'; - const reducer = storage.reducer(combineReducers(reducers)); +const reducer = storage.reducer(combineReducers(reducers)); +const engine = createEngine('my-save-key'); - import createEngine from 'redux-storage-engine-localstorage'; - const engine = createEngine('my-save-key'); - - const middleware = storage.createMiddleware(engine); - const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); - /* +const middleware = storage.createMiddleware(engine); +const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); +/* grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. - */ - const store = createStoreWithMiddleware( - reducers, /* preloadedState, */ - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() - ); +*/ +const store = createStoreWithMiddleware( + reducers, /* preloadedState, */ + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +); - const load = storage.createLoader(engine); - load(store) - .then((newState) => console.log('Loaded state:', newState)) - .catch(() => console.log('Failed to load previous state')); +const load = storage.createLoader(engine); +load(store) + .then((newState) => console.log('Loaded state:', newState)) + .catch(() => console.log('Failed to load previous state')); - export default store; +export default store; diff --git a/client/store/reducers.js b/client/store/reducers.js index 106ddbf..e4606ae 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -15,8 +15,8 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ const users = (state, action) => { - console.log('users state: ', state); - console.log('users action: ', action); + // console.log('users state: ', state); + // console.log('users action: ', action); if (state === undefined) { return []; } else if (action.type === 'USERS_ADD') { @@ -38,8 +38,8 @@ const users = (state, action) => { }; const pairedUsers = (state, action) => { - console.log('pairedUsers state: ', state); - console.log('pairedUsers action: ', action); + // console.log('pairedUsers state: ', state); + // console.log('pairedUsers action: ', action); if (state === undefined) { return []; } else if (action.type === 'ADD_PAIRING') { @@ -60,8 +60,8 @@ const pairedUsers = (state, action) => { inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button */ const projects = (state, action) => { - console.log('projects state: ', state); - console.log('projects action: ', action); + // console.log('projects state: ', state); + // console.log('projects action: ', action); if (state === undefined) { return []; } else if (action.type === 'LIST_PROJECTS') { @@ -97,8 +97,8 @@ const projects = (state, action) => { SUGGESTION: implement socket.io */ const messages = (state, action) => { - console.log('messages state: ', state); - console.log('messages action: ', action); + // console.log('messages state: ', state); + // console.log('messages action: ', action); if (state === undefined) { return {}; } else if (action.type === 'MESSAGE_SEND') { @@ -108,7 +108,7 @@ const messages = (state, action) => { } else if (action.type === 'MESSAGES_LOAD') { return action.messages; } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('messages load', action.payload.messages); + console.log('Messages load', action.payload.messages); return action.payload.messages; } return state; diff --git a/package.json b/package.json index d0216ad..7d75e87 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "type": "git", "url": "git+https://github.com/Toucans456/GitPal.git" }, - "author": "haque-kim-ngo-warner-medley", + "author": "haque-kim-ngo-warner-medley and chen-gallegos-mitchell-schafer-zimmerman", "license": "ISC", "bugs": { "url": "https://github.com/Toucans456/GitPal/issues" From fa8929fbe16d35ba7298fdf2efb59e62127e8122 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 12:42:49 -0700 Subject: [PATCH 030/105] Add theory to reducers --- client/store/reducers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/store/reducers.js b/client/store/reducers.js index e4606ae..a7d2438 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -14,6 +14,9 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside ProjectDetails component, we dispatch 'addUsers' to display users at initial load inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ + +//PUT A CONSOLE LOG HERE TO CHECK THEORY IF ACTION GOES THROUGH EVERY CONST// + const users = (state, action) => { // console.log('users state: ', state); // console.log('users action: ', action); From 47aca1209ebf8db3ee0f17f2555de3c98e865f3c Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 17:02:21 -0700 Subject: [PATCH 031/105] Refactor logout function to handle local storage --- client/components/App.jsx | 15 ++++++++++++++- client/components/AppDrawer.jsx | 4 ++-- client/store/reducers.js | 24 ++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 87b9931..ab7a488 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -46,6 +46,7 @@ class App extends React.Component { } this.checkAuthenticated(); + this.clickLogout = this.clickLogout.bind(this); this.navTap = this.navTap.bind(this); this.togglePartyMode = this.togglePartyMode.bind(this); } @@ -93,6 +94,15 @@ getPairs() { this.getProjects(); }); } + //CHANGE THIS TO this.props.userLogout + clickLogout() { + console.log('Logging out yo'); + axios.get('/auth/signout') + .then((res) => { + this.props.userLogout(); + window.location.replace('/'); + }); + } //party mode togglePartyMode() { @@ -127,7 +137,7 @@ getPairs() { }/> {/* opens and closes side menu */} - this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> + this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -198,6 +208,9 @@ const mapDispatchToProps = (dispatch) => { addPairsList: pairs => dispatch({ type: 'ADD_PAIRING', pairs, + }), + userLogout: () => dispatch({ + type: 'APP_LOGOUT' }) }; }; diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 0cc8691..4fa8e21 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -40,8 +40,8 @@ function AppDrawer(props) {
      - - }/> + + }/> } onClick={ props.closeDrawer }/> diff --git a/client/store/reducers.js b/client/store/reducers.js index a7d2438..ea0b824 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -15,8 +15,6 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ -//PUT A CONSOLE LOG HERE TO CHECK THEORY IF ACTION GOES THROUGH EVERY CONST// - const users = (state, action) => { // console.log('users state: ', state); // console.log('users action: ', action); @@ -36,6 +34,8 @@ const users = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Users load:', action.payload.users); return action.payload.users; + } else if (action.type === 'APP_LOGOUT') { + //state = []; } return state; }; @@ -52,6 +52,8 @@ const pairedUsers = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; + } else if (action.type === 'APP_LOGOUT') { + state = []; } return state; } @@ -86,6 +88,8 @@ const projects = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project load:', action.payload.projects); return action.payload.projects; + } else if (action.type === 'APP_LOGOUT') { + //state = []; } return state; @@ -113,6 +117,8 @@ const messages = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Messages load', action.payload.messages); return action.payload.messages; + } else if (action.type === 'APP_LOGOUT') { + state = {}; } return state; }; @@ -138,10 +144,23 @@ const projectProgress = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project progress load', action.payload.projectProgress); return action.payload.projectProgress; + } else if (action.type === 'APP_LOGOUT') { + state = {}; } return state; }; +const logout = (state, action) => { + console.log('logout action', action); + if (state === undefined) { + return []; + } else if (action.type === 'APP_LOGOUT') { + console.log('Reducer: APP_LOGOUT'); + state = []; + } + return state; +} + /* hands off state/dispatch to React components with mapStateToProps and mapDispatchToProps combineReducers function creates a single object that contains all the reducers @@ -158,4 +177,5 @@ export default combineReducers({ messages, pairedUsers, projectProgress, + logout }); From b6883f31b052a21f9e175221ca13cd70cf2bbc0e Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 17:55:00 -0700 Subject: [PATCH 032/105] Sign out destroys local storage --- client/components/App.jsx | 27 ++++++++++--------- client/components/AppDrawer.jsx | 2 +- client/store/reducers.js | 46 +++++++++++++++------------------ 3 files changed, 35 insertions(+), 40 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index ab7a488..0473585 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -46,9 +46,9 @@ class App extends React.Component { } this.checkAuthenticated(); - this.clickLogout = this.clickLogout.bind(this); this.navTap = this.navTap.bind(this); this.togglePartyMode = this.togglePartyMode.bind(this); + // this.handleLogout = this.handleLogout.bind(this); } componentDidMount() { @@ -92,17 +92,9 @@ getPairs() { this.setState({ loggedIn: res.data }); this.getMessages(); this.getProjects(); + this.props.loggedInUser(res.data); }); } - //CHANGE THIS TO this.props.userLogout - clickLogout() { - console.log('Logging out yo'); - axios.get('/auth/signout') - .then((res) => { - this.props.userLogout(); - window.location.replace('/'); - }); - } //party mode togglePartyMode() { @@ -121,6 +113,8 @@ getPairs() { } } + + render() { //console.log('App render this: ', this); /* @@ -137,7 +131,7 @@ getPairs() { }/> {/* opens and closes side menu */} - this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> + this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -170,7 +164,8 @@ getPairs() { } else if (this.state.loggedIn) { return ; } else { - return ; + console.log('LOGGING ON', this.state); + return ; } } } @@ -209,8 +204,12 @@ const mapDispatchToProps = (dispatch) => { type: 'ADD_PAIRING', pairs, }), - userLogout: () => dispatch({ - type: 'APP_LOGOUT' + loggedInUser: loggedInUser => dispatch({ + type: 'UPDATED_LOGGEDIN_USER', + loggedInUser, + }), + loggedOut: () => dispatch({ + type: 'USER_LOGOUT' }) }; }; diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 4fa8e21..1d7cf4c 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -40,7 +40,7 @@ function AppDrawer(props) {
      - + }/> } onClick={ props.closeDrawer }/> diff --git a/client/store/reducers.js b/client/store/reducers.js index ea0b824..4729c5d 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -34,8 +34,6 @@ const users = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Users load:', action.payload.users); return action.payload.users; - } else if (action.type === 'APP_LOGOUT') { - //state = []; } return state; }; @@ -52,8 +50,6 @@ const pairedUsers = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; - } else if (action.type === 'APP_LOGOUT') { - state = []; } return state; } @@ -88,10 +84,7 @@ const projects = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project load:', action.payload.projects); return action.payload.projects; - } else if (action.type === 'APP_LOGOUT') { - //state = []; } - return state; }; @@ -117,8 +110,6 @@ const messages = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Messages load', action.payload.messages); return action.payload.messages; - } else if (action.type === 'APP_LOGOUT') { - state = {}; } return state; }; @@ -144,23 +135,10 @@ const projectProgress = (state, action) => { } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project progress load', action.payload.projectProgress); return action.payload.projectProgress; - } else if (action.type === 'APP_LOGOUT') { - state = {}; } return state; }; -const logout = (state, action) => { - console.log('logout action', action); - if (state === undefined) { - return []; - } else if (action.type === 'APP_LOGOUT') { - console.log('Reducer: APP_LOGOUT'); - state = []; - } - return state; -} - /* hands off state/dispatch to React components with mapStateToProps and mapDispatchToProps combineReducers function creates a single object that contains all the reducers @@ -170,12 +148,30 @@ const logout = (state, action) => { code--they don't have to worry about every other part of the state. what we are doing here is using ES6 destructuring, so key and value are named the same. */ -export default combineReducers({ +// export default combineReducers({ +// message: changeString, +// users, +// projects, +// messages, +// pairedUsers, +// projectProgress, +// logout +// }); + +const appReducer = combineReducers({ message: changeString, users, projects, messages, pairedUsers, - projectProgress, - logout + projectProgress }); + +const rootReducer = (state, action) => { + if (action.type === 'APP_LOGOUT') { + state = undefined; + } + return appReducer(state, action); +} + +export default rootReducer From 09d64db8945c93fa88a070369ee0e1d14c732ac3 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sat, 26 Aug 2017 17:56:11 -0700 Subject: [PATCH 033/105] Update storage cleaner --- client/components/App.jsx | 2 +- client/store/reducers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 0473585..ff39462 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -215,4 +215,4 @@ const mapDispatchToProps = (dispatch) => { }; //connects the Store to App component -export default connect(mapStateToProps, mapDispatchToProps)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); \ No newline at end of file diff --git a/client/store/reducers.js b/client/store/reducers.js index 4729c5d..ab9a3fb 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -174,4 +174,4 @@ const rootReducer = (state, action) => { return appReducer(state, action); } -export default rootReducer +export default rootReducer \ No newline at end of file From 914813e2c10d0b2daa09c962311afb5941eb105f Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sat, 26 Aug 2017 20:23:11 -0700 Subject: [PATCH 034/105] Update select interested button on project page --- client/components/ProjectDetails.jsx | 55 +++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index dcd6b69..e8e6fc0 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -11,6 +11,8 @@ import { import Paper from 'material-ui/Paper'; import {Card, CardText } from 'material-ui/Card'; import RaisedButton from 'material-ui/RaisedButton'; +import Dialog from 'material-ui/Dialog'; +import FlatButton from 'material-ui/FlatButton'; import UserList from './UserList'; @@ -19,11 +21,18 @@ class ProjectDetails extends React.Component { constructor(props) { super(props); console.log('project details props', props); + console.log('60', this.props.project.interested) this.state = { interest: false, + open: false, }; this.toggleInterest = this.toggleInterest.bind(this); + this.handleOpen = this.handleOpen.bind(this); + this.handleClose = this.handleClose.bind(this); + this.clickHandler = this.clickHandler.bind(this); + this.handleInterest = this.handleInterest.bind(this); this.getUsers(); + } getUsers() { @@ -38,19 +47,53 @@ class ProjectDetails extends React.Component { .catch(console.error); } + /* dialog handler*/ + handleOpen() { + console.log("clicked") + this.setState({open: true}); + }; + + handleClose() { + this.setState({open: false}); + }; + /* dialog handler end*/ + toggleInterest() { axios.post('/API/projects', { projectId: this.props.project.id, }) .then((response) => { - this.props.dispatchInterest(this.props.project.id, !this.props.project.interested); + this.props.dispatchInterest(this.props.project.id, this.props.project.interested); }) .catch((error) => { console.log(error); }); } + handleInterest(){ + this.props.project.interested = !this.props.project.interested; + this.toggleInterest(); + } + + clickHandler() { + this.handleInterest(); + this.handleOpen(); + } + render() { + const actions = [ + , + + ]; + return ( @@ -72,9 +115,17 @@ class ProjectDetails extends React.Component { - + + + {this.props.project.interested? 'Choose a partner!' : 'Are you sure?' } + From ed4569d4abb55756636c65c1e721510d3f5e3efc Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sat, 26 Aug 2017 21:53:39 -0700 Subject: [PATCH 035/105] Update userGhID on userDetail.jsx --- client/components/UserDetails.jsx | 11 ++++++++++- client/store/reducers.js | 13 ++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index cb9c27f..e95a220 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -110,6 +110,10 @@ class UserDetails extends React.Component { /* dialog handler*/ handleOpen() { console.log("clicked") + console.log(this.props.loggedInUser) + console.log(this.props.loggedInUserGhId) + console.log(this.props.user.name) + console.log(this.props.user.ghId) this.setState({open: true}); }; @@ -143,7 +147,7 @@ class UserDetails extends React.Component { // socket.emit('chat message', ); var newMessage = { message: this._message.value, - username: this.props.user.name + username: this.props.loggedInUser } var myMessage = { @@ -264,13 +268,18 @@ class UserDetails extends React.Component { } const mapStateToProps = (state, props) => { + console.log("line 267", state) const userId = Number(props.match.params.id); const user = state.users.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) + const loggedInUser = state.loggedInUser.username; + const loggedInUserGhId = state.loggedInUser.ghId; return { user, projects, messages: state.messages[userId] || [], + loggedInUser, + loggedInUserGhId, }; }; diff --git a/client/store/reducers.js b/client/store/reducers.js index ab9a3fb..c213ab8 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -139,6 +139,16 @@ const projectProgress = (state, action) => { return state; }; +const loggedInUser = (state, action) => { + if (state === undefined) { + return {}; + } else if (action.type === 'UPDATED_LOGGEDIN_USER') { + return action.loggedInUser; + } + return state; +}; + + /* hands off state/dispatch to React components with mapStateToProps and mapDispatchToProps combineReducers function creates a single object that contains all the reducers @@ -164,7 +174,8 @@ const appReducer = combineReducers({ projects, messages, pairedUsers, - projectProgress + projectProgress, + loggedInUser }); const rootReducer = (state, action) => { From 746611793217dfe94c5fe2d14605db07686f54b2 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 22:01:06 -0700 Subject: [PATCH 036/105] Add api project route --- client/components/Project.jsx | 1 - client/components/UserDetails.jsx | 18 +++++++++++++++--- server/routes/api.js | 20 ++++++++++++++++++++ server/routes/auth.js | 2 +- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/client/components/Project.jsx b/client/components/Project.jsx index 59c9f37..c8f9f5f 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -36,7 +36,6 @@ class Project extends React.Component { } render() { - this.props.project.paired = this.props.project.paired || [] if (this.props.project.paired.length > 0) { return } else { diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index e95a220..72178f9 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -57,8 +57,10 @@ class UserDetails extends React.Component { this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); this.handleClose = this.handleClose.bind(this); - this.handleSubmit = this.handleSubmit.bind(this); + this.retrieveProjectId = this.retrieveProjectId.bind(this); + + this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { @@ -75,10 +77,11 @@ class UserDetails extends React.Component { }; } + addPair() { axios.post('/API/pair', { partnered: this.props.user.id, - project: this.props.match.params.projectId, + project: this.props.match.params.projectId, //this is undefined }) .then((response) => { console.log('this is props from clicking', this.props); @@ -86,6 +89,7 @@ class UserDetails extends React.Component { console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); window.location.reload(); + //window.location.replace(`/projects/${this.props}`) }) .catch((error) => { @@ -176,6 +180,14 @@ class UserDetails extends React.Component { }); }; + retrieveProjectId() { + axios.get('/API/project') + .then((project) => { + console.log('userdetails project', project); + }) + .catch(console.error); + }; + render() { const actions = [
      @@ -210,7 +222,7 @@ class UserDetails extends React.Component { project.project).join(' ')}/>
      { this.pairButton() } - } onClick={this.handleOpen} secondary={true} /> + } onClick={this.retrieveProjectId} secondary={true} />
      {/*dialog for message*/} diff --git a/server/routes/api.js b/server/routes/api.js index f7749eb..5481604 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -145,6 +145,26 @@ module.exports = { .then(() => dbSession.close()); }); }, + //Retrieve the project that two users share + //Returns SOMETHING + project: function getProject(req, res) { + console.log('running'); + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + console.log('GET project'); + const ghId = req.user.ghInfo.id; + console.log(ghId); + dbSession.run(` + MATCH (user:User {ghId: + ${ghId}}) + `) + .then((res) => { + resolve(res); + }) + .catch(reject) + .then(() => dbSession.close()); + }); + }, // Returns an array of user objects--one for each // user with which the requesting user is paired diff --git a/server/routes/auth.js b/server/routes/auth.js index f4a0bbb..40bf5f6 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -14,7 +14,7 @@ module.exports = { GET: { signout: function signout(req, res) { // destroy session and redirect to home - console.log('LOGGING OUT', req.logout); + console.log('LOGGING OUT'); req.logout(); res.redirect('/'); }, From fb3787de3c3bcdccc2e53ac57ab911459f7ad461 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sat, 26 Aug 2017 22:34:46 -0700 Subject: [PATCH 037/105] "Ready" for deploy (?) --- client/components/UserDetails.jsx | 11 ++++++++--- server/routes/api.js | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 72178f9..9a8a277 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -60,7 +60,7 @@ class UserDetails extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); this.retrieveProjectId = this.retrieveProjectId.bind(this); - + this.retrieveProjectId(); this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { @@ -181,7 +181,12 @@ class UserDetails extends React.Component { }; retrieveProjectId() { - axios.get('/API/project') + const meow = this.props.user.ghId; + axios.get('/API/project', { + params: { + id: meow + } + }) .then((project) => { console.log('userdetails project', project); }) @@ -222,7 +227,7 @@ class UserDetails extends React.Component { project.project).join(' ')}/>
      { this.pairButton() } - } onClick={this.retrieveProjectId} secondary={true} /> + } onClick={this.handleOpen} secondary={true} />
      {/*dialog for message*/} diff --git a/server/routes/api.js b/server/routes/api.js index 5481604..b9907f1 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -153,12 +153,14 @@ module.exports = { const dbSession = dbDriver.session(); console.log('GET project'); const ghId = req.user.ghInfo.id; - console.log(ghId); + const userId = req.query.id + console.log(req); dbSession.run(` - MATCH (user:User {ghId: - ${ghId}}) + MATCH (:User {ghId:${ghId}})-[WORKING_ON]-(project:Project)--(:User {ghId:${userId}}) + RETURN project `) .then((res) => { + console.log('GET PROJECT project response', res.records); resolve(res); }) .catch(reject) From 407c2e3eaadf1cffb56fddc4a7167131559e650d Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 11:22:24 -0700 Subject: [PATCH 038/105] Remove boiler plate non-redux code --- client/components/UserDetails.jsx | 11 ++++++++--- server/routes/api.js | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 9a8a277..876033a 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -43,6 +43,8 @@ class UserDetails extends React.Component { receivedMessage:'receivedMessage', //for popUp window open: false, + curProjectId: null, + curProjectProperty: null, } this.paired = false; this.expandCard = () => { @@ -81,7 +83,7 @@ class UserDetails extends React.Component { addPair() { axios.post('/API/pair', { partnered: this.props.user.id, - project: this.props.match.params.projectId, //this is undefined + project: this.state.curProjectId, //this is undefined }) .then((response) => { console.log('this is props from clicking', this.props); @@ -100,10 +102,10 @@ class UserDetails extends React.Component { togglePair() { axios.post('/API/pair', { partnered: this.props.user.id, - project: this.props.match.params.projectId, + project: this.state.curProjectId, }) .then((response) => { - this.props.dispatchPairing(this.props.user.id, Number(this.props.match.params.projectId)); + this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); console.log(response); }) .catch((error) => { @@ -182,6 +184,7 @@ class UserDetails extends React.Component { retrieveProjectId() { const meow = this.props.user.ghId; + console.log('retrieve project id meow', meow); axios.get('/API/project', { params: { id: meow @@ -189,6 +192,8 @@ class UserDetails extends React.Component { }) .then((project) => { console.log('userdetails project', project); + this.state.curProjectId = project.data.id; + this.state.curProjectProperty = project.data; }) .catch(console.error); }; diff --git a/server/routes/api.js b/server/routes/api.js index b9907f1..d47d2ab 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -148,20 +148,20 @@ module.exports = { //Retrieve the project that two users share //Returns SOMETHING project: function getProject(req, res) { - console.log('running'); return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('GET project'); const ghId = req.user.ghInfo.id; const userId = req.query.id - console.log(req); dbSession.run(` MATCH (:User {ghId:${ghId}})-[WORKING_ON]-(project:Project)--(:User {ghId:${userId}}) RETURN project `) .then((res) => { - console.log('GET PROJECT project response', res.records); - resolve(res); + console.log('GET PROJECT project response', res); + const project = res.records[0]; + resolve(new db.models.Project(project.get('project')) + ); }) .catch(reject) .then(() => dbSession.close()); From 1186a793bffcc7f03cebed44552e4da76b253551 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 11:49:43 -0700 Subject: [PATCH 039/105] Users unclickable unless you select a project --- client/components/ProjectDetails.jsx | 8 ++++++-- client/components/UserList.jsx | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index e8e6fc0..94369b5 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -25,6 +25,7 @@ class ProjectDetails extends React.Component { this.state = { interest: false, open: false, + disableUsers: true, }; this.toggleInterest = this.toggleInterest.bind(this); this.handleOpen = this.handleOpen.bind(this); @@ -76,6 +77,9 @@ class ProjectDetails extends React.Component { } clickHandler() { + this.setState({ + disableUsers: false, + }); this.handleInterest(); this.handleOpen(); } @@ -115,7 +119,7 @@ class ProjectDetails extends React.Component { - + {this.props.project.interested? 'Choose a partner!' : 'Are you sure?' } - + ) diff --git a/client/components/UserList.jsx b/client/components/UserList.jsx index 816672f..3e7e4e3 100644 --- a/client/components/UserList.jsx +++ b/client/components/UserList.jsx @@ -20,6 +20,7 @@ const UserList = (props) => { { props.users.map((user, index) => { return ( } leftAvatar={ From 00b3499fb9d21793c3d75b7b43e82bdd26d80b4a Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 12:23:32 -0700 Subject: [PATCH 040/105] Add subheader --- client/components/MyProjects.jsx | 2 ++ client/components/UserDetails.jsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index f05b2ab..f8a64a4 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import Paper from 'material-ui/Paper'; import RaisedButton from 'material-ui/RaisedButton'; +import Subheader from 'material-ui/Subheader'; import { Table, TableBody, @@ -27,6 +28,7 @@ const MyProjects = (props) => { + Projects you have a partner with diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 876033a..1166c35 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -90,7 +90,7 @@ class UserDetails extends React.Component { this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); - window.location.reload(); + //window.location.reload(); //window.location.replace(`/projects/${this.props}`) }) From bed8a2abd04fa11ace4544fe172c50c3e146762e Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 14:24:28 -0700 Subject: [PATCH 041/105] Remove Find Partner button --- client/components/App.jsx | 6 ++--- client/components/AppDrawer.jsx | 10 ++++++-- client/components/MyPartners.jsx | 2 ++ client/components/ProjectList.jsx | 4 ++-- client/components/UserDetails.jsx | 39 +++++++++++++++++++++++++------ server/routes/api.js | 23 +++++++++++++++++- 6 files changed, 69 insertions(+), 15 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index ff39462..4b154e0 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -124,7 +124,7 @@ getPairs() { If user is not logged in (logged out) display landing page */ if (this.state.loggedIn.language) { - console.log('App rendering', this.state.loggedIn); + //console.log('App rendering', this.state.loggedIn); return (
      @@ -164,7 +164,7 @@ getPairs() { } else if (this.state.loggedIn) { return ; } else { - console.log('LOGGING ON', this.state); + console.log('Logging on', this.state); return ; } } @@ -215,4 +215,4 @@ const mapDispatchToProps = (dispatch) => { }; //connects the Store to App component -export default connect(mapStateToProps, mapDispatchToProps)(App); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 1d7cf4c..9018788 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -15,6 +15,13 @@ import ActionAccountCircle from 'material-ui/svg-icons/action/account-circle'; import ActionFace from 'material-ui/svg-icons/action/face'; import DeviceDeveloperMode from 'material-ui/svg-icons/device/developer-mode'; +/* +Deprecated FindUsers button +Add this to AppDrawer when user functionality expands + + }/> +*/ + function AppDrawer(props) { return ( @@ -33,9 +40,8 @@ function AppDrawer(props) {
      - }/> - + }/>
      diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 83b732a..1ac3d84 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -16,6 +16,7 @@ import { ToolbarTitle } from 'material-ui/Toolbar'; import {Card, CardText } from 'material-ui/Card'; +import Subheader from 'material-ui/Subheader'; @@ -28,6 +29,7 @@ const MyPartners = (props) => { + Click on a user to chat and start working!
      diff --git a/client/components/ProjectList.jsx b/client/components/ProjectList.jsx index 5fa5144..465e7f1 100644 --- a/client/components/ProjectList.jsx +++ b/client/components/ProjectList.jsx @@ -19,7 +19,7 @@ import { import {Card, CardText } from 'material-ui/Card'; const ProjectList = (props) => { - console.log('ProjectList.jsx Props', props); + //console.log('ProjectList.jsx Props', props); return ( @@ -52,7 +52,7 @@ const ProjectList = (props) => { }; const mapStateToProps = (state) => { - console.log('project list state: ', state); + //console.log('project list state: ', state); return { projects: state.projects, }; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 1166c35..030eb25 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -43,10 +43,11 @@ class UserDetails extends React.Component { receivedMessage:'receivedMessage', //for popUp window open: false, + isPaired: false, curProjectId: null, curProjectProperty: null, } - this.paired = false; + this.paired = false; // ???????????????????/ this.expandCard = () => { this.setState({ expanded: true }); } @@ -62,7 +63,7 @@ class UserDetails extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); this.retrieveProjectId = this.retrieveProjectId.bind(this); - this.retrieveProjectId(); + this.initialize(); this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { @@ -79,6 +80,32 @@ class UserDetails extends React.Component { }; } + initialize() { + return new Promise((resolve, reject) => { + this.retrieveProjectId(); + resolve(); + }) + .then(() => { + this.checkIfPaired(); + }) + } + + checkIfPaired() { + console.log('Check paired their GHid: ', this.props.user.ghId); + axios.get('/API/pairedProjects', { + params: { + userId: this.props.loggedInUserGhId, + partnerId: this.props.user.ghId + } + }) + .then((res) => { + console.log('Checking paired 101 response', res); + }) + .catch((error) => { + console.log(error); + }) + } + addPair() { axios.post('/API/pair', { @@ -183,15 +210,13 @@ class UserDetails extends React.Component { }; retrieveProjectId() { - const meow = this.props.user.ghId; - console.log('retrieve project id meow', meow); + const userId = this.props.user.ghId; axios.get('/API/project', { params: { - id: meow + id: userId } }) .then((project) => { - console.log('userdetails project', project); this.state.curProjectId = project.data.id; this.state.curProjectProperty = project.data; }) @@ -290,7 +315,7 @@ class UserDetails extends React.Component { } const mapStateToProps = (state, props) => { - console.log("line 267", state) + //console.log("line 267", state) const userId = Number(props.match.params.id); const user = state.users.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) diff --git a/server/routes/api.js b/server/routes/api.js index d47d2ab..01d35d0 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -146,7 +146,7 @@ module.exports = { }); }, //Retrieve the project that two users share - //Returns SOMETHING + //Returns a project project: function getProject(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); @@ -168,6 +168,27 @@ module.exports = { }); }, + pairedProjects: function findPairProjects(req, res) { + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + + const userId = Number(req.query.userId); + const partnerId = Number(req.query.partnerId); + console.log('paired projects req', partnerId); + dbSession.run(` + MATCH(user:User {ghId: ${userId}})-[:PAIRED_WITH]->(group)<- + [:PAIRED_WITH]-(partner:User {ghId: ${partnerId}}) + RETURN group + `) + .then((res) => { + console.log('Database retrieval of group: ', res); + resolve(res); + }) + .catch(reject) + .then(() => dbSession.close()); + }) + }, + // Returns an array of user objects--one for each // user with which the requesting user is paired pairs: function getPairs(req) { From 3faf777fa6b46a6ae676c246045dc6e686c9b63f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 15:32:49 -0700 Subject: [PATCH 042/105] Streamline login and fix seed file relationship --- client/components/App.jsx | 17 ++++++++++------- client/components/UserDetails.jsx | 12 ++++++++---- server/db/seed.js | 3 +++ server/routes/api.js | 6 ++++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 4b154e0..c0cf133 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -51,9 +51,9 @@ class App extends React.Component { // this.handleLogout = this.handleLogout.bind(this); } -componentDidMount() { - this.getPairs() -} +// componentDidMount() { +// this.getPairs() +// } getPairs() { axios.get('/API/pairs') @@ -89,10 +89,13 @@ getPairs() { checkAuthenticated() { axios.get('/auth/authenticated') .then((res) => { - this.setState({ loggedIn: res.data }); - this.getMessages(); - this.getProjects(); - this.props.loggedInUser(res.data); + if (res.data !== false) { + this.setState({ loggedIn: res.data }); + this.getMessages(); + this.getProjects(); + this.getPairs() + this.props.loggedInUser(res.data); + } }); } diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 030eb25..0321660 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -47,7 +47,6 @@ class UserDetails extends React.Component { curProjectId: null, curProjectProperty: null, } - this.paired = false; // ???????????????????/ this.expandCard = () => { this.setState({ expanded: true }); } @@ -91,15 +90,20 @@ class UserDetails extends React.Component { } checkIfPaired() { - console.log('Check paired their GHid: ', this.props.user.ghId); axios.get('/API/pairedProjects', { params: { userId: this.props.loggedInUserGhId, partnerId: this.props.user.ghId } }) - .then((res) => { - console.log('Checking paired 101 response', res); + .then((pairProjects) => { + console.log('Checking paired 101 response', pairProjects.data.length); + if (pairProjects.data.length > 0) { + console.log('THERE ARE PROJECTS HERE'); + this.setState({ + buttonClicked: true + }) + } }) .catch((error) => { console.log(error); diff --git a/server/db/seed.js b/server/db/seed.js index d684dfe..d75dd5c 100644 --- a/server/db/seed.js +++ b/server/db/seed.js @@ -67,9 +67,12 @@ const addInterestedInRelationshipsQueryString = ` MATCH (bran:User) WHERE bran.name = "Bran Stark" MATCH (helloGitBud:Project) WHERE helloGitBud.project = "Hello GitBud" MATCH (randomQuoteMachine:Project) WHERE randomQuoteMachine.project = "Random Quote Machine" + MATCH (ticTacToe:Project) WHERE ticTacToe.project = "Tic Tac Toe" CREATE (robb)-[:INTERESTED_IN]->(helloGitBud), + (robb)-[:INTERESTED_IN]->(randomQuoteMachine), (arya)-[:INTERESTED_IN]->(helloGitBud), + (arya)-[:INTERESTED_IN]->(ticTacToe), (jon)-[:INTERESTED_IN]->(randomQuoteMachine), (bran)-[:INTERESTED_IN]->(randomQuoteMachine) `; diff --git a/server/routes/api.js b/server/routes/api.js index 01d35d0..1ce6911 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -181,8 +181,8 @@ module.exports = { RETURN group `) .then((res) => { - console.log('Database retrieval of group: ', res); - resolve(res); + console.log('Database retrieval of group: ', res.records); + resolve(res.records); }) .catch(reject) .then(() => dbSession.close()); @@ -244,6 +244,8 @@ module.exports = { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('POST pair'); + console.log('POST pair userId: ', req.user.ghInfo.id); + console.log('POST pair partnerId: ', req.body.partnered); dbSession.run(` MATCH (project:Project) WHERE ID(project) = ${Number(req.body.project)} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} From 95d8eebab1f3fe92c3e1b62f8fd25900b001feca Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 16:03:17 -0700 Subject: [PATCH 043/105] Clean up --- server/db/seed.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/db/seed.js b/server/db/seed.js index d75dd5c..a886b81 100644 --- a/server/db/seed.js +++ b/server/db/seed.js @@ -60,6 +60,7 @@ const addProjects = function addProjects() { } //Create INTERESTED_IN relationships between users and projects +//Add INTERESTED_IN relationships if you addPairs const addInterestedInRelationshipsQueryString = ` MATCH (robb:User) WHERE robb.name = "Robb Stark" MATCH (arya:User) WHERE arya.name = "Arya Stark" @@ -70,9 +71,7 @@ const addInterestedInRelationshipsQueryString = ` MATCH (ticTacToe:Project) WHERE ticTacToe.project = "Tic Tac Toe" CREATE (robb)-[:INTERESTED_IN]->(helloGitBud), - (robb)-[:INTERESTED_IN]->(randomQuoteMachine), (arya)-[:INTERESTED_IN]->(helloGitBud), - (arya)-[:INTERESTED_IN]->(ticTacToe), (jon)-[:INTERESTED_IN]->(randomQuoteMachine), (bran)-[:INTERESTED_IN]->(randomQuoteMachine) `; @@ -116,7 +115,7 @@ dropGraph() .then(addUsers) .then(addProjects) .then(addInterestedInRelationships) - .then(addPair) + // .then(addPair) .then(() => { session.close(); driver.close(); From a66a40d4f39b8ad3194807b3cb2f9ecdcb5bf173 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 20:44:27 -0700 Subject: [PATCH 044/105] Add "Get working" button --- client/components/UserDetails.jsx | 33 ++++++++++------- client/store/reducers.js | 61 +++++++++++++++++-------------- server/routes/api.js | 6 +-- 3 files changed, 54 insertions(+), 46 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 0321660..cc9e612 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -12,6 +12,7 @@ import RaisedButton from 'material-ui/RaisedButton'; import ActionFace from 'material-ui/svg-icons/action/face'; import ActionBuild from 'material-ui/svg-icons/action/build'; import ActionDone from 'material-ui/svg-icons/action/done'; +import ActionAdd from 'material-ui/svg-icons/social/person'; import ContentSend from 'material-ui/svg-icons/content/send'; import TextField from 'material-ui/TextField'; @@ -97,7 +98,6 @@ class UserDetails extends React.Component { } }) .then((pairProjects) => { - console.log('Checking paired 101 response', pairProjects.data.length); if (pairProjects.data.length > 0) { console.log('THERE ARE PROJECTS HERE'); this.setState({ @@ -128,6 +128,8 @@ class UserDetails extends React.Component { .catch((error) => { console.log(error); }); + + //POSSIBLY ADD GET REQUEST HERE } togglePair() { @@ -147,10 +149,6 @@ class UserDetails extends React.Component { /* dialog handler*/ handleOpen() { console.log("clicked") - console.log(this.props.loggedInUser) - console.log(this.props.loggedInUserGhId) - console.log(this.props.user.name) - console.log(this.props.user.ghId) this.setState({open: true}); }; @@ -161,19 +159,28 @@ class UserDetails extends React.Component { pairButton() { if (this.state.buttonClicked) { - return + } + onClick={ this.addPair } /> + } - onClick={ this.addPair } /> + icon={ } + href={`/projects/${this.state.curProjectId}`} + primary={ true } /> + } else if (!this.state.buttonClicked) { return } + icon={ } onClick={ this.addPair } primary={ true } /> } diff --git a/client/store/reducers.js b/client/store/reducers.js index c213ab8..e03041e 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -4,10 +4,12 @@ The actions get sent to App component and other parent component where they can be pass through as props. */ -import { combineReducers } from 'redux'; +import {combineReducers} from 'redux'; // does nothing - implemented to test connecting Redux to React -const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' ? action.text : state; +const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' + ? action.text + : state; /* first condition is the initial state @@ -26,14 +28,16 @@ const users = (state, action) => { } else if (action.type === 'CHANGE_USER_PAIRING') { return state.map((user) => { if (user.id === action.userId) { - const object = Object.assign({}, user, { paired: user.paired.concat(action.projectId) }); + const object = Object.assign({}, user, { + paired: user.paired.concat(action.projectId) + }); return object; } return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Users load:', action.payload.users); - return action.payload.users; + console.log('Users load:', action.payload.users); + return action.payload.users; } return state; }; @@ -44,12 +48,19 @@ const pairedUsers = (state, action) => { if (state === undefined) { return []; } else if (action.type === 'ADD_PAIRING') { - return state.concat([{ name: action.name, language: action.language, experience: action.experience, id: action.id }]); + return state.concat([ + { + name: action.name, + language: action.language, + experience: action.experience, + id: action.id + } + ]); // const object = Object.assign({}, ) // return state.concat(action.) } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('pairedUsers load:', action.payload.pairedUsers); - return action.payload.pairedUsers; + console.log('pairedUsers load:', action.payload.pairedUsers); + return action.payload.pairedUsers; } return state; } @@ -70,20 +81,22 @@ const projects = (state, action) => { } else if (action.type === 'CHANGE_PROJECT_INTEREST') { return state.map((project) => { if (project.id === action.projectId) { - return Object.assign({}, project, { interested: action.value }); + return Object.assign({}, project, {interested: action.value}); } return project; }); } else if (action.type === 'CHANGE_USER_PAIRING') { return state.map((project) => { if (project.id === action.projectId) { - return Object.assign({}, project, { paired: project.paired.concat(action.userId) }); + return Object.assign({}, project, { + paired: project.paired.concat(action.userId) + }); } return project; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Project load:', action.payload.projects); - return action.payload.projects; + console.log('Project load:', action.payload.projects); + return action.payload.projects; } return state; }; @@ -103,13 +116,15 @@ const messages = (state, action) => { return {}; } else if (action.type === 'MESSAGE_SEND') { const newMessages = {}; - newMessages[action.userId] = state[action.userId] ? [action.message].concat(state[action.userId]) : [action.message]; + newMessages[action.userId] = state[action.userId] + ? [action.message].concat(state[action.userId]) + : [action.message]; return Object.assign({}, state, newMessages); } else if (action.type === 'MESSAGES_LOAD') { return action.messages; } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Messages load', action.payload.messages); - return action.payload.messages; + console.log('Messages load', action.payload.messages); + return action.payload.messages; } return state; }; @@ -133,8 +148,8 @@ const projectProgress = (state, action) => { updatedProject[action.itemIndex].complete = !updatedProject[action.itemIndex].complete; return newProgress; } else if (action.type === 'REDUX_STORAGE_LOAD') { - console.log('Project progress load', action.payload.projectProgress); - return action.payload.projectProgress; + console.log('Project progress load', action.payload.projectProgress); + return action.payload.projectProgress; } return state; }; @@ -148,7 +163,6 @@ const loggedInUser = (state, action) => { return state; }; - /* hands off state/dispatch to React components with mapStateToProps and mapDispatchToProps combineReducers function creates a single object that contains all the reducers @@ -158,15 +172,6 @@ const loggedInUser = (state, action) => { code--they don't have to worry about every other part of the state. what we are doing here is using ES6 destructuring, so key and value are named the same. */ -// export default combineReducers({ -// message: changeString, -// users, -// projects, -// messages, -// pairedUsers, -// projectProgress, -// logout -// }); const appReducer = combineReducers({ message: changeString, @@ -185,4 +190,4 @@ const rootReducer = (state, action) => { return appReducer(state, action); } -export default rootReducer \ No newline at end of file +export default rootReducer diff --git a/server/routes/api.js b/server/routes/api.js index 1ce6911..7b18a60 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -171,17 +171,15 @@ module.exports = { pairedProjects: function findPairProjects(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); - + console.log('GET paired projects'); const userId = Number(req.query.userId); const partnerId = Number(req.query.partnerId); - console.log('paired projects req', partnerId); dbSession.run(` MATCH(user:User {ghId: ${userId}})-[:PAIRED_WITH]->(group)<- [:PAIRED_WITH]-(partner:User {ghId: ${partnerId}}) RETURN group `) .then((res) => { - console.log('Database retrieval of group: ', res.records); resolve(res.records); }) .catch(reject) @@ -244,8 +242,6 @@ module.exports = { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('POST pair'); - console.log('POST pair userId: ', req.user.ghInfo.id); - console.log('POST pair partnerId: ', req.body.partnered); dbSession.run(` MATCH (project:Project) WHERE ID(project) = ${Number(req.body.project)} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} From 537f6902228536b9b4c93440d021744bf562d3e9 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 21:12:13 -0700 Subject: [PATCH 045/105] Ready for rebase --- client/components/UserDetails.jsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index cc9e612..a50b9ae 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -122,14 +122,12 @@ class UserDetails extends React.Component { console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); //window.location.reload(); - //window.location.replace(`/projects/${this.props}`) - }) .catch((error) => { console.log(error); }); - //POSSIBLY ADD GET REQUEST HERE + axios.get('/') } togglePair() { @@ -210,6 +208,14 @@ class UserDetails extends React.Component { console.log(newMessage); }; + getMessages() { + axios.get('API/messages') + .then((res) => { + this.props.loadMessages(res.data) + }) + .catch(console.error); + } + renderMessages(msg) { console.log("asdadadadasd", this.state.chatBox) @@ -343,6 +349,10 @@ const mapStateToProps = (state, props) => { const mapDispatchToProps = dispatch => ({ + loadMessages: messages => dispatch({ + type: 'MESSAGES_LOAD', + messages, + }), createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), From 0c16b0ef38aabee082b725596cd3ef0f3a8e807f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 21:21:32 -0700 Subject: [PATCH 046/105] Ready for pull request --- client/components/UserDetails.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index a50b9ae..1dc1e88 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -360,7 +360,7 @@ const mapDispatchToProps = dispatch => export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); - +//WORK HERE /* }> From a9433e26e20b8512a9fbca5222db795ebd1c1be0 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 22:08:28 -0700 Subject: [PATCH 047/105] Fix login (again) --- client/components/App.jsx | 5 ----- client/components/UserDetails.jsx | 2 +- client/store/reducers.js | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index c0cf133..c8194e3 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -48,13 +48,8 @@ class App extends React.Component { this.navTap = this.navTap.bind(this); this.togglePartyMode = this.togglePartyMode.bind(this); - // this.handleLogout = this.handleLogout.bind(this); } -// componentDidMount() { -// this.getPairs() -// } - getPairs() { axios.get('/API/pairs') .then((pairs) => { diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 1dc1e88..0d8fb91 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -171,7 +171,7 @@ class UserDetails extends React.Component { label="Let's Work!" fullWidth={true} icon={ } - href={`/projects/${this.state.curProjectId}`} + href="/my-projects" primary={ true } /> } else if (!this.state.buttonClicked) { diff --git a/client/store/reducers.js b/client/store/reducers.js index e03041e..fbfda27 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -184,7 +184,7 @@ const appReducer = combineReducers({ }); const rootReducer = (state, action) => { - if (action.type === 'APP_LOGOUT') { + if (action.type === 'USER_LOGOUT') { state = undefined; } return appReducer(state, action); From 51e836c5f24b8aed0c22af15557f93b31b51d922 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 08:57:50 -0700 Subject: [PATCH 048/105] Update server side to grab projectId draft --- client/components/UserDetails.jsx | 8 ++++---- server/routes/api.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 0d8fb91..9a8e8fa 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -52,6 +52,7 @@ class UserDetails extends React.Component { this.setState({ expanded: true }); } + console.log("line 52", this.props.match.params.projectId) socket.on('chat message', (msg) => this.renderMessages(msg)); //receive messages @@ -112,6 +113,7 @@ class UserDetails extends React.Component { addPair() { + console.log("line 80", this.props.match.params.projectId) axios.post('/API/pair', { partnered: this.props.user.id, project: this.state.curProjectId, //this is undefined @@ -121,7 +123,6 @@ class UserDetails extends React.Component { this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); - //window.location.reload(); }) .catch((error) => { console.log(error); @@ -146,7 +147,7 @@ class UserDetails extends React.Component { /* dialog handler*/ handleOpen() { - console.log("clicked") + console.log("clicked"); this.setState({open: true}); }; @@ -174,6 +175,7 @@ class UserDetails extends React.Component { href="/my-projects" primary={ true } /> + } else if (!this.state.buttonClicked) { return dbSession.close()); From 9d5e0201f4f1d1b086b69f8f82e7c8f6f7ada429 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 09:08:24 -0700 Subject: [PATCH 049/105] Update projectId passing back to client side --- server/routes/api.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/routes/api.js b/server/routes/api.js index 7266bac..74d02b6 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -162,7 +162,6 @@ module.exports = { const project = res.records[0]; resolve(new db.models.Project(project.get('project')) ); - }) .catch(reject) .then(() => dbSession.close()); From 3433ba72e412da1314c97a1b74bac9107a62d8f0 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 13:17:06 -0700 Subject: [PATCH 050/105] Grab isPaired info from database --- client/components/UserDetails.jsx | 48 ++++++++++++++++++++++++++----- server/routes/api.js | 33 +++++++++++++++++++-- 2 files changed, 71 insertions(+), 10 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 9a8e8fa..3776c75 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -35,7 +35,7 @@ class UserDetails extends React.Component { console.log('this is props of UserDetails', props); super(props); this.state = { - buttonClicked: false, + // buttonClicked: false, expanded: false, partnerName: '', message: 'placeholder', @@ -52,20 +52,17 @@ class UserDetails extends React.Component { this.setState({ expanded: true }); } - console.log("line 52", this.props.match.params.projectId) - socket.on('chat message', (msg) => this.renderMessages(msg)); - //receive messages this.addPair = this.addPair.bind(this); - this.togglePair = this.togglePair.bind(this); + // this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); this.handleClose = this.handleClose.bind(this); this.handleSubmit = this.handleSubmit.bind(this); + this.checkIfPaired = this.checkIfPaired.bind(this); this.retrieveProjectId = this.retrieveProjectId.bind(this); this.initialize(); - this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { axios.post('/API/messages', { @@ -79,6 +76,36 @@ class UserDetails extends React.Component { }); }); }; + + socket.on('chat message', (msg) => this.renderMessages(msg)); + //receive messages + } + + initialize(){ + return new Promise ((resolve, reject) => { + this.retrieveProjectId(); + resolve(); + }) + .then(() => { + this.checkIfPaired(); + }) + + } + + + checkIfPaired() { + axios.get('/API/pairedProjects', { + params:{ + loggedInUserGhId: this.props.loggedInUserGhId, + partnerGhId:this.props.user.ghId + } + }) + .then((res)=> { + console.log('96....96 responseClient', res); + }) + .catch((error) => { + console.log(error); + }) } initialize() { @@ -113,7 +140,9 @@ class UserDetails extends React.Component { addPair() { - console.log("line 80", this.props.match.params.projectId) + console.log('partneredUserId91', this.props.user.id) + console.log('curProjectId92', this.state.curProjectId) + console.log('original',this.props.match.params.projectId) axios.post('/API/pair', { partnered: this.props.user.id, project: this.state.curProjectId, //this is undefined @@ -131,6 +160,7 @@ class UserDetails extends React.Component { axios.get('/') } + togglePair() { axios.post('/API/pair', { partnered: this.props.user.id, @@ -338,12 +368,16 @@ const mapStateToProps = (state, props) => { const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; + // const curProjectId = state.curProjectId; + // const curProjectProperty = state.curProjectProperty; return { user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, + // curProjectId, + // curProjectProperty, }; }; diff --git a/server/routes/api.js b/server/routes/api.js index 74d02b6..d49d311 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -168,6 +168,7 @@ module.exports = { }); }, + pairedProjects: function findPairProjects(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); @@ -200,6 +201,7 @@ module.exports = { RETURN pair `) .then((res) => { + console.log('185', res) resolve(res.records.map(project => res.records.map(user => new db.models.User(user.get('pair'))) )); @@ -207,7 +209,29 @@ module.exports = { .catch(reject) .then(() => dbSession.close()); }); - } + }, + + + pairedProjects: function findPair(req, res) { + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + console.log('197.....197 recived req', req.query); + const loggedInUserGhId = req.query.loggedInUserGhId; + const partnerGhId = req.query.partnerGhId; + + dbSession.run(` + MATCH (cur:User{ghId:${loggedInUserGhId}})-[:PAIRED_WITH]->(group)<-[:PAIRED_WITH]-(paired:User{ghId:${partnerGhId}}) + RETURN group + `) + .then((res) => { + console.log('205 response for group', res); + resolve(res); + }) + .catch(reject) + .then(()=> dbSession.close()); + }); + }, + }, @@ -241,7 +265,6 @@ module.exports = { pair: function addPair(req) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); - console.log('POST pair'); dbSession.run(` MATCH (project:Project) WHERE ID(project) = ${Number(req.body.project)} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} @@ -251,12 +274,16 @@ module.exports = { SET group.progress = project.structure return user, pair, group, project `) - .then(resolve) + .then((res)=> { + resolve(res); + }) .catch(reject) .then(() => dbSession.close()); }); }, + + // Adds a new message from the requesting user to the database messages: function sendMessage(req) { return new Promise((resolve, reject) => { From b8e7fbcac0621f110788a1eaaaff67a67371b024 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 21:12:16 -0700 Subject: [PATCH 051/105] Update myPartner state presistent stays --- client/components/UserDetails.jsx | 20 +++++++++++++++----- client/store/reducers.js | 12 +++++++++++- server/routes/api.js | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 3776c75..19975a8 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -81,12 +81,16 @@ class UserDetails extends React.Component { //receive messages } + + + initialize(){ return new Promise ((resolve, reject) => { this.retrieveProjectId(); resolve(); }) .then(() => { + this.props.checkPairingStatus(false); this.checkIfPaired(); }) @@ -102,6 +106,13 @@ class UserDetails extends React.Component { }) .then((res)=> { console.log('96....96 responseClient', res); + console.log('110', this.props.isPaired) + if(res.data.records.length !== 0) { + this.props.checkPairingStatus(true); + } else if (res.data.records.length > 0) { + this.props.checkPairingStatus(false); + } + console.log('line 115', this.props.isPaired) }) .catch((error) => { console.log(error); @@ -142,7 +153,6 @@ class UserDetails extends React.Component { addPair() { console.log('partneredUserId91', this.props.user.id) console.log('curProjectId92', this.state.curProjectId) - console.log('original',this.props.match.params.projectId) axios.post('/API/pair', { partnered: this.props.user.id, project: this.state.curProjectId, //this is undefined @@ -368,16 +378,15 @@ const mapStateToProps = (state, props) => { const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; - // const curProjectId = state.curProjectId; - // const curProjectProperty = state.curProjectProperty; + const isPaired = state.pairingStatus; + console.log('346', state.pairingStatus) return { user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, - // curProjectId, - // curProjectProperty, + isPaired, }; }; @@ -390,6 +399,7 @@ const mapDispatchToProps = dispatch => createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), + checkPairingStatus: (isPaired) => dispatch({type: 'ADD_PAIRING_STATUS', isPaired}), }); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); diff --git a/client/store/reducers.js b/client/store/reducers.js index fbfda27..a6307ea 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -63,6 +63,15 @@ const pairedUsers = (state, action) => { return action.payload.pairedUsers; } return state; +}; + +const pairingStatus = (state, action) => { + if (state === undefined) { + return null; + } else if (action.type === 'ADD_PAIRING_STATUS') { + return action.isPaired + } + return state; } /* @@ -180,7 +189,8 @@ const appReducer = combineReducers({ messages, pairedUsers, projectProgress, - loggedInUser + loggedInUser, + pairingStatus, }); const rootReducer = (state, action) => { diff --git a/server/routes/api.js b/server/routes/api.js index d49d311..755170f 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -215,7 +215,7 @@ module.exports = { pairedProjects: function findPair(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); - console.log('197.....197 recived req', req.query); + console.log('197.....197 recived req', req.query); const loggedInUserGhId = req.query.loggedInUserGhId; const partnerGhId = req.query.partnerGhId; From 40f392e6803d9f661d1cdc05875107ec0d00e861 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 22:11:15 -0700 Subject: [PATCH 052/105] Update partyMode position --- client/components/App.jsx | 3 -- client/components/ProjectStatus.jsx | 9 ++++ client/components/UserDetails.jsx | 64 +++++------------------------ server/routes/api.js | 37 +++-------------- 4 files changed, 24 insertions(+), 89 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index c8194e3..3724a12 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -153,9 +153,6 @@ getPairs() { - - - ); diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 6135de3..7167f36 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -7,10 +7,12 @@ import { ToolbarTitle } from 'material-ui/Toolbar'; import { Card, CardHeader, CardText } from 'material-ui/Card'; +import FloatingActionButton from 'material-ui/FloatingActionButton'; import Checkbox from 'material-ui/Checkbox'; import RaisedButton from 'material-ui/RaisedButton'; import FlatButton from 'material-ui/FlatButton'; import Dialog from 'material-ui/Dialog'; +import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; const style = { margin: 12, @@ -58,6 +60,7 @@ class ProjectStatus extends React.Component { render() { return ( +
      @@ -108,6 +111,12 @@ class ProjectStatus extends React.Component { + + + + +
      + ) } } diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 19975a8..51d5b98 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -35,7 +35,7 @@ class UserDetails extends React.Component { console.log('this is props of UserDetails', props); super(props); this.state = { - // buttonClicked: false, + buttonClicked: false, expanded: false, partnerName: '', message: 'placeholder', @@ -52,17 +52,19 @@ class UserDetails extends React.Component { this.setState({ expanded: true }); } + socket.on('chat message', (msg) => this.renderMessages(msg)); + //receive messages this.addPair = this.addPair.bind(this); - // this.togglePair = this.togglePair.bind(this); + this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); this.handleClose = this.handleClose.bind(this); this.handleSubmit = this.handleSubmit.bind(this); - this.checkIfPaired = this.checkIfPaired.bind(this); this.retrieveProjectId = this.retrieveProjectId.bind(this); this.initialize(); + this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { axios.post('/API/messages', { @@ -76,47 +78,6 @@ class UserDetails extends React.Component { }); }); }; - - socket.on('chat message', (msg) => this.renderMessages(msg)); - //receive messages - } - - - - - initialize(){ - return new Promise ((resolve, reject) => { - this.retrieveProjectId(); - resolve(); - }) - .then(() => { - this.props.checkPairingStatus(false); - this.checkIfPaired(); - }) - - } - - - checkIfPaired() { - axios.get('/API/pairedProjects', { - params:{ - loggedInUserGhId: this.props.loggedInUserGhId, - partnerGhId:this.props.user.ghId - } - }) - .then((res)=> { - console.log('96....96 responseClient', res); - console.log('110', this.props.isPaired) - if(res.data.records.length !== 0) { - this.props.checkPairingStatus(true); - } else if (res.data.records.length > 0) { - this.props.checkPairingStatus(false); - } - console.log('line 115', this.props.isPaired) - }) - .catch((error) => { - console.log(error); - }) } initialize() { @@ -151,8 +112,6 @@ class UserDetails extends React.Component { addPair() { - console.log('partneredUserId91', this.props.user.id) - console.log('curProjectId92', this.state.curProjectId) axios.post('/API/pair', { partnered: this.props.user.id, project: this.state.curProjectId, //this is undefined @@ -162,6 +121,7 @@ class UserDetails extends React.Component { this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); console.log(response); this.setState({buttonClicked: !this.state.buttonClicked}); + //window.location.reload(); }) .catch((error) => { console.log(error); @@ -170,7 +130,6 @@ class UserDetails extends React.Component { axios.get('/') } - togglePair() { axios.post('/API/pair', { partnered: this.props.user.id, @@ -187,7 +146,7 @@ class UserDetails extends React.Component { /* dialog handler*/ handleOpen() { - console.log("clicked"); + console.log("clicked") this.setState({open: true}); }; @@ -215,7 +174,6 @@ class UserDetails extends React.Component { href="/my-projects" primary={ true } /> - } else if (!this.state.buttonClicked) { return { const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; - const isPaired = state.pairingStatus; - console.log('346', state.pairingStatus) return { user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, - isPaired, }; }; @@ -399,7 +356,6 @@ const mapDispatchToProps = dispatch => createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), - checkPairingStatus: (isPaired) => dispatch({type: 'ADD_PAIRING_STATUS', isPaired}), }); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); @@ -408,4 +364,4 @@ export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); /* }> - */ +
      */ \ No newline at end of file diff --git a/server/routes/api.js b/server/routes/api.js index 755170f..04a6572 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -161,14 +161,13 @@ module.exports = { console.log('GET PROJECT project response', res); const project = res.records[0]; resolve(new db.models.Project(project.get('project')) - ); + ); }) .catch(reject) .then(() => dbSession.close()); }); }, - pairedProjects: function findPairProjects(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); @@ -201,7 +200,6 @@ module.exports = { RETURN pair `) .then((res) => { - console.log('185', res) resolve(res.records.map(project => res.records.map(user => new db.models.User(user.get('pair'))) )); @@ -209,29 +207,7 @@ module.exports = { .catch(reject) .then(() => dbSession.close()); }); - }, - - - pairedProjects: function findPair(req, res) { - return new Promise((resolve, reject) => { - const dbSession = dbDriver.session(); - console.log('197.....197 recived req', req.query); - const loggedInUserGhId = req.query.loggedInUserGhId; - const partnerGhId = req.query.partnerGhId; - - dbSession.run(` - MATCH (cur:User{ghId:${loggedInUserGhId}})-[:PAIRED_WITH]->(group)<-[:PAIRED_WITH]-(paired:User{ghId:${partnerGhId}}) - RETURN group - `) - .then((res) => { - console.log('205 response for group', res); - resolve(res); - }) - .catch(reject) - .then(()=> dbSession.close()); - }); - }, - + } }, @@ -265,6 +241,7 @@ module.exports = { pair: function addPair(req) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); + console.log('POST pair'); dbSession.run(` MATCH (project:Project) WHERE ID(project) = ${Number(req.body.project)} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} @@ -274,16 +251,12 @@ module.exports = { SET group.progress = project.structure return user, pair, group, project `) - .then((res)=> { - resolve(res); - }) + .then(resolve) .catch(reject) .then(() => dbSession.close()); }); }, - - // Adds a new message from the requesting user to the database messages: function sendMessage(req) { return new Promise((resolve, reject) => { @@ -343,4 +316,4 @@ module.exports = { } }, -}; +}; \ No newline at end of file From 070e5dc2053762094cfabe6d18071806290b7985 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 23:15:14 -0700 Subject: [PATCH 053/105] Update chatroom to userdetail page --- client/components/ProjectStatus.jsx | 137 +++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 5 deletions(-) diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 7167f36..5ff94be 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -14,10 +14,19 @@ import FlatButton from 'material-ui/FlatButton'; import Dialog from 'material-ui/Dialog'; import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; +import io from 'socket.io-client'; +const socket = io(); + + const style = { margin: 12, }; +const customContentStyle = { + width: '80%', + height: '100%', + maxWidth: 'none', +}; // renders a progress item component inside ProjectStatus const ProgressItem = (props) => { const check = () => props.dispatchProgress(props.projectId, props.index); @@ -36,13 +45,33 @@ class ProjectStatus extends React.Component { super(props); this.state = { - open: false + open: false, + dialogOpen: false, + chatBox: [], + } this.handleSubmit = this.handleSubmit.bind(this); this.handleClose = this.handleClose.bind(this); + this.handleDiaLogOpen = this.handleDiaLogOpen.bind(this); + this.handleDiaLogClose = this.handleDiaLogClose.bind(this); + this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); + + socket.on('chat message', (msg) => this.renderMessages(msg)); } + /* dialog handler*/ + handleDiaLogOpen() { + console.log("clicked") + this.setState({dialogOpen: true}); + }; + + handleDiaLogClose() { + console.log('clicked') + this.setState({dialogOpen: false}); + }; + /* dialog handler end*/ + //handles opening the dialog alert and submits the project's progress handleSubmit() { this.setState({ @@ -58,7 +87,58 @@ class ProjectStatus extends React.Component { }); } + + handleMessegeSubmit(event) { + event.preventDefault(); + + var newMessage = { + message: this._message.value, + username: this.props.loggedInUser + } + + var myMessage = { + username: "me: ", + message: this._message.value + } + + + var updatedChatBox = this.state.chatBox + updatedChatBox.push(myMessage); + console.log('chatbox', this.state.chatBox) + + this.setState({ + chatBox: updatedChatBox + }); + + socket.emit('chat message', newMessage); //send msg + console.log(newMessage); + console.log('chatbox',this.state.chatBox) + }; + + + renderMessages(msg) { + var updatedChatBox= this.state.chatBox; + console.log("line 119", msg) + updatedChatBox.push(msg); + this.setState({ + chatBox: updatedChatBox + }); + }; + render() { + const actions = [ +
      +
      + this._message = message} id="newMessage" type="text"/> + Send + +
      , + + ]; return (
      @@ -111,14 +191,61 @@ class ProjectStatus extends React.Component { - + - - + + +
        hey
      + { + this.state.chatBox.map((chat, index) => { + return( +
      + {chat.username} +

      {chat.message}

      +
      + )} + ) + } +
      ) } } -export default ProjectStatus; + + +const mapStateToProps = (state, props) => { + const loggedInUser = state.loggedInUser.username; + const loggedInUserGhId = state.loggedInUser.ghId; + return { + loggedInUser, + loggedInUserGhId, + }; +}; + +const mapDispatchToProps = dispatch => + ({ + + }); + +export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); + + + + + + + + + + + + From 1ca0f6b50a6882fab5174b9ca73921f968f546ad Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Sun, 27 Aug 2017 23:17:26 -0700 Subject: [PATCH 054/105] Update userprofile page back with origin message function --- client/components/UserDetails.jsx | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 51d5b98..def345f 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -274,10 +274,10 @@ class UserDetails extends React.Component { project.project).join(' ')}/>
      { this.pairButton() } - } onClick={this.handleOpen} secondary={true} /> + } onClick={this.expandCard} secondary={true} />
      - {/*dialog for message*/} + {/*dialog for message
      - // - //
      - //
      - // } secondary={true}/> - // { this.props.messages.map((message, index) => - // - // { message.sender ? 'You' : this.props.user.name } - // { message.text } - // - // )} - //
      - // {/* should be deleted end*/} - } + +
      + +
      +
      + } secondary={true}/> + { this.props.messages.map((message, index) => + + { message.sender ? 'You' : this.props.user.name } + { message.text } + + )} +
      + {/* should be deleted end*/} +
      From e6d1c913425a398f29b9247f5bff2da754793f9b Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Sun, 27 Aug 2017 23:20:24 -0700 Subject: [PATCH 055/105] Clean up code --- client/components/App.jsx | 1 + client/components/MyPartners.jsx | 2 +- client/components/UserDetails.jsx | 4 ++-- client/store/reducers.js | 12 +----------- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 6a05fd8..0d908e9 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -63,6 +63,7 @@ class App extends React.Component { getProjects() { axios.get('/API/projects/') .then((project) => { + console.log('GEt PROJECTS', project.data); this.props.addProjectsList(project.data); }) .catch(console.error); diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 08193f8..296052e 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -21,7 +21,7 @@ import Subheader from 'material-ui/Subheader'; const MyPartners = (props) => { - console.log('This is the props from MyPartners ', props); + console.log('My Partners props', props); return ( diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index db326b2..3170d72 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -30,8 +30,8 @@ const socket = io(); class UserDetails extends React.Component { constructor(props) { - console.log('this is props of UserDetails', props); super(props); + console.log('this is props of UserDetails', props); this.state = { buttonClicked: false, expanded: false, @@ -319,7 +319,7 @@ class UserDetails extends React.Component { } } const mapStateToProps = (state, props) => { - //console.log("line 267", state) + console.log("line 267", state) const userId = Number(props.match.params.id); const user = state.users.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) diff --git a/client/store/reducers.js b/client/store/reducers.js index a781ca2..4360425 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -14,8 +14,6 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE */ const users = (state, action) => { - // console.log('users state: ', state); - // console.log('users action: ', action); if (state === undefined) { return []; } else if (action.type === 'USERS_ADD') { @@ -41,8 +39,6 @@ const users = (state, action) => { }; const pairedUsers = (state, action) => { - // console.log('pairedUsers state: ', state); - // console.log('pairedUsers action: ', action); if (state === undefined) { return []; } else if (action.type === 'ADD_PAIRING') { @@ -54,8 +50,6 @@ const pairedUsers = (state, action) => { id: action.id } ]); - // const object = Object.assign({}, ) - // return state.concat(action.) } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; @@ -79,8 +73,6 @@ const pairingStatus = (state, action) => { inside UserDetails component we dispatch 'CHANGE_USER' when user select 'they want to pair' button */ const projects = (state, action) => { - // console.log('projects state: ', state); - // console.log('projects action: ', action); if (state === undefined) { return []; } else if (action.type === 'LIST_PROJECTS') { @@ -88,7 +80,7 @@ const projects = (state, action) => { } else if (action.type === 'CHANGE_PROJECT_INTEREST') { return state.map((project) => { if (project.id === action.projectId) { - return Object.assign({}, project, {interested: action.value}); + return Object.assign({}, project, { interested: action.value }); } return project; }); @@ -115,8 +107,6 @@ const projects = (state, action) => { SUGGESTION: implement socket.io */ const messages = (state, action) => { - // console.log('messages state: ', state); - // console.log('messages action: ', action); if (state === undefined) { return {}; } else if (action.type === 'MESSAGE_SEND') { From ea1a6143d3104856e12ebefe12bfefd45e4e3b78 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Mon, 28 Aug 2017 02:21:33 -0700 Subject: [PATCH 056/105] My Partners fixed --- client/components/MyPartners.jsx | 83 ++++++++++++++++++++++++++++--- client/components/UserDetails.jsx | 4 +- server/routes/auth.js | 3 ++ 3 files changed, 80 insertions(+), 10 deletions(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 296052e..2da8753 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -20,8 +20,64 @@ import Subheader from 'material-ui/Subheader'; -const MyPartners = (props) => { - console.log('My Partners props', props); +class MyPartners extends React.Component { + constructor(props) { + super(props); + console.log('props', Array.isArray(this.props.currentPartners)) + this.state = { + isMounted: false, + userLists: [], + } + + // this.handleMounted = this.handleMounted.bind(this); + // this.handlePatners = this.handlePatners.bind(this); + } + + componentDidMount(){ + console.log('i mounted', this.props.pairedUsers) + // this.handleMounted() + let tests = this.props.pairedUsers; + + if(tests) { + this.setState({ + userLists:this.props.pairedUsers + }) + } else { + this.setState({ + userLists:[] + }) + } + + } + + handleMounted(){ + // this.setState({isMounted : true}) + } + + + handlePatners(){ + // console.log('working'); + + // console.log("48", this.props.currentPartners) + // if (Aarray.isArray(this.props.currentPartners)) { + // console.log('am i running') + // (this.props.currentPartners[0] ? this.props.currentPartners[0] : []).map(user => + // ( + // { user.name } + // { user.language } + // { user.experience } + // ) + // ) + // } + + } + + // var test = Array.prototype.slice.call(props.currentPartners) + // console.log('test', test) +render() { + let tests = this.state.userLists + console.log('hehehehhehe', Array.isArray(tests)) + console.log('hsdsdwe3e23234', tests) return ( @@ -40,26 +96,37 @@ const MyPartners = (props) => {
      - {(props.currentPartners[0] ? props.currentPartners[0] : []).map(user => + { + tests.map(user => ( { user.name } { user.language } { user.experience } ) - )} + ) + } +
      ); -}; + } +} + + const mapStateToProps = (state) => { - console.log('State is: ', state); + console.log('state', state.pairedUsers) + const pairedUsers = state.pairedUsers; return { - // pairedUsers: state.pairedUsers + pairedUsers: pairedUsers }; }; +const mapDispatchToProps = (dispatch) => { + return { + }; +}; -export default connect(mapStateToProps)(MyPartners); +export default connect(mapStateToProps, mapDispatchToProps)(MyPartners); diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 3170d72..d6738a0 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -319,7 +319,7 @@ class UserDetails extends React.Component { } } const mapStateToProps = (state, props) => { - console.log("line 267", state) + console.log("line 267", props) const userId = Number(props.match.params.id); const user = state.users.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) @@ -347,4 +347,4 @@ export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); /* }> - */ \ No newline at end of file + */ diff --git a/server/routes/auth.js b/server/routes/auth.js index 40bf5f6..9d409c6 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -15,6 +15,9 @@ module.exports = { signout: function signout(req, res) { // destroy session and redirect to home console.log('LOGGING OUT'); + // req.session.destroy(function (err) { + // res.redirect('/'); + // }); req.logout(); res.redirect('/'); }, From ffacd13d46ba3847d38382cdb0a56ade7d2ab00f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Mon, 28 Aug 2017 03:36:24 -0700 Subject: [PATCH 057/105] Paired users load nicely --- client/components/App.jsx | 4 +++- client/components/MyPartners.jsx | 4 ---- client/components/UserDetails.jsx | 1 + client/store/reducers.js | 21 +++++++++++++-------- server/routes/auth.js | 4 +--- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 0d908e9..62e8a2b 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -54,7 +54,9 @@ class App extends React.Component { getPairs() { axios.get('/API/pairs') .then((pairs) => { - this.setState({myPartners: pairs.data}) + console.log('APP.jsx get pairs', pairs); + this.setState({myPartners: pairs.data}); + this.props.addPairsList(pairs.data); }) .catch(console.error); } diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 2da8753..43c5a35 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -23,7 +23,6 @@ import Subheader from 'material-ui/Subheader'; class MyPartners extends React.Component { constructor(props) { super(props); - console.log('props', Array.isArray(this.props.currentPartners)) this.state = { isMounted: false, userLists: [], @@ -34,7 +33,6 @@ class MyPartners extends React.Component { } componentDidMount(){ - console.log('i mounted', this.props.pairedUsers) // this.handleMounted() let tests = this.props.pairedUsers; @@ -76,8 +74,6 @@ class MyPartners extends React.Component { // console.log('test', test) render() { let tests = this.state.userLists - console.log('hehehehhehe', Array.isArray(tests)) - console.log('hsdsdwe3e23234', tests) return ( diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index d6738a0..9167154 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -234,6 +234,7 @@ class UserDetails extends React.Component { }; render() { + console.log('USER DETAILS props', this.props); const actions = [
      diff --git a/client/store/reducers.js b/client/store/reducers.js index 4360425..c6593ed 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -14,6 +14,7 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE */ const users = (state, action) => { + console.log('Reducer action', action); if (state === undefined) { return []; } else if (action.type === 'USERS_ADD') { @@ -42,14 +43,18 @@ const pairedUsers = (state, action) => { if (state === undefined) { return []; } else if (action.type === 'ADD_PAIRING') { - return state.concat([ - { - name: action.name, - language: action.language, - experience: action.experience, - id: action.id - } - ]); + console.log('ADD PAIRING state', state); + //console.log('ADD PAIRING action', action.pairs[0]); + //return action.pairs[0]; + // return state.map((pair) => { + // if (pair.id === action.userId) { + // const object = Object.assign({}, pair, { + // paired: pair.paired.concat(action.projectId) + // }); + // return object; + // } + // return pair; + // }); } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; diff --git a/server/routes/auth.js b/server/routes/auth.js index 9d409c6..34d906a 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -15,9 +15,7 @@ module.exports = { signout: function signout(req, res) { // destroy session and redirect to home console.log('LOGGING OUT'); - // req.session.destroy(function (err) { - // res.redirect('/'); - // }); + req.session.destroy(); req.logout(); res.redirect('/'); }, From 2db6440773aa5da0062f07c3128c4c698e308afb Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Mon, 28 Aug 2017 11:38:07 -0700 Subject: [PATCH 058/105] Destroy session and logout --- client/components/Questionnaire.jsx | 1 - server/routes/auth.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index 91017f8..16e274c 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -51,7 +51,6 @@ class Questionnaire extends React.Component { return (

      Welcome, {this.props.user.name}

      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam varius quam id quam aliquot, quis varius est euismod.


      Select your preferred language to use with other GitPal members:

      this.onLanguageSelect(val)}> diff --git a/server/routes/auth.js b/server/routes/auth.js index 34d906a..409e37c 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -14,10 +14,10 @@ module.exports = { GET: { signout: function signout(req, res) { // destroy session and redirect to home - console.log('LOGGING OUT'); - req.session.destroy(); - req.logout(); - res.redirect('/'); + console.log('LOGGING OUT'); + req.session.destroy() + req.logout(); + res.redirect('/'); }, authenticated: function checkAuthenticated(req, res) { // If user signed in, send account details From 32353efd5a7c41a16defa42feb6b3bae8efeef45 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 00:24:29 -0700 Subject: [PATCH 059/105] Update post pair route to send back paired user --- client/components/App.jsx | 13 +++++++++---- client/components/MyPartners.jsx | 28 +++++++++++----------------- client/components/UserDetails.jsx | 3 ++- client/store/reducers.js | 31 +++++++++++++++++++------------ server/routes/api.js | 8 ++++++-- 5 files changed, 47 insertions(+), 36 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 62e8a2b..4a4a5f7 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -55,8 +55,8 @@ class App extends React.Component { axios.get('/API/pairs') .then((pairs) => { console.log('APP.jsx get pairs', pairs); - this.setState({myPartners: pairs.data}); - this.props.addPairsList(pairs.data); + //this.setState({myPartners: pairs.data}); + this.props.loadPairedUsers(pairs.data); }) .catch(console.error); } @@ -173,10 +173,11 @@ class App extends React.Component { Allows App component to have message and project state */ const mapStateToProps = (state) => { - //console.log('APP state: ', state); + console.log('APP state: ', state); return { message: state.message, projects: state.projects, + pairedUsers: state.pairedUsers, }; }; @@ -185,7 +186,7 @@ const mapStateToProps = (state) => { Dispatch can be found in store/reducers.js */ const mapDispatchToProps = (dispatch) => { - //console.log('APP dispatch: ', dispatch); + //console.log('APP dispatch: ', projects); return { changeString: () => dispatch({ type: 'CHANGE_STRING', @@ -199,6 +200,10 @@ const mapDispatchToProps = (dispatch) => { type: 'MESSAGES_LOAD', messages, }), + loadPairedUsers: pairedUsers => dispatch({ + type: 'LOAD_PAIRING', + pairedUsers, + }), addPairsList: pairs => dispatch({ type: 'ADD_PAIRING', pairs, diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 43c5a35..f63d6fd 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -27,29 +27,25 @@ class MyPartners extends React.Component { isMounted: false, userLists: [], } - + console.log('My Partners props 1', props); + // this.setState({ + // userLists:this.props.pairedUsers + // }) // this.handleMounted = this.handleMounted.bind(this); // this.handlePatners = this.handlePatners.bind(this); } componentDidMount(){ - // this.handleMounted() - let tests = this.props.pairedUsers; - - if(tests) { + console.log('My Partners props 2', this.props); + if(this.props.pairedUsers) { this.setState({ - userLists:this.props.pairedUsers + userLists: this.props.pairedUsers }) } else { this.setState({ userLists:[] }) } - - } - - handleMounted(){ - // this.setState({isMounted : true}) } @@ -70,10 +66,9 @@ class MyPartners extends React.Component { } - // var test = Array.prototype.slice.call(props.currentPartners) - // console.log('test', test) render() { - let tests = this.state.userLists + console.log('My Partners state 1', this.props); + let tests = this.props.pairedUsers[0]; return ( @@ -113,10 +108,9 @@ render() { const mapStateToProps = (state) => { - console.log('state', state.pairedUsers) - const pairedUsers = state.pairedUsers; + //console.log('My Partners state 2', state); return { - pairedUsers: pairedUsers + pairedUsers: state.pairedUsers }; }; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 9167154..a603e18 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -115,8 +115,9 @@ class UserDetails extends React.Component { }) .then((response) => { console.log('this is props from clicking', this.props); + console.log('Add Pair response', response); this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); - console.log(response); + console.log('Add pair response: ', response); this.setState({buttonClicked: !this.state.buttonClicked}); //window.location.reload(); }) diff --git a/client/store/reducers.js b/client/store/reducers.js index c6593ed..45ea7c1 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -42,19 +42,26 @@ const users = (state, action) => { const pairedUsers = (state, action) => { if (state === undefined) { return []; + } else if (action.type === 'LOAD_PAIRING') { + console.log('LOAD PAIRING STATE', state); + console.log('LOAD PAIRING ACTION', action.pairedUsers); + return action.pairedUsers; } else if (action.type === 'ADD_PAIRING') { - console.log('ADD PAIRING state', state); - //console.log('ADD PAIRING action', action.pairs[0]); - //return action.pairs[0]; - // return state.map((pair) => { - // if (pair.id === action.userId) { - // const object = Object.assign({}, pair, { - // paired: pair.paired.concat(action.projectId) - // }); - // return object; - // } - // return pair; - // }); + console.log('ADD PAIRING state 1', state); + console.log('ADD PAIRING action', action); + if (state.length !== 0) { + let idCollection = state[0].map(function(id) { + return state.id; + }); + + if (idCollection.indexOf(action.id) === -1) { + state[0].push(action); + } + + console.log('ADD PAIRING state 2', state); + return state; + } + return action; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; diff --git a/server/routes/api.js b/server/routes/api.js index 04a6572..0487d00 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -251,7 +251,11 @@ module.exports = { SET group.progress = project.structure return user, pair, group, project `) - .then(resolve) + .then((res) => { + console.log('POST PAIR project response', res); + const pair = res.records[0]; + resolve(new db.models.User(pair.get('pair'))); + }) .catch(reject) .then(() => dbSession.close()); }); @@ -316,4 +320,4 @@ module.exports = { } }, -}; \ No newline at end of file +}; From 2c491481d9eef64505bec82b4ed9861e751636cd Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 00:32:04 -0700 Subject: [PATCH 060/105] Streamline POST pair and ADD_PAIRING methods --- client/components/UserDetails.jsx | 5 ++--- server/routes/api.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index a603e18..8e7a4c3 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -116,8 +116,7 @@ class UserDetails extends React.Component { .then((response) => { console.log('this is props from clicking', this.props); console.log('Add Pair response', response); - this.props.createPairing(this.props.user.name, this.props.user.language, this.props.user.experience, this.props.user.id); - console.log('Add pair response: ', response); + this.props.createPairing(response.data); this.setState({buttonClicked: !this.state.buttonClicked}); //window.location.reload(); }) @@ -341,7 +340,7 @@ const mapDispatchToProps = dispatch => type: 'MESSAGES_LOAD', messages, }), - createPairing: (name, language, experience, id) => dispatch({ type: 'ADD_PAIRING', name, language, experience, id }), + createPairing: (pairs) => dispatch({ type: 'ADD_PAIRING', pairs }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), }); diff --git a/server/routes/api.js b/server/routes/api.js index 0487d00..4f46748 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -252,7 +252,6 @@ module.exports = { return user, pair, group, project `) .then((res) => { - console.log('POST PAIR project response', res); const pair = res.records[0]; resolve(new db.models.User(pair.get('pair'))); }) From bddc41a140b6a8f3fd104589aa858e443bf649d7 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 01:16:16 -0700 Subject: [PATCH 061/105] Refresh bug nearly conquered --- client/components/UserDetails.jsx | 7 ++----- client/store/reducers.js | 16 +++++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 8e7a4c3..ddd39a0 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -96,7 +96,6 @@ class UserDetails extends React.Component { }) .then((pairProjects) => { if (pairProjects.data.length > 0) { - console.log('THERE ARE PROJECTS HERE'); this.setState({ buttonClicked: true }) @@ -114,8 +113,6 @@ class UserDetails extends React.Component { project: this.state.curProjectId, //this is undefined }) .then((response) => { - console.log('this is props from clicking', this.props); - console.log('Add Pair response', response); this.props.createPairing(response.data); this.setState({buttonClicked: !this.state.buttonClicked}); //window.location.reload(); @@ -132,7 +129,7 @@ class UserDetails extends React.Component { project: this.state.curProjectId, }) .then((response) => { - this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); + //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); console.log(response); }) .catch((error) => { @@ -141,7 +138,7 @@ class UserDetails extends React.Component { } /* dialog handler*/ handleOpen() { - console.log("clicked") + //console.log("clicked") this.setState({open: true}); }; handleClose() { diff --git a/client/store/reducers.js b/client/store/reducers.js index 45ea7c1..543cccf 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -50,18 +50,16 @@ const pairedUsers = (state, action) => { console.log('ADD PAIRING state 1', state); console.log('ADD PAIRING action', action); if (state.length !== 0) { - let idCollection = state[0].map(function(id) { - return state.id; + const idCollection = state[0].map((user) => { + return user.ghId; }); - - if (idCollection.indexOf(action.id) === -1) { - state[0].push(action); + if (idCollection.indexOf(action.pairs.ghId) === -1) { + state[0].push(action.pairs); } - - console.log('ADD PAIRING state 2', state); - return state; + } else { + state.push(action.pairs); } - return action; + return state; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('pairedUsers load:', action.payload.pairedUsers); return action.payload.pairedUsers; From b45e840e79223a2d527216ed9bdc55cfa623ca3f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 02:58:50 -0700 Subject: [PATCH 062/105] Unused functions removed --- client/components/MyPartners.jsx | 5 +++-- client/components/Project.jsx | 1 - client/components/UserDetails.jsx | 21 ++++++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index f63d6fd..21f3112 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -107,8 +107,9 @@ render() { -const mapStateToProps = (state) => { - //console.log('My Partners state 2', state); +const mapStateToProps = (state, props) => { + console.log('My Partners state 2', state); + console.log('My partner mapStateToProps props', props); return { pairedUsers: state.pairedUsers }; diff --git a/client/components/Project.jsx b/client/components/Project.jsx index c8f9f5f..e352551 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -48,7 +48,6 @@ class Project extends React.Component { Allows Project component to have project and projectID state */ const mapStateToProps = (state, props) => { - //debugger; console.log('Project.jsx state: ', state); const projectId = Number(props.match.params.id); const project = state.projects.filter(project => project.id === projectId)[0]; diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index ddd39a0..dbad244 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -337,12 +337,19 @@ const mapDispatchToProps = dispatch => type: 'MESSAGES_LOAD', messages, }), - createPairing: (pairs) => dispatch({ type: 'ADD_PAIRING', pairs }), - dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId }), - dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message }), + createPairing: (pairs) => dispatch({ + type: 'ADD_PAIRING', + pairs, + }), + dispatchPairing: (userId, projectId) => dispatch({ + type: 'CHANGE_USER_PAIRING', + userId, + projectId, + }), + dispatchMessage: (userId, message) => dispatch({ + type: 'MESSAGE_SEND', + userId, + message, + }), }); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); - -/* }> - - */ From 5c827b2ef525dcc4a270da81bbc8b879afbcd37f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 22:59:26 -0700 Subject: [PATCH 063/105] Just in case it is working --- client/components/App.jsx | 21 ++++++++++++++++++--- client/components/UserDetails.jsx | 5 +++-- client/store/reducers.js | 15 +++++++++++++++ server/routes/api.js | 16 ++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 4a4a5f7..35c8ee4 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -46,9 +46,20 @@ class App extends React.Component { this.navTap = this.navTap.bind(this); } + componentDidUpdate() { + console.log('component Updated'); + if(this.state.loggedIn) { + this.getAllUsers(); + } + + } - componentDidMount() { - this.getPairs() + getAllUsers() { + axios.get('/API/allUsers') + .then((allUsers) => { + this.props.addAllUsers(allUsers.data); + }) + .catch(console.error); } getPairs() { @@ -65,7 +76,7 @@ class App extends React.Component { getProjects() { axios.get('/API/projects/') .then((project) => { - console.log('GEt PROJECTS', project.data); + console.log('GET PROJECTS', project.data); this.props.addProjectsList(project.data); }) .catch(console.error); @@ -188,6 +199,10 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { //console.log('APP dispatch: ', projects); return { + addAllUsers: (allUsers) => dispatch({ + type: 'LOAD_ALL_USERS', + allUsers, + }), changeString: () => dispatch({ type: 'CHANGE_STRING', text: 'some other message' diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index dbad244..f15a6ce 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -317,9 +317,10 @@ class UserDetails extends React.Component { } } const mapStateToProps = (state, props) => { - console.log("line 267", props) + console.log("line 267", props); + console.log("line 334", state); const userId = Number(props.match.params.id); - const user = state.users.filter(user => user.id === userId)[0]; + const user = state.allUsers.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; diff --git a/client/store/reducers.js b/client/store/reducers.js index 543cccf..63efe3e 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -13,6 +13,20 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ +const allUsers = (state, action) => { + if(state === undefined) { + return []; + } else if (action.type === 'LOAD_ALL_USERS') { + console.log('LOAD ALL USERS', action); + return action.allUsers; + } else if (action.type === 'REDUX_STORAGE_LOAD') { + console.log('AllUsers load:', action.payload.allUsers); + return action.payload.allUsers; + } + return state; +}; + + const users = (state, action) => { console.log('Reducer action', action); if (state === undefined) { @@ -185,6 +199,7 @@ const appReducer = combineReducers({ projectProgress, loggedInUser, pairingStatus, + allUsers, }); const rootReducer = (state, action) => { diff --git a/server/routes/api.js b/server/routes/api.js index 4f46748..7f14ef5 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -187,6 +187,22 @@ module.exports = { }) }, + allUsers: function getAllUsers(req, res) { + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + dbSession.run( + `MATCH (users:User) RETURN users` + ) + .then((res) => { + resolve(res.records.map(user => + new db.models.User(user.get('users')) + )); + }) + .catch(reject) + .then(() => dbSession.close()); + }) + }, + // Returns an array of user objects--one for each // user with which the requesting user is paired pairs: function getPairs(req) { From 2a400e18a6fcc79f2a91e936502769ad272b1f90 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 29 Aug 2017 23:22:29 -0700 Subject: [PATCH 064/105] Ready for rebase --- client/components/App.jsx | 1 - client/components/MyPartners.jsx | 2 -- 2 files changed, 3 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 35c8ee4..054c153 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -184,7 +184,6 @@ class App extends React.Component { Allows App component to have message and project state */ const mapStateToProps = (state) => { - console.log('APP state: ', state); return { message: state.message, projects: state.projects, diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 21f3112..25deae4 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -108,8 +108,6 @@ render() { const mapStateToProps = (state, props) => { - console.log('My Partners state 2', state); - console.log('My partner mapStateToProps props', props); return { pairedUsers: state.pairedUsers }; From f9b929c4f2c062e76ecec5e826b39c8c1cd2addd Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 30 Aug 2017 00:03:36 -0700 Subject: [PATCH 065/105] Remove unnecessary console logs --- client/components/App.jsx | 8 -------- client/components/AppDrawer.jsx | 1 - client/components/MyPartners.jsx | 25 ------------------------- client/components/Project.jsx | 4 +--- client/components/ProjectDetails.jsx | 4 +--- client/components/ProjectList.jsx | 1 - client/components/ProjectStatus.jsx | 15 --------------- client/components/Questionnaire.jsx | 1 - client/components/UserDetails.jsx | 8 ++------ client/store/reducers.js | 6 +----- server/db/index.js | 6 +++--- server/routes/api.js | 5 ++--- server/routes/auth.js | 2 +- 13 files changed, 11 insertions(+), 75 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 054c153..707b36c 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -47,11 +47,9 @@ class App extends React.Component { this.navTap = this.navTap.bind(this); } componentDidUpdate() { - console.log('component Updated'); if(this.state.loggedIn) { this.getAllUsers(); } - } getAllUsers() { @@ -65,8 +63,6 @@ class App extends React.Component { getPairs() { axios.get('/API/pairs') .then((pairs) => { - console.log('APP.jsx get pairs', pairs); - //this.setState({myPartners: pairs.data}); this.props.loadPairedUsers(pairs.data); }) .catch(console.error); @@ -76,7 +72,6 @@ class App extends React.Component { getProjects() { axios.get('/API/projects/') .then((project) => { - console.log('GET PROJECTS', project.data); this.props.addProjectsList(project.data); }) .catch(console.error); @@ -129,7 +124,6 @@ class App extends React.Component { render() { - //console.log('App render this: ', this); /* Condition: If user is registered and logs render all the components. @@ -174,7 +168,6 @@ class App extends React.Component { } else if (this.state.loggedIn) { return ; } else { - console.log('Logging on', this.state); return ; } } @@ -196,7 +189,6 @@ const mapStateToProps = (state) => { Dispatch can be found in store/reducers.js */ const mapDispatchToProps = (dispatch) => { - //console.log('APP dispatch: ', projects); return { addAllUsers: (allUsers) => dispatch({ type: 'LOAD_ALL_USERS', diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 76bd0f6..9018788 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -23,7 +23,6 @@ Add this to AppDrawer when user functionality expands */ function AppDrawer(props) { - console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', props); return ( diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 25deae4..02d765d 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -27,16 +27,9 @@ class MyPartners extends React.Component { isMounted: false, userLists: [], } - console.log('My Partners props 1', props); - // this.setState({ - // userLists:this.props.pairedUsers - // }) - // this.handleMounted = this.handleMounted.bind(this); - // this.handlePatners = this.handlePatners.bind(this); } componentDidMount(){ - console.log('My Partners props 2', this.props); if(this.props.pairedUsers) { this.setState({ userLists: this.props.pairedUsers @@ -49,25 +42,7 @@ class MyPartners extends React.Component { } - handlePatners(){ - // console.log('working'); - - // console.log("48", this.props.currentPartners) - // if (Aarray.isArray(this.props.currentPartners)) { - // console.log('am i running') - // (this.props.currentPartners[0] ? this.props.currentPartners[0] : []).map(user => - // ( - // { user.name } - // { user.language } - // { user.experience } - // ) - // ) - // } - - } - render() { - console.log('My Partners state 1', this.props); let tests = this.props.pairedUsers[0]; return ( diff --git a/client/components/Project.jsx b/client/components/Project.jsx index e352551..eff9c97 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -9,10 +9,10 @@ class Project extends React.Component { constructor(props) { super(props); this.POSTprogress = this.POSTprogress.bind(this); + if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { this.GETprogress(); } - } @@ -48,10 +48,8 @@ class Project extends React.Component { Allows Project component to have project and projectID state */ const mapStateToProps = (state, props) => { - console.log('Project.jsx state: ', state); const projectId = Number(props.match.params.id); const project = state.projects.filter(project => project.id === projectId)[0]; - console.log('Project.jsx project: ', project); return { project, progress: state.projectProgress[projectId] || [], diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 94369b5..3cb6327 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -20,8 +20,6 @@ class ProjectDetails extends React.Component { constructor(props) { super(props); - console.log('project details props', props); - console.log('60', this.props.project.interested) this.state = { interest: false, open: false, @@ -32,8 +30,8 @@ class ProjectDetails extends React.Component { this.handleClose = this.handleClose.bind(this); this.clickHandler = this.clickHandler.bind(this); this.handleInterest = this.handleInterest.bind(this); - this.getUsers(); + this.getUsers(); } getUsers() { diff --git a/client/components/ProjectList.jsx b/client/components/ProjectList.jsx index 465e7f1..f8c2162 100644 --- a/client/components/ProjectList.jsx +++ b/client/components/ProjectList.jsx @@ -52,7 +52,6 @@ const ProjectList = (props) => { }; const mapStateToProps = (state) => { - //console.log('project list state: ', state); return { projects: state.projects, }; diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 5ff94be..245f3d8 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -104,15 +104,12 @@ class ProjectStatus extends React.Component { var updatedChatBox = this.state.chatBox updatedChatBox.push(myMessage); - console.log('chatbox', this.state.chatBox) this.setState({ chatBox: updatedChatBox }); socket.emit('chat message', newMessage); //send msg - console.log(newMessage); - console.log('chatbox',this.state.chatBox) }; @@ -237,15 +234,3 @@ const mapDispatchToProps = dispatch => }); export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); - - - - - - - - - - - - diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index 16e274c..3f78b8f 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -38,7 +38,6 @@ class Questionnaire extends React.Component { axios.post('/API/users', userInfo) .then((response) => { - console.log(response); // redirect to home after successful submission window.location.href = '/projects'; }) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index f15a6ce..41a4d08 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -110,12 +110,12 @@ class UserDetails extends React.Component { addPair() { axios.post('/API/pair', { partnered: this.props.user.id, - project: this.state.curProjectId, //this is undefined + project: this.state.curProjectId, }) .then((response) => { this.props.createPairing(response.data); this.setState({buttonClicked: !this.state.buttonClicked}); - //window.location.reload(); + window.location.reload(); //REACT needs this after a POST }) .catch((error) => { console.log(error); @@ -208,7 +208,6 @@ class UserDetails extends React.Component { renderMessages(msg) { - console.log("asdadadadasd", this.state.chatBox) var updatedChatBox= this.state.chatBox; updatedChatBox.push(msg); this.setState({ @@ -231,7 +230,6 @@ class UserDetails extends React.Component { }; render() { - console.log('USER DETAILS props', this.props); const actions = [
      @@ -317,8 +315,6 @@ class UserDetails extends React.Component { } } const mapStateToProps = (state, props) => { - console.log("line 267", props); - console.log("line 334", state); const userId = Number(props.match.params.id); const user = state.allUsers.filter(user => user.id === userId)[0]; const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) diff --git a/client/store/reducers.js b/client/store/reducers.js index 63efe3e..33a1c62 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -13,11 +13,11 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ +//Returns all users in the database const allUsers = (state, action) => { if(state === undefined) { return []; } else if (action.type === 'LOAD_ALL_USERS') { - console.log('LOAD ALL USERS', action); return action.allUsers; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('AllUsers load:', action.payload.allUsers); @@ -57,12 +57,8 @@ const pairedUsers = (state, action) => { if (state === undefined) { return []; } else if (action.type === 'LOAD_PAIRING') { - console.log('LOAD PAIRING STATE', state); - console.log('LOAD PAIRING ACTION', action.pairedUsers); return action.pairedUsers; } else if (action.type === 'ADD_PAIRING') { - console.log('ADD PAIRING state 1', state); - console.log('ADD PAIRING action', action); if (state.length !== 0) { const idCollection = state[0].map((user) => { return user.ghId; diff --git a/server/db/index.js b/server/db/index.js index 4eec324..f9fba65 100644 --- a/server/db/index.js +++ b/server/db/index.js @@ -3,10 +3,10 @@ * (Exports a connected DB object which is used in many places, but * primarily, you will see it in the routes module, which handles * all the endpoints that require db functionality) - * - * This module prorvides a connected db object for making queries + * + * This module provides a connected db object for making queries * and a set of models to parse the results of those queries. - * + * * We use the neo4j BOLT driver which is good (and fast), but has * its quirks. The workflow we have followed has meant creating a new * session for each query, which may well not be necessary--indeed, diff --git a/server/routes/api.js b/server/routes/api.js index 7f14ef5..0192f36 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -158,7 +158,6 @@ module.exports = { RETURN project `) .then((res) => { - console.log('GET PROJECT project response', res); const project = res.records[0]; resolve(new db.models.Project(project.get('project')) ); @@ -167,7 +166,7 @@ module.exports = { .then(() => dbSession.close()); }); }, - + //Retrieves all projects that a user is paired with other users pairedProjects: function findPairProjects(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); @@ -186,7 +185,7 @@ module.exports = { .then(() => dbSession.close()); }) }, - + //Retrieves all users allUsers: function getAllUsers(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); diff --git a/server/routes/auth.js b/server/routes/auth.js index 409e37c..7242998 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -14,7 +14,7 @@ module.exports = { GET: { signout: function signout(req, res) { // destroy session and redirect to home - console.log('LOGGING OUT'); + console.log('Logging out'); req.session.destroy() req.logout(); res.redirect('/'); From 45b46ba34cc91733e599bc93db74d18f2fce0660 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 30 Aug 2017 11:18:58 -0700 Subject: [PATCH 066/105] Update README, remove console logs, and remove duplicate code --- PRESS_RELEASE.md | 4 - README.md | 15 +- client/README.md | 17 +- client/components/App.jsx | 11 +- client/components/ProjectStatus.jsx | 236 ------------------- client/components/UserDetails.jsx | 352 ---------------------------- 6 files changed, 25 insertions(+), 610 deletions(-) delete mode 100644 client/components/ProjectStatus.jsx delete mode 100644 client/components/UserDetails.jsx diff --git a/PRESS_RELEASE.md b/PRESS_RELEASE.md index 256e021..12f98d0 100644 --- a/PRESS_RELEASE.md +++ b/PRESS_RELEASE.md @@ -27,7 +27,3 @@ ### Customer Quote > "GitPal helped me get started on my first open source project with ease." - -### Closing and Call to Action - -> FILL_ME_IN diff --git a/README.md b/README.md index 50f9a33..d2ec6fe 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ # GitPal -> GitPal is an application that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. +> GitPal is an application forked from GitBud that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. ## Team - - __Product Owner__: Shaikat Haque - - __Scrum Master__: Francis Ngo - - __Development Team Members__: Peter Warner-Medley, Brian Kim + - __Product Owner__: Scott Schaefer + - __Scrum Master__: Rick Gallegos + - __Development Team Members__: Christine Zimmerman, Scott Mitchell, Sonrisa Chen + ## Table of Contents @@ -63,8 +64,12 @@ npm install ### Roadmap -View the project roadmap [here](https://github.com/cranebaes/GitPal/issues) +View the project roadmap [here](https://github.com/Toucans456/GitPal/issues) + +## GitBud Repo +View the original Repo +[here](https://github.com/cranebaes/gitbud/) ## Contributing diff --git a/client/README.md b/client/README.md index 16b494e..abfb71b 100644 --- a/client/README.md +++ b/client/README.md @@ -1,7 +1,7 @@ ## Login/Signup -- The landing page is the entry point to the app. -- Handled by the Landing react component, the user has the option to login with Github. +- The landing page is the entry point to the app. +- Handled by the Landing react component, the user has the option to login with Github. - Clicking the login button will send a GET request to the url /auth/github. - If this is the user's first time, the user will be routed to the Questionnaire component. - This logic is handled App component, where a check is made to see if the user's loggedIn state has certain properties. @@ -17,6 +17,7 @@ - After completing the questionnaire, user is taken to the Project List page. ## Project List + - This can be considered the home page. - The list of available projects to work on will be displated - Clicking on a project will have 2 possibe outcomes: @@ -26,6 +27,7 @@ - The container checks the user's state to see whether the user is paired on a project or not, and renders the appropriate component. ## Project Details + - This page displays information about a project such description, link to GitHub repo, and a list of recommended users to pair with. - An Interest button allows user to express interest in the project. - The Project Details component uses a UserList Component to display a list of recommended users who have also expressed interest in the project. @@ -33,6 +35,7 @@ - Clicking on a recommended user will route the user to the User Details component ## User Details + - This page displays user information collected from the questionnaire by a user - There are options to message the user, and pairing with the user. - Pairing with a user will establish a pairing between the 2 users, represented by a PAIRED_WITH relationship in neo4j. @@ -40,15 +43,23 @@ - The next time the user clicks the Project through the the project list page, they will be taken to the Project Status page. ## Project Status + - This page has multiple checkboxes to that allow users to track their project progress. - Clicking 'Submit Progress' after checking checkboxes will save the users progress. - The next time the user enters the Project Status component, the boxes will remain checked. +- This page also comes with a socket.io chat allowing the partnered users to collaborate on the project together in realtime. ## My Projects + - This component is accessible through the app bar. - It displays the list of projects the user is currently WORKING_ON +## My Partners + +- This component is accessible through the app bar. +- It displays the list of users the currently logged in user is partnered with. ## My Account + - This component is accessible through the app bar -- It displays the the user's information that was entered in the questionnaire \ No newline at end of file +- It displays the user's information that was entered in the questionnaire diff --git a/client/components/App.jsx b/client/components/App.jsx index 707b36c..7ba1486 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -98,7 +98,7 @@ class App extends React.Component { this.setState({ loggedIn: res.data }); this.getMessages(); this.getProjects(); - this.getPairs() + this.getPairs(); this.props.loggedInUser(res.data); } }); @@ -131,7 +131,6 @@ class App extends React.Component { If user is not logged in (logged out) display landing page */ if (this.state.loggedIn.language) { - //console.log('App rendering', this.state.loggedIn); return (
      @@ -194,10 +193,6 @@ const mapDispatchToProps = (dispatch) => { type: 'LOAD_ALL_USERS', allUsers, }), - changeString: () => dispatch({ - type: 'CHANGE_STRING', - text: 'some other message' - }), addProjectsList: projects => dispatch({ type: 'LIST_PROJECTS', projects, @@ -210,10 +205,6 @@ const mapDispatchToProps = (dispatch) => { type: 'LOAD_PAIRING', pairedUsers, }), - addPairsList: pairs => dispatch({ - type: 'ADD_PAIRING', - pairs, - }), loggedInUser: loggedInUser => dispatch({ type: 'UPDATED_LOGGEDIN_USER', loggedInUser, diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx deleted file mode 100644 index 245f3d8..0000000 --- a/client/components/ProjectStatus.jsx +++ /dev/null @@ -1,236 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import Paper from 'material-ui/Paper'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import { Card, CardHeader, CardText } from 'material-ui/Card'; -import FloatingActionButton from 'material-ui/FloatingActionButton'; -import Checkbox from 'material-ui/Checkbox'; -import RaisedButton from 'material-ui/RaisedButton'; -import FlatButton from 'material-ui/FlatButton'; -import Dialog from 'material-ui/Dialog'; -import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; - -import io from 'socket.io-client'; -const socket = io(); - - -const style = { - margin: 12, -}; - -const customContentStyle = { - width: '80%', - height: '100%', - maxWidth: 'none', -}; -// renders a progress item component inside ProjectStatus -const ProgressItem = (props) => { - const check = () => props.dispatchProgress(props.projectId, props.index); - return ( -
      - - - { props.hint } - -
      - ) -}; - -class ProjectStatus extends React.Component { - constructor(props) { - super(props); - - this.state = { - open: false, - dialogOpen: false, - chatBox: [], - - } - - this.handleSubmit = this.handleSubmit.bind(this); - this.handleClose = this.handleClose.bind(this); - this.handleDiaLogOpen = this.handleDiaLogOpen.bind(this); - this.handleDiaLogClose = this.handleDiaLogClose.bind(this); - this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - - socket.on('chat message', (msg) => this.renderMessages(msg)); - } - - /* dialog handler*/ - handleDiaLogOpen() { - console.log("clicked") - this.setState({dialogOpen: true}); - }; - - handleDiaLogClose() { - console.log('clicked') - this.setState({dialogOpen: false}); - }; - /* dialog handler end*/ - - //handles opening the dialog alert and submits the project's progress - handleSubmit() { - this.setState({ - open: true - }); - this.props.submitProgress() - } - - //handles the closing of dialog alert - handleClose() { - this.setState({ - open: false - }); - } - - - handleMessegeSubmit(event) { - event.preventDefault(); - - var newMessage = { - message: this._message.value, - username: this.props.loggedInUser - } - - var myMessage = { - username: "me: ", - message: this._message.value - } - - - var updatedChatBox = this.state.chatBox - updatedChatBox.push(myMessage); - - this.setState({ - chatBox: updatedChatBox - }); - - socket.emit('chat message', newMessage); //send msg - }; - - - renderMessages(msg) { - var updatedChatBox= this.state.chatBox; - console.log("line 119", msg) - updatedChatBox.push(msg); - this.setState({ - chatBox: updatedChatBox - }); - }; - - render() { - const actions = [ -
      - - this._message = message} id="newMessage" type="text"/> - Send - -
      , - - ]; - return ( -
      - - - - - - - - - - - - - {this.props.project.description || 'This project has no description.' } - -
      - { - this.props.progress.map((item, index) => - ( - - ) - ) - } -
      - - - } - modal={false} - open={this.state.open} - onRequestClose={this.handleClose} - > - Congrats on your progress! - -
      -
      - - - - -
        hey
      - { - this.state.chatBox.map((chat, index) => { - return( -
      - {chat.username} -

      {chat.message}

      -
      - )} - ) - } -
      -
      - - ) - } -} - - - -const mapStateToProps = (state, props) => { - const loggedInUser = state.loggedInUser.username; - const loggedInUserGhId = state.loggedInUser.ghId; - return { - loggedInUser, - loggedInUserGhId, - }; -}; - -const mapDispatchToProps = dispatch => - ({ - - }); - -export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx deleted file mode 100644 index 41a4d08..0000000 --- a/client/components/UserDetails.jsx +++ /dev/null @@ -1,352 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import axios from 'axios'; - -import chatBox from './MyPartners'; - -import Paper from 'material-ui/Paper'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; -import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; -import { fullWhite } from 'material-ui/styles/colors'; -import RaisedButton from 'material-ui/RaisedButton'; -import ActionFace from 'material-ui/svg-icons/action/face'; -import ActionBuild from 'material-ui/svg-icons/action/build'; -import ActionDone from 'material-ui/svg-icons/action/done'; -import ActionAdd from 'material-ui/svg-icons/social/person'; -import ContentSend from 'material-ui/svg-icons/content/send'; -import TextField from 'material-ui/TextField'; -/* for Dialog */ -import Dialog from 'material-ui/Dialog'; -import FlatButton from 'material-ui/FlatButton'; -const customContentStyle = { - width: '80%', - height: '100%', - maxWidth: 'none', -}; -/* for Dialog */ - -import io from 'socket.io-client'; -const socket = io(); - -class UserDetails extends React.Component { - constructor(props) { - super(props); - console.log('this is props of UserDetails', props); - this.state = { - buttonClicked: false, - expanded: false, - partnerName: '', - message: 'placeholder', - chatBox: [], - myMessage: 'myMessage', - receivedMessage:'receivedMessage', - //for popUp window - open: false, - isPaired: false, - curProjectId: null, - curProjectProperty: null, - } - this.expandCard = () => { - this.setState({ expanded: true }); - } - - socket.on('chat message', (msg) => this.renderMessages(msg)); - //receive messages - this.addPair = this.addPair.bind(this); - this.togglePair = this.togglePair.bind(this); - this.pairButton = this.pairButton.bind(this); - this.handleOpen = this.handleOpen.bind(this); - this.handleClose = this.handleClose.bind(this); - this.handleSubmit = this.handleSubmit.bind(this); - this.retrieveProjectId = this.retrieveProjectId.bind(this); - - this.initialize(); - - this.setMessageText = (_, text) => this.setState({ message: text }); - this.sendMessage = () => { - axios.post('/API/messages', { - text: this.state.message, - recipient: this.props.user.id, - }) - .then(() => { - this.props.dispatchMessage(this.props.user.id, { - text: this.state.message, - sender: true, - }); - }); - }; - } - - initialize() { - return new Promise((resolve, reject) => { - this.retrieveProjectId(); - resolve(); - }) - .then(() => { - this.checkIfPaired(); - }) - } - - checkIfPaired() { - axios.get('/API/pairedProjects', { - params: { - userId: this.props.loggedInUserGhId, - partnerId: this.props.user.ghId - } - }) - .then((pairProjects) => { - if (pairProjects.data.length > 0) { - this.setState({ - buttonClicked: true - }) - } - }) - .catch((error) => { - console.log(error); - }) - } - - - addPair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { - this.props.createPairing(response.data); - this.setState({buttonClicked: !this.state.buttonClicked}); - window.location.reload(); //REACT needs this after a POST - }) - .catch((error) => { - console.log(error); - }); - - axios.get('/') - } - togglePair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { - //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); - console.log(response); - }) - .catch((error) => { - console.log(error); - }); - } - /* dialog handler*/ - handleOpen() { - //console.log("clicked") - this.setState({open: true}); - }; - handleClose() { - this.setState({open: false}); - }; - /* dialog handler end*/ - pairButton() { - if (this.state.buttonClicked) { - console.log('these are the props for UserDetails', this); - return
      - } - onClick={ this.addPair } /> - } - href="/my-projects" - primary={ true } /> -
      - } else if (!this.state.buttonClicked) { - return } - onClick={ this.addPair } - primary={ true } /> - } - }; - - handleSubmit(event) { - event.preventDefault(); - // socket.emit('chat message', ); - var newMessage = { - message: this._message.value, - username: this.props.loggedInUser - } - - var myMessage = { - username: "me: ", - message: this._message.value - } - - var updatedChatBox = this.state.chatBox - updatedChatBox.push(myMessage) - - this.setState({ - chatBox: updatedChatBox - }); - - socket.emit('chat message', newMessage); //send msg - console.log(newMessage); - }; - - getMessages() { - axios.get('API/messages') - .then((res) => { - this.props.loadMessages(res.data) - }) - .catch(console.error); - } - - - renderMessages(msg) { - var updatedChatBox= this.state.chatBox; - updatedChatBox.push(msg); - this.setState({ - chatBox: updatedChatBox - }); - }; - - retrieveProjectId() { - const userId = this.props.user.ghId; - axios.get('/API/project', { - params: { - id: userId - } - }) - .then((project) => { - this.state.curProjectId = project.data.id; - this.state.curProjectProperty = project.data; - }) - .catch(console.error); - }; - - render() { - const actions = [ -
      -
      - this._message = message} id="newMessage" type="text"/> - Send -
      -
      , - - ]; - return ( - - - - - - - - -
      - -
      -
      - - - - project.project).join(' ')}/> -
      - { this.pairButton() } - } onClick={this.expandCard} secondary={true} /> -
      - {/*dialog for message*/} -
      - -
        - {this.state.chatBox.map((chat, index) => { - return( -
        - {chat.username} -

        {chat.message}

        - -
        - )} - )} -
        -
        - {/*dialog for message end*/} - {/* should be deleted */} - -
        - -
        -
        - } secondary={true}/> - { this.props.messages.map((message, index) => - - { message.sender ? 'You' : this.props.user.name } - { message.text } - - )} -
        - {/* should be deleted end*/} - - -
        -
        - ); - } -} -const mapStateToProps = (state, props) => { - const userId = Number(props.match.params.id); - const user = state.allUsers.filter(user => user.id === userId)[0]; - const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) - const loggedInUser = state.loggedInUser.username; - const loggedInUserGhId = state.loggedInUser.ghId; - return { - user, - projects, - messages: state.messages[userId] || [], - loggedInUser, - loggedInUserGhId, - }; -}; -const mapDispatchToProps = dispatch => - ({ - loadMessages: messages => dispatch({ - type: 'MESSAGES_LOAD', - messages, - }), - createPairing: (pairs) => dispatch({ - type: 'ADD_PAIRING', - pairs, - }), - dispatchPairing: (userId, projectId) => dispatch({ - type: 'CHANGE_USER_PAIRING', - userId, - projectId, - }), - dispatchMessage: (userId, message) => dispatch({ - type: 'MESSAGE_SEND', - userId, - message, - }), - }); -export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); From ad130b1b856944f8cd1ffafe1ea169afcf7790ff Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 30 Aug 2017 11:44:54 -0700 Subject: [PATCH 067/105] Add deleted files --- client/components/ProjectStatus.jsx | 236 +++++++++++++++++++ client/components/UserDetails.jsx | 352 ++++++++++++++++++++++++++++ 2 files changed, 588 insertions(+) create mode 100644 client/components/ProjectStatus.jsx create mode 100644 client/components/UserDetails.jsx diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx new file mode 100644 index 0000000..245f3d8 --- /dev/null +++ b/client/components/ProjectStatus.jsx @@ -0,0 +1,236 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import Paper from 'material-ui/Paper'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; +import { Card, CardHeader, CardText } from 'material-ui/Card'; +import FloatingActionButton from 'material-ui/FloatingActionButton'; +import Checkbox from 'material-ui/Checkbox'; +import RaisedButton from 'material-ui/RaisedButton'; +import FlatButton from 'material-ui/FlatButton'; +import Dialog from 'material-ui/Dialog'; +import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; + +import io from 'socket.io-client'; +const socket = io(); + + +const style = { + margin: 12, +}; + +const customContentStyle = { + width: '80%', + height: '100%', + maxWidth: 'none', +}; +// renders a progress item component inside ProjectStatus +const ProgressItem = (props) => { + const check = () => props.dispatchProgress(props.projectId, props.index); + return ( +
        + + + { props.hint } + +
        + ) +}; + +class ProjectStatus extends React.Component { + constructor(props) { + super(props); + + this.state = { + open: false, + dialogOpen: false, + chatBox: [], + + } + + this.handleSubmit = this.handleSubmit.bind(this); + this.handleClose = this.handleClose.bind(this); + this.handleDiaLogOpen = this.handleDiaLogOpen.bind(this); + this.handleDiaLogClose = this.handleDiaLogClose.bind(this); + this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); + + socket.on('chat message', (msg) => this.renderMessages(msg)); + } + + /* dialog handler*/ + handleDiaLogOpen() { + console.log("clicked") + this.setState({dialogOpen: true}); + }; + + handleDiaLogClose() { + console.log('clicked') + this.setState({dialogOpen: false}); + }; + /* dialog handler end*/ + + //handles opening the dialog alert and submits the project's progress + handleSubmit() { + this.setState({ + open: true + }); + this.props.submitProgress() + } + + //handles the closing of dialog alert + handleClose() { + this.setState({ + open: false + }); + } + + + handleMessegeSubmit(event) { + event.preventDefault(); + + var newMessage = { + message: this._message.value, + username: this.props.loggedInUser + } + + var myMessage = { + username: "me: ", + message: this._message.value + } + + + var updatedChatBox = this.state.chatBox + updatedChatBox.push(myMessage); + + this.setState({ + chatBox: updatedChatBox + }); + + socket.emit('chat message', newMessage); //send msg + }; + + + renderMessages(msg) { + var updatedChatBox= this.state.chatBox; + console.log("line 119", msg) + updatedChatBox.push(msg); + this.setState({ + chatBox: updatedChatBox + }); + }; + + render() { + const actions = [ +
        +
        + this._message = message} id="newMessage" type="text"/> + Send +
        +
        , + + ]; + return ( +
        + + + + + + + + + + + + + {this.props.project.description || 'This project has no description.' } + +
        + { + this.props.progress.map((item, index) => + ( + + ) + ) + } +
        + + + } + modal={false} + open={this.state.open} + onRequestClose={this.handleClose} + > + Congrats on your progress! + +
        +
        + + + + +
          hey
        + { + this.state.chatBox.map((chat, index) => { + return( +
        + {chat.username} +

        {chat.message}

        +
        + )} + ) + } +
        +
        + + ) + } +} + + + +const mapStateToProps = (state, props) => { + const loggedInUser = state.loggedInUser.username; + const loggedInUserGhId = state.loggedInUser.ghId; + return { + loggedInUser, + loggedInUserGhId, + }; +}; + +const mapDispatchToProps = dispatch => + ({ + + }); + +export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx new file mode 100644 index 0000000..41a4d08 --- /dev/null +++ b/client/components/UserDetails.jsx @@ -0,0 +1,352 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import axios from 'axios'; + +import chatBox from './MyPartners'; + +import Paper from 'material-ui/Paper'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; +import { fullWhite } from 'material-ui/styles/colors'; +import RaisedButton from 'material-ui/RaisedButton'; +import ActionFace from 'material-ui/svg-icons/action/face'; +import ActionBuild from 'material-ui/svg-icons/action/build'; +import ActionDone from 'material-ui/svg-icons/action/done'; +import ActionAdd from 'material-ui/svg-icons/social/person'; +import ContentSend from 'material-ui/svg-icons/content/send'; +import TextField from 'material-ui/TextField'; +/* for Dialog */ +import Dialog from 'material-ui/Dialog'; +import FlatButton from 'material-ui/FlatButton'; +const customContentStyle = { + width: '80%', + height: '100%', + maxWidth: 'none', +}; +/* for Dialog */ + +import io from 'socket.io-client'; +const socket = io(); + +class UserDetails extends React.Component { + constructor(props) { + super(props); + console.log('this is props of UserDetails', props); + this.state = { + buttonClicked: false, + expanded: false, + partnerName: '', + message: 'placeholder', + chatBox: [], + myMessage: 'myMessage', + receivedMessage:'receivedMessage', + //for popUp window + open: false, + isPaired: false, + curProjectId: null, + curProjectProperty: null, + } + this.expandCard = () => { + this.setState({ expanded: true }); + } + + socket.on('chat message', (msg) => this.renderMessages(msg)); + //receive messages + this.addPair = this.addPair.bind(this); + this.togglePair = this.togglePair.bind(this); + this.pairButton = this.pairButton.bind(this); + this.handleOpen = this.handleOpen.bind(this); + this.handleClose = this.handleClose.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + this.retrieveProjectId = this.retrieveProjectId.bind(this); + + this.initialize(); + + this.setMessageText = (_, text) => this.setState({ message: text }); + this.sendMessage = () => { + axios.post('/API/messages', { + text: this.state.message, + recipient: this.props.user.id, + }) + .then(() => { + this.props.dispatchMessage(this.props.user.id, { + text: this.state.message, + sender: true, + }); + }); + }; + } + + initialize() { + return new Promise((resolve, reject) => { + this.retrieveProjectId(); + resolve(); + }) + .then(() => { + this.checkIfPaired(); + }) + } + + checkIfPaired() { + axios.get('/API/pairedProjects', { + params: { + userId: this.props.loggedInUserGhId, + partnerId: this.props.user.ghId + } + }) + .then((pairProjects) => { + if (pairProjects.data.length > 0) { + this.setState({ + buttonClicked: true + }) + } + }) + .catch((error) => { + console.log(error); + }) + } + + + addPair() { + axios.post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then((response) => { + this.props.createPairing(response.data); + this.setState({buttonClicked: !this.state.buttonClicked}); + window.location.reload(); //REACT needs this after a POST + }) + .catch((error) => { + console.log(error); + }); + + axios.get('/') + } + togglePair() { + axios.post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then((response) => { + //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); + console.log(response); + }) + .catch((error) => { + console.log(error); + }); + } + /* dialog handler*/ + handleOpen() { + //console.log("clicked") + this.setState({open: true}); + }; + handleClose() { + this.setState({open: false}); + }; + /* dialog handler end*/ + pairButton() { + if (this.state.buttonClicked) { + console.log('these are the props for UserDetails', this); + return
        + } + onClick={ this.addPair } /> + } + href="/my-projects" + primary={ true } /> +
        + } else if (!this.state.buttonClicked) { + return } + onClick={ this.addPair } + primary={ true } /> + } + }; + + handleSubmit(event) { + event.preventDefault(); + // socket.emit('chat message', ); + var newMessage = { + message: this._message.value, + username: this.props.loggedInUser + } + + var myMessage = { + username: "me: ", + message: this._message.value + } + + var updatedChatBox = this.state.chatBox + updatedChatBox.push(myMessage) + + this.setState({ + chatBox: updatedChatBox + }); + + socket.emit('chat message', newMessage); //send msg + console.log(newMessage); + }; + + getMessages() { + axios.get('API/messages') + .then((res) => { + this.props.loadMessages(res.data) + }) + .catch(console.error); + } + + + renderMessages(msg) { + var updatedChatBox= this.state.chatBox; + updatedChatBox.push(msg); + this.setState({ + chatBox: updatedChatBox + }); + }; + + retrieveProjectId() { + const userId = this.props.user.ghId; + axios.get('/API/project', { + params: { + id: userId + } + }) + .then((project) => { + this.state.curProjectId = project.data.id; + this.state.curProjectProperty = project.data; + }) + .catch(console.error); + }; + + render() { + const actions = [ +
        +
        + this._message = message} id="newMessage" type="text"/> + Send +
        +
        , + + ]; + return ( + + + + + + + + +
        + +
        +
        + + + + project.project).join(' ')}/> +
        + { this.pairButton() } + } onClick={this.expandCard} secondary={true} /> +
        + {/*dialog for message*/} +
        + +
          + {this.state.chatBox.map((chat, index) => { + return( +
          + {chat.username} +

          {chat.message}

          + +
          + )} + )} +
          +
          + {/*dialog for message end*/} + {/* should be deleted */} + +
          + +
          +
          + } secondary={true}/> + { this.props.messages.map((message, index) => + + { message.sender ? 'You' : this.props.user.name } + { message.text } + + )} +
          + {/* should be deleted end*/} + + +
          +
          + ); + } +} +const mapStateToProps = (state, props) => { + const userId = Number(props.match.params.id); + const user = state.allUsers.filter(user => user.id === userId)[0]; + const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) + const loggedInUser = state.loggedInUser.username; + const loggedInUserGhId = state.loggedInUser.ghId; + return { + user, + projects, + messages: state.messages[userId] || [], + loggedInUser, + loggedInUserGhId, + }; +}; +const mapDispatchToProps = dispatch => + ({ + loadMessages: messages => dispatch({ + type: 'MESSAGES_LOAD', + messages, + }), + createPairing: (pairs) => dispatch({ + type: 'ADD_PAIRING', + pairs, + }), + dispatchPairing: (userId, projectId) => dispatch({ + type: 'CHANGE_USER_PAIRING', + userId, + projectId, + }), + dispatchMessage: (userId, message) => dispatch({ + type: 'MESSAGE_SEND', + userId, + message, + }), + }); +export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); From 7e46d51e01108174ed6ab6d49433df0beb02dbee Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Thu, 31 Aug 2017 13:21:47 -0700 Subject: [PATCH 068/105] MyPartners page loads when no there are no partners --- client/components/MyPartners.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 02d765d..091b93c 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -43,7 +43,7 @@ class MyPartners extends React.Component { render() { - let tests = this.props.pairedUsers[0]; + let tests = this.props.pairedUsers[0] || []; return ( From f9cd13378879bcdeb0d7c1ec5b2357214d9b89f5 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Mon, 2 Oct 2017 00:44:13 -0700 Subject: [PATCH 069/105] Update all 3 READMEs --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++-------- client/README.md | 26 ++++++++++++++++++------ server/README.md | 28 ++++++++++++------------- 3 files changed, 79 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index d2ec6fe..994caa9 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,50 @@ > GitPal is an application forked from GitBud that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. -## Team - - - __Product Owner__: Scott Schaefer - - __Scrum Master__: Rick Gallegos - - __Development Team Members__: Christine Zimmerman, Scott Mitchell, Sonrisa Chen - +![Alt text](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/7b1e3bb1d52fba7f60c382df3dc03a0b-original.png) ## Table of Contents -1. [Usage](#Usage) +1. [Team](#team) +1. [Preview](#preview) + 1. [Demo](#demo) + 1. [Screenshots](#screenshots) +1. [Usage](#usage) 1. [Requirements](#requirements) 1. [Development](#development) 1. [Installing Dependencies](#installing-dependencies) 1. [Tasks](#tasks) -1. [Team](#team) + 1. [Roadmap](#roadmap) +1. [More Information](#more-information) + 1. [Server README](#server-readme) + 1. [Client README](#client-readme) +1. [GitBud Repo](#gitbud-repo) 1. [Contributing](#contributing) +## Team + + - __Product Owner__: Scott Schaefer + - __Scrum Master__: Rick Gallegos + - __Development Team Members__: Christine Zimmerman, Scott Mitchell, Sonrisa Chen + +## Preview + +### Demo + +Click [here](https://gitpal.herokuapp.com/) to try out GitPal + +### Screenshots + +[Sample projects](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/3857f3ab5dc89ba8668d64090a631d09-original.png) + +[Project page](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/2e76e08872778c681adc67e8eb0edac7-original.png) + +[User Profile](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/f8b4f7744d08fe5d166b127b7ca88fdd-original.png) + +[Navigation Drawer](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/1177499d4beb39863b539f274faf0d9a-original.png) + +[My Partners page](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/b762fd98fafa7ec781ca2af220a948f6-original.png) + ## Usage > __Environment Variables__ GitPal has hardcoded a username of 'neo4j' and a password of 'neo' for neo4j. You can change these in the code or override them by setting the appropriate environment variables. You will also need a GitHub Client ID and Client Secret to use the GitHub API. These, too, are set as environment variables. We have used the .env package, which allows environment variables to be set easily with the .env file in the root directory of the project. An example of the necessary variables for GitPal been provided here in this repo. @@ -66,6 +93,16 @@ npm install View the project roadmap [here](https://github.com/Toucans456/GitPal/issues) +## More Information + +### Server README + +View the GitPal server README [here](client/README.md) + +### Client README + +View the GitPal client README [here](server/README.md) + ## GitBud Repo View the original Repo diff --git a/client/README.md b/client/README.md index abfb71b..f178089 100644 --- a/client/README.md +++ b/client/README.md @@ -1,3 +1,17 @@ +# GitPal Client + +## Table of Contents + +1. [Login/Signup](#login/signup) +1. [Questionnaire](#questionnaire) +1. [Project List](#project-list) +1. [Project Details](#project-details) +1. [User Details](#user-details) +1. [Project Status](#project-status) +1. [My Projects](#my-projects) +1. [My Partners](#my-partners) +1. [My Account](#my-account) + ## Login/Signup - The landing page is the entry point to the app. @@ -7,20 +21,20 @@ - This logic is handled App component, where a check is made to see if the user's loggedIn state has certain properties. - If the user has logged in before, then they will be redirected to a project list page. -## Questionniare +## Questionnaire - This page asks the user for: - Experience Level - Interested Language - - Profile Descripion + - Profile Description - This info is stored in the user's node in the database and is displayed in the user's profile. - After completing the questionnaire, user is taken to the Project List page. ## Project List - This can be considered the home page. -- The list of available projects to work on will be displated -- Clicking on a project will have 2 possibe outcomes: +- The list of available projects to work on will be displayed +- Clicking on a project will have 2 possible outcomes: - If the user is not working on the project, they will be taken to the project details page. - If the user is already working on the project with a pair, they will be taken to the Project Status page. - This logic is handled inside a 'smart' Project container. @@ -31,7 +45,7 @@ - This page displays information about a project such description, link to GitHub repo, and a list of recommended users to pair with. - An Interest button allows user to express interest in the project. - The Project Details component uses a UserList Component to display a list of recommended users who have also expressed interest in the project. -- The list is sorted by an aglorithm on the server side that calculates the difference in coding activity by language between users. +- The list is sorted by an algorithm on the server side that calculates the difference in coding activity by language between users. - Clicking on a recommended user will route the user to the User Details component ## User Details @@ -40,7 +54,7 @@ - There are options to message the user, and pairing with the user. - Pairing with a user will establish a pairing between the 2 users, represented by a PAIRED_WITH relationship in neo4j. - The 2 users will also officially start working on the project, established by a WORKING_ON relationship in neo4j. -- The next time the user clicks the Project through the the project list page, they will be taken to the Project Status page. +- The next time the user clicks the Project through the project list page, they will be taken to the Project Status page. ## Project Status diff --git a/server/README.md b/server/README.md index 4f4581d..9f29fa2 100644 --- a/server/README.md +++ b/server/README.md @@ -1,4 +1,4 @@ -# GitPal Server Code +# GitPal Server > Most server code is clearly modularized and heavily (perhaps excessively) annotated for the benefit of teams wishing to inherit this codebase. On the understanding that comments can become inaccurate over time and that people may want to understand the what module does what before jumping in, we're providing short notes here. > We prefer each file to fulfill one role so modules with diverse responsibilities (_e.g._ the _routes_ module, which exports request handlers for _/API/_ and _/auth/_ routes) will generally have one file for each responsibility and a short _index.js_ that draws together exports functionality from the module's distinct files. @@ -9,10 +9,10 @@ __Note:__ We've aimed to use the names of React components in this documentation 1. [Modules](#modules) 1. [Handling A Connection](#handling-a-connection) - 1. [Order of resolution](#order-of-resolution) - 1. [Path of a request](#path-of-a-request) - 1. [New user](#new-user) - 1. [API request](#api-request) + 1. [Order of resolution](#order-of-resolution) + 1. [Path of a request](#path-of-a-request) + 1. [New user](#new-user) + 1. [API request](#api-request) ## Modules @@ -44,14 +44,14 @@ When a new user clicks on _'Sign in with GitHub'_ on the component wit 1. The _github_ function verifies that this is an OAuth callback and invokes the appropriate middleware exported from the authentication module. 1. This middleware (_exports.callback_) mostly defers to other passport functionality, redirecting back to _/_ on failure and _/projects_ on successful authentication, so at this point the _req_ is handled and _res_ (a redirect) has been sent. 1. Passport provides a set of useful functions, which are invoked after (I think) the _req_ is authenticated and which we use to handle our knowledge of the user. - 1. Firstly, it provides a callback function (used to initialise the passport object), which is passed the authenticated user's OAuth token and profile from the OAuth provider. The function we provide inserts the user into the database (if not already present) and ensures that their information matches the latest from GitHub. If they are a new user. it then begins the process of scraping information from GitHub to profile their experience and compare to other users. - 1. Passport also provides _serializeUser_ which is passed the user's whole profile from the OAuth provider (here, a whole load of info from GitHub) and whose return value will be stored on the user's session in the internal ([deliberately flimsy](https://www.npmjs.com/package/express-session#sessionoptions)) store. We use this opportunity to extract the information we want and store it in the layout we want and ignore the rest. + 1. Firstly, it provides a callback function (used to initialise the passport object), which is passed the authenticated user's OAuth token and profile from the OAuth provider. The function we provide inserts the user into the database (if not already present) and ensures that their information matches the latest from GitHub. If they are a new user. it then begins the process of scraping information from GitHub to profile their experience and compare to other users. + 1. Passport also provides _serializeUser_ which is passed the user's whole profile from the OAuth provider (here, a whole load of info from GitHub) and whose return value will be stored on the user's session in the internal ([deliberately flimsy](https://www.npmjs.com/package/express-session#sessionoptions)) store. We use this opportunity to extract the information we want and store it in the layout we want and ignore the rest. 1. As this is a new user, their GitHub ID is passed into a chain of promises from the (poorly name) _profiling_ module, which: - 1. Scrapes all of their repos from GitHub's API and returns those repos which they created or have committed to; - 1. Checks the how many KBs of which languages have been written in those repos and returns that on the user's experience profile; - 1. Tots up the basic stats from their repos (stars, watchers, forks) and returns that on the user's experience profile; - 1. Stores it that information on the user's node in the db; - 1. Finally, the user's GitHub ID is passed to the _compareUser_ function, which grabs their experience profile and finds the distance between it and every other user's, so that _/API/user_ results can be returned with nearest neighbours first. + 1. Scrapes all of their repos from GitHub's API and returns those repos which they created or have committed to; + 1. Checks the how many KBs of which languages have been written in those repos and returns that on the user's experience profile; + 1. Tots up the basic stats from their repos (stars, watchers, forks) and returns that on the user's experience profile; + 1. Stores it that information on the user's node in the db; + 1. Finally, the user's GitHub ID is passed to the _compareUser_ function, which grabs their experience profile and finds the distance between it and every other user's, so that _/API/user_ results can be returned with nearest neighbours first. #### API request When an authenticated user makes a GET request to _/API/users/_, the following things happen: @@ -59,7 +59,7 @@ When an authenticated user makes a GET request to _/API/users/_, the following t 1. Handler runs through the [checklist of possible requests](#order-of-resolution), finds that this is an _/API_ request, checks that the API object exported from the _routes_ module has a request-handler for this path and invokes it with the _req_ object. 1. The request handler for _/API/users_ instantiates a database session, gets the user's GitHub ID from the user's request (info added by express-session from its memory store) and gets the project ID from the _req_ object's URL parameters. 1. It then queries the DB, combining the results from two queries: - 1. The first returns users with whom the requesting user is paired, along with the IDs of projects on which they're working and the distance between their experience and the requesting user's; - 1. The second returns the same information from users with whom the requesting user is not paired. + 1. The first returns users with whom the requesting user is paired, along with the IDs of projects on which they're working and the distance between their experience and the requesting user's; + 1. The second returns the same information from users with whom the requesting user is not paired. 1. The results are then map()ed, parsing each returned record with a DB model (a set of pseudoclassical constructors that imply a schema--post hoc--onto DB results) that returns a consistent User object. The resulting array is sorted by experience (the rating property of users at this point represent the distance between their experience-smaller numbers mean more similar experience) and resolve()d. 1. The request-handler which invoked this function has a .then which receives the resolve()d array, and sends it back to the user as JSON with an OK status code, using the _res_ object's methods. From cee574a31048ee7f9275abff91f5c8ee9f80db17 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 02:05:47 -0700 Subject: [PATCH 070/105] Update mypartener List --- client/components/ProjectDetails.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 3cb6327..c46e275 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -158,4 +158,4 @@ const mapDispatchToProps = (dispatch) => { }; //connects the Store to ProjectDetails component -export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); +export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); \ No newline at end of file From bd7f2e43d7c14b6a6c4970b98c6a84ba0c784576 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 02:13:03 -0700 Subject: [PATCH 071/105] Update clean code --- client/components/ProjectStatus.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 245f3d8..a7e065e 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -199,7 +199,7 @@ class ProjectStatus extends React.Component { open={this.state.dialogOpen} autoScrollBodyContent={true} > -
            hey
          +
            { this.state.chatBox.map((chat, index) => { return( From 89b5d68d6082cd9b808296b0b7dba0953452d63e Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 06:56:48 -0700 Subject: [PATCH 072/105] Update alluser state in redux store --- client/components/App.jsx | 18 +++- client/components/Landing.jsx | 2 +- client/components/MyProjects.jsx | 74 +++++++++------- client/store/reducers.js | 4 +- package-lock.json | 146 ++++++++++++++++--------------- package.json | 3 +- server/routes/api.js | 16 ++++ 7 files changed, 155 insertions(+), 108 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 7ba1486..e5b953f 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -42,9 +42,10 @@ class App extends React.Component { loggedIn: false, drawerOpen: false, } - this.checkAuthenticated(); + this.checkAuthenticated= this.checkAuthenticated.bind(this); this.navTap = this.navTap.bind(this); + } componentDidUpdate() { if(this.state.loggedIn) { @@ -81,6 +82,7 @@ class App extends React.Component { getMessages() { axios.get('/API/messages') .then((res) => { + console.log(91) this.props.loadMessages(res.data) }) .catch(console.error); @@ -90,16 +92,30 @@ class App extends React.Component { this.setState({ drawerOpen: !this.state.drawerOpen }); } + handleClick(){ + // console.log('clicked'); + + } //gets authentication checkAuthenticated() { + console.log('clickedauthen') axios.get('/auth/authenticated') .then((res) => { if (res.data !== false) { this.setState({ loggedIn: res.data }); + console.log('111') this.getMessages(); + console.log('112') this.getProjects(); +<<<<<<< HEAD this.getPairs(); +======= + console.log('113') + this.getPairs() + console.log('114') +>>>>>>> Update alluser state in redux store this.props.loggedInUser(res.data); + this.getAllUsers(); } }); } diff --git a/client/components/Landing.jsx b/client/components/Landing.jsx index 97f825b..87b35af 100644 --- a/client/components/Landing.jsx +++ b/client/components/Landing.jsx @@ -20,7 +20,7 @@ function Landing(props) {
            diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index f8a64a4..2236475 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -20,42 +20,50 @@ import { import {Card, CardText } from 'material-ui/Card'; const MyProjects = (props) => { - return ( - - - - - - - - Projects you have a partner with - - - - Name - Language - Experience - - - - {props.projects.map(project => - ( - { project.project } - { project.language } - { project.experience } - ) - )} - -
            -
            -
            - ); +// return ( +// +// +// +// +// +// +// +// Projects you have a partner with +// +// +// +// Name +// Language +// Experience +// +// +// +// {props.projects.map(project => +// ( +// { project.project } +// { project.language } +// { project.experience } +// ) +// )} +// +//
            +//
            +//
            +// ); }; -const mapStateToProps = (state) => { +const mapStateToProps = (state, props) => { + console.log('56565656565',state) + const userId = state.loggedInUser.id; + console.log(userId) + const user = state.users.filter(user => user.id === userId)[0]; + const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) return { - projects: state.projects.filter(project => project.paired.length > 0), - }; + userId, + user, + projects, + } + }; //connects the Store to MyProjects component diff --git a/client/store/reducers.js b/client/store/reducers.js index 33a1c62..9fc4a5c 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -61,7 +61,7 @@ const pairedUsers = (state, action) => { } else if (action.type === 'ADD_PAIRING') { if (state.length !== 0) { const idCollection = state[0].map((user) => { - return user.ghId; + return user.ghId; }); if (idCollection.indexOf(action.pairs.ghId) === -1) { state[0].push(action.pairs); @@ -205,4 +205,4 @@ const rootReducer = (state, action) => { return appReducer(state, action); } -export default rootReducer +export default rootReducer \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9313b84..4eaed9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "acorn": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==" + "integrity": "sha1-U/4WERH5EquZnuiHqQoLxSgi/XU=" }, "acorn-dynamic-import": { "version": "2.0.2", @@ -101,7 +101,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" @@ -119,7 +119,7 @@ "aria-query": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.0.tgz", - "integrity": "sha512-/r2lHl09V3o74+2MLKEdewoj37YZqiQZnfen1O4iNlrOjUgeKuu1U2yF3iKh6HJxqF+OXkLMfQv65Z/cvxD6vA==", + "integrity": "sha1-SvEKHmFXPd6gzzuZtRxSwFtCTSQ=", "dev": true, "requires": { "ast-types-flow": "0.0.7" @@ -136,7 +136,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" }, "array-find-index": { "version": "1.0.2", @@ -223,7 +223,7 @@ "async": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", + "integrity": "sha1-hDGQ/WtzV6C54clW7d3V7IRitU0=", "requires": { "lodash": "4.17.4" } @@ -905,7 +905,7 @@ "base64-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" + "integrity": "sha1-qRlH2h9KUW6jjltOwOw3c2deCIY=" }, "base64id": { "version": "1.0.0", @@ -944,7 +944,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=" }, "body-parser": { "version": "1.17.2", @@ -1231,7 +1231,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -1240,7 +1240,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "cli-cursor": { @@ -1303,7 +1303,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=" }, "commondir": { "version": "1.0.1", @@ -1486,7 +1486,7 @@ "crypto-browserify": { "version": "3.11.1", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", - "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "integrity": "sha1-lIlF78Z1ekANbl5a9HGU0QBkJ58=", "requires": { "browserify-cipher": "1.0.0", "browserify-sign": "4.0.4", @@ -1714,7 +1714,7 @@ "emoji-regex": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "integrity": "sha1-m66pKbFVVlwR6kHGYm6qZc75ksI=", "dev": true }, "emojis-list": { @@ -1810,7 +1810,7 @@ "es-abstract": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", - "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", + "integrity": "sha1-OwA4XoVymTK+/6kWO76hI06TKRQ=", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -1963,7 +1963,7 @@ "eslint-config-airbnb": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-15.1.0.tgz", - "integrity": "sha512-m0q9fiMBzDAIbirlGnpJNWToIhdhJmXXnMG+IFflYzzod9231ZhtmGKegKg8E9T8F1YuVaDSU1FnCm5b9iXVhQ==", + "integrity": "sha1-/UMpZakG4wE5ABuoMPWPc67dro4=", "dev": true, "requires": { "eslint-config-airbnb-base": "11.3.1" @@ -1983,7 +1983,7 @@ "eslint-import-resolver-node": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "integrity": "sha1-RCJXTN5mqaewmZOO5NUIoZng48w=", "dev": true, "requires": { "debug": "2.6.8", @@ -1993,7 +1993,7 @@ "eslint-module-utils": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", - "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "integrity": "sha1-q67IJBd2E7ipWymWOeG2+s9HNEk=", "dev": true, "requires": { "debug": "2.6.8", @@ -2033,7 +2033,7 @@ "eslint-plugin-import": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "integrity": "sha1-Id4zOAue+1X1720uIQ7A4H5/pp8=", "dev": true, "requires": { "builtin-modules": "1.1.1", @@ -2069,7 +2069,7 @@ "eslint-plugin-jsx-a11y": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz", - "integrity": "sha512-5I9SpoP7gT4wBFOtXT8/tXNPYohHBVfyVfO17vkbC7r9kEIxYJF12D3pKqhk8+xnk12rfxKClS3WCFpVckFTPQ==", + "integrity": "sha1-XJa7UYbKFOlNsQlf9Zs+K9lAabE=", "dev": true, "requires": { "aria-query": "0.7.0", @@ -2132,7 +2132,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "esquery": { @@ -2285,7 +2285,7 @@ "express-session": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", - "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", + "integrity": "sha1-9JoYInJjsxb2+FRNpf7iWlQCWew=", "requires": { "cookie": "0.3.1", "cookie-signature": "1.0.6", @@ -2390,7 +2390,7 @@ "finalhandler": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", - "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", + "integrity": "sha1-GFdPLnxLmLiuOyMMIfIB8xvbP7c=", "requires": { "debug": "2.6.8", "encodeurl": "1.0.1", @@ -2434,7 +2434,7 @@ "follow-redirects": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", - "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", + "integrity": "sha1-NV6PTRaHa0P1d7DVziZouXIyFOo=", "requires": { "debug": "2.6.8" } @@ -2481,7 +2481,7 @@ "fsevents": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "integrity": "sha1-MoK3E/s62A7eDp/PRhG1qm/AM/Q=", "optional": true, "requires": { "nan": "2.6.2", @@ -3246,14 +3246,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", - "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -3264,6 +3256,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -3407,7 +3407,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -3453,7 +3453,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=" }, "globby": { "version": "5.0.0", @@ -3533,7 +3533,7 @@ "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "integrity": "sha1-NA3tvmKQGHFRweodd3o0SJNd+EY=", "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -3578,7 +3578,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=" }, "hpack.js": { "version": "2.1.6", @@ -4036,7 +4036,7 @@ "js-yaml": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", - "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "integrity": "sha1-CHdc69/dNZIJ8NKs04PI+GppBKA=", "dev": true, "requires": { "argparse": "1.0.9", @@ -4046,7 +4046,7 @@ "jschardet": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", + "integrity": "sha1-xRn2KfhrOlvtuliojTETCe7Al/k=", "dev": true }, "jsesc": { @@ -4057,7 +4057,7 @@ "json-loader": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", - "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==" + "integrity": "sha1-3KFKcCNf+C8KyaOr62DTN6NlGF0=" }, "json-schema-traverse": { "version": "0.3.1", @@ -4233,7 +4233,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" @@ -4476,7 +4476,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -4549,7 +4549,7 @@ "node-fetch": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.2.tgz", - "integrity": "sha512-xZZUq2yDhKMIn/UgG5q//IZSNLJIwW2QxS14CNH5spuiXkITM2pUitjdq58yLSaU7m4M0wBNaM2Gh/ggY4YJig==", + "integrity": "sha1-xU6arFfkModSM1JfPIkcQVn/79c=", "requires": { "encoding": "0.1.12", "is-stream": "1.1.0" @@ -4601,7 +4601,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -4759,7 +4759,7 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", "requires": { "execa": "0.7.0", "lcid": "1.0.0", @@ -4959,7 +4959,7 @@ "pbkdf2": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", - "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", + "integrity": "sha1-w30pVTHnhrHaPj6tyEBCasywriU=", "requires": { "create-hash": "1.1.3", "create-hmac": "1.1.6", @@ -5032,6 +5032,12 @@ "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" }, + "prettier": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.9.1.tgz", + "integrity": "sha512-oYpQsZk7/0o8+YJUB0LfjkTYQa79gUIF2ESeqvG23IzcgqqvmeOE4+lMG7E/UKX3q3RIj8JHSfhrXWhon1L+zA==", + "dev": true + }, "private": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", @@ -5056,7 +5062,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", "requires": { "asap": "2.0.6" } @@ -5135,7 +5141,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -5172,7 +5178,7 @@ "randombytes": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "integrity": "sha1-3ACaJGuNCaF3tLegrne8Vw9LG3k=", "requires": { "safe-buffer": "5.1.1" } @@ -5241,7 +5247,7 @@ "react-redux": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.6.tgz", - "integrity": "sha512-8taaaGu+J7PMJQDJrk/xiWEYQmdo3mkXw6wPr3K3LxvXis3Fymiq7c13S+Tpls/AyNUAsoONkU81AP0RA6y6Vw==", + "integrity": "sha1-I+06T5hjWdaLUhLqqmgeYNZXSUY=", "requires": { "hoist-non-react-statics": "2.2.2", "invariant": "2.2.2", @@ -5261,7 +5267,7 @@ "react-router-dom": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.1.2.tgz", - "integrity": "sha512-CU6pFlpfvIj/xi36rZAbUiN0x39241q+d5bAfJJLtlEqlM62F3zgyv5aERH9zesmKqyDBBp2kd85rkq9Mo/iNQ==", + "integrity": "sha1-f4p8qGjTKsrdGcoJVDtA0m347Dc=", "requires": { "history": "4.6.3", "loose-envify": "1.3.1", @@ -5319,7 +5325,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -5351,7 +5357,7 @@ "recompose": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.24.0.tgz", - "integrity": "sha512-7+UVym5Mfks/ukIDfcAiasrY61YGki8uIs4CmLTGU7UV2lm2ObbhOl913WrlsZKu8x8uA/sLJUOI5hxVga0dIA==", + "integrity": "sha1-Ji6T+XRDnrF+d3mCTYjM6QSSpd0=", "requires": { "change-emitter": "0.1.6", "fbjs": "0.8.14", @@ -5377,7 +5383,7 @@ "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "integrity": "sha1-BrcxIyFZAdJdBlvjQusCa8HIU3s=", "requires": { "lodash": "4.17.4", "lodash-es": "4.17.4", @@ -5530,7 +5536,7 @@ "resolve": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "integrity": "sha1-p1vgHFPaJdk0qY69DkxKcxL5KoY=", "dev": true, "requires": { "path-parse": "1.0.5" @@ -5610,7 +5616,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, "select-hose": { "version": "2.0.0", @@ -5630,7 +5636,7 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" }, "send": { "version": "0.15.4", @@ -5841,7 +5847,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" + "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=" }, "source-map": { "version": "0.5.6", @@ -5926,7 +5932,7 @@ "stream-http": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "integrity": "sha1-QKBQ7I3DtTsz2ZCUFcAsC/Gr+60=", "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", @@ -5935,18 +5941,10 @@ "xtend": "4.0.1" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" @@ -5967,6 +5965,14 @@ } } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "requires": { + "safe-buffer": "5.1.1" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -6187,7 +6193,7 @@ "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "integrity": "sha1-Kz1cckDo/C5Y+Komnl7knAhXvTo=", "requires": { "random-bytes": "1.0.0" } @@ -6675,7 +6681,7 @@ "webpack-hot-middleware": { "version": "2.18.2", "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.18.2.tgz", - "integrity": "sha512-dB7uOnUWsojZIAC6Nwi5v3tuaQNd2i7p4vF5LsJRyoTOgr2fRYQdMKQxRZIZZaz0cTPBX8rvcWU1A6/n7JTITg==", + "integrity": "sha1-hN7mQ/A3w9WcneFCVIQwNxqo07I=", "dev": true, "requires": { "ansi-html": "0.0.7", @@ -6687,7 +6693,7 @@ "webpack-sources": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz", - "integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==", + "integrity": "sha1-xzVkNqTRMSO+LiQmoF0drZy+Zc8=", "requires": { "source-list-map": "2.0.0", "source-map": "0.5.6" @@ -6716,7 +6722,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "requires": { "isexe": "2.0.0" } diff --git a/package.json b/package.json index 7d75e87..ff86440 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "eslint-plugin-react": "^7.2.0", "webpack-dev-middleware": "^1.12.0", "webpack-dev-server": "^2.7.1", - "webpack-hot-middleware": "^2.18.2" + "webpack-hot-middleware": "^2.18.2", + "prettier": "^1.7.4" }, "dependencies": { "axios": "^0.16.2", diff --git a/server/routes/api.js b/server/routes/api.js index 0192f36..234b210 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -73,6 +73,22 @@ module.exports = { }); }, + allusers: function getAllusers(req){ + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + dbSession.run( + `MATCH (users:User) RETURN users` + ) + .then((res)=>{ + resolve(res.records.map(user => + new db.models.User(user.get('users')) + )); + }) + .catch(reject) + .then(() => dbSession.close()); + }) + }, + // Returns an array of user objects interested in the given project id // NOTE: The relative xp is a relationship between users // calculated and stored for new users in the profliing module. From 24c57b71fd035e544747fefcc38bd66a04625e95 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 07:03:52 -0700 Subject: [PATCH 073/105] Update addAllUser to redux store --- client/components/App.jsx | 162 +++++++++++++++------------ client/components/ProjectDetails.jsx | 142 ++++++++++++----------- 2 files changed, 167 insertions(+), 137 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index e5b953f..dabb4f4 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -34,56 +34,58 @@ import NotFound from './NotFound'; import MyProjects from './MyProjects'; import MyPartners from './MyPartners'; - class App extends React.Component { constructor(props) { super(props); this.state = { loggedIn: false, drawerOpen: false, - } + }; - this.checkAuthenticated= this.checkAuthenticated.bind(this); + this.checkAuthenticated = this.checkAuthenticated.bind(this); this.navTap = this.navTap.bind(this); - } componentDidUpdate() { - if(this.state.loggedIn) { + if (this.state.loggedIn) { this.getAllUsers(); } } getAllUsers() { - axios.get('/API/allUsers') - .then((allUsers) => { + axios + .get('/API/allUsers') + .then(allUsers => { this.props.addAllUsers(allUsers.data); }) .catch(console.error); } getPairs() { - axios.get('/API/pairs') - .then((pairs) => { + axios + .get('/API/pairs') + .then(pairs => { this.props.loadPairedUsers(pairs.data); }) .catch(console.error); } - //gets list of projects + // gets list of projects getProjects() { - axios.get('/API/projects/') - .then((project) => { + axios + .get('/API/projects/') + .then(project => { this.props.addProjectsList(project.data); }) .catch(console.error); } - //gets messages + // gets messages getMessages() { - axios.get('/API/messages') - .then((res) => { - console.log(91) - this.props.loadMessages(res.data) + axios + .get('/API/messages') + .then(res => { + console.log(91); + this.props.loadMessages(res.data); }) .catch(console.error); } @@ -92,44 +94,38 @@ class App extends React.Component { this.setState({ drawerOpen: !this.state.drawerOpen }); } - handleClick(){ - // console.log('clicked'); - + handleClick() { + // console.log('clicked'); } - //gets authentication + // gets authentication checkAuthenticated() { - console.log('clickedauthen') - axios.get('/auth/authenticated') - .then((res) => { - if (res.data !== false) { - this.setState({ loggedIn: res.data }); - console.log('111') - this.getMessages(); - console.log('112') - this.getProjects(); -<<<<<<< HEAD - this.getPairs(); -======= - console.log('113') - this.getPairs() - console.log('114') ->>>>>>> Update alluser state in redux store - this.props.loggedInUser(res.data); - this.getAllUsers(); - } - }); + console.log('clickedauthen'); + axios.get('/auth/authenticated').then(res => { + if (res.data !== false) { + this.setState({ loggedIn: res.data }); + console.log('111'); + this.getMessages(); + console.log('112'); + this.getProjects(); + console.log('113'); + this.getPairs(); + console.log('114'); + this.props.loggedInUser(res.data); + this.getAllUsers(); + } + }); } - //party mode + // party mode togglePartyMode() { const colors = ['blue', 'green', 'red', 'yellow', 'lilac']; if (this.state.partyMode) { clearInterval(this.state.partyMode); - document.body.setAttribute('style', `background-color:white`); + document.body.setAttribute('style', 'background-color:white'); this.setState({ partyMode: false }); } else { - this.setState({partyMode: - setInterval(() => { + this.setState({ + partyMode: setInterval(() => { const randomNum = Math.floor(Math.random() * colors.length); document.body.setAttribute('style', `background-color:${colors[randomNum]}`); }, 200), @@ -137,8 +133,6 @@ class App extends React.Component { } } - - render() { /* Condition: @@ -150,10 +144,27 @@ class App extends React.Component { return (
            - }/> + + + + + + } + /> {/* opens and closes side menu */} - this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> + this.setState({ drawerOpen: open })} + closeDrawer={() => this.setState({ drawerOpen: false })} + /> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -166,12 +177,14 @@ class App extends React.Component { - ()} /> + } + /> {/* given this path render this component and pass down the loggedIn state as user props */} - () } /> + } /> @@ -182,54 +195,55 @@ class App extends React.Component { ); } else if (this.state.loggedIn) { return ; - } else { - return ; } + return ; } } /* Allows App component to have message and project state */ -const mapStateToProps = (state) => { - return { - message: state.message, - projects: state.projects, - pairedUsers: state.pairedUsers, - }; -}; +const mapStateToProps = state => ({ + message: state.message, + projects: state.projects, + pairedUsers: state.pairedUsers, +}); /* Map our dispatch to App component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = (dispatch) => { - return { - addAllUsers: (allUsers) => dispatch({ +const mapDispatchToProps = dispatch => ({ + addAllUsers: allUsers => + dispatch({ type: 'LOAD_ALL_USERS', allUsers, }), - addProjectsList: projects => dispatch({ + addProjectsList: projects => + dispatch({ type: 'LIST_PROJECTS', projects, }), - loadMessages: messages => dispatch({ + loadMessages: messages => + dispatch({ type: 'MESSAGES_LOAD', messages, }), - loadPairedUsers: pairedUsers => dispatch({ + loadPairedUsers: pairedUsers => + dispatch({ type: 'LOAD_PAIRING', pairedUsers, }), - loggedInUser: loggedInUser => dispatch({ + loggedInUser: loggedInUser => + dispatch({ type: 'UPDATED_LOGGEDIN_USER', loggedInUser, }), - loggedOut: () => dispatch({ - type: 'USER_LOGOUT' - }) - }; -}; + loggedOut: () => + dispatch({ + type: 'USER_LOGOUT', + }), +}); -//connects the Store to App component +// connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index c46e275..be9868f 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -3,13 +3,9 @@ import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import axios from 'axios'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import Paper from 'material-ui/Paper'; -import {Card, CardText } from 'material-ui/Card'; +import { Card, CardText } from 'material-ui/Card'; import RaisedButton from 'material-ui/RaisedButton'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -17,7 +13,6 @@ import FlatButton from 'material-ui/FlatButton'; import UserList from './UserList'; class ProjectDetails extends React.Component { - constructor(props) { super(props); this.state = { @@ -34,90 +29,107 @@ class ProjectDetails extends React.Component { this.getUsers(); } + componentDidMount() { + // console.log('line38...', this.props.project.interested); + if (this.props.project.interested) { + console.log('line37 running'); + this.setState({ + disableUsers: false, + }); + } + } + getUsers() { - axios.get('/API/users', { - params: { - projectId: this.props.project.id - } - }) - .then((users) => { + axios + .get('/API/users', { + params: { + projectId: this.props.project.id, + }, + }) + .then(users => { this.props.addUsers(users.data); }) .catch(console.error); } - /* dialog handler*/ + /* dialog handler */ handleOpen() { - console.log("clicked") - this.setState({open: true}); - }; + console.log('clicked'); + this.setState({ open: true }); + } handleClose() { - this.setState({open: false}); - }; - /* dialog handler end*/ + this.setState({ open: false }); + } + /* dialog handler end */ toggleInterest() { - axios.post('/API/projects', { - projectId: this.props.project.id, - }) - .then((response) => { + axios + .post('/API/projects', { + projectId: this.props.project.id, + }) + .then(response => { this.props.dispatchInterest(this.props.project.id, this.props.project.interested); }) - .catch((error) => { + .catch(error => { console.log(error); }); } - handleInterest(){ + handleInterest() { this.props.project.interested = !this.props.project.interested; + console.log('line90', this.props.project.interested); + if (this.props.project.interested) { + console.log('line37 running'); + this.setState({ + disableUsers: false, + }); + } this.toggleInterest(); } clickHandler() { - this.setState({ - disableUsers: false, - }); this.handleInterest(); this.handleOpen(); } render() { const actions = [ - , - + , + , ]; return ( - - + + - + - - + + - { this.props.project.description || 'This project has no description.' } + {this.props.project.description || 'This project has no description.'} - + - - + + - {this.props.project.interested? 'Choose a partner!' : 'Are you sure?' } - - + > + {this.props.project.interested ? 'Choose a partner!' : 'Are you sure?'} + + - ) + ); } } @@ -143,19 +159,19 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = (dispatch) => { - return { - addUsers: users => dispatch({ +const mapDispatchToProps = dispatch => ({ + addUsers: users => + dispatch({ type: 'USERS_ADD', - users: users + users, }), - dispatchInterest: (projectId, value) => dispatch({ + dispatchInterest: (projectId, value) => + dispatch({ type: 'CHANGE_PROJECT_INTEREST', projectId, value, - }) - }; -}; + }), +}); -//connects the Store to ProjectDetails component -export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); \ No newline at end of file +// connects the Store to ProjectDetails component +export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); From e445f1d04b8c83b41b022999b4c543a7e4cf311b Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 11:07:21 -0700 Subject: [PATCH 074/105] Add logginUser project and pair --- client/components/MyProjects.jsx | 113 +++++++++++++++++++++---------- client/store/reducers.js | 6 ++ 2 files changed, 83 insertions(+), 36 deletions(-) diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index 2236475..a062c76 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -19,49 +19,90 @@ import { } from 'material-ui/Toolbar'; import {Card, CardText } from 'material-ui/Card'; -const MyProjects = (props) => { -// return ( -// -// -// -// -// -// -// -// Projects you have a partner with -// -// -// -// Name -// Language -// Experience -// -// -// -// {props.projects.map(project => -// ( -// { project.project } -// { project.language } -// { project.experience } -// ) -// )} -// -//
            -//
            -//
            -// ); -}; +class MyProjects extends React.Component { + constructor(props) { + super(props); + this.state={ + projectList:[], + } + + console.log('this.props.projectsIDs', this.props.projectsIDs) + console.log('this.props.projects',this.props.projects) + this.handleMap=this.handleMap.bind(this) + + } + + componentWillMount(){ + this.handleMap(); + } + + + handleMap(){ + var projectList = []; + var idList = this.props.projectsIDs; + var projects = this.props.projects + + idList.forEach(function(element){ + projects.forEach(function(cur){ + if(cur.id === element) { + projectList.push(cur) + } + }) + }) + + console.log('line545454', projectList) + this.setState({projectList: projectList}) + return projectList + } + + + + render(){ + const ctrl = this.state.projectList + return ( + + + + + + + + Projects you have a partner with + + + + Name + Language + Experience + + + + {this.state.projectList.map(project => + ( + { project.project } + { project.language } + { project.experience } + ) + )} + +
            +
            +
            + ) + } +} const mapStateToProps = (state, props) => { - console.log('56565656565',state) + console.log('56565656565', state.loggedInUser.projects) const userId = state.loggedInUser.id; - console.log(userId) - const user = state.users.filter(user => user.id === userId)[0]; - const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) + const user = state.loggedInUser.name; + const projectsIDs = state.loggedInUser.projects; + const projects = state.projects; return { userId, user, projects, + projectsIDs, } }; diff --git a/client/store/reducers.js b/client/store/reducers.js index 9fc4a5c..28c84b7 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -172,7 +172,13 @@ const loggedInUser = (state, action) => { if (state === undefined) { return {}; } else if (action.type === 'UPDATED_LOGGEDIN_USER') { + console.log('hahahahahahahahha', action.loggedInUser) return action.loggedInUser; + } else if (action.type === 'ADD_CUR_PAIR_STATUS'){ + console.log('yoyoyoyoyoyoyoyoyoy', action.pair) + state = Object.assign({}, state, { + paired:state.paired.concat(action.pair)}); + return state } return state; }; From d4bcf247800d75dcdb0c0b2666c6e5625b2c9d68 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 12:54:40 -0700 Subject: [PATCH 075/105] Update userListDetail --- client/components/UserDetails.jsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 41a4d08..ed9600a 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -45,6 +45,7 @@ class UserDetails extends React.Component { isPaired: false, curProjectId: null, curProjectProperty: null, + projectList:[], } this.expandCard = () => { this.setState({ expanded: true }); @@ -87,6 +88,24 @@ class UserDetails extends React.Component { }) } + handlePorjectMapping() { + // var projectList = []; + // var idList = this.props.projectsIDs; + var projects = this.props.projects + + // idList.forEach(function(element){ + // projects.forEach(function(cur){ + // if(cur.id === element) { + // projectList.push(cur) + // } + // }) + // }) + + console.log('line545454', projectList) + this.setState({projectList: projectList}) + return projectList + } + checkIfPaired() { axios.get('/API/pairedProjects', { params: { @@ -259,7 +278,7 @@ class UserDetails extends React.Component { - project.project).join(' ')}/> + project).join(' ')}/>
            { this.pairButton() } } onClick={this.expandCard} secondary={true} /> @@ -320,12 +339,15 @@ const mapStateToProps = (state, props) => { const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; + const loggedInUser = state.loggedInUser.username; + // const projectsIDs = state.loggedInUser.projects return { - user, + user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, + // projectsIDs, }; }; const mapDispatchToProps = dispatch => From eb37ff27ad7b2dd74414c8b33852e7baa91bcfae Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Mon, 28 Aug 2017 13:24:44 -0700 Subject: [PATCH 076/105] Update loggedInUser last attempt changes --- client/components/MyPartners.jsx | 2 +- client/components/UserDetails.jsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 091b93c..74ffbe2 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -65,7 +65,7 @@ render() { { tests.map(user => ( - { user.name } + { user.name } { user.language } { user.experience } ) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index ed9600a..59c4023 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -100,7 +100,7 @@ class UserDetails extends React.Component { // } // }) // }) - + // userId: this.props.loggedInUserGhId, console.log('line545454', projectList) this.setState({projectList: projectList}) return projectList @@ -109,7 +109,7 @@ class UserDetails extends React.Component { checkIfPaired() { axios.get('/API/pairedProjects', { params: { - userId: this.props.loggedInUserGhId, + userId: this.props.userId, partnerId: this.props.user.ghId } }) @@ -339,10 +339,10 @@ const mapStateToProps = (state, props) => { const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; - const loggedInUser = state.loggedInUser.username; + // const loggedInUser = state.loggedInUser.username; // const projectsIDs = state.loggedInUser.projects return { - user, + user, projects, messages: state.messages[userId] || [], loggedInUser, From 338bb637755169296a39405ee15d8273a48cd383 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Tue, 5 Dec 2017 17:38:58 -0800 Subject: [PATCH 077/105] Add console.log and temparary query for test --- client/components/ProjectDetails.jsx | 4 ++++ server/routes/api.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index be9868f..4de8326 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -30,7 +30,11 @@ class ProjectDetails extends React.Component { } componentDidMount() { +<<<<<<< HEAD // console.log('line38...', this.props.project.interested); +======= + console.log('line38...', this.props.project.interested); +>>>>>>> Add console.log and temparary query for test if (this.props.project.interested) { console.log('line37 running'); this.setState({ diff --git a/server/routes/api.js b/server/routes/api.js index 234b210..9982656 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -260,6 +260,7 @@ module.exports = { ` ) .then((res) => { + console.log('line263....263',res) resolve(res); }) .catch(reject) @@ -267,6 +268,14 @@ module.exports = { }); }, +// ` +// MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} +// MATCH (project:Project) WHERE ID(project) = ${Number(req.body.projectId)} +// MATCH(user)-[r:INTERESTED_IN]->(project) +// DELETE r +// ` + + // Sets requesting user as working on the project with project ID // with the user with the given user ID pair: function addPair(req) { From c635a3a9201eaee4ef72bb9e61094bf7791a4977 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Tue, 5 Dec 2017 18:39:16 -0800 Subject: [PATCH 078/105] Update style and partial prop types --- .eslintignore | 2 + .eslintrc.json | 13 +- client/components/App.jsx | 38 ++- client/components/AppDrawer.jsx | 72 +++-- client/components/Landing.jsx | 27 +- client/components/MyPartners.jsx | 118 ++++---- client/components/MyProjects.jsx | 139 +++++---- client/components/Project.jsx | 63 ++-- client/components/ProjectDetails.jsx | 30 +- client/components/ProjectList.jsx | 83 +++--- client/components/ProjectStatus.jsx | 253 ++++++++--------- client/components/Questionnaire.jsx | 66 +++-- client/components/UserDetails.jsx | 410 +++++++++++++++------------ client/components/UserList.jsx | 43 ++- client/components/UserProfile.jsx | 33 ++- client/store/reducers.js | 55 ++-- package-lock.json | 340 ++++++++++++++++------ package.json | 9 +- 18 files changed, 1057 insertions(+), 737 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..248ee24 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +#folders# +node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json index cee3996..70d6783 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,10 @@ { - "extends": "airbnb", - "env": { - "browser": true, - "node": true - } + "extends": ["airbnb", "prettier", "prettier/react"], + "env": { + "browser": true, + "node": true + }, + "rules": { + " eslint no-console": "off" + } } diff --git a/client/components/App.jsx b/client/components/App.jsx index dabb4f4..9803aea 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ /* This is the main (parent) component for the application. @@ -8,7 +9,7 @@ You can find these routes inside server/routes/index.js - */ +*/ import React from 'react'; import { BrowserRouter, Route, Switch, Link } from 'react-router-dom'; @@ -16,10 +17,10 @@ import { connect } from 'react-redux'; import axios from 'axios'; import AppBar from 'material-ui/AppBar'; -import Paper from 'material-ui/Paper'; +// import Paper from 'material-ui/Paper'; import ActionHome from 'material-ui/svg-icons/action/home'; import IconButton from 'material-ui/IconButton'; -import FloatingActionButton from 'material-ui/FloatingActionButton'; +// import FloatingActionButton from 'material-ui/FloatingActionButton'; import { fullWhite } from 'material-ui/styles/colors'; import AppDrawer from './AppDrawer'; @@ -94,9 +95,10 @@ class App extends React.Component { this.setState({ drawerOpen: !this.state.drawerOpen }); } - handleClick() { - // console.log('clicked'); - } + // handleClick() { + // console.log('clicked'); + // } + // gets authentication checkAuthenticated() { console.log('clickedauthen'); @@ -127,7 +129,10 @@ class App extends React.Component { this.setState({ partyMode: setInterval(() => { const randomNum = Math.floor(Math.random() * colors.length); - document.body.setAttribute('style', `background-color:${colors[randomNum]}`); + document.body.setAttribute( + 'style', + `background-color:${colors[randomNum]}`, + ); }, 200), }); } @@ -179,12 +184,18 @@ class App extends React.Component { } + render={() => ( + + )} /> {/* given this path render this component and pass down the loggedIn state as user props */} - } /> + } + /> @@ -244,6 +255,13 @@ const mapDispatchToProps = dispatch => ({ type: 'USER_LOGOUT', }), }); - +App.propTypes = { + addAllUsers: React.PropTypes.isRequired, + loadPairedUsers: React.PropTypes.isRequired, + addProjectsList: React.PropTypes.isRequired, + loadMessages: React.PropTypes.isRequired, + loggedInUser: React.PropTypes.isRequired, + loggedOut: React.PropTypes.isRequired, +}; // connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 9018788..5342966 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -5,9 +5,12 @@ import { Card, CardHeader } from 'material-ui/Card'; // menus and toolbars etc. import Drawer from 'material-ui/Drawer'; import AppBar from 'material-ui/AppBar'; -import { BottomNavigation, BottomNavigationItem } from 'material-ui/BottomNavigation'; +import { + BottomNavigation, + BottomNavigationItem, +} from 'material-ui/BottomNavigation'; // buttons -import FlatButton from 'material-ui/FlatButton'; +// import FlatButton from 'material-ui/FlatButton'; import RaisedButton from 'material-ui/RaisedButton'; // icons import ActionEject from 'material-ui/svg-icons/action/eject'; @@ -24,35 +27,64 @@ Add this to AppDrawer when user functionality expands function AppDrawer(props) { return ( - - - - -
            - - }/> + + + + +
            + + } + /> - - + +
            - - -
            + + +
            - }/> + } + />
            - - - }/> + + + } + /> - } onClick={ props.closeDrawer }/> + + } + onClick={props.closeDrawer} + /> + - ) + ); } export default AppDrawer; diff --git a/client/components/Landing.jsx b/client/components/Landing.jsx index 87b35af..dab2393 100644 --- a/client/components/Landing.jsx +++ b/client/components/Landing.jsx @@ -13,14 +13,31 @@ const style = { function Landing(props) { return ( - - + + - + -
            + diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 74ffbe2..f1339aa 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -10,87 +10,81 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import {Card, CardText } from 'material-ui/Card'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardText } from 'material-ui/Card'; import Subheader from 'material-ui/Subheader'; - - class MyPartners extends React.Component { constructor(props) { super(props); this.state = { isMounted: false, userLists: [], - } + }; } - componentDidMount(){ - if(this.props.pairedUsers) { + componentDidMount() { + if (this.props.pairedUsers) { this.setState({ - userLists: this.props.pairedUsers - }) + userLists: this.props.pairedUsers, + }); } else { this.setState({ - userLists:[] - }) + userLists: [], + }); } } - -render() { - let tests = this.props.pairedUsers[0] || []; - return ( - - - - - - - - Click on a user to chat and start working! - - - - Name - Language - Experience - - - - { - tests.map(user => - ( - { user.name } - { user.language } - { user.experience } - ) - ) - } - - -
            -
            -
            - ); + render() { + const tests = this.props.pairedUsers[0] || []; + return ( + + + + + + + + Click on a user to chat and start working! + + + + Name + Language + Experience + + + + {tests.map(user => ( + + + + {user.name} + + + {user.language} + {user.experience} + + ))} + +
            +
            +
            + ); } } +const mapStateToProps = (state, props) => ({ + pairedUsers: state.pairedUsers, +}); - -const mapStateToProps = (state, props) => { - return { - pairedUsers: state.pairedUsers - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - }; -}; +const mapDispatchToProps = dispatch => ({}); export default connect(mapStateToProps, mapDispatchToProps)(MyPartners); diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index a062c76..c6975a2 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -12,100 +12,99 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import {Card, CardText } from 'material-ui/Card'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardText } from 'material-ui/Card'; class MyProjects extends React.Component { constructor(props) { super(props); - this.state={ - projectList:[], - } - - console.log('this.props.projectsIDs', this.props.projectsIDs) - console.log('this.props.projects',this.props.projects) - this.handleMap=this.handleMap.bind(this) + this.state = { + projectList: [], + }; + console.log('this.props.projectsIDs', this.props.projectsIDs); + console.log('this.props.projects', this.props.projects); + this.handleMap = this.handleMap.bind(this); } - componentWillMount(){ + componentWillMount() { this.handleMap(); } + handleMap() { + const projectList = []; + const idList = this.props.projectsIDs; + const projects = this.props.projects; - handleMap(){ - var projectList = []; - var idList = this.props.projectsIDs; - var projects = this.props.projects + idList.forEach(element => { + projects.forEach(cur => { + if (cur.id === element) { + projectList.push(cur); + } + }); + }); - idList.forEach(function(element){ - projects.forEach(function(cur){ - if(cur.id === element) { - projectList.push(cur) - } - }) - }) - - console.log('line545454', projectList) - this.setState({projectList: projectList}) - return projectList + console.log('line545454', projectList); + this.setState({ projectList }); + return projectList; } - - - render(){ - const ctrl = this.state.projectList + render() { + const ctrl = this.state.projectList; return ( - - - - - - - - Projects you have a partner with - - - - Name - Language - Experience - - - - {this.state.projectList.map(project => - ( - { project.project } - { project.language } - { project.experience } - ) - )} - -
            -
            -
            - ) + + + + + + + + Projects you have a partner with + + + + Name + Language + Experience + + + + {this.state.projectList.map(project => ( + + + + {project.project} + + + {project.language} + {project.experience} + + ))} + +
            +
            +
            + ); } } const mapStateToProps = (state, props) => { - console.log('56565656565', state.loggedInUser.projects) + console.log('56565656565', state.loggedInUser.projects); const userId = state.loggedInUser.id; const user = state.loggedInUser.name; const projectsIDs = state.loggedInUser.projects; const projects = state.projects; return { - userId, - user, - projects, - projectsIDs, - } - + userId, + user, + projects, + projectsIDs, + }; }; -//connects the Store to MyProjects component +// connects the Store to MyProjects component export default connect(mapStateToProps)(MyProjects); diff --git a/client/components/Project.jsx b/client/components/Project.jsx index eff9c97..ce649b5 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -10,37 +10,44 @@ class Project extends React.Component { super(props); this.POSTprogress = this.POSTprogress.bind(this); - if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { + if ( + this.props.project.paired.length > 0 && + this.props.progress.length < 1 + ) { this.GETprogress(); } } - - - //post user's progress + // post user's progress POSTprogress() { - axios.post('/API/progress', { - projectId: this.props.project.id, - progress: this.props.progress, - }) - .catch(console.error); + axios + .post('/API/progress', { + projectId: this.props.project.id, + progress: this.props.progress, + }) + .catch(console.error); } - //gets user's progress + // gets user's progress GETprogress() { - axios.get('/API/progress') - .then(res => - this.props.loadProgress(res.data) - ) + axios + .get('/API/progress') + .then(res => this.props.loadProgress(res.data)) .catch(console.error); } render() { - if (this.props.project.paired.length > 0) { - return - } else { - return - } + if (this.props.project.paired.length > 0) { + return ( + + ); + } + return ; } } @@ -60,19 +67,19 @@ const mapStateToProps = (state, props) => { Map our dispatch to Project component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = (dispatch, props) => { - return { - dispatchProgress: (projectId, itemIndex) => dispatch({ +const mapDispatchToProps = (dispatch, props) => ({ + dispatchProgress: (projectId, itemIndex) => + dispatch({ type: 'PROGRESS_CHANGE_ITEM', projectId, - itemIndex + itemIndex, }), - loadProgress: progress => dispatch({ + loadProgress: progress => + dispatch({ type: 'PROGRESS_LOAD_ITEMS', progress, - }) - }; -}; + }), +}); -//connects the Store to Project component +// connects the Store to Project component export default connect(mapStateToProps, mapDispatchToProps)(Project); diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 4de8326..2896500 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -30,11 +30,7 @@ class ProjectDetails extends React.Component { } componentDidMount() { -<<<<<<< HEAD // console.log('line38...', this.props.project.interested); -======= - console.log('line38...', this.props.project.interested); ->>>>>>> Add console.log and temparary query for test if (this.props.project.interested) { console.log('line37 running'); this.setState({ @@ -73,7 +69,10 @@ class ProjectDetails extends React.Component { projectId: this.props.project.id, }) .then(response => { - this.props.dispatchInterest(this.props.project.id, this.props.project.interested); + this.props.dispatchInterest( + this.props.project.id, + this.props.project.interested, + ); }) .catch(error => { console.log(error); @@ -104,7 +103,9 @@ class ProjectDetails extends React.Component { ]; return ( - + @@ -120,19 +121,26 @@ class ProjectDetails extends React.Component { - {this.props.project.description || 'This project has no description.'} + {this.props.project.description || + 'This project has no description.'} - + @@ -142,7 +150,9 @@ class ProjectDetails extends React.Component { open={this.state.open} onRequestClose={this.handleClose} > - {this.props.project.interested ? 'Choose a partner!' : 'Are you sure?'} + {this.props.project.interested + ? 'Choose a partner!' + : 'Are you sure?'} { - //console.log('ProjectList.jsx Props', props); - return ( - - - - - - - - - - - Name - Language - Experience +const ProjectList = props => ( + // console.log('ProjectList.jsx Props', props); + + + + + + + +
            + + + Name + Language + Experience + + + + {props.projects.map(project => ( + + + {project.project} + + {project.language} + {project.experience} - - - {props.projects.map(project => - ( - { project.project } - { project.language } - { project.experience } - ) - )} - -
            -
            -
            - ); -}; - -const mapStateToProps = (state) => { - return { - projects: state.projects, - }; -}; + ))} + + + +
            +); +const mapStateToProps = state => ({ + projects: state.projects, +}); -//connects the Store to ProjectList +// connects the Store to ProjectList export default connect(mapStateToProps)(ProjectList); diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index a7e065e..e4d1bab 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -1,11 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import Paper from 'material-ui/Paper'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import { Card, CardHeader, CardText } from 'material-ui/Card'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import Checkbox from 'material-ui/Checkbox'; @@ -15,8 +11,8 @@ import Dialog from 'material-ui/Dialog'; import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; import io from 'socket.io-client'; -const socket = io(); +const socket = io(); const style = { margin: 12, @@ -28,16 +24,14 @@ const customContentStyle = { maxWidth: 'none', }; // renders a progress item component inside ProjectStatus -const ProgressItem = (props) => { +const ProgressItem = props => { const check = () => props.dispatchProgress(props.projectId, props.index); return (
            - - { props.hint } - + {props.hint}
            - ) + ); }; class ProjectStatus extends React.Component { @@ -48,8 +42,7 @@ class ProjectStatus extends React.Component { open: false, dialogOpen: false, chatBox: [], - - } + }; this.handleSubmit = this.handleSubmit.bind(this); this.handleClose = this.handleClose.bind(this); @@ -57,168 +50,167 @@ class ProjectStatus extends React.Component { this.handleDiaLogClose = this.handleDiaLogClose.bind(this); this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - socket.on('chat message', (msg) => this.renderMessages(msg)); + socket.on('chat message', msg => this.renderMessages(msg)); } - /* dialog handler*/ + /* dialog handler */ handleDiaLogOpen() { - console.log("clicked") - this.setState({dialogOpen: true}); - }; + console.log('clicked'); + this.setState({ dialogOpen: true }); + } handleDiaLogClose() { - console.log('clicked') - this.setState({dialogOpen: false}); - }; - /* dialog handler end*/ + console.log('clicked'); + this.setState({ dialogOpen: false }); + } + /* dialog handler end */ - //handles opening the dialog alert and submits the project's progress + // handles opening the dialog alert and submits the project's progress handleSubmit() { this.setState({ - open: true + open: true, }); - this.props.submitProgress() + this.props.submitProgress(); } - //handles the closing of dialog alert + // handles the closing of dialog alert handleClose() { this.setState({ - open: false + open: false, }); } - handleMessegeSubmit(event) { event.preventDefault(); - var newMessage = { + const newMessage = { message: this._message.value, - username: this.props.loggedInUser - } - - var myMessage = { - username: "me: ", - message: this._message.value - } + username: this.props.loggedInUser, + }; + const myMessage = { + username: 'me: ', + message: this._message.value, + }; - var updatedChatBox = this.state.chatBox + const updatedChatBox = this.state.chatBox; updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - socket.emit('chat message', newMessage); //send msg - }; - + socket.emit('chat message', newMessage); // send msg + } renderMessages(msg) { - var updatedChatBox= this.state.chatBox; - console.log("line 119", msg) + const updatedChatBox = this.state.chatBox; + console.log('line 119', msg); updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - }; + } render() { const actions = [
            -
            - this._message = message} id="newMessage" type="text"/> - Send -
            +
            + (this._message = message)} + id="newMessage" + type="text" + /> + + Send + +
            , - + , ]; return (
            - - - - - - - - - - - - - {this.props.project.description || 'This project has no description.' } - -
            - { - this.props.progress.map((item, index) => - ( - - ) - ) - } -
            - - - } - modal={false} - open={this.state.open} - onRequestClose={this.handleClose} + + + + + + + + + + + + + {this.props.project.description || + 'This project has no description.'} + +
            + {this.props.progress.map((item, index) => ( + + ))} +
            + + + } + modal={false} + open={this.state.open} + onRequestClose={this.handleClose} > Congrats on your progress! - -
            -
            - - - +
            +
            +
            + + + -
              - { - this.state.chatBox.map((chat, index) => { - return( -
              - {chat.username} -

              {chat.message}

              -
              - )} - ) - } -
              + title="Send a message" + actions={actions} + modal + contentStyle={customContentStyle} + open={this.state.dialogOpen} + autoScrollBodyContent + > +
                + {this.state.chatBox.map((chat, index) => ( +
                + {chat.username} +

                {chat.message}

                +
                + ))} +
              - - ) + ); } } - - const mapStateToProps = (state, props) => { const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; @@ -228,9 +220,6 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = dispatch => - ({ - - }); +const mapDispatchToProps = dispatch => ({}); export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index 3f78b8f..b1ee842 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -18,58 +18,88 @@ class Questionnaire extends React.Component { } onLanguageSelect(val) { - this.setState({ selectedLanguage: val }, () => console.log(this.state.selectedLanguage)); + this.setState({ selectedLanguage: val }, () => + console.log(this.state.selectedLanguage), + ); } onSkillLevelSelect(val) { - this.setState({ selectedSkillLevel: val }, () => console.log(this.state.selectedSkillLevel)); + this.setState({ selectedSkillLevel: val }, () => + console.log(this.state.selectedSkillLevel), + ); } onDescriptionChange(val) { - this.setState({ description: val }, () => console.log(this.state.description)); + this.setState({ description: val }, () => + console.log(this.state.description), + ); } onButtonClick() { - let userInfo = { + const userInfo = { language: this.state.selectedLanguage, experience: this.state.selectedSkillLevel, description: this.state.description, }; - axios.post('/API/users', userInfo) - .then((response) => { + axios + .post('/API/users', userInfo) + .then(response => { // redirect to home after successful submission window.location.href = '/projects'; }) - .catch((error) => { + .catch(error => { console.log(error); }); } render() { return ( - +

              Welcome, {this.props.user.name}


              Select your preferred language to use with other GitPal members:

              - this.onLanguageSelect(val)}> - - - - + this.onLanguageSelect(val)} + > + + + +

              Select your proficieny level at the chosen language above:

              - this.onSkillLevelSelect(val)}> - + this.onSkillLevelSelect(val)} + > +
              -

              Write a short introduction about yourself that other GitPal members can see:

              - this.onDescriptionChange(val)} /> +

              + Write a short introduction about yourself that other GitPal members + can see: +

              + this.onDescriptionChange(val)} + />
              - this.onButtonClick()} /> + this.onButtonClick()} + />
              ); } diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 59c4023..aa87b60 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -18,6 +18,7 @@ import TextField from 'material-ui/TextField'; /* for Dialog */ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; + const customContentStyle = { width: '80%', height: '100%', @@ -26,6 +27,7 @@ const customContentStyle = { /* for Dialog */ import io from 'socket.io-client'; + const socket = io(); class UserDetails extends React.Component { @@ -39,20 +41,20 @@ class UserDetails extends React.Component { message: 'placeholder', chatBox: [], myMessage: 'myMessage', - receivedMessage:'receivedMessage', - //for popUp window + receivedMessage: 'receivedMessage', + // for popUp window open: false, isPaired: false, curProjectId: null, curProjectProperty: null, - projectList:[], - } + projectList: [], + }; this.expandCard = () => { this.setState({ expanded: true }); - } + }; - socket.on('chat message', (msg) => this.renderMessages(msg)); - //receive messages + socket.on('chat message', msg => this.renderMessages(msg)); + // receive messages this.addPair = this.addPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); @@ -65,10 +67,11 @@ class UserDetails extends React.Component { this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { - axios.post('/API/messages', { - text: this.state.message, - recipient: this.props.user.id, - }) + axios + .post('/API/messages', { + text: this.state.message, + recipient: this.props.user.id, + }) .then(() => { this.props.dispatchMessage(this.props.user.id, { text: this.state.message, @@ -82,189 +85,209 @@ class UserDetails extends React.Component { return new Promise((resolve, reject) => { this.retrieveProjectId(); resolve(); - }) - .then(() => { + }).then(() => { this.checkIfPaired(); - }) + }); } handlePorjectMapping() { - // var projectList = []; - // var idList = this.props.projectsIDs; - var projects = this.props.projects + // var projectList = []; + // var idList = this.props.projectsIDs; + const projects = this.props.projects; - // idList.forEach(function(element){ - // projects.forEach(function(cur){ - // if(cur.id === element) { - // projectList.push(cur) - // } - // }) - // }) - // userId: this.props.loggedInUserGhId, - console.log('line545454', projectList) - this.setState({projectList: projectList}) - return projectList + // idList.forEach(function(element){ + // projects.forEach(function(cur){ + // if(cur.id === element) { + // projectList.push(cur) + // } + // }) + // }) + // userId: this.props.loggedInUserGhId, + console.log('line545454', projectList); + this.setState({ projectList }); + return projectList; } checkIfPaired() { - axios.get('/API/pairedProjects', { - params: { - userId: this.props.userId, - partnerId: this.props.user.ghId - } - }) - .then((pairProjects) => { - if (pairProjects.data.length > 0) { - this.setState({ - buttonClicked: true - }) - } - }) - .catch((error) => { - console.log(error); - }) + axios + .get('/API/pairedProjects', { + params: { + userId: this.props.userId, + partnerId: this.props.user.ghId, + }, + }) + .then(pairProjects => { + if (pairProjects.data.length > 0) { + this.setState({ + buttonClicked: true, + }); + } + }) + .catch(error => { + console.log(error); + }); } - addPair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { + axios + .post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then(response => { this.props.createPairing(response.data); - this.setState({buttonClicked: !this.state.buttonClicked}); - window.location.reload(); //REACT needs this after a POST + this.setState({ buttonClicked: !this.state.buttonClicked }); + window.location.reload(); // REACT needs this after a POST }) - .catch((error) => { + .catch(error => { console.log(error); }); - axios.get('/') + axios.get('/'); } togglePair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { - //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); + axios + .post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then(response => { + // this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); console.log(response); }) - .catch((error) => { + .catch(error => { console.log(error); }); } - /* dialog handler*/ + /* dialog handler */ handleOpen() { - //console.log("clicked") - this.setState({open: true}); - }; + // console.log("clicked") + this.setState({ open: true }); + } handleClose() { - this.setState({open: false}); - }; - /* dialog handler end*/ + this.setState({ open: false }); + } + /* dialog handler end */ pairButton() { if (this.state.buttonClicked) { console.log('these are the props for UserDetails', this); - return
              - } - onClick={ this.addPair } /> - } - href="/my-projects" - primary={ true } /> -
              + return ( +
              + } + onClick={this.addPair} + /> + } + href="/my-projects" + primary + /> +
              + ); } else if (!this.state.buttonClicked) { - return } - onClick={ this.addPair } - primary={ true } /> + return ( + } + onClick={this.addPair} + primary + /> + ); } - }; + } handleSubmit(event) { event.preventDefault(); // socket.emit('chat message', ); - var newMessage = { + const newMessage = { message: this._message.value, - username: this.props.loggedInUser - } + username: this.props.loggedInUser, + }; - var myMessage = { - username: "me: ", - message: this._message.value - } + const myMessage = { + username: 'me: ', + message: this._message.value, + }; - var updatedChatBox = this.state.chatBox - updatedChatBox.push(myMessage) + const updatedChatBox = this.state.chatBox; + updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - socket.emit('chat message', newMessage); //send msg + socket.emit('chat message', newMessage); // send msg console.log(newMessage); - }; + } getMessages() { - axios.get('API/messages') - .then((res) => { - this.props.loadMessages(res.data) + axios + .get('API/messages') + .then(res => { + this.props.loadMessages(res.data); }) .catch(console.error); } - renderMessages(msg) { - var updatedChatBox= this.state.chatBox; + const updatedChatBox = this.state.chatBox; updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - }; + } retrieveProjectId() { const userId = this.props.user.ghId; - axios.get('/API/project', { - params: { - id: userId - } - }) - .then((project) => { + axios + .get('/API/project', { + params: { + id: userId, + }, + }) + .then(project => { this.state.curProjectId = project.data.id; this.state.curProjectProperty = project.data; }) .catch(console.error); - }; + } render() { - const actions = [ + const actions = [
              -
              - this._message = message} id="newMessage" type="text"/> - Send -
              +
              + (this._message = message)} + id="newMessage" + type="text" + /> + + Send + +
              , - + , ]; return ( - - + + @@ -272,62 +295,84 @@ class UserDetails extends React.Component {
              - +
              - - - - project).join(' ')}/> + + + + project).join(' ')} + />
              - { this.pairButton() } - } onClick={this.expandCard} secondary={true} /> + {this.pairButton()} + } + onClick={this.expandCard} + secondary + />
              - {/*dialog for message*/} + {/* dialog for message */}
              - -
                - {this.state.chatBox.map((chat, index) => { - return( -
                - {chat.username} -

                {chat.message}

                - -
                - )} - )} -
                -
                - {/*dialog for message end*/} + +
                  + {this.state.chatBox.map((chat, index) => ( +
                  + {chat.username} +

                  {chat.message}

                  +
                  + ))} +
                +
                + {/* dialog for message end */} {/* should be deleted */} -
                +
                -
                - } secondary={true}/> - { this.props.messages.map((message, index) => - - { message.sender ? 'You' : this.props.user.name } - { message.text } +
                + } + secondary + /> + {this.props.messages.map((message, index) => ( + + + {message.sender ? 'You' : this.props.user.name} + + {message.text} - )} + ))}
                - {/* should be deleted end*/} - - + {/* should be deleted end */}
                ); @@ -336,39 +381,44 @@ class UserDetails extends React.Component { const mapStateToProps = (state, props) => { const userId = Number(props.match.params.id); const user = state.allUsers.filter(user => user.id === userId)[0]; - const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) + const projects = state.projects.filter( + project => user.projects.indexOf(project.id) > -1, + ); const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; // const loggedInUser = state.loggedInUser.username; - // const projectsIDs = state.loggedInUser.projects + // const projectsIDs = state.loggedInUser.projects return { user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, - // projectsIDs, + // projectsIDs, }; }; -const mapDispatchToProps = dispatch => - ({ - loadMessages: messages => dispatch({ +const mapDispatchToProps = dispatch => ({ + loadMessages: messages => + dispatch({ type: 'MESSAGES_LOAD', messages, }), - createPairing: (pairs) => dispatch({ + createPairing: pairs => + dispatch({ type: 'ADD_PAIRING', pairs, }), - dispatchPairing: (userId, projectId) => dispatch({ + dispatchPairing: (userId, projectId) => + dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId, }), - dispatchMessage: (userId, message) => dispatch({ + dispatchMessage: (userId, message) => + dispatch({ type: 'MESSAGE_SEND', userId, message, }), - }); +}); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); diff --git a/client/components/UserList.jsx b/client/components/UserList.jsx index 9f2c391..154a8aa 100644 --- a/client/components/UserList.jsx +++ b/client/components/UserList.jsx @@ -12,30 +12,29 @@ import { TableHeader, TableHeaderColumn, TableRow, - TableRowColumn + TableRowColumn, } from 'material-ui/Table'; -const UserList = (props) => { - return ( - - Users interested in this project - { props.users.map((user, index) => { - return ( - } - leftAvatar={ - - } - key={ index } - primaryText={ user.name } - secondaryText={ "Rating: " + user.rating } +const UserList = props => ( + + Users interested in this project + {props.users.map((user, index) => ( + - ); - }, - )} - - ); -}; + } + leftAvatar={} + key={index} + primaryText={user.name} + secondaryText={`Rating: ${user.rating}`} + /> + ))} + +); export default UserList; diff --git a/client/components/UserProfile.jsx b/client/components/UserProfile.jsx index b749ee8..893ca4e 100644 --- a/client/components/UserProfile.jsx +++ b/client/components/UserProfile.jsx @@ -8,7 +8,14 @@ import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; function UserProfile(props) { return ( - + @@ -16,22 +23,28 @@ function UserProfile(props) {
                - +
                - + - - project.project).join(' ')} /> + + project.project).join(' ')} + />
                ); } -const mapStateToProps = (state, props) => ( - { - projects: state.projects.filter(project => props.user.projects.indexOf(project.id) > -1) - } -); +const mapStateToProps = (state, props) => ({ + projects: state.projects.filter( + project => props.user.projects.indexOf(project.id) > -1, + ), +}); export default connect(mapStateToProps)(UserProfile); diff --git a/client/store/reducers.js b/client/store/reducers.js index 28c84b7..159ca9b 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ /* Reducers - decides how the change a state after receiving an action, and thus can be considered the entrance of a state change. A reducer is comprised of functions and it changes states by taking an action as argument, in which it then returns a new state. The actions get sent to App component and other parent component where they can be pass through as props. @@ -5,7 +6,8 @@ import { combineReducers } from 'redux'; // does nothing - implemented to test connecting Redux to React -const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' ? action.text : state; +const changeString = (state = 'some message', action) => + action.type === 'CHANGE_STRING' ? action.text : state; /* first condition is the initial state @@ -13,9 +15,9 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ -//Returns all users in the database +// Returns all users in the database const allUsers = (state, action) => { - if(state === undefined) { + if (state === undefined) { return []; } else if (action.type === 'LOAD_ALL_USERS') { return action.allUsers; @@ -26,7 +28,6 @@ const allUsers = (state, action) => { return state; }; - const users = (state, action) => { console.log('Reducer action', action); if (state === undefined) { @@ -35,15 +36,15 @@ const users = (state, action) => { console.log('ADDING USERS', action); return action.users; } else if (action.type === 'CHANGE_USER_PAIRING') { - console.log('this is state before CHANGE_USER_PAIRING ', state) - return state.map((user) => { + console.log('this is state before CHANGE_USER_PAIRING ', state); + return state.map(user => { if (user.id === action.userId) { const object = Object.assign({}, user, { - paired: user.paired.concat(action.projectId) + paired: user.paired.concat(action.projectId), }); return object; } - console.log('this is the user from reducers ', user) + console.log('this is the user from reducers ', user); return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { @@ -60,9 +61,7 @@ const pairedUsers = (state, action) => { return action.pairedUsers; } else if (action.type === 'ADD_PAIRING') { if (state.length !== 0) { - const idCollection = state[0].map((user) => { - return user.ghId; - }); + const idCollection = state[0].map(user => user.ghId); if (idCollection.indexOf(action.pairs.ghId) === -1) { state[0].push(action.pairs); } @@ -81,10 +80,10 @@ const pairingStatus = (state, action) => { if (state === undefined) { return null; } else if (action.type === 'ADD_PAIRING_STATUS') { - return action.isPaired + return action.isPaired; } return state; -} +}; /* first condition is the initial state @@ -98,17 +97,17 @@ const projects = (state, action) => { } else if (action.type === 'LIST_PROJECTS') { return action.projects; } else if (action.type === 'CHANGE_PROJECT_INTEREST') { - return state.map((project) => { + return state.map(project => { if (project.id === action.projectId) { return Object.assign({}, project, { interested: action.value }); } return project; }); } else if (action.type === 'CHANGE_USER_PAIRING') { - return state.map((project) => { + return state.map(project => { if (project.id === action.projectId) { return Object.assign({}, project, { - paired: project.paired.concat(action.userId) + paired: project.paired.concat(action.userId), }); } return project; @@ -158,8 +157,13 @@ const projectProgress = (state, action) => { const stateProject = state[action.projectId]; newProgress[action.projectId] = stateProject.slice(); const updatedProject = newProgress[action.projectId]; - updatedProject[action.itemIndex] = Object.assign({}, stateProject[action.itemIndex]); - updatedProject[action.itemIndex].complete = !updatedProject[action.itemIndex].complete; + updatedProject[action.itemIndex] = Object.assign( + {}, + stateProject[action.itemIndex], + ); + updatedProject[action.itemIndex].complete = !updatedProject[ + action.itemIndex + ].complete; return newProgress; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project progress load', action.payload.projectProgress); @@ -172,13 +176,14 @@ const loggedInUser = (state, action) => { if (state === undefined) { return {}; } else if (action.type === 'UPDATED_LOGGEDIN_USER') { - console.log('hahahahahahahahha', action.loggedInUser) + console.log('reducersline175 loggedInUser', action.loggedInUser); return action.loggedInUser; - } else if (action.type === 'ADD_CUR_PAIR_STATUS'){ - console.log('yoyoyoyoyoyoyoyoyoy', action.pair) + } else if (action.type === 'ADD_CUR_PAIR_STATUS') { + console.log('yoyoyoyoyoyoyoyoyoy', action.pair); state = Object.assign({}, state, { - paired:state.paired.concat(action.pair)}); - return state + paired: state.paired.concat(action.pair), + }); + return state; } return state; }; @@ -209,6 +214,6 @@ const rootReducer = (state, action) => { state = undefined; } return appReducer(state, action); -} +}; -export default rootReducer \ No newline at end of file +export default rootReducer; diff --git a/package-lock.json b/package-lock.json index 4eaed9a..af921e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,6 +66,12 @@ "json-stable-stringify": "1.0.1" } }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -77,9 +83,9 @@ } }, "ansi-escapes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", - "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", "dev": true }, "ansi-html": { @@ -1212,6 +1218,12 @@ "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -1240,7 +1252,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "cli-cursor": { @@ -1253,9 +1265,9 @@ } }, "cli-width": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "cliui": { @@ -1286,9 +1298,9 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "color-convert": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", - "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { "color-name": "1.1.3" @@ -1917,33 +1929,33 @@ } }, "eslint": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", - "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.1.tgz", + "integrity": "sha512-28hOYej+NZ/R5H1yMvyKa1+bPlu+fnsIAQffK6hxXgvmXnImos2bA5XfCn5dYv2k2mrKj+/U/Z4L5ICWxC7TQw==", "dev": true, "requires": { - "ajv": "5.2.2", + "ajv": "5.5.1", "babel-code-frame": "6.22.0", - "chalk": "1.1.3", + "chalk": "2.3.0", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", - "debug": "2.6.8", - "doctrine": "2.0.0", + "debug": "3.1.0", + "doctrine": "2.0.2", "eslint-scope": "3.7.1", - "espree": "3.5.0", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.3", + "globals": "11.0.1", + "ignore": "3.3.7", "imurmurhash": "0.1.4", - "inquirer": "3.2.1", + "inquirer": "3.3.0", "is-resolvable": "1.0.0", - "js-yaml": "3.9.1", - "json-stable-stringify": "1.0.1", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -1951,13 +1963,96 @@ "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "4.0.0", + "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.4.1", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.1", + "table": "4.0.2", "text-table": "0.2.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "globals": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz", + "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } } }, "eslint-config-airbnb": { @@ -1980,6 +2075,23 @@ } } }, + "eslint-config-prettier": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.1.1.tgz", + "integrity": "sha1-qzkj+3BO6+yraWCQa30NboAc3lg=", + "dev": true, + "requires": { + "get-stdin": "5.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + } + } + }, "eslint-import-resolver-node": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", @@ -2120,19 +2232,27 @@ } }, "espree": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", - "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { - "acorn": "5.1.1", + "acorn": "5.2.1", "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "dev": true + } } }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, "esquery": { @@ -2299,14 +2419,14 @@ } }, "external-editor": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz", - "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { + "chardet": "0.4.2", "iconv-lite": "0.4.18", - "jschardet": "1.5.1", - "tmp": "0.0.31" + "tmp": "0.0.33" } }, "extglob": { @@ -2322,6 +2442,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -2366,7 +2492,7 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.2.2", + "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, @@ -2420,9 +2546,9 @@ } }, "flat-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", @@ -3675,9 +3801,9 @@ "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" }, "ignore": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", - "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "imurmurhash": { @@ -3724,16 +3850,16 @@ } }, "inquirer": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", - "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "2.0.0", - "chalk": "2.1.0", + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", "cli-cursor": "2.1.0", - "cli-width": "2.1.0", - "external-editor": "2.0.4", + "cli-width": "2.2.0", + "external-editor": "2.1.0", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -3757,18 +3883,18 @@ "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.5.0" } }, "strip-ansi": { @@ -3781,9 +3907,9 @@ } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -4034,21 +4160,15 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, "js-yaml": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", - "integrity": "sha1-CHdc69/dNZIJ8NKs04PI+GppBKA=", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" } }, - "jschardet": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha1-xRn2KfhrOlvtuliojTETCe7Al/k=", - "dev": true - }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -4072,6 +4192,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", @@ -4997,9 +5123,9 @@ } }, "pluralize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", - "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "portfinder": { @@ -5748,10 +5874,13 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } }, "socket.io": { "version": "2.0.3", @@ -6017,34 +6146,59 @@ "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" }, "table": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz", - "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", + "ajv": "5.5.1", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", "lodash": "4.17.4", - "slice-ansi": "0.0.4", + "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", "dev": true, "requires": { "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, - "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", - "dev": true + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, @@ -6087,9 +6241,9 @@ } }, "tmp": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "1.0.2" @@ -6388,7 +6542,7 @@ "supports-color": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=", "requires": { "has-flag": "2.0.0" } diff --git a/package.json b/package.json index ff86440..fb41dbc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "GitPal", "version": "1.0.0", - "description": "An application to help programmers begin working on open source projects.", + "description": + "An application to help programmers begin working on open source projects.", "main": "server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -16,17 +17,19 @@ "type": "git", "url": "git+https://github.com/Toucans456/GitPal.git" }, - "author": "haque-kim-ngo-warner-medley and chen-gallegos-mitchell-schafer-zimmerman", + "author": + "haque-kim-ngo-warner-medley and chen-gallegos-mitchell-schafer-zimmerman", "license": "ISC", "bugs": { "url": "https://github.com/Toucans456/GitPal/issues" }, "homepage": "https://github.com/Toucans456/GitPal#readme", "devDependencies": { - "eslint": "^4.4.1", + "eslint": "^4.12.1", "eslint-config-airbnb": "^15.1.0", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", + "eslint-config-prettier": "2.1.1", "eslint-plugin-react": "^7.2.0", "webpack-dev-middleware": "^1.12.0", "webpack-dev-server": "^2.7.1", From d4df9d16bd8bfc1610daca4ce140fe53426b4b8f Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 5 Dec 2017 19:11:22 -0800 Subject: [PATCH 079/105] Revert "Update cleanup and partial prop types" --- .eslintignore | 2 - .eslintrc.json | 13 +- client/components/App.jsx | 174 ++++------ client/components/AppDrawer.jsx | 72 ++-- client/components/Landing.jsx | 27 +- client/components/MyPartners.jsx | 118 +++---- client/components/MyProjects.jsx | 132 +++----- client/components/Project.jsx | 63 ++-- client/components/ProjectDetails.jsx | 156 ++++----- client/components/ProjectList.jsx | 83 ++--- client/components/ProjectStatus.jsx | 253 +++++++------- client/components/Questionnaire.jsx | 66 +--- client/components/UserDetails.jsx | 398 +++++++++------------- client/components/UserList.jsx | 43 +-- client/components/UserProfile.jsx | 33 +- client/store/reducers.js | 51 ++- package-lock.json | 474 +++++++++------------------ package.json | 12 +- server/routes/api.js | 25 -- 19 files changed, 858 insertions(+), 1337 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 248ee24..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -#folders# -node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json index 70d6783..cee3996 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,7 @@ { - "extends": ["airbnb", "prettier", "prettier/react"], - "env": { - "browser": true, - "node": true - }, - "rules": { - " eslint no-console": "off" - } + "extends": "airbnb", + "env": { + "browser": true, + "node": true + } } diff --git a/client/components/App.jsx b/client/components/App.jsx index 9803aea..7ba1486 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -1,4 +1,3 @@ -/* eslint no-console:0 */ /* This is the main (parent) component for the application. @@ -9,7 +8,7 @@ You can find these routes inside server/routes/index.js -*/ + */ import React from 'react'; import { BrowserRouter, Route, Switch, Link } from 'react-router-dom'; @@ -17,10 +16,10 @@ import { connect } from 'react-redux'; import axios from 'axios'; import AppBar from 'material-ui/AppBar'; -// import Paper from 'material-ui/Paper'; +import Paper from 'material-ui/Paper'; import ActionHome from 'material-ui/svg-icons/action/home'; import IconButton from 'material-ui/IconButton'; -// import FloatingActionButton from 'material-ui/FloatingActionButton'; +import FloatingActionButton from 'material-ui/FloatingActionButton'; import { fullWhite } from 'material-ui/styles/colors'; import AppDrawer from './AppDrawer'; @@ -35,58 +34,54 @@ import NotFound from './NotFound'; import MyProjects from './MyProjects'; import MyPartners from './MyPartners'; + class App extends React.Component { constructor(props) { super(props); this.state = { loggedIn: false, drawerOpen: false, - }; + } + this.checkAuthenticated(); - this.checkAuthenticated = this.checkAuthenticated.bind(this); this.navTap = this.navTap.bind(this); } componentDidUpdate() { - if (this.state.loggedIn) { + if(this.state.loggedIn) { this.getAllUsers(); } } getAllUsers() { - axios - .get('/API/allUsers') - .then(allUsers => { + axios.get('/API/allUsers') + .then((allUsers) => { this.props.addAllUsers(allUsers.data); }) .catch(console.error); } getPairs() { - axios - .get('/API/pairs') - .then(pairs => { + axios.get('/API/pairs') + .then((pairs) => { this.props.loadPairedUsers(pairs.data); }) .catch(console.error); } - // gets list of projects + //gets list of projects getProjects() { - axios - .get('/API/projects/') - .then(project => { + axios.get('/API/projects/') + .then((project) => { this.props.addProjectsList(project.data); }) .catch(console.error); } - // gets messages + //gets messages getMessages() { - axios - .get('/API/messages') - .then(res => { - console.log(91); - this.props.loadMessages(res.data); + axios.get('/API/messages') + .then((res) => { + this.props.loadMessages(res.data) }) .catch(console.error); } @@ -95,49 +90,39 @@ class App extends React.Component { this.setState({ drawerOpen: !this.state.drawerOpen }); } - // handleClick() { - // console.log('clicked'); - // } - - // gets authentication + //gets authentication checkAuthenticated() { - console.log('clickedauthen'); - axios.get('/auth/authenticated').then(res => { - if (res.data !== false) { - this.setState({ loggedIn: res.data }); - console.log('111'); - this.getMessages(); - console.log('112'); - this.getProjects(); - console.log('113'); - this.getPairs(); - console.log('114'); - this.props.loggedInUser(res.data); - this.getAllUsers(); - } - }); + axios.get('/auth/authenticated') + .then((res) => { + if (res.data !== false) { + this.setState({ loggedIn: res.data }); + this.getMessages(); + this.getProjects(); + this.getPairs(); + this.props.loggedInUser(res.data); + } + }); } - // party mode + //party mode togglePartyMode() { const colors = ['blue', 'green', 'red', 'yellow', 'lilac']; if (this.state.partyMode) { clearInterval(this.state.partyMode); - document.body.setAttribute('style', 'background-color:white'); + document.body.setAttribute('style', `background-color:white`); this.setState({ partyMode: false }); } else { - this.setState({ - partyMode: setInterval(() => { + this.setState({partyMode: + setInterval(() => { const randomNum = Math.floor(Math.random() * colors.length); - document.body.setAttribute( - 'style', - `background-color:${colors[randomNum]}`, - ); + document.body.setAttribute('style', `background-color:${colors[randomNum]}`); }, 200), }); } } + + render() { /* Condition: @@ -149,27 +134,10 @@ class App extends React.Component { return (
                - - - - - - } - /> + }/> {/* opens and closes side menu */} - this.setState({ drawerOpen: open })} - closeDrawer={() => this.setState({ drawerOpen: false })} - /> + this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -182,20 +150,12 @@ class App extends React.Component { - ( - - )} - /> + ()} /> {/* given this path render this component and pass down the loggedIn state as user props */} - } - /> + () } /> @@ -206,62 +166,54 @@ class App extends React.Component { ); } else if (this.state.loggedIn) { return ; + } else { + return ; } - return ; } } /* Allows App component to have message and project state */ -const mapStateToProps = state => ({ - message: state.message, - projects: state.projects, - pairedUsers: state.pairedUsers, -}); +const mapStateToProps = (state) => { + return { + message: state.message, + projects: state.projects, + pairedUsers: state.pairedUsers, + }; +}; /* Map our dispatch to App component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = dispatch => ({ - addAllUsers: allUsers => - dispatch({ +const mapDispatchToProps = (dispatch) => { + return { + addAllUsers: (allUsers) => dispatch({ type: 'LOAD_ALL_USERS', allUsers, }), - addProjectsList: projects => - dispatch({ + addProjectsList: projects => dispatch({ type: 'LIST_PROJECTS', projects, }), - loadMessages: messages => - dispatch({ + loadMessages: messages => dispatch({ type: 'MESSAGES_LOAD', messages, }), - loadPairedUsers: pairedUsers => - dispatch({ + loadPairedUsers: pairedUsers => dispatch({ type: 'LOAD_PAIRING', pairedUsers, }), - loggedInUser: loggedInUser => - dispatch({ + loggedInUser: loggedInUser => dispatch({ type: 'UPDATED_LOGGEDIN_USER', loggedInUser, }), - loggedOut: () => - dispatch({ - type: 'USER_LOGOUT', - }), -}); -App.propTypes = { - addAllUsers: React.PropTypes.isRequired, - loadPairedUsers: React.PropTypes.isRequired, - addProjectsList: React.PropTypes.isRequired, - loadMessages: React.PropTypes.isRequired, - loggedInUser: React.PropTypes.isRequired, - loggedOut: React.PropTypes.isRequired, + loggedOut: () => dispatch({ + type: 'USER_LOGOUT' + }) + }; }; -// connects the Store to App component + +//connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 5342966..9018788 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -5,12 +5,9 @@ import { Card, CardHeader } from 'material-ui/Card'; // menus and toolbars etc. import Drawer from 'material-ui/Drawer'; import AppBar from 'material-ui/AppBar'; -import { - BottomNavigation, - BottomNavigationItem, -} from 'material-ui/BottomNavigation'; +import { BottomNavigation, BottomNavigationItem } from 'material-ui/BottomNavigation'; // buttons -// import FlatButton from 'material-ui/FlatButton'; +import FlatButton from 'material-ui/FlatButton'; import RaisedButton from 'material-ui/RaisedButton'; // icons import ActionEject from 'material-ui/svg-icons/action/eject'; @@ -27,64 +24,35 @@ Add this to AppDrawer when user functionality expands function AppDrawer(props) { return ( - - - - -
                - - } - /> + + + + +
                + + }/> - - + +
                - - -
                + + +
                - } - /> + }/>
                - - - } - /> + + + }/> - - } - onClick={props.closeDrawer} - /> - + } onClick={ props.closeDrawer }/> - ); + ) } export default AppDrawer; diff --git a/client/components/Landing.jsx b/client/components/Landing.jsx index dab2393..97f825b 100644 --- a/client/components/Landing.jsx +++ b/client/components/Landing.jsx @@ -13,31 +13,14 @@ const style = { function Landing(props) { return ( - - + + - + -
                + diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index f1339aa..091b93c 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -10,81 +10,87 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; -import { Card, CardText } from 'material-ui/Card'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; +import {Card, CardText } from 'material-ui/Card'; import Subheader from 'material-ui/Subheader'; + + class MyPartners extends React.Component { constructor(props) { super(props); this.state = { isMounted: false, userLists: [], - }; + } } - componentDidMount() { - if (this.props.pairedUsers) { + componentDidMount(){ + if(this.props.pairedUsers) { this.setState({ - userLists: this.props.pairedUsers, - }); + userLists: this.props.pairedUsers + }) } else { this.setState({ - userLists: [], - }); + userLists:[] + }) } } - render() { - const tests = this.props.pairedUsers[0] || []; - return ( - - - - - - - - Click on a user to chat and start working! - - - - Name - Language - Experience - - - - {tests.map(user => ( - - - - {user.name} - - - {user.language} - {user.experience} - - ))} - -
                -
                -
                - ); + +render() { + let tests = this.props.pairedUsers[0] || []; + return ( + + + + + + + + Click on a user to chat and start working! + + + + Name + Language + Experience + + + + { + tests.map(user => + ( + { user.name } + { user.language } + { user.experience } + ) + ) + } + + +
                +
                +
                + ); } } -const mapStateToProps = (state, props) => ({ - pairedUsers: state.pairedUsers, -}); -const mapDispatchToProps = dispatch => ({}); + +const mapStateToProps = (state, props) => { + return { + pairedUsers: state.pairedUsers + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + }; +}; export default connect(mapStateToProps, mapDispatchToProps)(MyPartners); diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index c6975a2..f8a64a4 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -12,99 +12,51 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; -import { Card, CardText } from 'material-ui/Card'; - -class MyProjects extends React.Component { - constructor(props) { - super(props); - this.state = { - projectList: [], - }; - - console.log('this.props.projectsIDs', this.props.projectsIDs); - console.log('this.props.projects', this.props.projects); - this.handleMap = this.handleMap.bind(this); - } - - componentWillMount() { - this.handleMap(); - } - - handleMap() { - const projectList = []; - const idList = this.props.projectsIDs; - const projects = this.props.projects; - - idList.forEach(element => { - projects.forEach(cur => { - if (cur.id === element) { - projectList.push(cur); - } - }); - }); - - console.log('line545454', projectList); - this.setState({ projectList }); - return projectList; - } - - render() { - const ctrl = this.state.projectList; - return ( - - - - - - - - Projects you have a partner with - - - - Name - Language - Experience - - - - {this.state.projectList.map(project => ( - - - - {project.project} - - - {project.language} - {project.experience} - - ))} - -
                -
                -
                - ); - } -} +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; +import {Card, CardText } from 'material-ui/Card'; + +const MyProjects = (props) => { + return ( + + + + + + + + Projects you have a partner with + + + + Name + Language + Experience + + + + {props.projects.map(project => + ( + { project.project } + { project.language } + { project.experience } + ) + )} + +
                +
                +
                + ); +}; -const mapStateToProps = (state, props) => { - console.log('56565656565', state.loggedInUser.projects); - const userId = state.loggedInUser.id; - const user = state.loggedInUser.name; - const projectsIDs = state.loggedInUser.projects; - const projects = state.projects; +const mapStateToProps = (state) => { return { - userId, - user, - projects, - projectsIDs, + projects: state.projects.filter(project => project.paired.length > 0), }; }; -// connects the Store to MyProjects component +//connects the Store to MyProjects component export default connect(mapStateToProps)(MyProjects); diff --git a/client/components/Project.jsx b/client/components/Project.jsx index ce649b5..eff9c97 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -10,44 +10,37 @@ class Project extends React.Component { super(props); this.POSTprogress = this.POSTprogress.bind(this); - if ( - this.props.project.paired.length > 0 && - this.props.progress.length < 1 - ) { + if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { this.GETprogress(); } } - // post user's progress + + + //post user's progress POSTprogress() { - axios - .post('/API/progress', { - projectId: this.props.project.id, - progress: this.props.progress, - }) - .catch(console.error); + axios.post('/API/progress', { + projectId: this.props.project.id, + progress: this.props.progress, + }) + .catch(console.error); } - // gets user's progress + //gets user's progress GETprogress() { - axios - .get('/API/progress') - .then(res => this.props.loadProgress(res.data)) + axios.get('/API/progress') + .then(res => + this.props.loadProgress(res.data) + ) .catch(console.error); } render() { - if (this.props.project.paired.length > 0) { - return ( - - ); - } - return ; + if (this.props.project.paired.length > 0) { + return + } else { + return + } } } @@ -67,19 +60,19 @@ const mapStateToProps = (state, props) => { Map our dispatch to Project component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = (dispatch, props) => ({ - dispatchProgress: (projectId, itemIndex) => - dispatch({ +const mapDispatchToProps = (dispatch, props) => { + return { + dispatchProgress: (projectId, itemIndex) => dispatch({ type: 'PROGRESS_CHANGE_ITEM', projectId, - itemIndex, + itemIndex }), - loadProgress: progress => - dispatch({ + loadProgress: progress => dispatch({ type: 'PROGRESS_LOAD_ITEMS', progress, - }), -}); + }) + }; +}; -// connects the Store to Project component +//connects the Store to Project component export default connect(mapStateToProps, mapDispatchToProps)(Project); diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 2896500..3cb6327 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -3,9 +3,13 @@ import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import axios from 'axios'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; import Paper from 'material-ui/Paper'; -import { Card, CardText } from 'material-ui/Card'; +import {Card, CardText } from 'material-ui/Card'; import RaisedButton from 'material-ui/RaisedButton'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -13,6 +17,7 @@ import FlatButton from 'material-ui/FlatButton'; import UserList from './UserList'; class ProjectDetails extends React.Component { + constructor(props) { super(props); this.state = { @@ -29,119 +34,90 @@ class ProjectDetails extends React.Component { this.getUsers(); } - componentDidMount() { - // console.log('line38...', this.props.project.interested); - if (this.props.project.interested) { - console.log('line37 running'); - this.setState({ - disableUsers: false, - }); - } - } - getUsers() { - axios - .get('/API/users', { - params: { - projectId: this.props.project.id, - }, - }) - .then(users => { + axios.get('/API/users', { + params: { + projectId: this.props.project.id + } + }) + .then((users) => { this.props.addUsers(users.data); }) .catch(console.error); } - /* dialog handler */ + /* dialog handler*/ handleOpen() { - console.log('clicked'); - this.setState({ open: true }); - } + console.log("clicked") + this.setState({open: true}); + }; handleClose() { - this.setState({ open: false }); - } - /* dialog handler end */ + this.setState({open: false}); + }; + /* dialog handler end*/ toggleInterest() { - axios - .post('/API/projects', { - projectId: this.props.project.id, - }) - .then(response => { - this.props.dispatchInterest( - this.props.project.id, - this.props.project.interested, - ); + axios.post('/API/projects', { + projectId: this.props.project.id, + }) + .then((response) => { + this.props.dispatchInterest(this.props.project.id, this.props.project.interested); }) - .catch(error => { + .catch((error) => { console.log(error); }); } - handleInterest() { + handleInterest(){ this.props.project.interested = !this.props.project.interested; - console.log('line90', this.props.project.interested); - if (this.props.project.interested) { - console.log('line37 running'); - this.setState({ - disableUsers: false, - }); - } this.toggleInterest(); } clickHandler() { + this.setState({ + disableUsers: false, + }); this.handleInterest(); this.handleOpen(); } render() { const actions = [ - , - , + , + ]; return ( - - + + - + - - + + - {this.props.project.description || - 'This project has no description.'} + { this.props.project.description || 'This project has no description.' } - + - - + + - {this.props.project.interested - ? 'Choose a partner!' - : 'Are you sure?'} - - + > + {this.props.project.interested? 'Choose a partner!' : 'Are you sure?' } + + - ); + ) } } @@ -173,19 +143,19 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = dispatch => ({ - addUsers: users => - dispatch({ +const mapDispatchToProps = (dispatch) => { + return { + addUsers: users => dispatch({ type: 'USERS_ADD', - users, + users: users }), - dispatchInterest: (projectId, value) => - dispatch({ + dispatchInterest: (projectId, value) => dispatch({ type: 'CHANGE_PROJECT_INTEREST', projectId, value, - }), -}); + }) + }; +}; -// connects the Store to ProjectDetails component +//connects the Store to ProjectDetails component export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); diff --git a/client/components/ProjectList.jsx b/client/components/ProjectList.jsx index eb189de..f8c2162 100644 --- a/client/components/ProjectList.jsx +++ b/client/components/ProjectList.jsx @@ -11,47 +11,52 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; -import { Card, CardText } from 'material-ui/Card'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; +import {Card, CardText } from 'material-ui/Card'; -const ProjectList = props => ( - // console.log('ProjectList.jsx Props', props); - - - - - - - - - - - Name - Language - Experience - - - - {props.projects.map(project => ( - - - {project.project} - - {project.language} - {project.experience} +const ProjectList = (props) => { + //console.log('ProjectList.jsx Props', props); + return ( + + + + + + + +
                + + + Name + Language + Experience - ))} - -
                -
                -
                -); + + + {props.projects.map(project => + ( + { project.project } + { project.language } + { project.experience } + ) + )} + + +
                +
                + ); +}; + +const mapStateToProps = (state) => { + return { + projects: state.projects, + }; +}; -const mapStateToProps = state => ({ - projects: state.projects, -}); -// connects the Store to ProjectList +//connects the Store to ProjectList export default connect(mapStateToProps)(ProjectList); diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index e4d1bab..245f3d8 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -1,7 +1,11 @@ import React from 'react'; import { connect } from 'react-redux'; import Paper from 'material-ui/Paper'; -import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { + Toolbar, + ToolbarGroup, + ToolbarTitle +} from 'material-ui/Toolbar'; import { Card, CardHeader, CardText } from 'material-ui/Card'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import Checkbox from 'material-ui/Checkbox'; @@ -11,9 +15,9 @@ import Dialog from 'material-ui/Dialog'; import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; import io from 'socket.io-client'; - const socket = io(); + const style = { margin: 12, }; @@ -24,14 +28,16 @@ const customContentStyle = { maxWidth: 'none', }; // renders a progress item component inside ProjectStatus -const ProgressItem = props => { +const ProgressItem = (props) => { const check = () => props.dispatchProgress(props.projectId, props.index); return (
                - {props.hint} + + { props.hint } +
                - ); + ) }; class ProjectStatus extends React.Component { @@ -42,7 +48,8 @@ class ProjectStatus extends React.Component { open: false, dialogOpen: false, chatBox: [], - }; + + } this.handleSubmit = this.handleSubmit.bind(this); this.handleClose = this.handleClose.bind(this); @@ -50,167 +57,168 @@ class ProjectStatus extends React.Component { this.handleDiaLogClose = this.handleDiaLogClose.bind(this); this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - socket.on('chat message', msg => this.renderMessages(msg)); + socket.on('chat message', (msg) => this.renderMessages(msg)); } - /* dialog handler */ + /* dialog handler*/ handleDiaLogOpen() { - console.log('clicked'); - this.setState({ dialogOpen: true }); - } + console.log("clicked") + this.setState({dialogOpen: true}); + }; handleDiaLogClose() { - console.log('clicked'); - this.setState({ dialogOpen: false }); - } - /* dialog handler end */ + console.log('clicked') + this.setState({dialogOpen: false}); + }; + /* dialog handler end*/ - // handles opening the dialog alert and submits the project's progress + //handles opening the dialog alert and submits the project's progress handleSubmit() { this.setState({ - open: true, + open: true }); - this.props.submitProgress(); + this.props.submitProgress() } - // handles the closing of dialog alert + //handles the closing of dialog alert handleClose() { this.setState({ - open: false, + open: false }); } + handleMessegeSubmit(event) { event.preventDefault(); - const newMessage = { + var newMessage = { message: this._message.value, - username: this.props.loggedInUser, - }; + username: this.props.loggedInUser + } + + var myMessage = { + username: "me: ", + message: this._message.value + } - const myMessage = { - username: 'me: ', - message: this._message.value, - }; - const updatedChatBox = this.state.chatBox; + var updatedChatBox = this.state.chatBox updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); - socket.emit('chat message', newMessage); // send msg - } + socket.emit('chat message', newMessage); //send msg + }; + renderMessages(msg) { - const updatedChatBox = this.state.chatBox; - console.log('line 119', msg); + var updatedChatBox= this.state.chatBox; + console.log("line 119", msg) updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); - } + }; render() { const actions = [
                -
                - (this._message = message)} - id="newMessage" - type="text" - /> - - Send - -
                +
                + this._message = message} id="newMessage" type="text"/> + Send +
                , - , + ]; return (
                - - - - - - - - - - - - - {this.props.project.description || - 'This project has no description.'} - -
                - {this.props.progress.map((item, index) => ( - - ))} -
                - - - } - modal={false} - open={this.state.open} - onRequestClose={this.handleClose} + + + + + + + + + + + + + {this.props.project.description || 'This project has no description.' } + +
                + { + this.props.progress.map((item, index) => + ( + + ) + ) + } +
                + + + } + modal={false} + open={this.state.open} + onRequestClose={this.handleClose} > Congrats on your progress! - -
                -
                - - - +
                +
                +
                + + + -
                  - {this.state.chatBox.map((chat, index) => ( -
                  - {chat.username} -

                  {chat.message}

                  -
                  - ))} -
                + title="Send a message" + actions={actions} + modal={true} + contentStyle={customContentStyle} + open={this.state.dialogOpen} + autoScrollBodyContent={true} + > +
                  hey
                + { + this.state.chatBox.map((chat, index) => { + return( +
                + {chat.username} +

                {chat.message}

                +
                + )} + ) + } +
                - ); + + ) } } + + const mapStateToProps = (state, props) => { const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; @@ -220,6 +228,9 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = dispatch => ({}); +const mapDispatchToProps = dispatch => + ({ + + }); export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index b1ee842..3f78b8f 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -18,88 +18,58 @@ class Questionnaire extends React.Component { } onLanguageSelect(val) { - this.setState({ selectedLanguage: val }, () => - console.log(this.state.selectedLanguage), - ); + this.setState({ selectedLanguage: val }, () => console.log(this.state.selectedLanguage)); } onSkillLevelSelect(val) { - this.setState({ selectedSkillLevel: val }, () => - console.log(this.state.selectedSkillLevel), - ); + this.setState({ selectedSkillLevel: val }, () => console.log(this.state.selectedSkillLevel)); } onDescriptionChange(val) { - this.setState({ description: val }, () => - console.log(this.state.description), - ); + this.setState({ description: val }, () => console.log(this.state.description)); } onButtonClick() { - const userInfo = { + let userInfo = { language: this.state.selectedLanguage, experience: this.state.selectedSkillLevel, description: this.state.description, }; - axios - .post('/API/users', userInfo) - .then(response => { + axios.post('/API/users', userInfo) + .then((response) => { // redirect to home after successful submission window.location.href = '/projects'; }) - .catch(error => { + .catch((error) => { console.log(error); }); } render() { return ( - +

                Welcome, {this.props.user.name}


                Select your preferred language to use with other GitPal members:

                - this.onLanguageSelect(val)} - > - - - - + this.onLanguageSelect(val)}> + + + +

                Select your proficieny level at the chosen language above:

                - this.onSkillLevelSelect(val)} - > - + this.onSkillLevelSelect(val)}> +
                -

                - Write a short introduction about yourself that other GitPal members - can see: -

                - this.onDescriptionChange(val)} - /> +

                Write a short introduction about yourself that other GitPal members can see:

                + this.onDescriptionChange(val)} />
                - this.onButtonClick()} - /> + this.onButtonClick()} />
                ); } diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index aa87b60..41a4d08 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -18,7 +18,6 @@ import TextField from 'material-ui/TextField'; /* for Dialog */ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; - const customContentStyle = { width: '80%', height: '100%', @@ -27,7 +26,6 @@ const customContentStyle = { /* for Dialog */ import io from 'socket.io-client'; - const socket = io(); class UserDetails extends React.Component { @@ -41,20 +39,19 @@ class UserDetails extends React.Component { message: 'placeholder', chatBox: [], myMessage: 'myMessage', - receivedMessage: 'receivedMessage', - // for popUp window + receivedMessage:'receivedMessage', + //for popUp window open: false, isPaired: false, curProjectId: null, curProjectProperty: null, - projectList: [], - }; + } this.expandCard = () => { this.setState({ expanded: true }); - }; + } - socket.on('chat message', msg => this.renderMessages(msg)); - // receive messages + socket.on('chat message', (msg) => this.renderMessages(msg)); + //receive messages this.addPair = this.addPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); @@ -67,11 +64,10 @@ class UserDetails extends React.Component { this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { - axios - .post('/API/messages', { - text: this.state.message, - recipient: this.props.user.id, - }) + axios.post('/API/messages', { + text: this.state.message, + recipient: this.props.user.id, + }) .then(() => { this.props.dispatchMessage(this.props.user.id, { text: this.state.message, @@ -85,209 +81,171 @@ class UserDetails extends React.Component { return new Promise((resolve, reject) => { this.retrieveProjectId(); resolve(); - }).then(() => { + }) + .then(() => { this.checkIfPaired(); - }); - } - - handlePorjectMapping() { - // var projectList = []; - // var idList = this.props.projectsIDs; - const projects = this.props.projects; - - // idList.forEach(function(element){ - // projects.forEach(function(cur){ - // if(cur.id === element) { - // projectList.push(cur) - // } - // }) - // }) - // userId: this.props.loggedInUserGhId, - console.log('line545454', projectList); - this.setState({ projectList }); - return projectList; + }) } checkIfPaired() { - axios - .get('/API/pairedProjects', { - params: { - userId: this.props.userId, - partnerId: this.props.user.ghId, - }, - }) - .then(pairProjects => { - if (pairProjects.data.length > 0) { - this.setState({ - buttonClicked: true, - }); - } - }) - .catch(error => { - console.log(error); - }); + axios.get('/API/pairedProjects', { + params: { + userId: this.props.loggedInUserGhId, + partnerId: this.props.user.ghId + } + }) + .then((pairProjects) => { + if (pairProjects.data.length > 0) { + this.setState({ + buttonClicked: true + }) + } + }) + .catch((error) => { + console.log(error); + }) } + addPair() { - axios - .post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then(response => { + axios.post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then((response) => { this.props.createPairing(response.data); - this.setState({ buttonClicked: !this.state.buttonClicked }); - window.location.reload(); // REACT needs this after a POST + this.setState({buttonClicked: !this.state.buttonClicked}); + window.location.reload(); //REACT needs this after a POST }) - .catch(error => { + .catch((error) => { console.log(error); }); - axios.get('/'); + axios.get('/') } togglePair() { - axios - .post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then(response => { - // this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); + axios.post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then((response) => { + //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); console.log(response); }) - .catch(error => { + .catch((error) => { console.log(error); }); } - /* dialog handler */ + /* dialog handler*/ handleOpen() { - // console.log("clicked") - this.setState({ open: true }); - } + //console.log("clicked") + this.setState({open: true}); + }; handleClose() { - this.setState({ open: false }); - } - /* dialog handler end */ + this.setState({open: false}); + }; + /* dialog handler end*/ pairButton() { if (this.state.buttonClicked) { console.log('these are the props for UserDetails', this); - return ( -
                - } - onClick={this.addPair} - /> - } - href="/my-projects" - primary - /> -
                - ); + return
                + } + onClick={ this.addPair } /> + } + href="/my-projects" + primary={ true } /> +
                } else if (!this.state.buttonClicked) { - return ( - } - onClick={this.addPair} - primary - /> - ); + return } + onClick={ this.addPair } + primary={ true } /> } - } + }; handleSubmit(event) { event.preventDefault(); // socket.emit('chat message', ); - const newMessage = { + var newMessage = { message: this._message.value, - username: this.props.loggedInUser, - }; + username: this.props.loggedInUser + } - const myMessage = { - username: 'me: ', - message: this._message.value, - }; + var myMessage = { + username: "me: ", + message: this._message.value + } - const updatedChatBox = this.state.chatBox; - updatedChatBox.push(myMessage); + var updatedChatBox = this.state.chatBox + updatedChatBox.push(myMessage) this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); - socket.emit('chat message', newMessage); // send msg + socket.emit('chat message', newMessage); //send msg console.log(newMessage); - } + }; getMessages() { - axios - .get('API/messages') - .then(res => { - this.props.loadMessages(res.data); + axios.get('API/messages') + .then((res) => { + this.props.loadMessages(res.data) }) .catch(console.error); } + renderMessages(msg) { - const updatedChatBox = this.state.chatBox; + var updatedChatBox= this.state.chatBox; updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); - } + }; retrieveProjectId() { const userId = this.props.user.ghId; - axios - .get('/API/project', { - params: { - id: userId, - }, - }) - .then(project => { + axios.get('/API/project', { + params: { + id: userId + } + }) + .then((project) => { this.state.curProjectId = project.data.id; this.state.curProjectProperty = project.data; }) .catch(console.error); - } + }; render() { - const actions = [ + const actions = [
                -
                - (this._message = message)} - id="newMessage" - type="text" - /> - - Send - -
                +
                + this._message = message} id="newMessage" type="text"/> + Send +
                , - , + ]; return ( - - + + @@ -295,84 +253,62 @@ class UserDetails extends React.Component {
                - +
                - - - - project).join(' ')} - /> + + + + project.project).join(' ')}/>
                - {this.pairButton()} - } - onClick={this.expandCard} - secondary - /> + { this.pairButton() } + } onClick={this.expandCard} secondary={true} />
                - {/* dialog for message */} + {/*dialog for message*/}
                - -
                  - {this.state.chatBox.map((chat, index) => ( -
                  - {chat.username} -

                  {chat.message}

                  -
                  - ))} -
                -
                - {/* dialog for message end */} + +
                  + {this.state.chatBox.map((chat, index) => { + return( +
                  + {chat.username} +

                  {chat.message}

                  + +
                  + )} + )} +
                  +
                  + {/*dialog for message end*/} {/* should be deleted */} -
                  +
                  -
                  - } - secondary - /> - {this.props.messages.map((message, index) => ( - - - {message.sender ? 'You' : this.props.user.name} - - {message.text} +
                  + } secondary={true}/> + { this.props.messages.map((message, index) => + + { message.sender ? 'You' : this.props.user.name } + { message.text } - ))} + )}
                  - {/* should be deleted end */} + {/* should be deleted end*/} + +
                  ); @@ -381,44 +317,36 @@ class UserDetails extends React.Component { const mapStateToProps = (state, props) => { const userId = Number(props.match.params.id); const user = state.allUsers.filter(user => user.id === userId)[0]; - const projects = state.projects.filter( - project => user.projects.indexOf(project.id) > -1, - ); + const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; - // const loggedInUser = state.loggedInUser.username; - // const projectsIDs = state.loggedInUser.projects return { user, projects, messages: state.messages[userId] || [], loggedInUser, loggedInUserGhId, - // projectsIDs, }; }; -const mapDispatchToProps = dispatch => ({ - loadMessages: messages => - dispatch({ +const mapDispatchToProps = dispatch => + ({ + loadMessages: messages => dispatch({ type: 'MESSAGES_LOAD', messages, }), - createPairing: pairs => - dispatch({ + createPairing: (pairs) => dispatch({ type: 'ADD_PAIRING', pairs, }), - dispatchPairing: (userId, projectId) => - dispatch({ + dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId, }), - dispatchMessage: (userId, message) => - dispatch({ + dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, message, }), -}); + }); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); diff --git a/client/components/UserList.jsx b/client/components/UserList.jsx index 154a8aa..9f2c391 100644 --- a/client/components/UserList.jsx +++ b/client/components/UserList.jsx @@ -12,29 +12,30 @@ import { TableHeader, TableHeaderColumn, TableRow, - TableRowColumn, + TableRowColumn } from 'material-ui/Table'; -const UserList = props => ( - - Users interested in this project - {props.users.map((user, index) => ( - { + return ( + + Users interested in this project + { props.users.map((user, index) => { + return ( + } + leftAvatar={ + + } + key={ index } + primaryText={ user.name } + secondaryText={ "Rating: " + user.rating } /> - } - leftAvatar={} - key={index} - primaryText={user.name} - secondaryText={`Rating: ${user.rating}`} - /> - ))} - -); + ); + }, + )} + + ); +}; export default UserList; diff --git a/client/components/UserProfile.jsx b/client/components/UserProfile.jsx index 893ca4e..b749ee8 100644 --- a/client/components/UserProfile.jsx +++ b/client/components/UserProfile.jsx @@ -8,14 +8,7 @@ import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; function UserProfile(props) { return ( - + @@ -23,28 +16,22 @@ function UserProfile(props) {
                  - +
                  - + - - project.project).join(' ')} - /> + + project.project).join(' ')} />
                  ); } -const mapStateToProps = (state, props) => ({ - projects: state.projects.filter( - project => props.user.projects.indexOf(project.id) > -1, - ), -}); +const mapStateToProps = (state, props) => ( + { + projects: state.projects.filter(project => props.user.projects.indexOf(project.id) > -1) + } +); export default connect(mapStateToProps)(UserProfile); diff --git a/client/store/reducers.js b/client/store/reducers.js index 159ca9b..33a1c62 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -1,4 +1,3 @@ -/* eslint no-console:0 */ /* Reducers - decides how the change a state after receiving an action, and thus can be considered the entrance of a state change. A reducer is comprised of functions and it changes states by taking an action as argument, in which it then returns a new state. The actions get sent to App component and other parent component where they can be pass through as props. @@ -6,8 +5,7 @@ import { combineReducers } from 'redux'; // does nothing - implemented to test connecting Redux to React -const changeString = (state = 'some message', action) => - action.type === 'CHANGE_STRING' ? action.text : state; +const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' ? action.text : state; /* first condition is the initial state @@ -15,9 +13,9 @@ const changeString = (state = 'some message', action) => inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ -// Returns all users in the database +//Returns all users in the database const allUsers = (state, action) => { - if (state === undefined) { + if(state === undefined) { return []; } else if (action.type === 'LOAD_ALL_USERS') { return action.allUsers; @@ -28,6 +26,7 @@ const allUsers = (state, action) => { return state; }; + const users = (state, action) => { console.log('Reducer action', action); if (state === undefined) { @@ -36,15 +35,15 @@ const users = (state, action) => { console.log('ADDING USERS', action); return action.users; } else if (action.type === 'CHANGE_USER_PAIRING') { - console.log('this is state before CHANGE_USER_PAIRING ', state); - return state.map(user => { + console.log('this is state before CHANGE_USER_PAIRING ', state) + return state.map((user) => { if (user.id === action.userId) { const object = Object.assign({}, user, { - paired: user.paired.concat(action.projectId), + paired: user.paired.concat(action.projectId) }); return object; } - console.log('this is the user from reducers ', user); + console.log('this is the user from reducers ', user) return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { @@ -61,7 +60,9 @@ const pairedUsers = (state, action) => { return action.pairedUsers; } else if (action.type === 'ADD_PAIRING') { if (state.length !== 0) { - const idCollection = state[0].map(user => user.ghId); + const idCollection = state[0].map((user) => { + return user.ghId; + }); if (idCollection.indexOf(action.pairs.ghId) === -1) { state[0].push(action.pairs); } @@ -80,10 +81,10 @@ const pairingStatus = (state, action) => { if (state === undefined) { return null; } else if (action.type === 'ADD_PAIRING_STATUS') { - return action.isPaired; + return action.isPaired } return state; -}; +} /* first condition is the initial state @@ -97,17 +98,17 @@ const projects = (state, action) => { } else if (action.type === 'LIST_PROJECTS') { return action.projects; } else if (action.type === 'CHANGE_PROJECT_INTEREST') { - return state.map(project => { + return state.map((project) => { if (project.id === action.projectId) { return Object.assign({}, project, { interested: action.value }); } return project; }); } else if (action.type === 'CHANGE_USER_PAIRING') { - return state.map(project => { + return state.map((project) => { if (project.id === action.projectId) { return Object.assign({}, project, { - paired: project.paired.concat(action.userId), + paired: project.paired.concat(action.userId) }); } return project; @@ -157,13 +158,8 @@ const projectProgress = (state, action) => { const stateProject = state[action.projectId]; newProgress[action.projectId] = stateProject.slice(); const updatedProject = newProgress[action.projectId]; - updatedProject[action.itemIndex] = Object.assign( - {}, - stateProject[action.itemIndex], - ); - updatedProject[action.itemIndex].complete = !updatedProject[ - action.itemIndex - ].complete; + updatedProject[action.itemIndex] = Object.assign({}, stateProject[action.itemIndex]); + updatedProject[action.itemIndex].complete = !updatedProject[action.itemIndex].complete; return newProgress; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project progress load', action.payload.projectProgress); @@ -176,14 +172,7 @@ const loggedInUser = (state, action) => { if (state === undefined) { return {}; } else if (action.type === 'UPDATED_LOGGEDIN_USER') { - console.log('reducersline175 loggedInUser', action.loggedInUser); return action.loggedInUser; - } else if (action.type === 'ADD_CUR_PAIR_STATUS') { - console.log('yoyoyoyoyoyoyoyoyoy', action.pair); - state = Object.assign({}, state, { - paired: state.paired.concat(action.pair), - }); - return state; } return state; }; @@ -214,6 +203,6 @@ const rootReducer = (state, action) => { state = undefined; } return appReducer(state, action); -}; +} -export default rootReducer; +export default rootReducer diff --git a/package-lock.json b/package-lock.json index af921e0..9313b84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "acorn": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha1-U/4WERH5EquZnuiHqQoLxSgi/XU=" + "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==" }, "acorn-dynamic-import": { "version": "2.0.2", @@ -66,12 +66,6 @@ "json-stable-stringify": "1.0.1" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "dev": true - }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -83,9 +77,9 @@ } }, "ansi-escapes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", - "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", + "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", "dev": true }, "ansi-html": { @@ -107,7 +101,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" @@ -125,7 +119,7 @@ "aria-query": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.0.tgz", - "integrity": "sha1-SvEKHmFXPd6gzzuZtRxSwFtCTSQ=", + "integrity": "sha512-/r2lHl09V3o74+2MLKEdewoj37YZqiQZnfen1O4iNlrOjUgeKuu1U2yF3iKh6HJxqF+OXkLMfQv65Z/cvxD6vA==", "dev": true, "requires": { "ast-types-flow": "0.0.7" @@ -142,7 +136,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, "array-find-index": { "version": "1.0.2", @@ -229,7 +223,7 @@ "async": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha1-hDGQ/WtzV6C54clW7d3V7IRitU0=", + "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", "requires": { "lodash": "4.17.4" } @@ -911,7 +905,7 @@ "base64-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha1-qRlH2h9KUW6jjltOwOw3c2deCIY=" + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" }, "base64id": { "version": "1.0.0", @@ -950,7 +944,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=" + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "body-parser": { "version": "1.17.2", @@ -1218,12 +1212,6 @@ "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -1243,7 +1231,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -1265,9 +1253,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", "dev": true }, "cliui": { @@ -1298,9 +1286,9 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", "dev": true, "requires": { "color-name": "1.1.3" @@ -1315,7 +1303,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=" + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" }, "commondir": { "version": "1.0.1", @@ -1498,7 +1486,7 @@ "crypto-browserify": { "version": "3.11.1", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", - "integrity": "sha1-lIlF78Z1ekANbl5a9HGU0QBkJ58=", + "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", "requires": { "browserify-cipher": "1.0.0", "browserify-sign": "4.0.4", @@ -1726,7 +1714,7 @@ "emoji-regex": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha1-m66pKbFVVlwR6kHGYm6qZc75ksI=", + "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", "dev": true }, "emojis-list": { @@ -1822,7 +1810,7 @@ "es-abstract": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", - "integrity": "sha1-OwA4XoVymTK+/6kWO76hI06TKRQ=", + "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -1929,33 +1917,33 @@ } }, "eslint": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.1.tgz", - "integrity": "sha512-28hOYej+NZ/R5H1yMvyKa1+bPlu+fnsIAQffK6hxXgvmXnImos2bA5XfCn5dYv2k2mrKj+/U/Z4L5ICWxC7TQw==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", + "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", "dev": true, "requires": { - "ajv": "5.5.1", + "ajv": "5.2.2", "babel-code-frame": "6.22.0", - "chalk": "2.3.0", + "chalk": "1.1.3", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", - "debug": "3.1.0", - "doctrine": "2.0.2", + "debug": "2.6.8", + "doctrine": "2.0.0", "eslint-scope": "3.7.1", - "espree": "3.5.2", + "espree": "3.5.0", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "11.0.1", - "ignore": "3.3.7", + "globals": "9.18.0", + "ignore": "3.3.3", "imurmurhash": "0.1.4", - "inquirer": "3.3.0", + "inquirer": "3.2.1", "is-resolvable": "1.0.0", - "js-yaml": "3.10.0", - "json-stable-stringify-without-jsonify": "1.0.1", + "js-yaml": "3.9.1", + "json-stable-stringify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -1963,102 +1951,19 @@ "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "7.0.0", + "pluralize": "4.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.4.1", - "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.2", + "table": "4.0.1", "text-table": "0.2.0" - }, - "dependencies": { - "ajv": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", - "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "dev": true, - "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "doctrine": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", - "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", - "dev": true, - "requires": { - "esutils": "2.0.2" - } - }, - "globals": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz", - "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } } }, "eslint-config-airbnb": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-15.1.0.tgz", - "integrity": "sha1-/UMpZakG4wE5ABuoMPWPc67dro4=", + "integrity": "sha512-m0q9fiMBzDAIbirlGnpJNWToIhdhJmXXnMG+IFflYzzod9231ZhtmGKegKg8E9T8F1YuVaDSU1FnCm5b9iXVhQ==", "dev": true, "requires": { "eslint-config-airbnb-base": "11.3.1" @@ -2075,27 +1980,10 @@ } } }, - "eslint-config-prettier": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.1.1.tgz", - "integrity": "sha1-qzkj+3BO6+yraWCQa30NboAc3lg=", - "dev": true, - "requires": { - "get-stdin": "5.0.1" - }, - "dependencies": { - "get-stdin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", - "dev": true - } - } - }, "eslint-import-resolver-node": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha1-RCJXTN5mqaewmZOO5NUIoZng48w=", + "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", "dev": true, "requires": { "debug": "2.6.8", @@ -2105,7 +1993,7 @@ "eslint-module-utils": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", - "integrity": "sha1-q67IJBd2E7ipWymWOeG2+s9HNEk=", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", "dev": true, "requires": { "debug": "2.6.8", @@ -2145,7 +2033,7 @@ "eslint-plugin-import": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha1-Id4zOAue+1X1720uIQ7A4H5/pp8=", + "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", "dev": true, "requires": { "builtin-modules": "1.1.1", @@ -2181,7 +2069,7 @@ "eslint-plugin-jsx-a11y": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz", - "integrity": "sha1-XJa7UYbKFOlNsQlf9Zs+K9lAabE=", + "integrity": "sha512-5I9SpoP7gT4wBFOtXT8/tXNPYohHBVfyVfO17vkbC7r9kEIxYJF12D3pKqhk8+xnk12rfxKClS3WCFpVckFTPQ==", "dev": true, "requires": { "aria-query": "0.7.0", @@ -2232,21 +2120,13 @@ } }, "espree": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", - "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", + "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", "dev": true, "requires": { - "acorn": "5.2.1", + "acorn": "5.1.1", "acorn-jsx": "3.0.1" - }, - "dependencies": { - "acorn": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", - "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", - "dev": true - } } }, "esprima": { @@ -2405,7 +2285,7 @@ "express-session": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", - "integrity": "sha1-9JoYInJjsxb2+FRNpf7iWlQCWew=", + "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", "requires": { "cookie": "0.3.1", "cookie-signature": "1.0.6", @@ -2419,14 +2299,14 @@ } }, "external-editor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", - "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz", + "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=", "dev": true, "requires": { - "chardet": "0.4.2", "iconv-lite": "0.4.18", - "tmp": "0.0.33" + "jschardet": "1.5.1", + "tmp": "0.0.31" } }, "extglob": { @@ -2442,12 +2322,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -2492,7 +2366,7 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.3.0", + "flat-cache": "1.2.2", "object-assign": "4.1.1" } }, @@ -2516,7 +2390,7 @@ "finalhandler": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", - "integrity": "sha1-GFdPLnxLmLiuOyMMIfIB8xvbP7c=", + "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", "requires": { "debug": "2.6.8", "encodeurl": "1.0.1", @@ -2546,9 +2420,9 @@ } }, "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", "dev": true, "requires": { "circular-json": "0.3.3", @@ -2560,7 +2434,7 @@ "follow-redirects": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", - "integrity": "sha1-NV6PTRaHa0P1d7DVziZouXIyFOo=", + "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", "requires": { "debug": "2.6.8" } @@ -2607,7 +2481,7 @@ "fsevents": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha1-MoK3E/s62A7eDp/PRhG1qm/AM/Q=", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", "optional": true, "requires": { "nan": "2.6.2", @@ -3372,6 +3246,14 @@ } } }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "requires": { + "safe-buffer": "5.0.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -3382,14 +3264,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", - "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", - "requires": { - "safe-buffer": "5.0.1" - } - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -3533,7 +3407,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -3579,7 +3453,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=" + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, "globby": { "version": "5.0.0", @@ -3659,7 +3533,7 @@ "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha1-NA3tvmKQGHFRweodd3o0SJNd+EY=", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -3704,7 +3578,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=" + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" }, "hpack.js": { "version": "2.1.6", @@ -3801,9 +3675,9 @@ "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" }, "ignore": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", - "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", + "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", "dev": true }, "imurmurhash": { @@ -3850,16 +3724,16 @@ } }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", + "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", "dev": true, "requires": { - "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "ansi-escapes": "2.0.0", + "chalk": "2.1.0", "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.1.0", + "cli-width": "2.1.0", + "external-editor": "2.0.4", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -3883,18 +3757,18 @@ "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "1.9.0" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "4.2.1" } }, "strip-ansi": { @@ -3907,9 +3781,9 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -4160,15 +4034,21 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, "js-yaml": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", + "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" } }, + "jschardet": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", + "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", + "dev": true + }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -4177,7 +4057,7 @@ "json-loader": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", - "integrity": "sha1-3KFKcCNf+C8KyaOr62DTN6NlGF0=" + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==" }, "json-schema-traverse": { "version": "0.3.1", @@ -4192,12 +4072,6 @@ "jsonify": "0.0.0" } }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", @@ -4359,7 +4233,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" @@ -4602,7 +4476,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "1.1.8" } @@ -4675,7 +4549,7 @@ "node-fetch": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.2.tgz", - "integrity": "sha1-xU6arFfkModSM1JfPIkcQVn/79c=", + "integrity": "sha512-xZZUq2yDhKMIn/UgG5q//IZSNLJIwW2QxS14CNH5spuiXkITM2pUitjdq58yLSaU7m4M0wBNaM2Gh/ggY4YJig==", "requires": { "encoding": "0.1.12", "is-stream": "1.1.0" @@ -4727,7 +4601,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -4885,7 +4759,7 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "requires": { "execa": "0.7.0", "lcid": "1.0.0", @@ -5085,7 +4959,7 @@ "pbkdf2": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", - "integrity": "sha1-w30pVTHnhrHaPj6tyEBCasywriU=", + "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", "requires": { "create-hash": "1.1.3", "create-hmac": "1.1.6", @@ -5123,9 +4997,9 @@ } }, "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", + "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", "dev": true }, "portfinder": { @@ -5158,12 +5032,6 @@ "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" }, - "prettier": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.9.1.tgz", - "integrity": "sha512-oYpQsZk7/0o8+YJUB0LfjkTYQa79gUIF2ESeqvG23IzcgqqvmeOE4+lMG7E/UKX3q3RIj8JHSfhrXWhon1L+zA==", - "dev": true - }, "private": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", @@ -5188,7 +5056,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "requires": { "asap": "2.0.6" } @@ -5267,7 +5135,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -5304,7 +5172,7 @@ "randombytes": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha1-3ACaJGuNCaF3tLegrne8Vw9LG3k=", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", "requires": { "safe-buffer": "5.1.1" } @@ -5373,7 +5241,7 @@ "react-redux": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.6.tgz", - "integrity": "sha1-I+06T5hjWdaLUhLqqmgeYNZXSUY=", + "integrity": "sha512-8taaaGu+J7PMJQDJrk/xiWEYQmdo3mkXw6wPr3K3LxvXis3Fymiq7c13S+Tpls/AyNUAsoONkU81AP0RA6y6Vw==", "requires": { "hoist-non-react-statics": "2.2.2", "invariant": "2.2.2", @@ -5393,7 +5261,7 @@ "react-router-dom": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.1.2.tgz", - "integrity": "sha1-f4p8qGjTKsrdGcoJVDtA0m347Dc=", + "integrity": "sha512-CU6pFlpfvIj/xi36rZAbUiN0x39241q+d5bAfJJLtlEqlM62F3zgyv5aERH9zesmKqyDBBp2kd85rkq9Mo/iNQ==", "requires": { "history": "4.6.3", "loose-envify": "1.3.1", @@ -5451,7 +5319,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -5483,7 +5351,7 @@ "recompose": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.24.0.tgz", - "integrity": "sha1-Ji6T+XRDnrF+d3mCTYjM6QSSpd0=", + "integrity": "sha512-7+UVym5Mfks/ukIDfcAiasrY61YGki8uIs4CmLTGU7UV2lm2ObbhOl913WrlsZKu8x8uA/sLJUOI5hxVga0dIA==", "requires": { "change-emitter": "0.1.6", "fbjs": "0.8.14", @@ -5509,7 +5377,7 @@ "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha1-BrcxIyFZAdJdBlvjQusCa8HIU3s=", + "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", "requires": { "lodash": "4.17.4", "lodash-es": "4.17.4", @@ -5662,7 +5530,7 @@ "resolve": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha1-p1vgHFPaJdk0qY69DkxKcxL5KoY=", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -5742,7 +5610,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, "select-hose": { "version": "2.0.0", @@ -5762,7 +5630,7 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "send": { "version": "0.15.4", @@ -5874,13 +5742,10 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0" - } + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true }, "socket.io": { "version": "2.0.3", @@ -5976,7 +5841,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=" + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" }, "source-map": { "version": "0.5.6", @@ -6061,7 +5926,7 @@ "stream-http": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha1-QKBQ7I3DtTsz2ZCUFcAsC/Gr+60=", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", @@ -6070,10 +5935,18 @@ "xtend": "4.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" @@ -6094,14 +5967,6 @@ } } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", - "requires": { - "safe-buffer": "5.1.1" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -6146,59 +6011,34 @@ "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz", + "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=", "dev": true, "requires": { - "ajv": "5.5.1", - "ajv-keywords": "2.1.1", - "chalk": "2.3.0", + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", "lodash": "4.17.4", - "slice-ansi": "1.0.0", + "slice-ansi": "0.0.4", "string-width": "2.1.1" }, "dependencies": { "ajv": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", - "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, "requires": { "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "dev": true, - "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "json-stable-stringify": "1.0.1" } }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true } } }, @@ -6241,9 +6081,9 @@ } }, "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", "dev": true, "requires": { "os-tmpdir": "1.0.2" @@ -6347,7 +6187,7 @@ "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha1-Kz1cckDo/C5Y+Komnl7knAhXvTo=", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", "requires": { "random-bytes": "1.0.0" } @@ -6542,7 +6382,7 @@ "supports-color": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", "requires": { "has-flag": "2.0.0" } @@ -6835,7 +6675,7 @@ "webpack-hot-middleware": { "version": "2.18.2", "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.18.2.tgz", - "integrity": "sha1-hN7mQ/A3w9WcneFCVIQwNxqo07I=", + "integrity": "sha512-dB7uOnUWsojZIAC6Nwi5v3tuaQNd2i7p4vF5LsJRyoTOgr2fRYQdMKQxRZIZZaz0cTPBX8rvcWU1A6/n7JTITg==", "dev": true, "requires": { "ansi-html": "0.0.7", @@ -6847,7 +6687,7 @@ "webpack-sources": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz", - "integrity": "sha1-xzVkNqTRMSO+LiQmoF0drZy+Zc8=", + "integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==", "requires": { "source-list-map": "2.0.0", "source-map": "0.5.6" @@ -6876,7 +6716,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "requires": { "isexe": "2.0.0" } diff --git a/package.json b/package.json index fb41dbc..7d75e87 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "GitPal", "version": "1.0.0", - "description": - "An application to help programmers begin working on open source projects.", + "description": "An application to help programmers begin working on open source projects.", "main": "server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -17,24 +16,21 @@ "type": "git", "url": "git+https://github.com/Toucans456/GitPal.git" }, - "author": - "haque-kim-ngo-warner-medley and chen-gallegos-mitchell-schafer-zimmerman", + "author": "haque-kim-ngo-warner-medley and chen-gallegos-mitchell-schafer-zimmerman", "license": "ISC", "bugs": { "url": "https://github.com/Toucans456/GitPal/issues" }, "homepage": "https://github.com/Toucans456/GitPal#readme", "devDependencies": { - "eslint": "^4.12.1", + "eslint": "^4.4.1", "eslint-config-airbnb": "^15.1.0", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", - "eslint-config-prettier": "2.1.1", "eslint-plugin-react": "^7.2.0", "webpack-dev-middleware": "^1.12.0", "webpack-dev-server": "^2.7.1", - "webpack-hot-middleware": "^2.18.2", - "prettier": "^1.7.4" + "webpack-hot-middleware": "^2.18.2" }, "dependencies": { "axios": "^0.16.2", diff --git a/server/routes/api.js b/server/routes/api.js index 9982656..0192f36 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -73,22 +73,6 @@ module.exports = { }); }, - allusers: function getAllusers(req){ - return new Promise((resolve, reject) => { - const dbSession = dbDriver.session(); - dbSession.run( - `MATCH (users:User) RETURN users` - ) - .then((res)=>{ - resolve(res.records.map(user => - new db.models.User(user.get('users')) - )); - }) - .catch(reject) - .then(() => dbSession.close()); - }) - }, - // Returns an array of user objects interested in the given project id // NOTE: The relative xp is a relationship between users // calculated and stored for new users in the profliing module. @@ -260,7 +244,6 @@ module.exports = { ` ) .then((res) => { - console.log('line263....263',res) resolve(res); }) .catch(reject) @@ -268,14 +251,6 @@ module.exports = { }); }, -// ` -// MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} -// MATCH (project:Project) WHERE ID(project) = ${Number(req.body.projectId)} -// MATCH(user)-[r:INTERESTED_IN]->(project) -// DELETE r -// ` - - // Sets requesting user as working on the project with project ID // with the user with the given user ID pair: function addPair(req) { From d08e17f5fe2e7be5af4dbc2b0aa957602b738b5b Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Tue, 5 Dec 2017 19:13:12 -0800 Subject: [PATCH 080/105] Update celanup --- client/components/App.jsx | 1 + client/store/actions.js | 2 +- client/store/index.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index 7ba1486..95eda26 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -130,6 +130,7 @@ class App extends React.Component { If user is new and logged in using github auth, render questionnaire If user is not logged in (logged out) display landing page */ + if (this.state.loggedIn.language) { return ( diff --git a/client/store/actions.js b/client/store/actions.js index af8c37b..ff9ac9e 100644 --- a/client/store/actions.js +++ b/client/store/actions.js @@ -1,3 +1,3 @@ /* This file, you will notice, is empty. -*/ \ No newline at end of file +*/ diff --git a/client/store/index.js b/client/store/index.js index ea7bcd1..1c20f11 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -18,13 +18,13 @@ const createStoreWithMiddleware = applyMiddleware(middleware)(createStore); grabs all the reducer from store/reducers.js and creates a store with it. A store manages state. */ const store = createStoreWithMiddleware( - reducers, /* preloadedState, */ - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() + reducers /* preloadedState, */, + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), ); const load = storage.createLoader(engine); load(store) - .then((newState) => console.log('Loaded state:', newState)) + .then(newState => console.log('Loaded state:', newState)) .catch(() => console.log('Failed to load previous state')); export default store; From 249b0eff4e4bdd571251a93e83c6e7d0945c7cf9 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Tue, 5 Dec 2017 19:25:10 -0800 Subject: [PATCH 081/105] Update style and eslint rules --- .eslintignore | 3 + .eslintrc.json | 13 +- client/components/App.jsx | 146 +++++---- client/components/AppDrawer.jsx | 71 ++-- client/components/ChatBox.jsx | 1 + client/components/Landing.jsx | 23 +- client/components/MyPartners.jsx | 114 +++---- client/components/MyProjects.jsx | 81 +++-- client/components/NotFound.jsx | 1 + client/components/Project.jsx | 64 ++-- client/components/ProjectDetails.jsx | 137 ++++---- client/components/ProjectList.jsx | 84 +++-- client/components/ProjectStatus.jsx | 254 +++++++-------- client/components/Questionnaire.jsx | 67 ++-- client/components/UserDetails.jsx | 379 ++++++++++++---------- client/components/UserList.jsx | 44 +-- client/components/UserProfile.jsx | 34 +- client/store/reducers.js | 43 +-- package-lock.json | 468 ++++++++++++++++++--------- package.json | 3 +- 20 files changed, 1184 insertions(+), 846 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..18df5a1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +#folders# +public/ +node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json index cee3996..8cb1d04 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,10 @@ { - "extends": "airbnb", - "env": { - "browser": true, - "node": true - } + "extends": ["airbnb", "prettier", "prettier/react"], + "env": { + "browser": true, + "node": true + }, + "rules": { + "eslint no-console": "off" + } } diff --git a/client/components/App.jsx b/client/components/App.jsx index 95eda26..4d580bf 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ /* This is the main (parent) component for the application. @@ -34,54 +35,57 @@ import NotFound from './NotFound'; import MyProjects from './MyProjects'; import MyPartners from './MyPartners'; - class App extends React.Component { constructor(props) { super(props); this.state = { loggedIn: false, drawerOpen: false, - } + }; this.checkAuthenticated(); this.navTap = this.navTap.bind(this); } componentDidUpdate() { - if(this.state.loggedIn) { + if (this.state.loggedIn) { this.getAllUsers(); } } getAllUsers() { - axios.get('/API/allUsers') - .then((allUsers) => { + axios + .get('/API/allUsers') + .then(allUsers => { this.props.addAllUsers(allUsers.data); }) .catch(console.error); } getPairs() { - axios.get('/API/pairs') - .then((pairs) => { + axios + .get('/API/pairs') + .then(pairs => { this.props.loadPairedUsers(pairs.data); }) .catch(console.error); } - //gets list of projects + // gets list of projects getProjects() { - axios.get('/API/projects/') - .then((project) => { + axios + .get('/API/projects/') + .then(project => { this.props.addProjectsList(project.data); }) .catch(console.error); } - //gets messages + // gets messages getMessages() { - axios.get('/API/messages') - .then((res) => { - this.props.loadMessages(res.data) + axios + .get('/API/messages') + .then(res => { + this.props.loadMessages(res.data); }) .catch(console.error); } @@ -90,21 +94,20 @@ class App extends React.Component { this.setState({ drawerOpen: !this.state.drawerOpen }); } - //gets authentication + // gets authentication checkAuthenticated() { - axios.get('/auth/authenticated') - .then((res) => { - if (res.data !== false) { - this.setState({ loggedIn: res.data }); - this.getMessages(); - this.getProjects(); - this.getPairs(); - this.props.loggedInUser(res.data); - } - }); + axios.get('/auth/authenticated').then(res => { + if (res.data !== false) { + this.setState({ loggedIn: res.data }); + this.getMessages(); + this.getProjects(); + this.getPairs(); + this.props.loggedInUser(res.data); + } + }); } - //party mode + // party mode togglePartyMode() { const colors = ['blue', 'green', 'red', 'yellow', 'lilac']; if (this.state.partyMode) { @@ -112,17 +115,18 @@ class App extends React.Component { document.body.setAttribute('style', `background-color:white`); this.setState({ partyMode: false }); } else { - this.setState({partyMode: - setInterval(() => { + this.setState({ + partyMode: setInterval(() => { const randomNum = Math.floor(Math.random() * colors.length); - document.body.setAttribute('style', `background-color:${colors[randomNum]}`); + document.body.setAttribute( + 'style', + `background-color:${colors[randomNum]}`, + ); }, 200), }); } } - - render() { /* Condition: @@ -135,10 +139,27 @@ class App extends React.Component { return (
                  - }/> + + + + + + } + /> {/* opens and closes side menu */} - this.setState({ drawerOpen: open }) } closeDrawer={ () => this.setState({ drawerOpen: false}) }/> + this.setState({ drawerOpen: open })} + closeDrawer={() => this.setState({ drawerOpen: false })} + /> {/* Switch renders a route exclusively. Without it, it would route inclusively @@ -151,12 +172,20 @@ class App extends React.Component { - ()} /> + ( + + )} + /> {/* given this path render this component and pass down the loggedIn state as user props */} - () } /> + } + /> @@ -167,54 +196,55 @@ class App extends React.Component { ); } else if (this.state.loggedIn) { return ; - } else { - return ; } + return ; } } /* Allows App component to have message and project state */ -const mapStateToProps = (state) => { - return { - message: state.message, - projects: state.projects, - pairedUsers: state.pairedUsers, - }; -}; +const mapStateToProps = state => ({ + message: state.message, + projects: state.projects, + pairedUsers: state.pairedUsers, +}); /* Map our dispatch to App component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = (dispatch) => { - return { - addAllUsers: (allUsers) => dispatch({ +const mapDispatchToProps = dispatch => ({ + addAllUsers: allUsers => + dispatch({ type: 'LOAD_ALL_USERS', allUsers, }), - addProjectsList: projects => dispatch({ + addProjectsList: projects => + dispatch({ type: 'LIST_PROJECTS', projects, }), - loadMessages: messages => dispatch({ + loadMessages: messages => + dispatch({ type: 'MESSAGES_LOAD', messages, }), - loadPairedUsers: pairedUsers => dispatch({ + loadPairedUsers: pairedUsers => + dispatch({ type: 'LOAD_PAIRING', pairedUsers, }), - loggedInUser: loggedInUser => dispatch({ + loggedInUser: loggedInUser => + dispatch({ type: 'UPDATED_LOGGEDIN_USER', loggedInUser, }), - loggedOut: () => dispatch({ - type: 'USER_LOGOUT' - }) - }; -}; + loggedOut: () => + dispatch({ + type: 'USER_LOGOUT', + }), +}); -//connects the Store to App component +// connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 9018788..180581b 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link, Route } from 'react-router-dom'; @@ -5,7 +6,10 @@ import { Card, CardHeader } from 'material-ui/Card'; // menus and toolbars etc. import Drawer from 'material-ui/Drawer'; import AppBar from 'material-ui/AppBar'; -import { BottomNavigation, BottomNavigationItem } from 'material-ui/BottomNavigation'; +import { + BottomNavigation, + BottomNavigationItem, +} from 'material-ui/BottomNavigation'; // buttons import FlatButton from 'material-ui/FlatButton'; import RaisedButton from 'material-ui/RaisedButton'; @@ -24,35 +28,64 @@ Add this to AppDrawer when user functionality expands function AppDrawer(props) { return ( - - - - -
                  - - }/> + + + + +
                  + + } + /> - - + +
                  - - -
                  + + +
                  - }/> + } + />
                  - - - }/> + + + } + /> - } onClick={ props.closeDrawer }/> + + } + onClick={props.closeDrawer} + /> + - ) + ); } export default AppDrawer; diff --git a/client/components/ChatBox.jsx b/client/components/ChatBox.jsx index e69de29..a603149 100644 --- a/client/components/ChatBox.jsx +++ b/client/components/ChatBox.jsx @@ -0,0 +1 @@ +/* eslint no-console:0 */ diff --git a/client/components/Landing.jsx b/client/components/Landing.jsx index 97f825b..497cab6 100644 --- a/client/components/Landing.jsx +++ b/client/components/Landing.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link } from 'react-router-dom'; @@ -13,14 +14,26 @@ const style = { function Landing(props) { return ( - - + + - + -
                  + diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index 091b93c..ffc9a12 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; @@ -10,87 +11,76 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import {Card, CardText } from 'material-ui/Card'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardText } from 'material-ui/Card'; import Subheader from 'material-ui/Subheader'; - - class MyPartners extends React.Component { constructor(props) { super(props); this.state = { isMounted: false, userLists: [], - } + }; } - componentDidMount(){ - if(this.props.pairedUsers) { + componentDidMount() { + if (this.props.pairedUsers) { this.setState({ - userLists: this.props.pairedUsers - }) + userLists: this.props.pairedUsers, + }); } else { this.setState({ - userLists:[] - }) + userLists: [], + }); } } - -render() { - let tests = this.props.pairedUsers[0] || []; - return ( - - - - - - - - Click on a user to chat and start working! - - - - Name - Language - Experience - - - - { - tests.map(user => - ( - { user.name } - { user.language } - { user.experience } - ) - ) - } - - -
                  -
                  -
                  - ); + render() { + const tests = this.props.pairedUsers[0] || []; + return ( + + + + + + + + Click on a user to chat and start working! + + + + Name + Language + Experience + + + + {tests.map(user => ( + + + {user.name} + + {user.language} + {user.experience} + + ))} + +
                  +
                  +
                  + ); } } +const mapStateToProps = (state, props) => ({ + pairedUsers: state.pairedUsers, +}); - -const mapStateToProps = (state, props) => { - return { - pairedUsers: state.pairedUsers - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - }; -}; +const mapDispatchToProps = dispatch => ({}); export default connect(mapStateToProps, mapDispatchToProps)(MyPartners); diff --git a/client/components/MyProjects.jsx b/client/components/MyProjects.jsx index f8a64a4..72f309c 100644 --- a/client/components/MyProjects.jsx +++ b/client/components/MyProjects.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; @@ -12,51 +13,47 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import {Card, CardText } from 'material-ui/Card'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardText } from 'material-ui/Card'; -const MyProjects = (props) => { - return ( - - - - - - - - Projects you have a partner with - - - - Name - Language - Experience +const MyProjects = props => ( + + + + + + + + Projects you have a partner with +
                  + + + Name + Language + Experience + + + + {props.projects.map(project => ( + + + {project.project} + + {project.language} + {project.experience} - - - {props.projects.map(project => - ( - { project.project } - { project.language } - { project.experience } - ) - )} - -
                  + ))} + +
                  -
                  - ); -}; + +); -const mapStateToProps = (state) => { - return { - projects: state.projects.filter(project => project.paired.length > 0), - }; -}; +const mapStateToProps = state => ({ + projects: state.projects.filter(project => project.paired.length > 0), +}); -//connects the Store to MyProjects component +// connects the Store to MyProjects component export default connect(mapStateToProps)(MyProjects); diff --git a/client/components/NotFound.jsx b/client/components/NotFound.jsx index da735c1..361e8db 100644 --- a/client/components/NotFound.jsx +++ b/client/components/NotFound.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; function NotFound() { diff --git a/client/components/Project.jsx b/client/components/Project.jsx index eff9c97..217dd76 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { connect } from 'react-redux'; import axios from 'axios'; @@ -10,37 +11,44 @@ class Project extends React.Component { super(props); this.POSTprogress = this.POSTprogress.bind(this); - if (this.props.project.paired.length > 0 && this.props.progress.length < 1) { + if ( + this.props.project.paired.length > 0 && + this.props.progress.length < 1 + ) { this.GETprogress(); } } - - - //post user's progress + // post user's progress POSTprogress() { - axios.post('/API/progress', { - projectId: this.props.project.id, - progress: this.props.progress, - }) - .catch(console.error); + axios + .post('/API/progress', { + projectId: this.props.project.id, + progress: this.props.progress, + }) + .catch(console.error); } - //gets user's progress + // gets user's progress GETprogress() { - axios.get('/API/progress') - .then(res => - this.props.loadProgress(res.data) - ) + axios + .get('/API/progress') + .then(res => this.props.loadProgress(res.data)) .catch(console.error); } render() { - if (this.props.project.paired.length > 0) { - return - } else { - return - } + if (this.props.project.paired.length > 0) { + return ( + + ); + } + return ; } } @@ -60,19 +68,19 @@ const mapStateToProps = (state, props) => { Map our dispatch to Project component as props Dispatch can be found in store/reducers.js */ -const mapDispatchToProps = (dispatch, props) => { - return { - dispatchProgress: (projectId, itemIndex) => dispatch({ +const mapDispatchToProps = (dispatch, props) => ({ + dispatchProgress: (projectId, itemIndex) => + dispatch({ type: 'PROGRESS_CHANGE_ITEM', projectId, - itemIndex + itemIndex, }), - loadProgress: progress => dispatch({ + loadProgress: progress => + dispatch({ type: 'PROGRESS_LOAD_ITEMS', progress, - }) - }; -}; + }), +}); -//connects the Store to Project component +// connects the Store to Project component export default connect(mapStateToProps, mapDispatchToProps)(Project); diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 3cb6327..20dbba4 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -1,15 +1,12 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import axios from 'axios'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import Paper from 'material-ui/Paper'; -import {Card, CardText } from 'material-ui/Card'; +import { Card, CardText } from 'material-ui/Card'; import RaisedButton from 'material-ui/RaisedButton'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -17,7 +14,6 @@ import FlatButton from 'material-ui/FlatButton'; import UserList from './UserList'; class ProjectDetails extends React.Component { - constructor(props) { super(props); this.state = { @@ -35,41 +31,46 @@ class ProjectDetails extends React.Component { } getUsers() { - axios.get('/API/users', { - params: { - projectId: this.props.project.id - } - }) - .then((users) => { + axios + .get('/API/users', { + params: { + projectId: this.props.project.id, + }, + }) + .then(users => { this.props.addUsers(users.data); }) .catch(console.error); } - /* dialog handler*/ + /* dialog handler */ handleOpen() { - console.log("clicked") - this.setState({open: true}); - }; + console.log('clicked'); + this.setState({ open: true }); + } handleClose() { - this.setState({open: false}); - }; - /* dialog handler end*/ + this.setState({ open: false }); + } + /* dialog handler end */ toggleInterest() { - axios.post('/API/projects', { - projectId: this.props.project.id, - }) - .then((response) => { - this.props.dispatchInterest(this.props.project.id, this.props.project.interested); + axios + .post('/API/projects', { + projectId: this.props.project.id, }) - .catch((error) => { + .then(response => { + this.props.dispatchInterest( + this.props.project.id, + this.props.project.interested, + ); + }) + .catch(error => { console.log(error); }); } - handleInterest(){ + handleInterest() { this.props.project.interested = !this.props.project.interested; this.toggleInterest(); } @@ -84,40 +85,50 @@ class ProjectDetails extends React.Component { render() { const actions = [ - , - + , + , ]; return ( - - + + - + - - + + - { this.props.project.description || 'This project has no description.' } + {this.props.project.description || + 'This project has no description.'} - + - - + + - {this.props.project.interested? 'Choose a partner!' : 'Are you sure?' } - - + > + {this.props.project.interested + ? 'Choose a partner!' + : 'Are you sure?'} + + - ) + ); } } @@ -143,19 +160,19 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = (dispatch) => { - return { - addUsers: users => dispatch({ +const mapDispatchToProps = dispatch => ({ + addUsers: users => + dispatch({ type: 'USERS_ADD', - users: users + users, }), - dispatchInterest: (projectId, value) => dispatch({ + dispatchInterest: (projectId, value) => + dispatch({ type: 'CHANGE_PROJECT_INTEREST', projectId, value, - }) - }; -}; + }), +}); -//connects the Store to ProjectDetails component +// connects the Store to ProjectDetails component export default connect(mapStateToProps, mapDispatchToProps)(ProjectDetails); diff --git a/client/components/ProjectList.jsx b/client/components/ProjectList.jsx index f8c2162..0de14a3 100644 --- a/client/components/ProjectList.jsx +++ b/client/components/ProjectList.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; @@ -11,52 +12,47 @@ import { TableRow, TableRowColumn, } from 'material-ui/Table'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; -import {Card, CardText } from 'material-ui/Card'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; +import { Card, CardText } from 'material-ui/Card'; -const ProjectList = (props) => { - //console.log('ProjectList.jsx Props', props); - return ( - - - - - - - - - - - Name - Language - Experience +const ProjectList = props => ( + // console.log('ProjectList.jsx Props', props); + + + + + + + +
                  + + + Name + Language + Experience + + + + {props.projects.map(project => ( + + + {project.project} + + {project.language} + {project.experience} - - - {props.projects.map(project => - ( - { project.project } - { project.language } - { project.experience } - ) - )} - -
                  -
                  -
                  - ); -}; - -const mapStateToProps = (state) => { - return { - projects: state.projects, - }; -}; + ))} + + +
                  +
                  +); +const mapStateToProps = state => ({ + projects: state.projects, +}); -//connects the Store to ProjectList +// connects the Store to ProjectList export default connect(mapStateToProps)(ProjectList); diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 245f3d8..c52d47d 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -1,11 +1,8 @@ +/* eslint no-console:0 */ import React from 'react'; import { connect } from 'react-redux'; import Paper from 'material-ui/Paper'; -import { - Toolbar, - ToolbarGroup, - ToolbarTitle -} from 'material-ui/Toolbar'; +import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import { Card, CardHeader, CardText } from 'material-ui/Card'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import Checkbox from 'material-ui/Checkbox'; @@ -15,8 +12,8 @@ import Dialog from 'material-ui/Dialog'; import SocialPartyMode from 'material-ui/svg-icons/social/party-mode'; import io from 'socket.io-client'; -const socket = io(); +const socket = io(); const style = { margin: 12, @@ -28,16 +25,14 @@ const customContentStyle = { maxWidth: 'none', }; // renders a progress item component inside ProjectStatus -const ProgressItem = (props) => { +const ProgressItem = props => { const check = () => props.dispatchProgress(props.projectId, props.index); return (
                  - - { props.hint } - + {props.hint}
                  - ) + ); }; class ProjectStatus extends React.Component { @@ -48,8 +43,7 @@ class ProjectStatus extends React.Component { open: false, dialogOpen: false, chatBox: [], - - } + }; this.handleSubmit = this.handleSubmit.bind(this); this.handleClose = this.handleClose.bind(this); @@ -57,168 +51,167 @@ class ProjectStatus extends React.Component { this.handleDiaLogClose = this.handleDiaLogClose.bind(this); this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - socket.on('chat message', (msg) => this.renderMessages(msg)); + socket.on('chat message', msg => this.renderMessages(msg)); } - /* dialog handler*/ + /* dialog handler */ handleDiaLogOpen() { - console.log("clicked") - this.setState({dialogOpen: true}); - }; + console.log('clicked'); + this.setState({ dialogOpen: true }); + } handleDiaLogClose() { - console.log('clicked') - this.setState({dialogOpen: false}); - }; - /* dialog handler end*/ + console.log('clicked'); + this.setState({ dialogOpen: false }); + } + /* dialog handler end */ - //handles opening the dialog alert and submits the project's progress + // handles opening the dialog alert and submits the project's progress handleSubmit() { this.setState({ - open: true + open: true, }); - this.props.submitProgress() + this.props.submitProgress(); } - //handles the closing of dialog alert + // handles the closing of dialog alert handleClose() { this.setState({ - open: false + open: false, }); } - handleMessegeSubmit(event) { event.preventDefault(); - var newMessage = { + const newMessage = { message: this._message.value, - username: this.props.loggedInUser - } - - var myMessage = { - username: "me: ", - message: this._message.value - } + username: this.props.loggedInUser, + }; + const myMessage = { + username: 'me: ', + message: this._message.value, + }; - var updatedChatBox = this.state.chatBox + const updatedChatBox = this.state.chatBox; updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - socket.emit('chat message', newMessage); //send msg - }; - + socket.emit('chat message', newMessage); // send msg + } renderMessages(msg) { - var updatedChatBox= this.state.chatBox; - console.log("line 119", msg) + const updatedChatBox = this.state.chatBox; + console.log('line 119', msg); updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - }; + } render() { const actions = [
                  -
                  - this._message = message} id="newMessage" type="text"/> - Send -
                  +
                  + (this._message = message)} + id="newMessage" + type="text" + /> + + Send + +
                  , - + , ]; return (
                  - - - - - - - - - - - - - {this.props.project.description || 'This project has no description.' } - -
                  - { - this.props.progress.map((item, index) => - ( - - ) - ) - } -
                  - - - } - modal={false} - open={this.state.open} - onRequestClose={this.handleClose} + + + + + + + + + + + + + {this.props.project.description || + 'This project has no description.'} + +
                  + {this.props.progress.map((item, index) => ( + + ))} +
                  + + + } + modal={false} + open={this.state.open} + onRequestClose={this.handleClose} > Congrats on your progress! - -
                  -
                  - - - +
                  +
                  +
                  + + + -
                    hey
                  - { - this.state.chatBox.map((chat, index) => { - return( -
                  - {chat.username} -

                  {chat.message}

                  -
                  - )} - ) - } -
                  + title="Send a message" + actions={actions} + modal + contentStyle={customContentStyle} + open={this.state.dialogOpen} + autoScrollBodyContent + > +
                    hey
                  + {this.state.chatBox.map((chat, index) => ( +
                  + {chat.username} +

                  {chat.message}

                  +
                  + ))} +
                  - - ) + ); } } - - const mapStateToProps = (state, props) => { const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; @@ -228,9 +221,6 @@ const mapStateToProps = (state, props) => { }; }; -const mapDispatchToProps = dispatch => - ({ - - }); +const mapDispatchToProps = dispatch => ({}); export default connect(mapStateToProps, mapDispatchToProps)(ProjectStatus); diff --git a/client/components/Questionnaire.jsx b/client/components/Questionnaire.jsx index 3f78b8f..552fa50 100644 --- a/client/components/Questionnaire.jsx +++ b/client/components/Questionnaire.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import axios from 'axios'; import { Card } from 'material-ui/Card'; @@ -18,58 +19,88 @@ class Questionnaire extends React.Component { } onLanguageSelect(val) { - this.setState({ selectedLanguage: val }, () => console.log(this.state.selectedLanguage)); + this.setState({ selectedLanguage: val }, () => + console.log(this.state.selectedLanguage), + ); } onSkillLevelSelect(val) { - this.setState({ selectedSkillLevel: val }, () => console.log(this.state.selectedSkillLevel)); + this.setState({ selectedSkillLevel: val }, () => + console.log(this.state.selectedSkillLevel), + ); } onDescriptionChange(val) { - this.setState({ description: val }, () => console.log(this.state.description)); + this.setState({ description: val }, () => + console.log(this.state.description), + ); } onButtonClick() { - let userInfo = { + const userInfo = { language: this.state.selectedLanguage, experience: this.state.selectedSkillLevel, description: this.state.description, }; - axios.post('/API/users', userInfo) - .then((response) => { + axios + .post('/API/users', userInfo) + .then(response => { // redirect to home after successful submission window.location.href = '/projects'; }) - .catch((error) => { + .catch(error => { console.log(error); }); } render() { return ( - +

                  Welcome, {this.props.user.name}


                  Select your preferred language to use with other GitPal members:

                  - this.onLanguageSelect(val)}> - - - - + this.onLanguageSelect(val)} + > + + + +

                  Select your proficieny level at the chosen language above:

                  - this.onSkillLevelSelect(val)}> - + this.onSkillLevelSelect(val)} + > +
                  -

                  Write a short introduction about yourself that other GitPal members can see:

                  - this.onDescriptionChange(val)} /> +

                  + Write a short introduction about yourself that other GitPal members + can see: +

                  + this.onDescriptionChange(val)} + />
                  - this.onButtonClick()} /> + this.onButtonClick()} + />
                  ); } diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 41a4d08..82bc54a 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { connect } from 'react-redux'; import axios from 'axios'; @@ -18,6 +19,7 @@ import TextField from 'material-ui/TextField'; /* for Dialog */ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; + const customContentStyle = { width: '80%', height: '100%', @@ -26,6 +28,7 @@ const customContentStyle = { /* for Dialog */ import io from 'socket.io-client'; + const socket = io(); class UserDetails extends React.Component { @@ -39,19 +42,19 @@ class UserDetails extends React.Component { message: 'placeholder', chatBox: [], myMessage: 'myMessage', - receivedMessage:'receivedMessage', - //for popUp window + receivedMessage: 'receivedMessage', + // for popUp window open: false, isPaired: false, curProjectId: null, curProjectProperty: null, - } + }; this.expandCard = () => { this.setState({ expanded: true }); - } + }; - socket.on('chat message', (msg) => this.renderMessages(msg)); - //receive messages + socket.on('chat message', msg => this.renderMessages(msg)); + // receive messages this.addPair = this.addPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); @@ -64,10 +67,11 @@ class UserDetails extends React.Component { this.setMessageText = (_, text) => this.setState({ message: text }); this.sendMessage = () => { - axios.post('/API/messages', { - text: this.state.message, - recipient: this.props.user.id, - }) + axios + .post('/API/messages', { + text: this.state.message, + recipient: this.props.user.id, + }) .then(() => { this.props.dispatchMessage(this.props.user.id, { text: this.state.message, @@ -81,171 +85,191 @@ class UserDetails extends React.Component { return new Promise((resolve, reject) => { this.retrieveProjectId(); resolve(); - }) - .then(() => { + }).then(() => { this.checkIfPaired(); - }) + }); } checkIfPaired() { - axios.get('/API/pairedProjects', { - params: { - userId: this.props.loggedInUserGhId, - partnerId: this.props.user.ghId - } - }) - .then((pairProjects) => { - if (pairProjects.data.length > 0) { - this.setState({ - buttonClicked: true - }) - } - }) - .catch((error) => { - console.log(error); - }) + axios + .get('/API/pairedProjects', { + params: { + userId: this.props.loggedInUserGhId, + partnerId: this.props.user.ghId, + }, + }) + .then(pairProjects => { + if (pairProjects.data.length > 0) { + this.setState({ + buttonClicked: true, + }); + } + }) + .catch(error => { + console.log(error); + }); } - addPair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { + axios + .post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then(response => { this.props.createPairing(response.data); - this.setState({buttonClicked: !this.state.buttonClicked}); - window.location.reload(); //REACT needs this after a POST + this.setState({ buttonClicked: !this.state.buttonClicked }); + window.location.reload(); // REACT needs this after a POST }) - .catch((error) => { + .catch(error => { console.log(error); }); - axios.get('/') + axios.get('/'); } togglePair() { - axios.post('/API/pair', { - partnered: this.props.user.id, - project: this.state.curProjectId, - }) - .then((response) => { - //this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); + axios + .post('/API/pair', { + partnered: this.props.user.id, + project: this.state.curProjectId, + }) + .then(response => { + // this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); console.log(response); }) - .catch((error) => { + .catch(error => { console.log(error); }); } - /* dialog handler*/ + /* dialog handler */ handleOpen() { - //console.log("clicked") - this.setState({open: true}); - }; + // console.log("clicked") + this.setState({ open: true }); + } handleClose() { - this.setState({open: false}); - }; - /* dialog handler end*/ + this.setState({ open: false }); + } + /* dialog handler end */ pairButton() { if (this.state.buttonClicked) { console.log('these are the props for UserDetails', this); - return
                  - } - onClick={ this.addPair } /> - } - href="/my-projects" - primary={ true } /> -
                  + return ( +
                  + } + onClick={this.addPair} + /> + } + href="/my-projects" + primary + /> +
                  + ); } else if (!this.state.buttonClicked) { - return } - onClick={ this.addPair } - primary={ true } /> + return ( + } + onClick={this.addPair} + primary + /> + ); } - }; + } handleSubmit(event) { event.preventDefault(); // socket.emit('chat message', ); - var newMessage = { + const newMessage = { message: this._message.value, - username: this.props.loggedInUser - } + username: this.props.loggedInUser, + }; - var myMessage = { - username: "me: ", - message: this._message.value - } + const myMessage = { + username: 'me: ', + message: this._message.value, + }; - var updatedChatBox = this.state.chatBox - updatedChatBox.push(myMessage) + const updatedChatBox = this.state.chatBox; + updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - socket.emit('chat message', newMessage); //send msg + socket.emit('chat message', newMessage); // send msg console.log(newMessage); - }; + } getMessages() { - axios.get('API/messages') - .then((res) => { - this.props.loadMessages(res.data) + axios + .get('API/messages') + .then(res => { + this.props.loadMessages(res.data); }) .catch(console.error); } - renderMessages(msg) { - var updatedChatBox= this.state.chatBox; + const updatedChatBox = this.state.chatBox; updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox + chatBox: updatedChatBox, }); - }; + } retrieveProjectId() { const userId = this.props.user.ghId; - axios.get('/API/project', { - params: { - id: userId - } - }) - .then((project) => { + axios + .get('/API/project', { + params: { + id: userId, + }, + }) + .then(project => { this.state.curProjectId = project.data.id; this.state.curProjectProperty = project.data; }) .catch(console.error); - }; + } render() { - const actions = [ + const actions = [
                  -
                  - this._message = message} id="newMessage" type="text"/> - Send -
                  +
                  + (this._message = message)} + id="newMessage" + type="text" + /> + + Send + +
                  , - + , ]; return ( - - + + @@ -253,62 +277,86 @@ class UserDetails extends React.Component {
                  - +
                  - - - - project.project).join(' ')}/> + + + + project.project) + .join(' ')} + />
                  - { this.pairButton() } - } onClick={this.expandCard} secondary={true} /> + {this.pairButton()} + } + onClick={this.expandCard} + secondary + />
                  - {/*dialog for message*/} + {/* dialog for message */}
                  - -
                    - {this.state.chatBox.map((chat, index) => { - return( -
                    - {chat.username} -

                    {chat.message}

                    - -
                    - )} - )} -
                    -
                    - {/*dialog for message end*/} + +
                      + {this.state.chatBox.map((chat, index) => ( +
                      + {chat.username} +

                      {chat.message}

                      +
                      + ))} +
                    +
                    + {/* dialog for message end */} {/* should be deleted */} -
                    +
                    -
                    - } secondary={true}/> - { this.props.messages.map((message, index) => - - { message.sender ? 'You' : this.props.user.name } - { message.text } +
                    + } + secondary + /> + {this.props.messages.map((message, index) => ( + + + {message.sender ? 'You' : this.props.user.name} + + {message.text} - )} + ))}
                    - {/* should be deleted end*/} - - + {/* should be deleted end */}
                    ); @@ -317,7 +365,9 @@ class UserDetails extends React.Component { const mapStateToProps = (state, props) => { const userId = Number(props.match.params.id); const user = state.allUsers.filter(user => user.id === userId)[0]; - const projects = state.projects.filter(project => user.projects.indexOf(project.id) > -1) + const projects = state.projects.filter( + project => user.projects.indexOf(project.id) > -1, + ); const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; return { @@ -328,25 +378,28 @@ const mapStateToProps = (state, props) => { loggedInUserGhId, }; }; -const mapDispatchToProps = dispatch => - ({ - loadMessages: messages => dispatch({ +const mapDispatchToProps = dispatch => ({ + loadMessages: messages => + dispatch({ type: 'MESSAGES_LOAD', messages, }), - createPairing: (pairs) => dispatch({ + createPairing: pairs => + dispatch({ type: 'ADD_PAIRING', pairs, }), - dispatchPairing: (userId, projectId) => dispatch({ + dispatchPairing: (userId, projectId) => + dispatch({ type: 'CHANGE_USER_PAIRING', userId, projectId, }), - dispatchMessage: (userId, message) => dispatch({ + dispatchMessage: (userId, message) => + dispatch({ type: 'MESSAGE_SEND', userId, message, }), - }); +}); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); diff --git a/client/components/UserList.jsx b/client/components/UserList.jsx index 9f2c391..32aea17 100644 --- a/client/components/UserList.jsx +++ b/client/components/UserList.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ /* Not currently connected to FIND PARTNER button */ /* Used to show All Users */ import React from 'react'; @@ -12,30 +13,29 @@ import { TableHeader, TableHeaderColumn, TableRow, - TableRowColumn + TableRowColumn, } from 'material-ui/Table'; -const UserList = (props) => { - return ( - - Users interested in this project - { props.users.map((user, index) => { - return ( - } - leftAvatar={ - - } - key={ index } - primaryText={ user.name } - secondaryText={ "Rating: " + user.rating } +const UserList = props => ( + + Users interested in this project + {props.users.map((user, index) => ( + - ); - }, - )} - - ); -}; + } + leftAvatar={} + key={index} + primaryText={user.name} + secondaryText={`Rating: ${user.rating}`} + /> + ))} + +); export default UserList; diff --git a/client/components/UserProfile.jsx b/client/components/UserProfile.jsx index b749ee8..25dbfce 100644 --- a/client/components/UserProfile.jsx +++ b/client/components/UserProfile.jsx @@ -1,3 +1,4 @@ +/* eslint no-console:0 */ import React from 'react'; import { connect } from 'react-redux'; @@ -8,7 +9,14 @@ import { Card, CardMedia, CardText, CardTitle } from 'material-ui/Card'; function UserProfile(props) { return ( - + @@ -16,22 +24,28 @@ function UserProfile(props) {
                    - +
                    - + - - project.project).join(' ')} /> + + project.project).join(' ')} + />
                    ); } -const mapStateToProps = (state, props) => ( - { - projects: state.projects.filter(project => props.user.projects.indexOf(project.id) > -1) - } -); +const mapStateToProps = (state, props) => ({ + projects: state.projects.filter( + project => props.user.projects.indexOf(project.id) > -1, + ), +}); export default connect(mapStateToProps)(UserProfile); diff --git a/client/store/reducers.js b/client/store/reducers.js index 33a1c62..a9dd89b 100644 --- a/client/store/reducers.js +++ b/client/store/reducers.js @@ -5,7 +5,8 @@ import { combineReducers } from 'redux'; // does nothing - implemented to test connecting Redux to React -const changeString = (state = 'some message', action) => action.type === 'CHANGE_STRING' ? action.text : state; +const changeString = (state = 'some message', action) => + action.type === 'CHANGE_STRING' ? action.text : state; /* first condition is the initial state @@ -13,9 +14,9 @@ const changeString = (state = 'some message', action) => action.type === 'CHANGE inside UserDetails component, we dispatch 'dispatchPairing' when user select a partner to pair with */ -//Returns all users in the database +// Returns all users in the database const allUsers = (state, action) => { - if(state === undefined) { + if (state === undefined) { return []; } else if (action.type === 'LOAD_ALL_USERS') { return action.allUsers; @@ -26,7 +27,6 @@ const allUsers = (state, action) => { return state; }; - const users = (state, action) => { console.log('Reducer action', action); if (state === undefined) { @@ -35,15 +35,15 @@ const users = (state, action) => { console.log('ADDING USERS', action); return action.users; } else if (action.type === 'CHANGE_USER_PAIRING') { - console.log('this is state before CHANGE_USER_PAIRING ', state) - return state.map((user) => { + console.log('this is state before CHANGE_USER_PAIRING ', state); + return state.map(user => { if (user.id === action.userId) { const object = Object.assign({}, user, { - paired: user.paired.concat(action.projectId) + paired: user.paired.concat(action.projectId), }); return object; } - console.log('this is the user from reducers ', user) + console.log('this is the user from reducers ', user); return user; }); } else if (action.type === 'REDUX_STORAGE_LOAD') { @@ -60,9 +60,7 @@ const pairedUsers = (state, action) => { return action.pairedUsers; } else if (action.type === 'ADD_PAIRING') { if (state.length !== 0) { - const idCollection = state[0].map((user) => { - return user.ghId; - }); + const idCollection = state[0].map(user => user.ghId); if (idCollection.indexOf(action.pairs.ghId) === -1) { state[0].push(action.pairs); } @@ -81,10 +79,10 @@ const pairingStatus = (state, action) => { if (state === undefined) { return null; } else if (action.type === 'ADD_PAIRING_STATUS') { - return action.isPaired + return action.isPaired; } return state; -} +}; /* first condition is the initial state @@ -98,17 +96,17 @@ const projects = (state, action) => { } else if (action.type === 'LIST_PROJECTS') { return action.projects; } else if (action.type === 'CHANGE_PROJECT_INTEREST') { - return state.map((project) => { + return state.map(project => { if (project.id === action.projectId) { return Object.assign({}, project, { interested: action.value }); } return project; }); } else if (action.type === 'CHANGE_USER_PAIRING') { - return state.map((project) => { + return state.map(project => { if (project.id === action.projectId) { return Object.assign({}, project, { - paired: project.paired.concat(action.userId) + paired: project.paired.concat(action.userId), }); } return project; @@ -158,8 +156,13 @@ const projectProgress = (state, action) => { const stateProject = state[action.projectId]; newProgress[action.projectId] = stateProject.slice(); const updatedProject = newProgress[action.projectId]; - updatedProject[action.itemIndex] = Object.assign({}, stateProject[action.itemIndex]); - updatedProject[action.itemIndex].complete = !updatedProject[action.itemIndex].complete; + updatedProject[action.itemIndex] = Object.assign( + {}, + stateProject[action.itemIndex], + ); + updatedProject[action.itemIndex].complete = !updatedProject[ + action.itemIndex + ].complete; return newProgress; } else if (action.type === 'REDUX_STORAGE_LOAD') { console.log('Project progress load', action.payload.projectProgress); @@ -203,6 +206,6 @@ const rootReducer = (state, action) => { state = undefined; } return appReducer(state, action); -} +}; -export default rootReducer +export default rootReducer; diff --git a/package-lock.json b/package-lock.json index 9313b84..1a5d22b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "acorn": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==" + "integrity": "sha1-U/4WERH5EquZnuiHqQoLxSgi/XU=" }, "acorn-dynamic-import": { "version": "2.0.2", @@ -66,6 +66,12 @@ "json-stable-stringify": "1.0.1" } }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -77,9 +83,9 @@ } }, "ansi-escapes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", - "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", "dev": true }, "ansi-html": { @@ -101,7 +107,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" @@ -119,7 +125,7 @@ "aria-query": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.0.tgz", - "integrity": "sha512-/r2lHl09V3o74+2MLKEdewoj37YZqiQZnfen1O4iNlrOjUgeKuu1U2yF3iKh6HJxqF+OXkLMfQv65Z/cvxD6vA==", + "integrity": "sha1-SvEKHmFXPd6gzzuZtRxSwFtCTSQ=", "dev": true, "requires": { "ast-types-flow": "0.0.7" @@ -136,7 +142,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" }, "array-find-index": { "version": "1.0.2", @@ -223,7 +229,7 @@ "async": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", + "integrity": "sha1-hDGQ/WtzV6C54clW7d3V7IRitU0=", "requires": { "lodash": "4.17.4" } @@ -905,7 +911,7 @@ "base64-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" + "integrity": "sha1-qRlH2h9KUW6jjltOwOw3c2deCIY=" }, "base64id": { "version": "1.0.0", @@ -944,7 +950,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=" }, "body-parser": { "version": "1.17.2", @@ -1212,6 +1218,12 @@ "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -1231,7 +1243,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -1253,9 +1265,9 @@ } }, "cli-width": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "cliui": { @@ -1286,9 +1298,9 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "color-convert": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", - "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { "color-name": "1.1.3" @@ -1303,7 +1315,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=" }, "commondir": { "version": "1.0.1", @@ -1486,7 +1498,7 @@ "crypto-browserify": { "version": "3.11.1", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", - "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "integrity": "sha1-lIlF78Z1ekANbl5a9HGU0QBkJ58=", "requires": { "browserify-cipher": "1.0.0", "browserify-sign": "4.0.4", @@ -1714,7 +1726,7 @@ "emoji-regex": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "integrity": "sha1-m66pKbFVVlwR6kHGYm6qZc75ksI=", "dev": true }, "emojis-list": { @@ -1810,7 +1822,7 @@ "es-abstract": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", - "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", + "integrity": "sha1-OwA4XoVymTK+/6kWO76hI06TKRQ=", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -1917,33 +1929,33 @@ } }, "eslint": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", - "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.1.tgz", + "integrity": "sha512-28hOYej+NZ/R5H1yMvyKa1+bPlu+fnsIAQffK6hxXgvmXnImos2bA5XfCn5dYv2k2mrKj+/U/Z4L5ICWxC7TQw==", "dev": true, "requires": { - "ajv": "5.2.2", + "ajv": "5.5.1", "babel-code-frame": "6.22.0", - "chalk": "1.1.3", + "chalk": "2.3.0", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", - "debug": "2.6.8", - "doctrine": "2.0.0", + "debug": "3.1.0", + "doctrine": "2.0.2", "eslint-scope": "3.7.1", - "espree": "3.5.0", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.3", + "globals": "11.0.1", + "ignore": "3.3.7", "imurmurhash": "0.1.4", - "inquirer": "3.2.1", + "inquirer": "3.3.0", "is-resolvable": "1.0.0", - "js-yaml": "3.9.1", - "json-stable-stringify": "1.0.1", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -1951,19 +1963,102 @@ "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "4.0.0", + "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.4.1", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.1", + "table": "4.0.2", "text-table": "0.2.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "globals": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz", + "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } } }, "eslint-config-airbnb": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-15.1.0.tgz", - "integrity": "sha512-m0q9fiMBzDAIbirlGnpJNWToIhdhJmXXnMG+IFflYzzod9231ZhtmGKegKg8E9T8F1YuVaDSU1FnCm5b9iXVhQ==", + "integrity": "sha1-/UMpZakG4wE5ABuoMPWPc67dro4=", "dev": true, "requires": { "eslint-config-airbnb-base": "11.3.1" @@ -1980,10 +2075,27 @@ } } }, + "eslint-config-prettier": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.1.1.tgz", + "integrity": "sha1-qzkj+3BO6+yraWCQa30NboAc3lg=", + "dev": true, + "requires": { + "get-stdin": "5.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + } + } + }, "eslint-import-resolver-node": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "integrity": "sha1-RCJXTN5mqaewmZOO5NUIoZng48w=", "dev": true, "requires": { "debug": "2.6.8", @@ -1993,7 +2105,7 @@ "eslint-module-utils": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", - "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "integrity": "sha1-q67IJBd2E7ipWymWOeG2+s9HNEk=", "dev": true, "requires": { "debug": "2.6.8", @@ -2033,7 +2145,7 @@ "eslint-plugin-import": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "integrity": "sha1-Id4zOAue+1X1720uIQ7A4H5/pp8=", "dev": true, "requires": { "builtin-modules": "1.1.1", @@ -2069,7 +2181,7 @@ "eslint-plugin-jsx-a11y": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz", - "integrity": "sha512-5I9SpoP7gT4wBFOtXT8/tXNPYohHBVfyVfO17vkbC7r9kEIxYJF12D3pKqhk8+xnk12rfxKClS3WCFpVckFTPQ==", + "integrity": "sha1-XJa7UYbKFOlNsQlf9Zs+K9lAabE=", "dev": true, "requires": { "aria-query": "0.7.0", @@ -2120,13 +2232,21 @@ } }, "espree": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", - "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { - "acorn": "5.1.1", + "acorn": "5.2.1", "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "dev": true + } } }, "esprima": { @@ -2285,7 +2405,7 @@ "express-session": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", - "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", + "integrity": "sha1-9JoYInJjsxb2+FRNpf7iWlQCWew=", "requires": { "cookie": "0.3.1", "cookie-signature": "1.0.6", @@ -2299,14 +2419,14 @@ } }, "external-editor": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz", - "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { + "chardet": "0.4.2", "iconv-lite": "0.4.18", - "jschardet": "1.5.1", - "tmp": "0.0.31" + "tmp": "0.0.33" } }, "extglob": { @@ -2322,6 +2442,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -2366,7 +2492,7 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.2.2", + "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, @@ -2390,7 +2516,7 @@ "finalhandler": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", - "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", + "integrity": "sha1-GFdPLnxLmLiuOyMMIfIB8xvbP7c=", "requires": { "debug": "2.6.8", "encodeurl": "1.0.1", @@ -2420,9 +2546,9 @@ } }, "flat-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", @@ -2434,7 +2560,7 @@ "follow-redirects": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", - "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", + "integrity": "sha1-NV6PTRaHa0P1d7DVziZouXIyFOo=", "requires": { "debug": "2.6.8" } @@ -2481,7 +2607,7 @@ "fsevents": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "integrity": "sha1-MoK3E/s62A7eDp/PRhG1qm/AM/Q=", "optional": true, "requires": { "nan": "2.6.2", @@ -3246,14 +3372,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", - "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -3264,6 +3382,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -3407,7 +3533,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -3453,7 +3579,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=" }, "globby": { "version": "5.0.0", @@ -3533,7 +3659,7 @@ "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "integrity": "sha1-NA3tvmKQGHFRweodd3o0SJNd+EY=", "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -3578,7 +3704,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=" }, "hpack.js": { "version": "2.1.6", @@ -3675,9 +3801,9 @@ "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" }, "ignore": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", - "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "imurmurhash": { @@ -3724,16 +3850,16 @@ } }, "inquirer": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", - "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "2.0.0", - "chalk": "2.1.0", + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", "cli-cursor": "2.1.0", - "cli-width": "2.1.0", - "external-editor": "2.0.4", + "cli-width": "2.2.0", + "external-editor": "2.1.0", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -3757,18 +3883,18 @@ "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.5.0" } }, "strip-ansi": { @@ -3781,9 +3907,9 @@ } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -4034,21 +4160,15 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, "js-yaml": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", - "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" } }, - "jschardet": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", - "dev": true - }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -4057,7 +4177,7 @@ "json-loader": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", - "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==" + "integrity": "sha1-3KFKcCNf+C8KyaOr62DTN6NlGF0=" }, "json-schema-traverse": { "version": "0.3.1", @@ -4072,6 +4192,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", @@ -4233,7 +4359,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" @@ -4476,7 +4602,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -4549,7 +4675,7 @@ "node-fetch": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.2.tgz", - "integrity": "sha512-xZZUq2yDhKMIn/UgG5q//IZSNLJIwW2QxS14CNH5spuiXkITM2pUitjdq58yLSaU7m4M0wBNaM2Gh/ggY4YJig==", + "integrity": "sha1-xU6arFfkModSM1JfPIkcQVn/79c=", "requires": { "encoding": "0.1.12", "is-stream": "1.1.0" @@ -4601,7 +4727,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -4759,7 +4885,7 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", "requires": { "execa": "0.7.0", "lcid": "1.0.0", @@ -4959,7 +5085,7 @@ "pbkdf2": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", - "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", + "integrity": "sha1-w30pVTHnhrHaPj6tyEBCasywriU=", "requires": { "create-hash": "1.1.3", "create-hmac": "1.1.6", @@ -4997,9 +5123,9 @@ } }, "pluralize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", - "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "portfinder": { @@ -5056,7 +5182,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", "requires": { "asap": "2.0.6" } @@ -5135,7 +5261,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -5172,7 +5298,7 @@ "randombytes": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "integrity": "sha1-3ACaJGuNCaF3tLegrne8Vw9LG3k=", "requires": { "safe-buffer": "5.1.1" } @@ -5241,7 +5367,7 @@ "react-redux": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.6.tgz", - "integrity": "sha512-8taaaGu+J7PMJQDJrk/xiWEYQmdo3mkXw6wPr3K3LxvXis3Fymiq7c13S+Tpls/AyNUAsoONkU81AP0RA6y6Vw==", + "integrity": "sha1-I+06T5hjWdaLUhLqqmgeYNZXSUY=", "requires": { "hoist-non-react-statics": "2.2.2", "invariant": "2.2.2", @@ -5261,7 +5387,7 @@ "react-router-dom": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.1.2.tgz", - "integrity": "sha512-CU6pFlpfvIj/xi36rZAbUiN0x39241q+d5bAfJJLtlEqlM62F3zgyv5aERH9zesmKqyDBBp2kd85rkq9Mo/iNQ==", + "integrity": "sha1-f4p8qGjTKsrdGcoJVDtA0m347Dc=", "requires": { "history": "4.6.3", "loose-envify": "1.3.1", @@ -5319,7 +5445,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -5351,7 +5477,7 @@ "recompose": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.24.0.tgz", - "integrity": "sha512-7+UVym5Mfks/ukIDfcAiasrY61YGki8uIs4CmLTGU7UV2lm2ObbhOl913WrlsZKu8x8uA/sLJUOI5hxVga0dIA==", + "integrity": "sha1-Ji6T+XRDnrF+d3mCTYjM6QSSpd0=", "requires": { "change-emitter": "0.1.6", "fbjs": "0.8.14", @@ -5377,7 +5503,7 @@ "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "integrity": "sha1-BrcxIyFZAdJdBlvjQusCa8HIU3s=", "requires": { "lodash": "4.17.4", "lodash-es": "4.17.4", @@ -5530,7 +5656,7 @@ "resolve": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "integrity": "sha1-p1vgHFPaJdk0qY69DkxKcxL5KoY=", "dev": true, "requires": { "path-parse": "1.0.5" @@ -5610,7 +5736,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, "select-hose": { "version": "2.0.0", @@ -5630,7 +5756,7 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" }, "send": { "version": "0.15.4", @@ -5742,10 +5868,13 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } }, "socket.io": { "version": "2.0.3", @@ -5841,7 +5970,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" + "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=" }, "source-map": { "version": "0.5.6", @@ -5926,7 +6055,7 @@ "stream-http": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "integrity": "sha1-QKBQ7I3DtTsz2ZCUFcAsC/Gr+60=", "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", @@ -5935,18 +6064,10 @@ "xtend": "4.0.1" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" @@ -5967,6 +6088,14 @@ } } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "requires": { + "safe-buffer": "5.1.1" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -6011,34 +6140,59 @@ "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" }, "table": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz", - "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", + "ajv": "5.5.1", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", "lodash": "4.17.4", - "slice-ansi": "0.0.4", + "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", "dev": true, "requires": { "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, - "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", - "dev": true + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, @@ -6081,9 +6235,9 @@ } }, "tmp": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "1.0.2" @@ -6187,7 +6341,7 @@ "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "integrity": "sha1-Kz1cckDo/C5Y+Komnl7knAhXvTo=", "requires": { "random-bytes": "1.0.0" } @@ -6382,7 +6536,7 @@ "supports-color": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=", "requires": { "has-flag": "2.0.0" } @@ -6675,7 +6829,7 @@ "webpack-hot-middleware": { "version": "2.18.2", "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.18.2.tgz", - "integrity": "sha512-dB7uOnUWsojZIAC6Nwi5v3tuaQNd2i7p4vF5LsJRyoTOgr2fRYQdMKQxRZIZZaz0cTPBX8rvcWU1A6/n7JTITg==", + "integrity": "sha1-hN7mQ/A3w9WcneFCVIQwNxqo07I=", "dev": true, "requires": { "ansi-html": "0.0.7", @@ -6687,7 +6841,7 @@ "webpack-sources": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz", - "integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==", + "integrity": "sha1-xzVkNqTRMSO+LiQmoF0drZy+Zc8=", "requires": { "source-list-map": "2.0.0", "source-map": "0.5.6" @@ -6716,7 +6870,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "requires": { "isexe": "2.0.0" } diff --git a/package.json b/package.json index 7d75e87..243828e 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ }, "homepage": "https://github.com/Toucans456/GitPal#readme", "devDependencies": { - "eslint": "^4.4.1", + "eslint": "^4.12.1", "eslint-config-airbnb": "^15.1.0", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-react": "^7.2.0", + "eslint-config-prettier": "2.1.1", "webpack-dev-middleware": "^1.12.0", "webpack-dev-server": "^2.7.1", "webpack-hot-middleware": "^2.18.2" From 2c57d061748a24a3ab85b00b85adcd23e8d8b4d3 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 10:05:44 -0800 Subject: [PATCH 082/105] Update eslintrc rules and add editorconfig --- .editorconfig | 10 ++ .eslintrc.json | 20 ++- client/components/App.jsx | 55 ++++++-- client/components/AppDrawer.jsx | 7 +- client/components/UserDetails.jsx | 48 ++++--- client/components/UserProfile.jsx | 6 +- server/db/index.js | 6 +- server/db/models.js | 27 ++-- server/db/seed.js | 45 +++--- server/routes/api.js | 226 +++++++++++++++++++----------- 10 files changed, 300 insertions(+), 150 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b5217a1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.eslintrc.json b/.eslintrc.json index 8cb1d04..30cc9c6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,24 @@ { - "extends": ["airbnb", "prettier", "prettier/react"], + "extends": "airbnb", + "plugins": ["prettier"], "env": { "browser": true, - "node": true + "node": true, + "es6": true }, "rules": { - "eslint no-console": "off" + "arrow-parens": ["error", "as-needed"], + "no-console": 0, + "react/prop-types": 0, + "comma-dangle": [ + "error", + { + "arrays": "never", + "objects": "never", + "imports": "never", + "exports": "never", + "functions": "ignore" + } + ] } } diff --git a/client/components/App.jsx b/client/components/App.jsx index 4d580bf..aa3f8df 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -40,7 +40,11 @@ class App extends React.Component { super(props); this.state = { loggedIn: false, +<<<<<<< HEAD drawerOpen: false, +======= + drawerOpen: false +>>>>>>> Update eslintrc rules and add editorconfig }; this.checkAuthenticated(); @@ -55,18 +59,26 @@ class App extends React.Component { getAllUsers() { axios .get('/API/allUsers') +<<<<<<< HEAD .then(allUsers => { this.props.addAllUsers(allUsers.data); }) +======= + .then(allUsers => this.props.addAllUsers(allUsers.data)) +>>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } getPairs() { axios .get('/API/pairs') +<<<<<<< HEAD .then(pairs => { this.props.loadPairedUsers(pairs.data); }) +======= + .then(pairs => this.props.loadPairedUsers(pairs.data)) +>>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -74,9 +86,13 @@ class App extends React.Component { getProjects() { axios .get('/API/projects/') +<<<<<<< HEAD .then(project => { this.props.addProjectsList(project.data); }) +======= + .then(project => this.props.addProjectsList(project.data)) +>>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -84,9 +100,13 @@ class App extends React.Component { getMessages() { axios .get('/API/messages') +<<<<<<< HEAD .then(res => { this.props.loadMessages(res.data); }) +======= + .then(res => this.props.loadMessages(res.data)) +>>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -112,7 +132,7 @@ class App extends React.Component { const colors = ['blue', 'green', 'red', 'yellow', 'lilac']; if (this.state.partyMode) { clearInterval(this.state.partyMode); - document.body.setAttribute('style', `background-color:white`); + document.body.setAttribute('style', 'background-color:white'); this.setState({ partyMode: false }); } else { this.setState({ @@ -120,9 +140,9 @@ class App extends React.Component { const randomNum = Math.floor(Math.random() * colors.length); document.body.setAttribute( 'style', - `background-color:${colors[randomNum]}`, + `background-color:${colors[randomNum]}` ); - }, 200), + }, 200) }); } } @@ -207,7 +227,11 @@ class App extends React.Component { const mapStateToProps = state => ({ message: state.message, projects: state.projects, +<<<<<<< HEAD pairedUsers: state.pairedUsers, +======= + pairedUsers: state.pairedUsers +>>>>>>> Update eslintrc rules and add editorconfig }); /* @@ -218,33 +242,48 @@ const mapDispatchToProps = dispatch => ({ addAllUsers: allUsers => dispatch({ type: 'LOAD_ALL_USERS', - allUsers, + allUsers }), addProjectsList: projects => dispatch({ type: 'LIST_PROJECTS', - projects, + projects }), loadMessages: messages => dispatch({ type: 'MESSAGES_LOAD', - messages, + messages }), loadPairedUsers: pairedUsers => dispatch({ type: 'LOAD_PAIRING', - pairedUsers, + pairedUsers }), loggedInUser: loggedInUser => dispatch({ type: 'UPDATED_LOGGEDIN_USER', - loggedInUser, + loggedInUser }), loggedOut: () => dispatch({ +<<<<<<< HEAD type: 'USER_LOGOUT', }), }); +======= + type: 'USER_LOGOUT' + }) +}); + +App.propTypes = { + addAllUsers: React.PropTypes.isRequired, + loadPairedUsers: React.PropTypes.isRequired, + addProjectsList: React.PropTypes.isRequired, + loadMessages: React.PropTypes.isRequired, + loggedInUser: React.PropTypes.isRequired, + loggedOut: React.PropTypes.isRequired +}; +>>>>>>> Update eslintrc rules and add editorconfig // connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 180581b..6d61359 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -8,7 +8,7 @@ import Drawer from 'material-ui/Drawer'; import AppBar from 'material-ui/AppBar'; import { BottomNavigation, - BottomNavigationItem, + BottomNavigationItem } from 'material-ui/BottomNavigation'; // buttons import FlatButton from 'material-ui/FlatButton'; @@ -63,7 +63,12 @@ function AppDrawer(props) { label="My Partners" fullWidth onClick={props.closeDrawer} +<<<<<<< HEAD secondaryicon={} +======= + secondary + icon={} +>>>>>>> Update eslintrc rules and add editorconfig />
                    diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 82bc54a..db884f4 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -23,7 +23,7 @@ import FlatButton from 'material-ui/FlatButton'; const customContentStyle = { width: '80%', height: '100%', - maxWidth: 'none', + maxWidth: 'none' }; /* for Dialog */ @@ -47,7 +47,11 @@ class UserDetails extends React.Component { open: false, isPaired: false, curProjectId: null, +<<<<<<< HEAD curProjectProperty: null, +======= + curProjectProperty: null +>>>>>>> Update eslintrc rules and add editorconfig }; this.expandCard = () => { this.setState({ expanded: true }); @@ -70,12 +74,16 @@ class UserDetails extends React.Component { axios .post('/API/messages', { text: this.state.message, +<<<<<<< HEAD recipient: this.props.user.id, +======= + recipient: this.props.user.id +>>>>>>> Update eslintrc rules and add editorconfig }) .then(() => { this.props.dispatchMessage(this.props.user.id, { text: this.state.message, - sender: true, + sender: true }); }); }; @@ -95,13 +103,13 @@ class UserDetails extends React.Component { .get('/API/pairedProjects', { params: { userId: this.props.loggedInUserGhId, - partnerId: this.props.user.ghId, - }, + partnerId: this.props.user.ghId + } }) .then(pairProjects => { if (pairProjects.data.length > 0) { this.setState({ - buttonClicked: true, + buttonClicked: true }); } }) @@ -114,7 +122,7 @@ class UserDetails extends React.Component { axios .post('/API/pair', { partnered: this.props.user.id, - project: this.state.curProjectId, + project: this.state.curProjectId }) .then(response => { this.props.createPairing(response.data); @@ -131,7 +139,7 @@ class UserDetails extends React.Component { axios .post('/API/pair', { partnered: this.props.user.id, - project: this.state.curProjectId, + project: this.state.curProjectId }) .then(response => { // this.props.dispatchPairing(this.props.user.id, this.state.curProjectId); @@ -190,12 +198,12 @@ class UserDetails extends React.Component { // socket.emit('chat message', ); const newMessage = { message: this._message.value, - username: this.props.loggedInUser, + username: this.props.loggedInUser }; const myMessage = { username: 'me: ', - message: this._message.value, + message: this._message.value }; const updatedChatBox = this.state.chatBox; @@ -231,8 +239,8 @@ class UserDetails extends React.Component { axios .get('/API/project', { params: { - id: userId, - }, + id: userId + } }) .then(project => { this.state.curProjectId = project.data.id; @@ -255,7 +263,7 @@ class UserDetails extends React.Component {
                    , - , + ]; return ( @@ -366,7 +374,7 @@ const mapStateToProps = (state, props) => { const userId = Number(props.match.params.id); const user = state.allUsers.filter(user => user.id === userId)[0]; const projects = state.projects.filter( - project => user.projects.indexOf(project.id) > -1, + project => user.projects.indexOf(project.id) > -1 ); const loggedInUser = state.loggedInUser.username; const loggedInUserGhId = state.loggedInUser.ghId; @@ -375,31 +383,31 @@ const mapStateToProps = (state, props) => { projects, messages: state.messages[userId] || [], loggedInUser, - loggedInUserGhId, + loggedInUserGhId }; }; const mapDispatchToProps = dispatch => ({ loadMessages: messages => dispatch({ type: 'MESSAGES_LOAD', - messages, + messages }), createPairing: pairs => dispatch({ type: 'ADD_PAIRING', - pairs, + pairs }), dispatchPairing: (userId, projectId) => dispatch({ type: 'CHANGE_USER_PAIRING', userId, - projectId, + projectId }), dispatchMessage: (userId, message) => dispatch({ type: 'MESSAGE_SEND', userId, - message, - }), + message + }) }); export default connect(mapStateToProps, mapDispatchToProps)(UserDetails); diff --git a/client/components/UserProfile.jsx b/client/components/UserProfile.jsx index 25dbfce..9abff61 100644 --- a/client/components/UserProfile.jsx +++ b/client/components/UserProfile.jsx @@ -14,7 +14,7 @@ function UserProfile(props) { width: '40%', marginLeft: 'auto', marginRight: 'auto', - marginBottom: 12, + marginBottom: 12 }} > @@ -44,8 +44,8 @@ function UserProfile(props) { const mapStateToProps = (state, props) => ({ projects: state.projects.filter( - project => props.user.projects.indexOf(project.id) > -1, - ), + project => props.user.projects.indexOf(project.id) > -1 + ) }); export default connect(mapStateToProps)(UserProfile); diff --git a/server/db/index.js b/server/db/index.js index f9fba65..6798bfa 100644 --- a/server/db/index.js +++ b/server/db/index.js @@ -36,8 +36,10 @@ const neo4j = require('neo4j-driver').v1; // set variables to connect const url = process.env.GRAPHENEDB_BOLT_URL || 'bolt://localhost'; -const username = process.env.GRAPHENEDB_BOLT_USERNAME || process.env.NEO4J_USERNAME || 'neo4j'; -const password = process.env.GRAPHENEDB_BOLT_PASSWORD || process.env.NEO4J_PASSWORD || 'neo'; +const username = + process.env.GRAPHENEDB_BOLT_USERNAME || process.env.NEO4J_USERNAME || 'neo4j'; +const password = + process.env.GRAPHENEDB_BOLT_PASSWORD || process.env.NEO4J_PASSWORD || 'neo'; // connect and create session exports.driver = neo4j.driver(url, neo4j.auth.basic(username, password)); diff --git a/server/db/models.js b/server/db/models.js index 5df96da..bcc9a6d 100644 --- a/server/db/models.js +++ b/server/db/models.js @@ -1,8 +1,8 @@ /* * DATABASE MODELS * (Used whenever db results are parsed--mostly - * in request-handler) - * + * in request-handler) + * * This module massages neo4j search results * into more convenient objects. The constructors are * essentially parsers. This allows us to abstract the logic @@ -24,24 +24,31 @@ exports.User = class User { this.username = user.properties.username; this.name = user.properties.name; this.avatarUrl = user.properties.avatarUrl; - this.ghId = 'ghId' in user.properties ? user.properties.ghId.toNumber() : null; - this.rating = rating ? rating.properties.difference.toNumber() : user.properties.rating.toNumber(); + this.ghId = + 'ghId' in user.properties ? user.properties.ghId.toNumber() : null; + this.rating = rating + ? rating.properties.difference.toNumber() + : user.properties.rating.toNumber(); this.paired = pairs ? pairs.map(pair => pair.toNumber()) : []; - this.projects = projects ? projects.map(project => project.toNumber()) : this.paired; + this.projects = projects + ? projects.map(project => project.toNumber()) + : this.paired; this.language = user.properties.language; this.experience = user.properties.experience; this.description = user.properties.description; } -} +}; // Includes sensitive information (e.g. OAuthToken) that should not be sent to users exports.ServerUser = class extends exports.User { constructor(user) { - super(user) + super(user); this.OAuthToken = user.properties.OAuthToken; - this.profile = user.properties.profile ? JSON.parse(user.properties.profile) : false; + this.profile = user.properties.profile + ? JSON.parse(user.properties.profile) + : false; } -} +}; exports.Project = class Project { constructor(project, pairs, interested) { @@ -54,4 +61,4 @@ exports.Project = class Project { this.paired = pairs ? pairs.map(pair => pair.toNumber()) : []; this.interested = interested; } -} +}; diff --git a/server/db/seed.js b/server/db/seed.js index a886b81..71fdef5 100644 --- a/server/db/seed.js +++ b/server/db/seed.js @@ -9,15 +9,16 @@ const session = driver.session(); // Deletes all nodes and relationships in the graph const dropGraph = function dropGraph() { const dropGraphQueryString = 'MATCH (n) DETACH DELETE n'; - return session.run(dropGraphQueryString) - .then((result) => { - console.log('Graph dropped'); + return session + .run(dropGraphQueryString) + .then(result => { + console.log('Graph dropped'); }) - .catch((error) => { + .catch(error => { session.close(); throw error; }); -} +}; const addUsersQueryString = ` CREATE @@ -29,11 +30,12 @@ const addUsersQueryString = ` // Add user nodes function addUsers() { - return session.run(addUsersQueryString) - .then((result) => { + return session + .run(addUsersQueryString) + .then(result => { console.log('Users added'); }) - .catch((error) => { + .catch(error => { session.close(); throw error; }); @@ -49,15 +51,16 @@ const addProjectsQueryString = ` // Add project nodes const addProjects = function addProjects() { - return session.run(addProjectsQueryString) - .then((result) => { + return session + .run(addProjectsQueryString) + .then(result => { console.log('Projects added'); }) - .catch((error) => { + .catch(error => { session.close(); throw error; }); -} +}; //Create INTERESTED_IN relationships between users and projects //Add INTERESTED_IN relationships if you addPairs @@ -77,15 +80,16 @@ const addInterestedInRelationshipsQueryString = ` `; const addInterestedInRelationships = function addInterestedInRelationships() { - return session.run(addInterestedInRelationshipsQueryString) - .then((result) => { + return session + .run(addInterestedInRelationshipsQueryString) + .then(result => { console.log('INTERESTED_IN relationships added'); }) - .catch((error) => { + .catch(error => { session.close(); throw error; }); -} +}; // Add pair const addPairQueryString = ` @@ -100,15 +104,16 @@ const addPairQueryString = ` `; const addPair = function addPair() { - return session.run(addPairQueryString) - .then((result) => { + return session + .run(addPairQueryString) + .then(result => { console.log('PAIRED_WITH relationships added'); }) - .catch((error) => { + .catch(error => { session.close(); throw error; }); -} +}; // Call functions that seed the db dropGraph() diff --git a/server/routes/api.js b/server/routes/api.js index 0192f36..f361d2a 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -4,7 +4,8 @@ * first by method then by route. * * THINGS TO FIX: - * There's a lot of repeated code in the db queries. You may find it helpful to create better helper functions + * There's a lot of repeated code in the db queries. You may find it helpful + * to create better helper functions * here, simply modularise the db functionality better or both. * Suggestions in the db module. */ @@ -12,8 +13,8 @@ // Required to create a db session and run a query. // For info on how to do this better, check the hints in the db module. const db = require('../db'); -const dbDriver = db.driver; +const dbDriver = db.driver; module.exports = { GET: { @@ -22,20 +23,27 @@ module.exports = { */ // Returns an object with numerical properties representing // project IDs each with a value of an array of checkpoints of the form - // { text: prompt(string), hint: hint on how to tackle prompt(string), complete: completion status of prompt(bool) } + // { text: prompt(string), hint: hint on how to tackle prompt(string), + // complete: completion status of prompt(bool) } progress: function getProgress(req) { return new Promise((resolve, reject) => { console.log('GET progress'); const dbSession = dbDriver.session(); - dbSession.run(` - MATCH (:User {ghId: ${req.user.ghInfo.id}})-->(group:Group)-->(project:Project) + dbSession + .run( + ` + MATCH (:User {ghId: ${req.user.ghInfo + .id}})-->(group:Group)-->(project:Project) RETURN group, project - `) - .then((res) => { + ` + ) + .then(res => { const projectProgress = {}; - res.records.forEach((record) => { + res.records.forEach(record => { const group = record.get('group').properties; - projectProgress[record.get('project').identity] = group.progress ? JSON.parse(group.progress) : []; + projectProgress[record.get('project').identity] = group.progress + ? JSON.parse(group.progress) + : []; }); resolve(projectProgress); }) @@ -50,13 +58,14 @@ module.exports = { return new Promise((resolve, reject) => { console.log('GET messages'); const dbSession = dbDriver.session(); - dbSession.run(` - MATCH (:User {ghId: ${req.user.ghInfo.id}})-[to_user]-(message:Message)--(other:User) - RETURN message, to_user, other ORDER BY message.created_at DESC - `) - .then((res) => { + dbSession + .run( + `MATCH (:User {ghId: ${req.user.ghInfo + .id}})-[to_user]-(message:Message)--(other:User) RETURN message, to_user, other ORDER BY message.created_at DESC` + ) + .then(res => { const messages = {}; - res.records.forEach((record) => { + res.records.forEach(record => { const text = record.get('message').properties.text; const userId = record.get('other').identity.toNumber(); const sender = record.get('to_user').type === 'SENT'; @@ -66,7 +75,7 @@ module.exports = { }); resolve(messages); }) - .catch((err) => { + .catch(err => { reject(err); dbSession.close(); }); @@ -84,7 +93,9 @@ module.exports = { console.log('GET users'); const ghId = req.user.ghInfo.id; const projectId = Number(req.query.projectId); - dbSession.run(` + dbSession + .run( + ` MATCH (user:User {ghId: ${ghId}})<-[xp:EXPERIENCE_DIFFERENCE]->(pair:User) WITH user, pair, xp MATCH (pair)-->(group:Group)<--(user), @@ -100,14 +111,22 @@ module.exports = { WHERE ID(project) = ${projectId} AND NOT (pair)-->(:Group)<--(:User {ghId: ${ghId}}) OPTIONAL MATCH (pair)--(:Group)--(pairsProjects:Project) RETURN pair, false as projects, COLLECT(ID(pairsProjects)) as pairsProjects, xp - `) - .then((res) => { + ` + ) + .then(res => { resolve( - res.records.map(user => - new db.models.User(user.get('pair'), user.get('projects'), user.get('xp'), user.get('pairsProjects')) - ) + res.records + .map( + user => + new db.models.User( + user.get('pair'), + user.get('projects'), + user.get('xp'), + user.get('pairsProjects') + ) + ) .sort((a, b) => a.rating - b.rating) - ) + ); }) .catch(reject) .then(() => dbSession.close()); @@ -121,7 +140,9 @@ module.exports = { const dbSession = dbDriver.session(); console.log('GET projects'); const ghId = req.user.ghInfo.id; - dbSession.run(` + dbSession + .run( + ` MATCH (user:User {ghId: ${ghId}})-->(group:Group)-->(project:Project) WITH user, group, project MATCH (pair:User)-->(group)-->(project) @@ -135,71 +156,83 @@ module.exports = { MATCH (user:User {ghId: ${ghId}}), (project:Project) WHERE NOT (user)-->(:Group)-->(project) AND NOT (user)-[:INTERESTED_IN]->(project) RETURN false as pairs, false as interested, project - `) - .then((res) => { - resolve(res.records.map(project => - new db.models.Project(project.get('project'), project.get('pairs'), project.get('interested')) - )); + ` + ) + .then(res => { + resolve( + res.records.map( + project => + new db.models.Project( + project.get('project'), + project.get('pairs'), + project.get('interested') + ) + ) + ); }) .catch(reject) .then(() => dbSession.close()); }); }, - //Retrieve the project that two users share - //Returns a project + // Retrieve the project that two users share + // Returns a project project: function getProject(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('GET project'); const ghId = req.user.ghInfo.id; - const userId = req.query.id - dbSession.run(` + const userId = req.query.id; + dbSession + .run( + ` MATCH (:User {ghId:${ghId}})-[WORKING_ON]-(project:Project)--(:User {ghId:${userId}}) RETURN project - `) - .then((res) => { + ` + ) + .then(res => { const project = res.records[0]; - resolve(new db.models.Project(project.get('project')) - ); + resolve(new db.models.Project(project.get('project'))); }) .catch(reject) .then(() => dbSession.close()); }); }, - //Retrieves all projects that a user is paired with other users + // Retrieves all projects that a user is paired with other users pairedProjects: function findPairProjects(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('GET paired projects'); const userId = Number(req.query.userId); const partnerId = Number(req.query.partnerId); - dbSession.run(` + dbSession + .run( + ` MATCH(user:User {ghId: ${userId}})-[:PAIRED_WITH]->(group)<- [:PAIRED_WITH]-(partner:User {ghId: ${partnerId}}) RETURN group - `) - .then((res) => { + ` + ) + .then(res => { resolve(res.records); }) .catch(reject) .then(() => dbSession.close()); - }) + }); }, - //Retrieves all users + // Retrieves all users allUsers: function getAllUsers(req, res) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); - dbSession.run( - `MATCH (users:User) RETURN users` - ) - .then((res) => { - resolve(res.records.map(user => - new db.models.User(user.get('users')) - )); + dbSession + .run('MATCH (users:User) RETURN users') + .then(res => { + resolve( + res.records.map(user => new db.models.User(user.get('users'))) + ); }) .catch(reject) .then(() => dbSession.close()); - }) + }); }, // Returns an array of user objects--one for each @@ -209,21 +242,25 @@ module.exports = { const dbSession = dbDriver.session(); console.log('GET pairs'); const ghId = req.user.ghInfo.id; - dbSession.run(` + dbSession + .run( + ` MATCH (pair:User)-->(group:Group)<--(user:User) WHERE user.ghId = ${Number(ghId)} RETURN pair - `) - .then((res) => { - resolve(res.records.map(project => - res.records.map(user => new db.models.User(user.get('pair'))) - )); + ` + ) + .then(res => { + resolve( + res.records.map(project => + res.records.map(user => new db.models.User(user.get('pair'))) + ) + ); }) .catch(reject) .then(() => dbSession.close()); }); } - }, /* @@ -235,15 +272,18 @@ module.exports = { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('POST projects'); - dbSession.run( - ` + dbSession + .run( + ` MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} - MATCH (project:Project) WHERE ID(project) = ${Number(req.body.projectId)} + MATCH (project:Project) WHERE ID(project) = ${Number( + req.body.projectId + )} MERGE (user)-[:INTERESTED_IN]->(project) return user, project ` - ) - .then((res) => { + ) + .then(res => { resolve(res); }) .catch(reject) @@ -257,16 +297,21 @@ module.exports = { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('POST pair'); - dbSession.run(` - MATCH (project:Project) WHERE ID(project) = ${Number(req.body.project)} + dbSession + .run( + ` + MATCH (project:Project) WHERE ID(project) = ${Number( + req.body.project + )} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) MERGE (group)-[:WORKING_ON]->(project) SET group.progress = project.structure return user, pair, group, project - `) - .then((res) => { + ` + ) + .then(res => { const pair = res.records[0]; resolve(new db.models.User(pair.get('pair'))); }) @@ -281,19 +326,25 @@ module.exports = { const dbSession = dbDriver.session(); const message = req.body; console.log('POST messages'); - dbSession.run(` - MATCH (user:User {ghId: ${ req.user.ghInfo.id }}), (recipient:User) - WHERE ID(recipient) = ${ req.body.recipient } - CREATE (user)-[:SENT]->(:Message {text: '${ req.body.text.replace('\'', '\\\'') }', created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) - `) + dbSession + .run( + ` + MATCH (user:User {ghId: ${req.user.ghInfo.id}}), (recipient:User) + WHERE ID(recipient) = ${req.body.recipient} + CREATE (user)-[:SENT]->(:Message {text: '${req.body.text.replace( + "'", + "\\'" + )}', created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) + ` + ) .then(() => { resolve(); dbSession.close(); }) - .catch((err) => { + .catch(err => { reject(err); dbSession.close(); - }) + }); }); }, @@ -305,12 +356,19 @@ module.exports = { progress: function updateProgress(req) { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); - console.log('POST progress') - dbSession.run(` - MATCH (:User {ghId: ${req.user.ghInfo.id}})-->(group:Group)-->(project:Project) + console.log('POST progress'); + dbSession + .run( + ` + MATCH (:User {ghId: ${req.user.ghInfo + .id}})-->(group:Group)-->(project:Project) WHERE ID(project) = ${req.body.projectId} - SET group.progress = '${JSON.stringify(req.body.progress).replace('\'', '\\\'')}' - `) + SET group.progress = '${JSON.stringify(req.body.progress).replace( + "'", + "\\'" + )}' + ` + ) .then(resolve) .catch(reject) .then(() => dbSession.close()); @@ -322,16 +380,18 @@ module.exports = { return new Promise((resolve, reject) => { const dbSession = dbDriver.session(); console.log('POST users'); - dbSession.run(` + dbSession + .run( + ` MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} SET user.description = '${req.body.description}' SET user.language = '${req.body.language}' SET user.experience = '${req.body.experience}' - `) + ` + ) .then(() => resolve()) .catch(reject); }); } - }, - + } }; From 0ac1366e094a82c3015823442222ac634af39715 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 10:15:48 -0800 Subject: [PATCH 083/105] Update string indentation --- server/routes/api.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/server/routes/api.js b/server/routes/api.js index f361d2a..13a9a06 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -276,9 +276,8 @@ module.exports = { .run( ` MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} - MATCH (project:Project) WHERE ID(project) = ${Number( - req.body.projectId - )} + MATCH (project:Project) + WHERE ID(project) = ${Number(req.body.projectId)} MERGE (user)-[:INTERESTED_IN]->(project) return user, project ` @@ -300,9 +299,8 @@ module.exports = { dbSession .run( ` - MATCH (project:Project) WHERE ID(project) = ${Number( - req.body.project - )} + MATCH (project:Project) + WHERE ID(project) = ${Number(req.body.project)} MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) @@ -331,10 +329,10 @@ module.exports = { ` MATCH (user:User {ghId: ${req.user.ghInfo.id}}), (recipient:User) WHERE ID(recipient) = ${req.body.recipient} - CREATE (user)-[:SENT]->(:Message {text: '${req.body.text.replace( - "'", - "\\'" - )}', created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) + CREATE (user)-[:SENT]-> + (:Message + {text: '${req.body.text.replace("'", "\\'")}', + created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) ` ) .then(() => { @@ -360,13 +358,11 @@ module.exports = { dbSession .run( ` - MATCH (:User {ghId: ${req.user.ghInfo - .id}})-->(group:Group)-->(project:Project) + MATCH (:User {ghId: ${req.user.ghInfo.id}}) + -->(group:Group)-->(project:Project) WHERE ID(project) = ${req.body.projectId} - SET group.progress = '${JSON.stringify(req.body.progress).replace( - "'", - "\\'" - )}' + SET group.progress = + '${JSON.stringify(req.body.progress).replace("'", "\\'")}' ` ) .then(resolve) From fc507528a345947c3fac6e97b9e46356fe5fe57f Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 10:22:18 -0800 Subject: [PATCH 084/105] Clean up head conflict --- client/components/App.jsx | 40 ++----------------------------- client/components/AppDrawer.jsx | 4 ---- client/components/UserDetails.jsx | 12 ++-------- 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/client/components/App.jsx b/client/components/App.jsx index aa3f8df..c5dfb26 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -40,11 +40,7 @@ class App extends React.Component { super(props); this.state = { loggedIn: false, -<<<<<<< HEAD - drawerOpen: false, -======= drawerOpen: false ->>>>>>> Update eslintrc rules and add editorconfig }; this.checkAuthenticated(); @@ -59,26 +55,14 @@ class App extends React.Component { getAllUsers() { axios .get('/API/allUsers') -<<<<<<< HEAD - .then(allUsers => { - this.props.addAllUsers(allUsers.data); - }) -======= .then(allUsers => this.props.addAllUsers(allUsers.data)) ->>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } getPairs() { axios .get('/API/pairs') -<<<<<<< HEAD - .then(pairs => { - this.props.loadPairedUsers(pairs.data); - }) -======= .then(pairs => this.props.loadPairedUsers(pairs.data)) ->>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -86,13 +70,7 @@ class App extends React.Component { getProjects() { axios .get('/API/projects/') -<<<<<<< HEAD - .then(project => { - this.props.addProjectsList(project.data); - }) -======= .then(project => this.props.addProjectsList(project.data)) ->>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -100,13 +78,7 @@ class App extends React.Component { getMessages() { axios .get('/API/messages') -<<<<<<< HEAD - .then(res => { - this.props.loadMessages(res.data); - }) -======= .then(res => this.props.loadMessages(res.data)) ->>>>>>> Update eslintrc rules and add editorconfig .catch(console.error); } @@ -227,11 +199,7 @@ class App extends React.Component { const mapStateToProps = state => ({ message: state.message, projects: state.projects, -<<<<<<< HEAD - pairedUsers: state.pairedUsers, -======= pairedUsers: state.pairedUsers ->>>>>>> Update eslintrc rules and add editorconfig }); /* @@ -266,15 +234,11 @@ const mapDispatchToProps = dispatch => ({ }), loggedOut: () => dispatch({ -<<<<<<< HEAD - type: 'USER_LOGOUT', - }), -}); -======= type: 'USER_LOGOUT' }) }); +/* App.propTypes = { addAllUsers: React.PropTypes.isRequired, loadPairedUsers: React.PropTypes.isRequired, @@ -283,7 +247,7 @@ App.propTypes = { loggedInUser: React.PropTypes.isRequired, loggedOut: React.PropTypes.isRequired }; ->>>>>>> Update eslintrc rules and add editorconfig +*/ // connects the Store to App component export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/client/components/AppDrawer.jsx b/client/components/AppDrawer.jsx index 6d61359..80c355f 100644 --- a/client/components/AppDrawer.jsx +++ b/client/components/AppDrawer.jsx @@ -63,12 +63,8 @@ function AppDrawer(props) { label="My Partners" fullWidth onClick={props.closeDrawer} -<<<<<<< HEAD - secondaryicon={} -======= secondary icon={} ->>>>>>> Update eslintrc rules and add editorconfig />
                    diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index db884f4..0efe687 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -47,11 +47,7 @@ class UserDetails extends React.Component { open: false, isPaired: false, curProjectId: null, -<<<<<<< HEAD - curProjectProperty: null, -======= curProjectProperty: null ->>>>>>> Update eslintrc rules and add editorconfig }; this.expandCard = () => { this.setState({ expanded: true }); @@ -74,11 +70,7 @@ class UserDetails extends React.Component { axios .post('/API/messages', { text: this.state.message, -<<<<<<< HEAD - recipient: this.props.user.id, -======= recipient: this.props.user.id ->>>>>>> Update eslintrc rules and add editorconfig }) .then(() => { this.props.dispatchMessage(this.props.user.id, { @@ -210,7 +202,7 @@ class UserDetails extends React.Component { updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); socket.emit('chat message', newMessage); // send msg @@ -230,7 +222,7 @@ class UserDetails extends React.Component { const updatedChatBox = this.state.chatBox; updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); } From fc38c2e7c541bad5b28e6cda508bf3620067d9d1 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 12:06:00 -0800 Subject: [PATCH 085/105] Update unpair feature --- client/components/MyPartners.jsx | 10 +- client/components/UserDetails.jsx | 24 ++++- server/request-handler/index.js | 54 +++++----- server/routes/api.js | 157 ++++++++++++++++++------------ server/routes/auth.js | 31 ++++-- 5 files changed, 174 insertions(+), 102 deletions(-) diff --git a/client/components/MyPartners.jsx b/client/components/MyPartners.jsx index ffc9a12..e4a966e 100644 --- a/client/components/MyPartners.jsx +++ b/client/components/MyPartners.jsx @@ -9,7 +9,7 @@ import { TableHeader, TableHeaderColumn, TableRow, - TableRowColumn, + TableRowColumn } from 'material-ui/Table'; import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; import { Card, CardText } from 'material-ui/Card'; @@ -20,18 +20,18 @@ class MyPartners extends React.Component { super(props); this.state = { isMounted: false, - userLists: [], + userLists: [] }; } componentDidMount() { if (this.props.pairedUsers) { this.setState({ - userLists: this.props.pairedUsers, + userLists: this.props.pairedUsers }); } else { this.setState({ - userLists: [], + userLists: [] }); } } @@ -78,7 +78,7 @@ class MyPartners extends React.Component { } const mapStateToProps = (state, props) => ({ - pairedUsers: state.pairedUsers, + pairedUsers: state.pairedUsers }); const mapDispatchToProps = dispatch => ({}); diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index 0efe687..c2caf25 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -56,6 +56,7 @@ class UserDetails extends React.Component { socket.on('chat message', msg => this.renderMessages(msg)); // receive messages this.addPair = this.addPair.bind(this); + this.unPair = this.unPair.bind(this); this.togglePair = this.togglePair.bind(this); this.pairButton = this.pairButton.bind(this); this.handleOpen = this.handleOpen.bind(this); @@ -127,6 +128,25 @@ class UserDetails extends React.Component { axios.get('/'); } + + unPair() { + axios + .post('/API/unpair', { + partnered: this.props.user.id, + project: this.state.curProjectId + }) + .then(response => { + // this.props.createPairing(response.data); + this.setState({ buttonClicked: !this.state.buttonClicked }); + window.location.reload(); // REACT needs this after a POST + }) + .catch(error => { + console.log(error); + }); + + axios.get('/'); + } + togglePair() { axios .post('/API/pair', { @@ -156,12 +176,12 @@ class UserDetails extends React.Component { return (
                    } - onClick={this.addPair} + onClick={this.unPair} /> { - if (err) { - throw err; - } else { - exports.index = data; +fs.readFile( + path.join(__dirname, '../../dist/index.html'), + 'utf8', + (err, data) => { + if (err) { + throw err; + } else { + exports.index = data; + } } -}); +); /* REACT ROUTES @@ -40,7 +44,6 @@ fs.readFile(path.join(__dirname, '../../dist/index.html'), 'utf8', (err, data) = // Serves index.html on react routes // and redirects /API request to appropriate endpoint exports.handler = function handler(req, res) { - // split URL to send to correct request handler const urlParts = req.path.split('/'); @@ -48,42 +51,49 @@ exports.handler = function handler(req, res) { if (routes.react.has(urlParts[1])) { res.send(exports.index); - /* + /* API ENDPOINTS */ - } else if (urlParts[1] === 'API' && routes.api[req.method].hasOwnProperty(urlParts[2])) { + } else if ( + urlParts[1] === 'API' && + routes.api[req.method].hasOwnProperty(urlParts[2]) + ) { // Only send meaningful response to authenticated users if (req.isAuthenticated()) { - routes.api[req.method][urlParts[2]](req) - .then((data) => { + routes.api[req.method] + [urlParts[2]](req) + .then(data => { res.statusCode = 200; res.json(data); }) - .catch((err) => { + .catch(err => { console.error(err); res.end('sorry not sorry'); }); } else { - // Unauthenticated users get 403 and empty data + // Unauthenticated users get 403 and empty data res.statusCode = 403; res.json([]); } - /* + /* AUTHENTICATION ENDPOINTS */ - // Handle authentication endpoints--these take req and res mostly for our convenience - // and to make implementation of passport easier. - // Consider refactoring similar to the above. - } else if (urlParts[1] === 'auth' && routes.auth[req.method].hasOwnProperty(urlParts[2])) { + // Handle authentication endpoints--these take req and res mostly for our convenience + // and to make implementation of passport easier. + // Consider refactoring similar to the above. + } else if ( + urlParts[1] === 'auth' && + routes.auth[req.method].hasOwnProperty(urlParts[2]) + ) { routes.auth[req.method][urlParts[2]](req, res, urlParts); - /* + /* 404 NOT FOUND */ - // If a request has still not been handled, it is using an incorrect URL. - // Send index.html -- React will render NotFound component - } else { + // If a request has still not been handled, it is using an incorrect URL. + // Send index.html -- React will render NotFound component + } else { res.statusCode = 404; res.end(exports.index); } diff --git a/server/routes/api.js b/server/routes/api.js index 13a9a06..37caec5 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -32,10 +32,10 @@ module.exports = { dbSession .run( ` - MATCH (:User {ghId: ${req.user.ghInfo - .id}})-->(group:Group)-->(project:Project) - RETURN group, project - ` + MATCH (:User {ghId: ${req.user.ghInfo.id}}) + -->(group:Group)-->(project:Project) + RETURN group, project + ` ) .then(res => { const projectProgress = {}; @@ -60,8 +60,11 @@ module.exports = { const dbSession = dbDriver.session(); dbSession .run( - `MATCH (:User {ghId: ${req.user.ghInfo - .id}})-[to_user]-(message:Message)--(other:User) RETURN message, to_user, other ORDER BY message.created_at DESC` + ` + MATCH (:User {ghId: ${req.user.ghInfo.id}}) + -[to_user]-(message:Message)--(other:User) + RETURN message, to_user, other ORDER BY message.created_at DESC + ` ) .then(res => { const messages = {}; @@ -96,22 +99,22 @@ module.exports = { dbSession .run( ` - MATCH (user:User {ghId: ${ghId}})<-[xp:EXPERIENCE_DIFFERENCE]->(pair:User) - WITH user, pair, xp - MATCH (pair)-->(group:Group)<--(user), - (group)-->(pairedProject:Project), - (pair)-[:INTERESTED_IN]->(project:Project) - WHERE ID(project) = ${projectId} - OPTIONAL MATCH (pair)--(:Group)--(pairsProjects:Project) - RETURN pair, COLLECT(ID(pairedProject)) as projects, COLLECT(ID(pairsProjects)) as pairsProjects, xp - UNION - MATCH (user:User {ghId: ${ghId}})<-[xp:EXPERIENCE_DIFFERENCE]->(pair:User) - WITH user, xp, pair - MATCH (pair)-[:INTERESTED_IN]->(project:Project) - WHERE ID(project) = ${projectId} AND NOT (pair)-->(:Group)<--(:User {ghId: ${ghId}}) - OPTIONAL MATCH (pair)--(:Group)--(pairsProjects:Project) - RETURN pair, false as projects, COLLECT(ID(pairsProjects)) as pairsProjects, xp - ` + MATCH (user:User {ghId: ${ghId}})<-[xp:EXPERIENCE_DIFFERENCE]->(pair:User) + WITH user, pair, xp + MATCH (pair)-->(group:Group)<--(user), + (group)-->(pairedProject:Project), + (pair)-[:INTERESTED_IN]->(project:Project) + WHERE ID(project) = ${projectId} + OPTIONAL MATCH (pair)--(:Group)--(pairsProjects:Project) + RETURN pair, COLLECT(ID(pairedProject)) as projects, COLLECT(ID(pairsProjects)) as pairsProjects, xp + UNION + MATCH (user:User {ghId: ${ghId}})<-[xp:EXPERIENCE_DIFFERENCE]->(pair:User) + WITH user, xp, pair + MATCH (pair)-[:INTERESTED_IN]->(project:Project) + WHERE ID(project) = ${projectId} AND NOT (pair)-->(:Group)<--(:User {ghId: ${ghId}}) + OPTIONAL MATCH (pair)--(:Group)--(pairsProjects:Project) + RETURN pair, false as projects, COLLECT(ID(pairsProjects)) as pairsProjects, xp + ` ) .then(res => { resolve( @@ -156,7 +159,7 @@ module.exports = { MATCH (user:User {ghId: ${ghId}}), (project:Project) WHERE NOT (user)-->(:Group)-->(project) AND NOT (user)-[:INTERESTED_IN]->(project) RETURN false as pairs, false as interested, project - ` + ` ) .then(res => { resolve( @@ -185,9 +188,9 @@ module.exports = { dbSession .run( ` - MATCH (:User {ghId:${ghId}})-[WORKING_ON]-(project:Project)--(:User {ghId:${userId}}) - RETURN project - ` + MATCH (:User {ghId:${ghId}})-[WORKING_ON]-(project:Project)--(:User {ghId:${userId}}) + RETURN project + ` ) .then(res => { const project = res.records[0]; @@ -245,10 +248,10 @@ module.exports = { dbSession .run( ` - MATCH (pair:User)-->(group:Group)<--(user:User) - WHERE user.ghId = ${Number(ghId)} - RETURN pair - ` + MATCH (pair:User)-->(group:Group)<--(user:User) + WHERE user.ghId = ${Number(ghId)} + RETURN pair + ` ) .then(res => { resolve( @@ -275,12 +278,12 @@ module.exports = { dbSession .run( ` - MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} - MATCH (project:Project) - WHERE ID(project) = ${Number(req.body.projectId)} - MERGE (user)-[:INTERESTED_IN]->(project) - return user, project - ` + MATCH (user:User) WHERE user.ghId=${Number(req.user.ghInfo.id)} + MATCH (project:Project) + WHERE ID(project) = ${Number(req.body.projectId)} + MERGE (user)-[:INTERESTED_IN]->(project) + return user, project + ` ) .then(res => { resolve(res); @@ -299,15 +302,15 @@ module.exports = { dbSession .run( ` - MATCH (project:Project) - WHERE ID(project) = ${Number(req.body.project)} - MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} - MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} - MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) - MERGE (group)-[:WORKING_ON]->(project) - SET group.progress = project.structure - return user, pair, group, project - ` + MATCH (project:Project) + WHERE ID(project) = ${Number(req.body.project)} + MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} + MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} + MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) + MERGE (group)-[:WORKING_ON]->(project) + SET group.progress = project.structure + return user, pair, group, project + ` ) .then(res => { const pair = res.records[0]; @@ -318,6 +321,34 @@ module.exports = { }); }, + unpair: function unPair(req) { + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + console.log('327 userGhid', req.user.ghInfo.id); + console.log('328 partnered', req.body.partnered); + console.log('329req.body.project', req.body.project); + dbSession + .run( + ` + MATCH (project:Project) + WHERE ID(project) = ${Number(req.body.project)} + MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} + MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} + MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) + DETACH DELETE group + ` + ) + .then(() => { + resolve(); + dbSession.close(); + }) + .catch(err => { + reject(err); + dbSession.close(); + }); + }); + }, + // Adds a new message from the requesting user to the database messages: function sendMessage(req) { return new Promise((resolve, reject) => { @@ -327,13 +358,13 @@ module.exports = { dbSession .run( ` - MATCH (user:User {ghId: ${req.user.ghInfo.id}}), (recipient:User) - WHERE ID(recipient) = ${req.body.recipient} - CREATE (user)-[:SENT]-> - (:Message - {text: '${req.body.text.replace("'", "\\'")}', - created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) - ` + MATCH (user:User {ghId: ${req.user.ghInfo.id}}), (recipient:User) + WHERE ID(recipient) = ${req.body.recipient} + CREATE (user)-[:SENT]-> + (:Message + {text: '${req.body.text.replace("'", "\\'")}', + created_at: TIMESTAMP()})-[:RECEIVED]->(recipient) + ` ) .then(() => { resolve(); @@ -358,12 +389,12 @@ module.exports = { dbSession .run( ` - MATCH (:User {ghId: ${req.user.ghInfo.id}}) - -->(group:Group)-->(project:Project) - WHERE ID(project) = ${req.body.projectId} - SET group.progress = - '${JSON.stringify(req.body.progress).replace("'", "\\'")}' - ` + MATCH (:User {ghId: ${req.user.ghInfo.id}}) + -->(group:Group)-->(project:Project) + WHERE ID(project) = ${req.body.projectId} + SET group.progress = + '${JSON.stringify(req.body.progress).replace("'", "\\'")}' + ` ) .then(resolve) .catch(reject) @@ -379,11 +410,11 @@ module.exports = { dbSession .run( ` - MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} - SET user.description = '${req.body.description}' - SET user.language = '${req.body.language}' - SET user.experience = '${req.body.experience}' - ` + MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} + SET user.description = '${req.body.description}' + SET user.language = '${req.body.language}' + SET user.experience = '${req.body.experience}' + ` ) .then(() => resolve()) .catch(reject); diff --git a/server/routes/auth.js b/server/routes/auth.js index 7242998..2b4da52 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -7,29 +7,40 @@ // Required to create a db session and run a query. // For info on how to do this better, check the hints in the db module. const db = require('../db'); -const dbDriver = db.driver; const passport = require('../authentication'); +const dbDriver = db.driver; + module.exports = { GET: { signout: function signout(req, res) { // destroy session and redirect to home - console.log('Logging out'); - req.session.destroy() - req.logout(); - res.redirect('/'); + console.log('Logging out'); + req.session.destroy(); + req.logout(); + res.redirect('/'); }, authenticated: function checkAuthenticated(req, res) { // If user signed in, send account details if (req.isAuthenticated()) { const dbSession = dbDriver.session(); - dbSession.run(` - MATCH (user:User {ghId: ${ req.user.ghInfo.id }}) + dbSession + .run( + ` + MATCH (user:User {ghId: ${req.user.ghInfo.id}}) OPTIONAL MATCH (user)--(:Group)--(project:Project) RETURN user, COLLECT(ID(project)) as projects - `) - .then((result) => { - res.json(new db.models.User(result.records[0].get('user'), false, false, result.records[0].get('projects'))); + ` + ) + .then(result => { + res.json( + new db.models.User( + result.records[0].get('user'), + false, + false, + result.records[0].get('projects') + ) + ); dbSession.close(); }) .catch(() => { From 2d0697beb94faf888ddd38dfade68b43c034efdc Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 12:14:19 -0800 Subject: [PATCH 086/105] Update icon to avoid confusion --- client/components/UserDetails.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/UserDetails.jsx b/client/components/UserDetails.jsx index c2caf25..b022a66 100644 --- a/client/components/UserDetails.jsx +++ b/client/components/UserDetails.jsx @@ -176,11 +176,11 @@ class UserDetails extends React.Component { return (
                    } + icon={} onClick={this.unPair} /> Date: Wed, 6 Dec 2017 13:34:24 -0800 Subject: [PATCH 087/105] Update link to my-partners list on detail project page --- client/components/Project.jsx | 11 ++--- client/components/ProjectStatus.jsx | 32 +++++++++----- package-lock.json | 68 ++++++++++++++++++----------- package.json | 1 + server/routes/api.js | 27 ++++++++++++ 5 files changed, 96 insertions(+), 43 deletions(-) diff --git a/client/components/Project.jsx b/client/components/Project.jsx index 217dd76..835359b 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -24,7 +24,7 @@ class Project extends React.Component { axios .post('/API/progress', { projectId: this.props.project.id, - progress: this.props.progress, + progress: this.props.progress }) .catch(console.error); } @@ -58,9 +58,10 @@ class Project extends React.Component { const mapStateToProps = (state, props) => { const projectId = Number(props.match.params.id); const project = state.projects.filter(project => project.id === projectId)[0]; + console.log('Project.jsx line61 props.project', project); return { project, - progress: state.projectProgress[projectId] || [], + progress: state.projectProgress[projectId] || [] }; }; @@ -73,13 +74,13 @@ const mapDispatchToProps = (dispatch, props) => ({ dispatch({ type: 'PROGRESS_CHANGE_ITEM', projectId, - itemIndex, + itemIndex }), loadProgress: progress => dispatch({ type: 'PROGRESS_LOAD_ITEMS', - progress, - }), + progress + }) }); // connects the Store to Project component diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index c52d47d..443fe54 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -1,5 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; +import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import Paper from 'material-ui/Paper'; import { Toolbar, ToolbarGroup, ToolbarTitle } from 'material-ui/Toolbar'; @@ -16,13 +17,13 @@ import io from 'socket.io-client'; const socket = io(); const style = { - margin: 12, + margin: 12 }; const customContentStyle = { width: '80%', height: '100%', - maxWidth: 'none', + maxWidth: 'none' }; // renders a progress item component inside ProjectStatus const ProgressItem = props => { @@ -42,7 +43,7 @@ class ProjectStatus extends React.Component { this.state = { open: false, dialogOpen: false, - chatBox: [], + chatBox: [] }; this.handleSubmit = this.handleSubmit.bind(this); @@ -50,7 +51,7 @@ class ProjectStatus extends React.Component { this.handleDiaLogOpen = this.handleDiaLogOpen.bind(this); this.handleDiaLogClose = this.handleDiaLogClose.bind(this); this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - + this.handlePartenerList = this.handlePartenerList.bind(this); socket.on('chat message', msg => this.renderMessages(msg)); } @@ -69,7 +70,7 @@ class ProjectStatus extends React.Component { // handles opening the dialog alert and submits the project's progress handleSubmit() { this.setState({ - open: true, + open: true }); this.props.submitProgress(); } @@ -77,7 +78,7 @@ class ProjectStatus extends React.Component { // handles the closing of dialog alert handleClose() { this.setState({ - open: false, + open: false }); } @@ -86,19 +87,19 @@ class ProjectStatus extends React.Component { const newMessage = { message: this._message.value, - username: this.props.loggedInUser, + username: this.props.loggedInUser }; const myMessage = { username: 'me: ', - message: this._message.value, + message: this._message.value }; const updatedChatBox = this.state.chatBox; updatedChatBox.push(myMessage); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); socket.emit('chat message', newMessage); // send msg @@ -109,7 +110,7 @@ class ProjectStatus extends React.Component { console.log('line 119', msg); updatedChatBox.push(msg); this.setState({ - chatBox: updatedChatBox, + chatBox: updatedChatBox }); } @@ -127,7 +128,7 @@ class ProjectStatus extends React.Component {
                    , - , + ]; return (
                    @@ -146,6 +147,13 @@ class ProjectStatus extends React.Component { href={this.props.project.link} target="_blank" /> + + + @@ -217,7 +225,7 @@ const mapStateToProps = (state, props) => { const loggedInUserGhId = state.loggedInUser.ghId; return { loggedInUser, - loggedInUserGhId, + loggedInUserGhId }; }; diff --git a/package-lock.json b/package-lock.json index 1a5d22b..51aa0d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -239,6 +239,11 @@ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, "axios": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.16.2.tgz", @@ -1252,7 +1257,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "cli-cursor": { @@ -1762,22 +1767,41 @@ } }, "engine.io-client": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz", - "integrity": "sha1-QVqYUrrbFPoAj6PvHjFgjbZ2EyU=", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.4.tgz", + "integrity": "sha1-T88TcLRxY70s6b4nM5ckMDUNTqE=", "requires": { "component-emitter": "1.2.1", "component-inherit": "0.0.3", - "debug": "2.6.8", + "debug": "2.6.9", "engine.io-parser": "2.1.1", "has-cors": "1.1.0", "indexof": "0.0.1", - "parsejson": "0.0.3", "parseqs": "0.0.5", "parseuri": "0.0.5", - "ws": "2.3.1", - "xmlhttprequest-ssl": "1.5.3", + "ws": "3.3.2", + "xmlhttprequest-ssl": "1.5.4", "yeast": "0.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ws": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.2.tgz", + "integrity": "sha512-t+WGpsNxhMR4v6EClXS8r8km5ZljKJzyGhJf7goJz9k5Ye3+b5Bvno5rjqPuIBn5mnn5GBb7o8IrIWHxX1qOLQ==", + "requires": { + "async-limiter": "1.0.0", + "safe-buffer": "5.1.1", + "ultron": "1.1.0" + } + } } }, "engine.io-parser": { @@ -2252,7 +2276,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "esquery": { @@ -3880,7 +3904,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", "dev": true, "requires": { "color-convert": "1.9.1" @@ -4967,14 +4991,6 @@ "error-ex": "1.3.1" } }, - "parsejson": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", - "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", - "requires": { - "better-assert": "1.0.2" - } - }, "parseqs": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", @@ -5885,7 +5901,7 @@ "engine.io": "3.1.0", "object-assign": "4.1.1", "socket.io-adapter": "1.1.1", - "socket.io-client": "2.0.3", + "socket.io-client": "2.0.4", "socket.io-parser": "3.1.2" } }, @@ -5895,16 +5911,16 @@ "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" }, "socket.io-client": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz", - "integrity": "sha1-bK9K/5+FsZ/ZG2zhPWmttWT4hzs=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.4.tgz", + "integrity": "sha1-CRilUkBtxeVAs4Dc2Xr8SmQzL44=", "requires": { "backo2": "1.0.2", "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", "component-emitter": "1.2.1", "debug": "2.6.8", - "engine.io-client": "3.1.1", + "engine.io-client": "3.1.4", "has-cors": "1.1.0", "indexof": "0.0.1", "object-component": "0.0.3", @@ -6951,9 +6967,9 @@ } }, "xmlhttprequest-ssl": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", - "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=" + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.4.tgz", + "integrity": "sha1-BPVgkVcks4kIhxXMDteBPpZ3v1c=" }, "xtend": { "version": "4.0.1", diff --git a/package.json b/package.json index 243828e..f19b245 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "redux-storage": "^4.1.2", "redux-storage-engine-localstorage": "^1.1.4", "socket.io": "^2.0.3", + "socket.io-client": "^2.0.4", "webpack": "^3.5.3" } } diff --git a/server/routes/api.js b/server/routes/api.js index 37caec5..c478eff 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -402,6 +402,33 @@ module.exports = { }); }, + // deleteInterest: function deleteInterest(req) { + // return new Promise((resolve, reject) => { + // const dbSession = dbDriver.session(); + // console.log('408 userGhid', req.user.ghInfo.id); + // console.log('409 req.body.project', req.body.projectId); + // dbSession + // .run( + // ` + // MATCH (project:Project) + // WHERE ID(project) = ${Number(req.body.project)} + // MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} + // MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} + // MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) + // DETACH DELETE group + // ` + // ) + // .then(() => { + // resolve(); + // dbSession.close(); + // }) + // .catch(err => { + // reject(err); + // dbSession.close(); + // }); + // }); + // }, + // Updates the db with data from the questionnaire. users: function addQuestionnaireData(req) { return new Promise((resolve, reject) => { From d5fc19b23d694464a856c2d0e5464dd805d4d5c7 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 14:51:48 -0800 Subject: [PATCH 088/105] Update deleteInterest api --- client/components/Project.jsx | 3 +- client/components/ProjectDetails.jsx | 88 +++++++++++++++++++--------- server/routes/api.js | 53 ++++++++--------- 3 files changed, 88 insertions(+), 56 deletions(-) diff --git a/client/components/Project.jsx b/client/components/Project.jsx index 835359b..760b45b 100644 --- a/client/components/Project.jsx +++ b/client/components/Project.jsx @@ -23,8 +23,7 @@ class Project extends React.Component { POSTprogress() { axios .post('/API/progress', { - projectId: this.props.project.id, - progress: this.props.progress + projectId: this.props.project.id }) .catch(console.error); } diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 20dbba4..184a731 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -17,25 +17,28 @@ class ProjectDetails extends React.Component { constructor(props) { super(props); this.state = { - interest: false, + interest: this.props.project.interested, open: false, - disableUsers: true, + disableUsers: !this.props.project.interested }; this.toggleInterest = this.toggleInterest.bind(this); this.handleOpen = this.handleOpen.bind(this); this.handleClose = this.handleClose.bind(this); this.clickHandler = this.clickHandler.bind(this); this.handleInterest = this.handleInterest.bind(this); - this.getUsers(); } + componentDidMount() { + console.log('ProjectDetails 31', this.props.project.interested); + } + getUsers() { axios .get('/API/users', { params: { - projectId: this.props.project.id, - }, + projectId: this.props.project.id + } }) .then(users => { this.props.addUsers(users.data); @@ -55,30 +58,60 @@ class ProjectDetails extends React.Component { /* dialog handler end */ toggleInterest() { - axios - .post('/API/projects', { - projectId: this.props.project.id, - }) - .then(response => { - this.props.dispatchInterest( - this.props.project.id, - this.props.project.interested, - ); - }) - .catch(error => { - console.log(error); - }); + //if wasnt interested, sent request for adding interests + console.log( + 'what was the original state???', + this.props.project.interested + ); + if (!this.props.project.interested) { + console.log('adding interest'); + axios + .post('/API/projects', { + projectId: this.props.project.id + }) + .then(response => { + this.props.project.interested = !this.props.project.interested; + this.props.dispatchInterest( + this.props.project.id, + this.props.project.interested + ); + }) + .catch(error => { + console.log(error); + }); + } else if (this.props.project.interested) { + console.log('deleting interest'); + axios + .post('/API/deleteInterest', { + projectId: this.props.project.id + }) + .then(response => { + this.props.project.interested = !this.props.project.interested; + console.log( + 'line82 afterDelete interest', + this.props.project.interested + ); + this.props.dispatchInterest( + this.props.project.id, + this.props.project.interested + ); + }) + .catch(error => { + console.log(error); + }); + } } handleInterest() { - this.props.project.interested = !this.props.project.interested; + // this.props.project.interested = !this.props.project.interested; + console.log('handleInterest ran'); this.toggleInterest(); } clickHandler() { - this.setState({ - disableUsers: false, - }); + // this.setState({ + // disableUsers: false + // }); this.handleInterest(); this.handleOpen(); } @@ -86,7 +119,7 @@ class ProjectDetails extends React.Component { render() { const actions = [ , - , + ]; return ( @@ -154,9 +187,10 @@ class ProjectDetails extends React.Component { const mapStateToProps = (state, props) => { const projectId = Number(props.routedProjectId); + console.log('ProjectDetails line157 project', state.projects); return { users: state.users, - project: state.projects.filter(project => project.id === projectId)[0], + project: state.projects.filter(project => project.id === projectId)[0] }; }; @@ -164,14 +198,14 @@ const mapDispatchToProps = dispatch => ({ addUsers: users => dispatch({ type: 'USERS_ADD', - users, + users }), dispatchInterest: (projectId, value) => dispatch({ type: 'CHANGE_PROJECT_INTEREST', projectId, - value, - }), + value + }) }); // connects the Store to ProjectDetails component diff --git a/server/routes/api.js b/server/routes/api.js index c478eff..495a86c 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -293,6 +293,32 @@ module.exports = { }); }, + deleteInterest: function deleteInterest(req) { + return new Promise((resolve, reject) => { + const dbSession = dbDriver.session(); + console.log('298 userGhid', req.user.ghInfo.id); + console.log('299 req.body.project', req.body.projectId); + dbSession + .run( + ` + MATCH (project:Project) + WHERE ID(project) = ${req.body.projectId} + MATCH (user:User) WHERE user.ghId = ${req.user.ghInfo.id} + MATCH (user)-[r:INTERESTED_IN]->(project:Project) + DELETE r + ` + ) + .then(() => { + resolve(); + dbSession.close(); + }) + .catch(err => { + reject(err); + dbSession.close(); + }); + }); + }, + // Sets requesting user as working on the project with project ID // with the user with the given user ID pair: function addPair(req) { @@ -402,33 +428,6 @@ module.exports = { }); }, - // deleteInterest: function deleteInterest(req) { - // return new Promise((resolve, reject) => { - // const dbSession = dbDriver.session(); - // console.log('408 userGhid', req.user.ghInfo.id); - // console.log('409 req.body.project', req.body.projectId); - // dbSession - // .run( - // ` - // MATCH (project:Project) - // WHERE ID(project) = ${Number(req.body.project)} - // MATCH (user:User) WHERE user.ghId = ${Number(req.user.ghInfo.id)} - // MATCH (pair:User) WHERE ID(pair) = ${Number(req.body.partnered)} - // MERGE (user)-[:PAIRED_WITH]->(group:Group)<-[:PAIRED_WITH]-(pair) - // DETACH DELETE group - // ` - // ) - // .then(() => { - // resolve(); - // dbSession.close(); - // }) - // .catch(err => { - // reject(err); - // dbSession.close(); - // }); - // }); - // }, - // Updates the db with data from the questionnaire. users: function addQuestionnaireData(req) { return new Promise((resolve, reject) => { From 485d4f4f6bc4f53cfb83ebeda445474ae6b3bfe7 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 15:05:23 -0800 Subject: [PATCH 089/105] Add unInterested feature, temporary disable comfirmation --- client/components/ProjectDetails.jsx | 16 +++++----------- client/components/ProjectStatus.jsx | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 184a731..9443de4 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -29,10 +29,6 @@ class ProjectDetails extends React.Component { this.getUsers(); } - componentDidMount() { - console.log('ProjectDetails 31', this.props.project.interested); - } - getUsers() { axios .get('/API/users', { @@ -58,23 +54,20 @@ class ProjectDetails extends React.Component { /* dialog handler end */ toggleInterest() { - //if wasnt interested, sent request for adding interests - console.log( - 'what was the original state???', - this.props.project.interested - ); + // if wasnt interested, sent request for adding interests if (!this.props.project.interested) { console.log('adding interest'); axios .post('/API/projects', { projectId: this.props.project.id }) - .then(response => { + .then(() => { this.props.project.interested = !this.props.project.interested; this.props.dispatchInterest( this.props.project.id, this.props.project.interested ); + window.location.reload(); // REACT needs this after a POST }) .catch(error => { console.log(error); @@ -95,6 +88,7 @@ class ProjectDetails extends React.Component { this.props.project.id, this.props.project.interested ); + window.location.reload(); // REACT needs this after a POST }) .catch(error => { console.log(error); @@ -113,7 +107,7 @@ class ProjectDetails extends React.Component { // disableUsers: false // }); this.handleInterest(); - this.handleOpen(); + // this.handleOpen(); } render() { diff --git a/client/components/ProjectStatus.jsx b/client/components/ProjectStatus.jsx index 443fe54..5a6dc3b 100644 --- a/client/components/ProjectStatus.jsx +++ b/client/components/ProjectStatus.jsx @@ -51,7 +51,7 @@ class ProjectStatus extends React.Component { this.handleDiaLogOpen = this.handleDiaLogOpen.bind(this); this.handleDiaLogClose = this.handleDiaLogClose.bind(this); this.handleMessegeSubmit = this.handleMessegeSubmit.bind(this); - this.handlePartenerList = this.handlePartenerList.bind(this); + // this.handlePartenerList = this.handlePartenerList.bind(this); socket.on('chat message', msg => this.renderMessages(msg)); } From 43860485e29f10ecc545183e076687a7b3bc6c36 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Wed, 6 Dec 2017 15:07:25 -0800 Subject: [PATCH 090/105] Update temporary add dialog back --- client/components/ProjectDetails.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index 9443de4..cf8c0d1 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -107,7 +107,7 @@ class ProjectDetails extends React.Component { // disableUsers: false // }); this.handleInterest(); - // this.handleOpen(); + this.handleOpen(); } render() { From a0ff32e2d6c95416dd055c47e1a0421aaf9ba599 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Tue, 5 Dec 2017 19:09:58 -0800 Subject: [PATCH 091/105] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 994caa9..840f28b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitPal -> GitPal is an application forked from GitBud that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. +> GitPal is an application that was forked from GitBud that allows users to connect with others who are either at the same level or higher to work on open source projects. Users can view current projects, interested users, and pair up to work on a project together. ![Alt text](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/c6/610187/7b1e3bb1d52fba7f60c382df3dc03a0b-original.png) From 7537fc357f1068767c98b2b2eb9dd7e34cb81fe8 Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 6 Dec 2017 16:59:24 -0800 Subject: [PATCH 092/105] Add props and readd icon to app drawer --- client/components/App.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/App.jsx b/client/components/App.jsx index c5dfb26..8729ac5 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -1,4 +1,5 @@ /* eslint no-console:0 */ + /* This is the main (parent) component for the application. From 26c35803fde6a67a450bf6df40c046158531addd Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 6 Dec 2017 20:28:05 -0800 Subject: [PATCH 093/105] Move octocat to assets and webpack --- client/assets/octocat.bmp | Bin 0 -> 2128138 bytes client/components/Landing.jsx | 3 ++- package.json | 3 ++- webpack.config.js | 20 ++++++++++++++------ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 client/assets/octocat.bmp diff --git a/client/assets/octocat.bmp b/client/assets/octocat.bmp new file mode 100644 index 0000000000000000000000000000000000000000..48d277b988bd48b578ed4eb3dc5471d659407ff3 GIT binary patch literal 2128138 zcmeF42bdJa)`s1jGwi~Wc8N>Qf*?rFIVSpy3-*I{--&rHvB^~}ffEIpy8yXvh|Rp;xfQ&p>JGs`PR_@oo zQ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UADQ_8RkW1wU{)pV3i%GgiJ z+a@O`=WAI5`F*(;{T$XF!+NM##}@q-`0m-Yu91u4yJ44hAkx<<--rF8t$4fYi`Pv8 zBtQZrpgsZ4K@YB9!<(nTp3rG&X-`P)YcV!PeUb~L`U-#?@WDdd-%&WGvNO*B15FrBc zUAhzBDYiMD+Z(D&L`0hQviw8O(do*;CHIPmZ5jQ_h0wfRs0et81-D4Z&y^R7N>`fT}TE3M8NPq-L zfCQpOK*kGKWo-8x+p*^a_AH261@XirKmz|K`=wqgbJT~it@7MfVSQ*yg#<`|1W14c zbRi)7xy@r-uNc>59sMz~5B1-5sY8~N1nfWnd$Vx=!isGb+HPsX=h~tEd5t7M0wh2J z)**m>E0}+j#dO(|agyv$cZ+pumsdgp)+2!LDE6FZyH(b1VXlnzYMEC=0wh2JBw%F% zviI{p?HMAOU{}V7)ByZ$SytWa z3wtSJj=ii;d75h6SsoG~f$$N){vkOzx!+rLe5thAM`f?Z-0%_Pkx76ANPq-LAiM-* z+`?ch-7739DP5Y8k@1S;R_Wm-$D@+~38+j!+JH=H3tp8rVY!vsIJDU+b7$E|fCNZ@ z1W3Raf%NqBXLXOwazF66>>1cw#)01~*Bk5Wn)x~jkbtcS#HOUA+#&P721;9TLihGg z+U%!nReQWx5+DH*AOXt}KtH~&W3Wm~tFFz;%Kl8oSXHxJ#qfeifCNk@fbp1UGoJFk%hNI*>j$VIT0USVP3NNJm*zNd(^(e2eF#Zr*~36KB@ zkU($*urGKt@(-B@x+*s}uVqR~>fLg0FC)0p^HU^10wfSV0x>bM*{P|i_vhv1wZ^&^ z(P%4^l9I0v-xc!6BtQZrKmsHX6#_BXJ0sk2RnDN#XdEqP+36KB@gg^k}MWuh_K3UuMlY)YRUefk0LmOyTdx|zRgyQj| zBtQZrKmsJ7ECCt+l!bnY+}zwBFb|`oq+~(Ws?|1296jn9N9F&+^86OWSj^MJ`n@?h zxy> - +

                      diff --git a/package.json b/package.json index f19b245..f9d7286 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,11 @@ "devDependencies": { "eslint": "^4.12.1", "eslint-config-airbnb": "^15.1.0", + "eslint-config-prettier": "2.1.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-react": "^7.2.0", - "eslint-config-prettier": "2.1.1", + "file-loader": "^1.1.5", "webpack-dev-middleware": "^1.12.0", "webpack-dev-server": "^2.7.1", "webpack-hot-middleware": "^2.18.2" diff --git a/webpack.config.js b/webpack.config.js index 9bb6cae..cc1f90c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,13 +15,21 @@ module.exports = { extensions: ['.js', '.jsx'] }, module: { - loaders: [ + rules: [ { - test: /\.jsx?$/, - loader: 'babel-loader', - exclude: /node_modules/ - } - ] + test: /\.(js|jsx)$/, + exclude: /node_modules/, + use: [ + 'babel-loader', + ], + }, + { + test: /\.(png|jpg|gif|bmp)$/, + use: [ + 'file-loader', + ], + }, + ], }, devServer: { contentBase: path.join(__dirname, '/dist'), From b42810e6947c0aa2e956a692871006b91c836a8e Mon Sep 17 00:00:00 2001 From: Rick Gallegos Date: Wed, 6 Dec 2017 20:34:10 -0800 Subject: [PATCH 094/105] Update gitignore to ignore bmp file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d54406e..19acf05 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist/bundle.js npm-debug.log .env *hot-update* +c855bcf167bb6f333cfe6dfb9f3771ba.bmp From f8dd99d6c6c4d46fba24a4a5824c1864257e07b9 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Fri, 8 Dec 2017 17:51:22 -0800 Subject: [PATCH 095/105] Update lock file --- package-lock.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package-lock.json b/package-lock.json index 51aa0d9..1093f64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2520,6 +2520,16 @@ "object-assign": "4.1.1" } }, + "file-loader": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.5.tgz", + "integrity": "sha512-RzGHDatcVNpGISTvCpfUfOGpYuSR7HSsSg87ki+wF6rw1Hm0RALPTiAdsxAq1UwLf0RRhbe22/eHK6nhXspiOQ==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "schema-utils": "0.3.0" + } + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -5754,6 +5764,15 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "5.2.2" + } + }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", From bc7a185428fa2967c339b4f60873881c0af670ef Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Fri, 8 Dec 2017 17:53:10 -0800 Subject: [PATCH 096/105] Update process.env --- server/db/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/db/index.js b/server/db/index.js index 6798bfa..3a7f391 100644 --- a/server/db/index.js +++ b/server/db/index.js @@ -33,13 +33,14 @@ */ // import neo4 driver +require('dotenv').config(); const neo4j = require('neo4j-driver').v1; // set variables to connect const url = process.env.GRAPHENEDB_BOLT_URL || 'bolt://localhost'; const username = - process.env.GRAPHENEDB_BOLT_USERNAME || process.env.NEO4J_USERNAME || 'neo4j'; + process.env.GRAPHENEDB_BOLT_USERNAME || process.env.NEO4J_USERNAME; const password = - process.env.GRAPHENEDB_BOLT_PASSWORD || process.env.NEO4J_PASSWORD || 'neo'; + process.env.GRAPHENEDB_BOLT_PASSWORD || process.env.NEO4J_PASSWORD; // connect and create session exports.driver = neo4j.driver(url, neo4j.auth.basic(username, password)); From b4e34a08f8b6afc330c8c9486c08dd85d9872b11 Mon Sep 17 00:00:00 2001 From: Sonrisa Date: Fri, 22 Dec 2017 10:15:16 -0800 Subject: [PATCH 097/105] Update env file --- client/components/ProjectDetails.jsx | 4 ++-- client/components/ProjectStatus.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/components/ProjectDetails.jsx b/client/components/ProjectDetails.jsx index cf8c0d1..9144242 100644 --- a/client/components/ProjectDetails.jsx +++ b/client/components/ProjectDetails.jsx @@ -164,9 +164,9 @@ class ProjectDetails extends React.Component { open={this.state.open} onRequestClose={this.handleClose} > - {this.props.project.interested + {/* {this.props.project.interested ? 'Choose a partner!' - : 'Are you sure?'} + : 'Are you sure?'} */} -
                        hey
                      +