Skip to content

Commit

Permalink
Merge pull request #194 from labzero/develop
Browse files Browse the repository at this point in the history
Merge to master
  • Loading branch information
JeffreyATW authored May 2, 2018
2 parents a8bef23 + 9e0f5b2 commit 3668744
Show file tree
Hide file tree
Showing 19 changed files with 932 additions and 604 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
docker:
# image for running tests
- image: circleci/node:8.1-browsers
- image: circleci/node:9.11-browsers
environment:
- DB_NAME=lunch_test
- DB_USER=lunch_test
Expand Down Expand Up @@ -35,8 +35,6 @@ jobs:
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

# install deps
- run:
Expand Down Expand Up @@ -68,7 +66,7 @@ jobs:
command: |
echo 127.0.0.1 local.lunch.pink | sudo tee -a /etc/hosts
echo 127.0.0.1 integration-test.local.lunch.pink | sudo tee -a /etc/hosts
# build the app
- run:
name: build-release
Expand All @@ -91,6 +89,9 @@ jobs:
- store_artifacts:
path: ~/repo/junit

- store_artifacts:
path: ~/repo/screenshots

build:
docker:
- image: ${BUILD_IMAGE}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ package-lock.json
.env.test
deploy.sh
test-results.xml
screenshots
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8.1
FROM node:9.11-alpine

