From f54dffbf9bff951513e52ae9f051f7d5a8bdaf7d Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 19 Jan 2017 07:54:12 -0800 Subject: [PATCH 1/4] Code cleanup --- client/Components/Login.jsx | 8 +++---- client/Components/PickADatePage/PickADate.jsx | 24 +++++++++---------- server/routes/primary.js | 2 +- server/server.js | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client/Components/Login.jsx b/client/Components/Login.jsx index 9c3efba..fb23b1a 100644 --- a/client/Components/Login.jsx +++ b/client/Components/Login.jsx @@ -19,7 +19,7 @@ class Login extends React.Component { url: '/user?accountName=' + this.state.accountName, success: function(data) { var parsed = JSON.parse(data); - if (parsed.notFound){ + if (parsed.notFound) { // user was not found in database, post them to db $.ajax({ method: 'POST', @@ -29,13 +29,13 @@ class Login extends React.Component { success: function(success) { this.props.handleLogin(accountName); }.bind(this) - }) + }); } else { // user was found, login using the accountName this.props.handleLogin(accountName); } }.bind(this) - }) + }); } userSignup(accountName) { @@ -66,7 +66,7 @@ class Login extends React.Component { Submit - ) + ); } } diff --git a/client/Components/PickADatePage/PickADate.jsx b/client/Components/PickADatePage/PickADate.jsx index 961c311..509ef40 100644 --- a/client/Components/PickADatePage/PickADate.jsx +++ b/client/Components/PickADatePage/PickADate.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import Nav from '../nav.jsx' +import Nav from '../nav.jsx'; import Calendar from 'rc-calendar'; import FeatureNavigation from '../FeatureNavigation.jsx'; import Moment from 'moment'; @@ -8,11 +8,11 @@ import $ from 'jquery'; class PickADate extends React.Component { constructor (props) { - super(props) + super(props); this.state = { dates: [], date: null - } + }; this.selectNewDate = this.selectNewDate.bind(this); this.updateList = this.updateList.bind(this); this.postNewDate = this.postNewDate.bind(this); @@ -35,14 +35,14 @@ class PickADate extends React.Component { dates: dates }); } - }) + }); } selectNewDate (dateInfo) { var date = dateInfo.date(); var month = dateInfo.month(); var year = dateInfo.year(); - var time = prompt('Please select a time for ' + month + '/' + date + '/' + year) + var time = prompt('Please select a time for ' + month + '/' + date + '/' + year); var completeDate = month + '/' + date + '/' + year + ' ' + time; var postInfo = { @@ -51,9 +51,9 @@ class PickADate extends React.Component { eventName: this.props.featuredEvent.name, description: this.props.featuredEvent.description, where: this.props.featuredEvent.where - } + }; // gather info then send it to database - this.postNewDate(postInfo) + this.postNewDate(postInfo); } postNewDate (postInfo) { @@ -64,9 +64,9 @@ class PickADate extends React.Component { data: postInfo, success: function (data) { // when you successfully suggest a new time, update list on screen - context.updateList() + context.updateList(); } - }) + }); } @@ -75,12 +75,12 @@ class PickADate extends React.Component { 'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'center', - } + }; const titleStyle = { 'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'center' - } + }; return (
@@ -116,7 +116,7 @@ class PickADate extends React.Component { />
- ) + ); } } diff --git a/server/routes/primary.js b/server/routes/primary.js index 288162f..4c9ab30 100644 --- a/server/routes/primary.js +++ b/server/routes/primary.js @@ -123,7 +123,7 @@ module.exports = function(app){ var eventName = '"' + req.body.eventName + '"'; var parsedName = JSON.parse(accountName); - + var queryString ='INSERT INTO eventattendees (eventId, userId) \ SELECT \ event.id, user.id \ diff --git a/server/server.js b/server/server.js index 27e076a..e0c1e59 100644 --- a/server/server.js +++ b/server/server.js @@ -27,7 +27,7 @@ app.use(webpackDevMiddleware(compiler, { historyApiFallback: true, })); -app.use(express.static(path.join(__dirname,'../dist'))); +app.use(express.static(path.join(__dirname, '../dist'))); //serve node_modules via the '/script' virtual file path app.use('/scripts', express.static(path.join(__dirname, '../node_modules'))); From e6dbb08959153e8b87396a41c97bd755e0913f39 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 10 Feb 2017 00:13:48 -0800 Subject: [PATCH 2/4] Add README.md --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 README.md diff --git a/README.md b/README.md new file mode 100755 index 0000000..43040aa --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# Project Name + +PlanThis is a collaborative event planner designed to make group event-planning easy. Sign-in to your group's channel, create an event, and start planning details! + +## Team + + - __Product Owner__: Jenn Kao + - __Scrum Master__: Vivian Zhang + - __Development Team Members__: Adam Jung, Anton Arboleda, Wells Tsai, Tim Chin, Nick Wang + +## Table of Contents + +1. [Usage](#Usage) +1. [Requirements](#requirements) +1. [Development](#development) + 1. [Installing Dependencies](#installing-dependencies) + 1. [Tasks](#tasks) +1. [Team](#team) +1. [Contributing](#contributing) + +## Usage + +> Some usage instructions + +## Requirements + +- Node 0.10.x +- Redis 2.6.x +- Postgresql 9.1.x +- etc +- etc + +## Development + +### Installing Dependencies + +From within the root directory: + +```sh +npm install +``` + +### Roadmap + +View the project roadmap [here](LINK_TO_PROJECT_ISSUES) + + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. From 5072c8e5665dd447d3a3b8b92b791bf158fa5e79 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 10 Feb 2017 00:14:38 -0800 Subject: [PATCH 3/4] Add title --- README.md | 2 +- _README.md | 50 -------------------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100755 _README.md diff --git a/README.md b/README.md index 43040aa..19d9621 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Project Name +# PlanThis PlanThis is a collaborative event planner designed to make group event-planning easy. Sign-in to your group's channel, create an event, and start planning details! diff --git a/_README.md b/_README.md deleted file mode 100755 index b3be733..0000000 --- a/_README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Project Name - -Friends is a collaborative event planner designed to make group event-planning easy. Sign-in to your group's channel, create an event, and start planning details! - -## Team - - - __Product Owner__: Jenn Kao - - __Scrum Master__: Vivian Zhang - - __Development Team Members__: Wells Tsai, Tim Chin - -## Table of Contents - -1. [Usage](#Usage) -1. [Requirements](#requirements) -1. [Development](#development) - 1. [Installing Dependencies](#installing-dependencies) - 1. [Tasks](#tasks) -1. [Team](#team) -1. [Contributing](#contributing) - -## Usage - -> Some usage instructions - -## Requirements - -- Node 0.10.x -- Redis 2.6.x -- Postgresql 9.1.x -- etc -- etc - -## Development - -### Installing Dependencies - -From within the root directory: - -```sh -npm install -``` - -### Roadmap - -View the project roadmap [here](LINK_TO_PROJECT_ISSUES) - - -## Contributing - -See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. From 28e8cb08d12a6104a2bb9cb9d7297124b765e428 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 10 Feb 2017 00:18:31 -0800 Subject: [PATCH 4/4] Add press release --- CONTRIBUTING.md | 181 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100755 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100755 index 0000000..8398342 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,181 @@ +# Contributing + +## General Workflow + +1. Fork the repo +1. Cut a namespaced feature branch from master + - bug/... + - feat/... + - test/... + - doc/... + - refactor/... +1. Make commits to your feature branch. Prefix each commit like so: + - (feat) Added a new feature + - (fix) Fixed inconsistent tests [Fixes #0] + - (refactor) ... + - (cleanup) ... + - (test) ... + - (doc) ... +1. When you've finished with your fix or feature, Rebase upstream changes into your branch. submit a [pull request][] + directly to master. Include a description of your changes. +1. Your pull request will be reviewed by another maintainer. The point of code + reviews is to help keep the codebase clean and of high quality and, equally + as important, to help you grow as a programmer. If your code reviewer + requests you make a change you don't understand, ask them why. +1. Fix any issues raised by your code reviwer, and push your fixes as a single + new commit. +1. Once the pull request has been reviewed, it will be merged by another member of the team. Do not merge your own commits. + +## Detailed Workflow + +### Fork the repo + +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/reactorcore/.git +``` + +### Cut a namespaced feature branch from master + +Your branch should follow this naming convention: + - bug/... + - feat/... + - test/... + - doc/... + - refactor/... + +These commands will help you do this: + +``` bash + +# Creates your branch and brings you there +git checkout -b `your-branch-name` +``` + +### Make commits to your feature branch. + +Prefix each commit like so + - (feat) Added a new feature + - (fix) Fixed inconsistent tests [Fixes #0] + - (refactor) ... + - (cleanup) ... + - (test) ... + - (doc) ... + +Make changes and commits on your branch, and make sure that you +only make changes that are relevant to this branch. If you find +yourself making unrelated changes, make a new branch for those +changes. + +#### Commit Message Guidelines + +- Commit messages should be written in the present tense; e.g. "Fix continuous + integration script". +- The first line of your commit message should be a brief summary of what the + commit changes. Aim for about 70 characters max. Remember: This is a summary, + not a detailed description of everything that changed. +- If you want to explain the commit in more depth, following the first line should + be a blank line and then a more detailed description of the commit. This can be + as detailed as you want, so dig into details here and keep the first line short. + +### Rebase upstream changes into your branch + +Once you are done making changes, you can begin the process of getting +your code merged into the main repo. Step 1 is to rebase upstream +changes to the master branch into yours by running this command +from your branch: + +```bash +git pull --rebase upstream master +``` + +This will start the rebase process. You must commit all of your changes +before doing this. If there are no conflicts, this should just roll all +of your changes back on top of the changes from upstream, leading to a +nice, clean, linear commit history. + +If there are conflicting changes, git will start yelling at you part way +through the rebasing process. Git will pause rebasing to allow you to sort +out the conflicts. You do this the same way you solve merge conflicts, +by checking all of the files git says have been changed in both histories +and picking the versions you want. Be aware that these changes will show +up in your pull request, so try and incorporate upstream changes as much +as possible. + +You pick a file by `git add`ing it - you do not make commits during a +rebase. + +Once you are done fixing conflicts for a specific commit, run: + +```bash +git rebase --continue +``` + +This will continue the rebasing process. Once you are done fixing all +conflicts you should run the existing tests to make sure you didn’t break +anything, then run your new tests (there are new tests, right?) and +make sure they work also. + +If rebasing broke anything, fix it, then repeat the above process until +you get here again and nothing is broken and all the tests pass. + +### Make a pull request + +Make a clear pull request from your fork and branch to the upstream master +branch, detailing exactly what changes you made and what feature this +should add. The clearer your pull request is the faster you can get +your changes incorporated into this repo. + +At least one other person MUST give your changes a code review, and once +they are satisfied they will merge your changes into upstream. Alternatively, +they may have some requested changes. You should make more commits to your +branch to fix these, then follow this process again from rebasing onwards. + +Once you get back here, make a comment requesting further review and +someone will look at your code again. If they like it, it will get merged, +else, just repeat again. + +Thanks for contributing! + +### Guidelines + +1. Uphold the current code standard: + - Keep your code [DRY][]. + - Apply the [boy scout rule][]. + - Follow [STYLE-GUIDE.md](STYLE-GUIDE.md) +1. Run the [tests][] before submitting a pull request. +1. Tests are very, very important. Submit tests if your pull request contains + new, testable behavior. +1. Your pull request is comprised of a single ([squashed][]) commit. + +## Checklist: + +This is just to help you organize your process + +- [ ] Did I cut my work branch off of master (don't cut new branches from existing feature brances)? +- [ ] Did I follow the correct naming convention for my branch? +- [ ] Is my branch focused on a single main change? + - [ ] Do all of my changes directly relate to this change? +- [ ] Did I rebase the upstream master branch after I finished all my + work? +- [ ] Did I write a clear pull request message detailing what changes I made? +- [ ] Did I get a code review? + - [ ] Did I make any requested changes from that code review? + +If you follow all of these guidelines and make good changes, you should have +no problem getting your changes merged in. + + + +[style guide]: https://github.com/reactorcore/style-guide +[n-queens]: https://github.com/reactorcore/n-queens +[Underbar]: https://github.com/reactorcore/underbar +[curriculum workflow diagram]: http://i.imgur.com/p0e4tQK.png +[cons of merge]: https://f.cloud.github.com/assets/1577682/1458274/1391ac28-435e-11e3-88b6-69c85029c978.png +[Bookstrap]: https://github.com/reactorcore/bookstrap +[Taser]: https://github.com/reactorcore/bookstrap +[tools workflow diagram]: http://i.imgur.com/kzlrDj7.png +[Git Flow]: http://nvie.com/posts/a-successful-git-branching-model/ +[GitHub Flow]: http://scottchacon.com/2011/08/31/github-flow.html +[Squash]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html