# Set a working directory
WORKDIR /usr/src/app
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ For `GOOGLE_*` env variables:
* Enable the Google+ API, Contacts API, Google Maps JavaScript API, Google Places API Web Service, and Google Maps Geocoding API.
* Go to the Credentials section and create an OAuth client ID.
* For local development:
* Enter `http://local.lunch.pink:3000` as an authorized JavaScript origin
* Enter `http://local.lunch.pink:3000/login/google/callback` as an authorized redirect URI
* Enter `http://local.lunch.pink:3000` and `https://local.lunch.pink:3000` as authorized JavaScript origins
* Enter `http://local.lunch.pink:3000/login/google/callback` and `https://local.lunch.pink:3000/login/google/callback` as authorized redirect URIs
* Add your deployment target(s) as additional origins/redirect URIs.
* Go back to the Credentials section and create two API keys - one for the client, and one for the server.
* For the client, optionally limit requests to certain referrers.
Expand Down
22 changes: 22 additions & 0 deletions cert/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDljCCAn4CCQDKlarFMPQQbDANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMC
VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28x
ETAPBgNVBAoMCExhYiBaZXJvMRkwFwYDVQQDDBBsb2NhbC5sdW5jaC5waW5rMSIw
IAYJKoZIhvcNAQkBFhNqZWZmcmV5QGxhYnplcm8uY29tMB4XDTE4MDQyNjIxMjIy
NFoXDTE5MDQyNjIxMjIyNFowgYwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp
Zm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMREwDwYDVQQKDAhMYWIgWmVy
bzEZMBcGA1UEAwwQbG9jYWwubHVuY2gucGluazEiMCAGCSqGSIb3DQEJARYTamVm
ZnJleUBsYWJ6ZXJvLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ALtMxMSaciE+9/GPzOhtG8b9oeCSIIBKd8FY1JQ+s2ZUuDppA46hCzLjuhoHMuJe
hJKYlctZGDYVE2jRYCC/mdFN8jWfHE1sqp9AQ/qP6vsTvPpfmKcnu/x62TLPH7Zr
Nvwhiv18YxszvJQAhdGBW8geftMH8x9PfznQyzkIDTROeAZbnY29PxQTmVwx90o6
CKfLaBAX/Z6ZkFAMio8v3GGuW6bJMo+g7Lz0r2KzzZEZp7oUCP5tw1uvAjzO4XD5
6vNdjrBymrySza2qCM7UNbMEWExtMqvsUK6C5HcnT3PyWARaJH8G5wQpvFqNbW18
nQoh9owoa/hcYhxR2nBRQOECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAEZBXOlpz
xhrFUaVZKmPe3oKXCFhdjjVlaAPODmAOXCOEoErgxaUBd1i2Asps8NT14Wgi0wq9
5UQVWKUcJ7prGprIzECc4fSPU+qjZcfnXX9BFcIqcB2270HnjpD6M62eyqE3t4aX
QWBROgTFZI0Z0saVMV4RMS7/E/FBq7TxbCl1Nb+c0o4oHmcf6iORDDKBFrYfidc5
2cLYrWWDSUe/P6nuc9JpDjSFbPSzS7HsDtq4opJfZccd9xRYN3UnkTgbAZLvEYas
RFTPTkPpwq4ZVB8WdvxAKigiTpt/iXDKMVNxtR50csnjVG4kb9w56xdrhZRgvEeQ
n3wxTZFWub4ecg==
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions cert/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAu0zExJpyIT738Y/M6G0bxv2h4JIggEp3wVjUlD6zZlS4OmkD
jqELMuO6Ggcy4l6EkpiVy1kYNhUTaNFgIL+Z0U3yNZ8cTWyqn0BD+o/q+xO8+l+Y
pye7/HrZMs8ftms2/CGK/XxjGzO8lACF0YFbyB5+0wfzH09/OdDLOQgNNE54Blud
jb0/FBOZXDH3SjoIp8toEBf9npmQUAyKjy/cYa5bpskyj6DsvPSvYrPNkRmnuhQI
/m3DW68CPM7hcPnq812OsHKavJLNraoIztQ1swRYTG0yq+xQroLkdydPc/JYBFok
fwbnBCm8Wo1tbXydCiH2jChr+FxiHFHacFFA4QIDAQABAoIBAHUZCMfVu1bXtFHc
0oHZfQ1KksMA+LrcU8SYkcbg8G4gt1ElSGkKfCLjxvzw1To7V20DYltQp1dgk9Lr
W8r9nuABeFVX1Wz+bCnGFvn2sjUo4PQzgg+3QssVzub6IVx96VF2cx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b6CSTZ/bAcXSPDPwqI5lMsPRvCnVI=
-----END RSA PRIVATE KEY-----
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "web",
"name": "lunch",
"version": "1.0.0",
"private": true,
"engines": {
"node": ">=8.1",
"npm": ">=3.10"
"node": ">=9.11",
"npm": ">=5.0"
},
"browserslist": [">1%", "last 4 versions", "Firefox ESR", "not ie < 9"],
"dependencies": {
"@babel/polyfill": "^7.0.0-beta.42",
"@babel/polyfill": "^7.0.0-beta.44",
"bcrypt": "^1.0.3",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
Expand All @@ -18,7 +18,7 @@
"connect-flash": "^0.1.1",
"connect-session-sequelize": "^4.1.0",
"cookie-parser": "^1.4.3",
"core-js": "^2.5.3",
"core-js": "^2.5.4",
"cors": "^2.8.3",
"dotenv": "^2.0.0",
"eventemitter3": "^1.2.0",
Expand All @@ -36,12 +36,12 @@
"immutability-helper": "^2.1.2",
"isomorphic-fetch": "^2.2.1",
"isomorphic-style-loader": "^4.0.0",
"jsonwebtoken": "^8.2.0",
"jsonwebtoken": "^8.2.1",
"method-override": "^2.3.8",
"mocha-junit-reporter": "^1.17.0",
"moment": "^2.11.2",
"morgan": "^1.8.1",
"node-fetch": "^2.1.1",
"node-fetch": "^2.1.2",
"normalizr": "^3.2.2",
"passport": "^0.4.0",
"passport-google-oauth20": "^1.0.0",
Expand All @@ -51,11 +51,11 @@
"pretty-error": "^2.1.1",
"prop-types": "^15.6.1",
"query-string": "^6.0.0",
"react": "^16.2.0",
"react": "^16.3.1",
"react-addons-shallow-compare": "^15.4.2",
"react-autosuggest": "^9.3.1",
"react-bootstrap": "^0.31.0",
"react-dom": "^16.2.0",
"react-dom": "^16.3.1",
"react-flip-move": "^3.0.1",
"react-geosuggest": "^2.7.0",
"react-intl": "^2.3.0",
Expand All @@ -73,25 +73,25 @@
"robust-websocket": "^0.2.1",
"rotating-file-stream": "^1.2.1",
"sendgrid": "^5.2.3",
"sequelize": "^4.37.3",
"sequelize": "^4.37.6",
"sequelize-cli": "^3.2.0",
"serialize-javascript": "^1.4.0",
"source-map-support": "^0.5.4",
"sqlite3": "^4.0.0",
"universal-router": "^6.0.0",
"uuid": "^3.0.1",
"whatwg-fetch": "^2.0.3"
"whatwg-fetch": "^2.0.4"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.42",
"@babel/node": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.44",
"@babel/node": "^7.0.0-beta.44",
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.42",
"@babel/plugin-transform-react-constant-elements": "^7.0.0-beta.42",
"@babel/plugin-transform-react-inline-elements": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-flow": "^7.0.0-beta.42",
"@babel/preset-react": "^7.0.0-beta.42",
"@babel/preset-stage-2": "^7.0.0-beta.42",
"@babel/plugin-transform-react-constant-elements": "^7.0.0-beta.44",
"@babel/plugin-transform-react-inline-elements": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.44",
"@babel/preset-flow": "^7.0.0-beta.44",
"@babel/preset-react": "^7.0.0-beta.44",
"@babel/preset-stage-2": "^7.0.0-beta.44",
"@babel/register": "^7.0.0-beta.42",
"assets-webpack-plugin": "^3.5.1",
"autoprefixer": "^8.1.0",
Expand Down Expand Up @@ -119,14 +119,14 @@
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.0.0",
"es6-promise": "^4.1.0",
"eslint": "^4.19.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-loader": "^2.0.0",
"eslint-plugin-css-modules": "^2.7.5",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.7.0",
Expand All @@ -137,7 +137,7 @@
"husky": "^0.14.3",
"identity-obj-proxy": "^3.0.0",
"json-loader": "^0.5.4",
"lint-staged": "^7.0.0",
"lint-staged": "^7.0.4",
"mkdirp": "^0.5.1",
"mocha": "^5.0.0",
"node-sass": "^4.5.0",
Expand Down Expand Up @@ -165,30 +165,30 @@
"postcss-selector-not": "^3.0.1",
"prettier": "^1.11.1",
"proxyquire": "^1.7.11",
"puppeteer": "^1.1.1",
"puppeteer": "^1.3.0",
"raw-loader": "^0.5.1",
"react-deep-force-update": "^2.1.1",
"react-dev-utils": "^5.0.0",
"react-dev-utils": "^5.0.1",
"react-error-overlay": "^4.0.0",
"react-test-renderer": "^16.2.0",
"react-test-renderer": "^16.3.1",
"redux-mock-store": "^1.5.1",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"sequelize-mock": "^0.7.0",
"sinon": "^4.2.0",
"style-loader": "^0.13.2",
"stylelint": "^9.1.3",
"stylelint": "^9.2.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-order": "^0.8.1",
"supertest": "^3.0.0",
"svg-url-loader": "^2.3.2",
"url-loader": "^1.0.1",
"webpack": "^4.2.0",
"webpack-assets-manifest": "^2.0.0",
"webpack": "^4.5.0",
"webpack-assets-manifest": "^3.0.1",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-dev-middleware": "^3.0.1",
"webpack-dev-middleware": "^3.1.2",
"webpack-hot-middleware": "^2.21.2",
"webpack-node-externals": "^1.6.0"
"webpack-node-externals": "^1.7.2"
},
"lint-staged": {
"*.{js,jsx}": ["eslint --no-ignore --fix", "git add --force"],
Expand Down
23 changes: 14 additions & 9 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,29 @@ class Header extends Component {
static propTypes = {
flashes: PropTypes.array.isRequired,
loggedIn: PropTypes.bool.isRequired,
// eslint-disable-next-line react/no-unused-prop-types
path: PropTypes.string
};

static defaultProps = {
path: PropTypes.string
};

state = {
menuOpen: false
static getDerivedStateFromProps(nextProps, state) {
if (nextProps.path !== state.prevPath) {
return {
menuOpen: false,
prevPath: nextProps.path
}
}
return null;
};

componentWillReceiveProps(nextProps) {
if (!nextProps.path || nextProps.path !== this.props.path) {
this.setState({
menuOpen: false
});
}
}
state = {
menuOpen: false,
// eslint-disable-next-line react/no-unused-state
prevPath: null
};

flashContainers = () => {
const { flashes } = this.props;
Expand Down
13 changes: 5 additions & 8 deletions src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ class Layout extends Component {
insertCss: PropTypes.func.isRequired,
};

constructor(props, context) {
super(props);
this.removeCss = context.insertCss(s, globalCss);
}

getChildContext() {
const context = this.context;
return {
insertCss: context.insertCss || emptyFunction,
};
}

componentWillMount() {
this.removeCss = this.context.insertCss(s, globalCss);
}

componentDidUpdate() {
if (this.props.shouldScrollToTop) {
if (canUseDOM) {
Expand All @@ -66,10 +67,6 @@ class Layout extends Component {
}
}

componentWillUnmount() {
this.removeCss();
}

render() {
const { confirmShown, isHome, path } = this.props;

Expand Down
2 changes: 1 addition & 1 deletion src/components/PastDecisionsModal/PastDecisionsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PastDecisionsModal extends Component {
return (
<Modal show={shown} onHide={hideModal}>
<ModalHeader>
We went here...
We ate here...
</ModalHeader>
<ModalBody>
<FormControl
Expand Down
2 changes: 1 addition & 1 deletion src/components/RestaurantDecision/RestaurantDecision.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import s from './RestaurantDecision.scss';
// TODO return null when upgrading to React 15
const RestaurantDecision = ({ id, votes, decided, loggedIn, handleClick }) => {
const tooltip = (
<Tooltip id={`restaurantDecisionTooltip_${id}`}>We went here{decided ? '!' : '?'}</Tooltip>
<Tooltip id={`restaurantDecisionTooltip_${id}`}>We ate here{decided ? '!' : '?'}</Tooltip>
);

return ((loggedIn && votes.length > 0) || decided) &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/RestaurantDropdown/RestaurantDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const RestaurantDropdown = ({
} else {
decideButton = (
<MenuItem onSelect={showPastDecisionsModal} key={`restaurantDropdown_${restaurant.id}_showPastDecisionsModal`}>
We went here...
We ate here...
</MenuItem>
);
}
Expand Down
9 changes: 3 additions & 6 deletions src/components/RestaurantMap/RestaurantMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,17 @@ class RestaurantMap extends Component {
});
}

componentWillReceiveProps(nextProps) {
if (nextProps.center !== undefined) {
componentDidUpdate() {
if (this.props.center !== undefined) {
this.props.clearCenter();

if (nextProps.tempMarker === undefined) {
if (this.props.tempMarker === undefined) {
// offset by infowindow height after recenter
setTimeout(() => {
this.map.panBy(0, -100);
});
}
}
}

componentDidUpdate() {
if (this.props.newlyAddedRestaurant !== undefined) {
this.props.showNewlyAddedInfoWindow();
}
Expand Down
Binary file modified src/routes/main/landing/decide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3668744

Please sign in to comment.