From 5fb7991a7de0c5247b5251ef2137995a9cfc7ed0 Mon Sep 17 00:00:00 2001 From: Jeffrey Carl Faden Date: Mon, 7 May 2018 15:29:46 -0700 Subject: [PATCH 1/5] Add new Chrome 58+-approved cert --- cert/server.crt | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/cert/server.crt b/cert/server.crt index b35a0ae17..1103cc7e5 100644 --- a/cert/server.crt +++ b/cert/server.crt @@ -1,22 +1,18 @@ -----BEGIN CERTIFICATE----- -MIIDljCCAn4CCQDKlarFMPQQbDANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMC -VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28x -ETAPBgNVBAoMCExhYiBaZXJvMRkwFwYDVQQDDBBsb2NhbC5sdW5jaC5waW5rMSIw -IAYJKoZIhvcNAQkBFhNqZWZmcmV5QGxhYnplcm8uY29tMB4XDTE4MDQyNjIxMjIy -NFoXDTE5MDQyNjIxMjIyNFowgYwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp -Zm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMREwDwYDVQQKDAhMYWIgWmVy -bzEZMBcGA1UEAwwQbG9jYWwubHVuY2gucGluazEiMCAGCSqGSIb3DQEJARYTamVm -ZnJleUBsYWJ6ZXJvLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ALtMxMSaciE+9/GPzOhtG8b9oeCSIIBKd8FY1JQ+s2ZUuDppA46hCzLjuhoHMuJe -hJKYlctZGDYVE2jRYCC/mdFN8jWfHE1sqp9AQ/qP6vsTvPpfmKcnu/x62TLPH7Zr -Nvwhiv18YxszvJQAhdGBW8geftMH8x9PfznQyzkIDTROeAZbnY29PxQTmVwx90o6 -CKfLaBAX/Z6ZkFAMio8v3GGuW6bJMo+g7Lz0r2KzzZEZp7oUCP5tw1uvAjzO4XD5 -6v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jaC5waW5rMA0GCSqGSIb3DQEBCwUAA4IB +AQCqystbK46mhrfCWKnS2qlCkuU1YT8xGaOFqb8/f+rNq6UonIZ38vcHUn4k9UcT +HYhVkul36YK85KMq9E6tlmuGxgl8hg021bPgi/0Y8x/4EAWIVYM2IARQhIgEa5+F +30u4Rf+OZhjt4EQ4QUoyOynXLrA2sFnzApeFYhmDwXtkB9umECSF1CLDc8l+zLZB +utBZwdzVSHs8atnZTdCLHwo42egWJVecA8CbNuQZ0PCEF7hmMoVH9Iln1Fvidhp3 +gwI/NnK7fZUWEee4nuinX2OIybPtofkfXjxljcC8bubslmceAjc4rSxGwuY61lvN +B8NDHd+xb30jLmlnr5x+pq7l -----END CERTIFICATE----- From 8e9fcfcef4f0bf557edfe7d71e5979eb0549f11a Mon Sep 17 00:00:00 2001 From: Jeffrey Carl Faden Date: Mon, 7 May 2018 16:41:57 -0700 Subject: [PATCH 2/5] Move Google Maps touch warning above map markers --- src/styles/globalCss.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/styles/globalCss.scss b/src/styles/globalCss.scss index df1cf3e3d..2ce0950b9 100644 --- a/src/styles/globalCss.scss +++ b/src/styles/globalCss.scss @@ -92,3 +92,9 @@ a { border-color: $border-color; } } + +// causes google maps touch warning to appear above markers +.gm-style-pbc { + z-index: 5 !important; + pointer-events: none; +} From 0535c2e3168e13e0414346477ceb41527866740f Mon Sep 17 00:00:00 2001 From: Jeffrey Carl Faden Date: Tue, 8 May 2018 11:18:04 -0700 Subject: [PATCH 3/5] Update page titles and description --- src/components/ErrorPage/ErrorPage.js | 2 +- src/routes/helpers/render404.js | 2 +- src/routes/helpers/rootAction.js | 4 +++- src/routes/login/index.js | 1 + src/routes/main/invitation/create/index.js | 1 + src/routes/main/invitation/new/index.js | 1 + src/routes/main/landing/index.js | 1 + src/routes/main/new-team/index.js | 2 +- src/routes/main/password/create/index.js | 1 + src/routes/main/password/edit/index.js | 1 + src/routes/main/password/new/index.js | 1 + src/routes/main/teams/index.js | 1 + src/routes/main/users/create/index.js | 1 + src/routes/main/users/new/index.js | 3 ++- src/server.js | 2 +- test/integration/other.spec.js | 2 +- 16 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/ErrorPage/ErrorPage.js b/src/components/ErrorPage/ErrorPage.js index ca40c3b60..0ea869b5b 100644 --- a/src/components/ErrorPage/ErrorPage.js +++ b/src/components/ErrorPage/ErrorPage.js @@ -18,7 +18,7 @@ export function ErrorPage({ error }) { let errorMessage = null; if (error.status === 404) { - title = 'Page Not Found'; + title = 'Page not found'; content = 'Sorry, the page you were trying to view does not exist.'; } else if (process.env.NODE_ENV !== 'production') { errorMessage =
{error.stack}
; diff --git a/src/routes/helpers/render404.js b/src/routes/helpers/render404.js index eb8f388a6..6d2fe5a19 100644 --- a/src/routes/helpers/render404.js +++ b/src/routes/helpers/render404.js @@ -2,7 +2,7 @@ import React from 'react'; import LayoutContainer from '../../components/Layout/LayoutContainer'; import NotFound from '../not-found/NotFound'; -const title = 'Page Not Found'; +const title = 'Page not found'; export default (context) => ({ chunks: ['not-found'], diff --git a/src/routes/helpers/rootAction.js b/src/routes/helpers/rootAction.js index eb80e77ad..6dbf8d3f0 100644 --- a/src/routes/helpers/rootAction.js +++ b/src/routes/helpers/rootAction.js @@ -4,7 +4,9 @@ export default async ({ next }) => { // Provide default values for title, description etc. const title = 'Lunch'; - if (route.title) { + if (route.fullTitle) { + route.title = route.fullTitle; + } else if (route.title) { route.title = `${title} | ${route.title}`; } else { route.title = title; diff --git a/src/routes/login/index.js b/src/routes/login/index.js index a996300ac..902b4495d 100644 --- a/src/routes/login/index.js +++ b/src/routes/login/index.js @@ -25,6 +25,7 @@ function action(context) { ), + title: 'Log in', })); } diff --git a/src/routes/main/invitation/create/index.js b/src/routes/main/invitation/create/index.js index 2e88f9ac6..80a9fa419 100644 --- a/src/routes/main/invitation/create/index.js +++ b/src/routes/main/invitation/create/index.js @@ -27,5 +27,6 @@ export default (context) => { ), + title: 'Invitation', }; }; diff --git a/src/routes/main/invitation/new/index.js b/src/routes/main/invitation/new/index.js index 18bb55348..85421e844 100644 --- a/src/routes/main/invitation/new/index.js +++ b/src/routes/main/invitation/new/index.js @@ -20,5 +20,6 @@ export default (context) => { ), + title: 'Invitation', }; }; diff --git a/src/routes/main/landing/index.js b/src/routes/main/landing/index.js index a7cd3081b..8d06819b9 100644 --- a/src/routes/main/landing/index.js +++ b/src/routes/main/landing/index.js @@ -22,5 +22,6 @@ export default (context) => { ), + fullTitle: 'Lunch – Team voting for nearby restaurants', })); }; diff --git a/src/routes/main/new-team/index.js b/src/routes/main/new-team/index.js index db657a96d..4eba4748b 100644 --- a/src/routes/main/new-team/index.js +++ b/src/routes/main/new-team/index.js @@ -12,7 +12,7 @@ import LayoutContainer from '../../../components/Layout/LayoutContainer'; import renderIfHasName from '../../helpers/renderIfHasName'; import NewTeamContainer from './NewTeamContainer'; -const title = 'New Team'; +const title = 'New team'; export default (context) => renderIfHasName(context, () => ({ title, diff --git a/src/routes/main/password/create/index.js b/src/routes/main/password/create/index.js index 68ebf41f0..8a29b97c4 100644 --- a/src/routes/main/password/create/index.js +++ b/src/routes/main/password/create/index.js @@ -30,6 +30,7 @@ export default (context) => { ), + title: 'Reset password', }; }); }; diff --git a/src/routes/main/password/edit/index.js b/src/routes/main/password/edit/index.js index 86ff1ede3..6e5fd3432 100644 --- a/src/routes/main/password/edit/index.js +++ b/src/routes/main/password/edit/index.js @@ -30,6 +30,7 @@ export default (context) => { ), + title: 'Reset password', }; }); }; diff --git a/src/routes/main/password/new/index.js b/src/routes/main/password/new/index.js index fe9b01f33..44622b26c 100644 --- a/src/routes/main/password/new/index.js +++ b/src/routes/main/password/new/index.js @@ -23,5 +23,6 @@ export default (context) => { ), + title: 'Reset password', })); }; diff --git a/src/routes/main/teams/index.js b/src/routes/main/teams/index.js index 9258a285c..9aab8a387 100644 --- a/src/routes/main/teams/index.js +++ b/src/routes/main/teams/index.js @@ -8,4 +8,5 @@ import TeamsContainer from './TeamsContainer'; export default (context) => renderIfHasName(context, () => ({ chunks: ['teams'], component: , + title: 'My teams', })); diff --git a/src/routes/main/users/create/index.js b/src/routes/main/users/create/index.js index 078eb4fab..5aef6ecd0 100644 --- a/src/routes/main/users/create/index.js +++ b/src/routes/main/users/create/index.js @@ -23,6 +23,7 @@ export default (context) => { ), + title: 'New user', }; } diff --git a/src/routes/main/users/new/index.js b/src/routes/main/users/new/index.js index ca0946153..0f6c47390 100644 --- a/src/routes/main/users/new/index.js +++ b/src/routes/main/users/new/index.js @@ -24,7 +24,8 @@ export default (context) => { - ) + ), + title: 'New user', }; } diff --git a/src/server.js b/src/server.js index 9e87c6c76..81395ca28 100644 --- a/src/server.js +++ b/src/server.js @@ -358,7 +358,7 @@ const render = async (req, res, next) => { const data = { ...route, apikey: process.env.GOOGLE_CLIENT_APIKEY || '', title: route.title || 'Lunch', - description: 'An app for groups to decide on nearby lunch options.', + description: 'A simple lunch voting app for you and your team. Search nearby restaurants, add them to your list, vote for as many as you like, and decide on today’s pick!', body: '', root: generateUrl(req, req.get('host')), }; diff --git a/test/integration/other.spec.js b/test/integration/other.spec.js index 814c09ec1..e3854d27c 100644 --- a/test/integration/other.spec.js +++ b/test/integration/other.spec.js @@ -83,7 +83,7 @@ describe('other pages', () => { await page.goto('http://local.lunch.pink:3000/404'); await page.waitForSelector('#app', helpers.waitOptions); const content = await page.content(); - expect(content).to.contain('Page Not Found'); + expect(content).to.contain('Page not found'); }); }); }); From 78ee02b7cf0a7f1e86250f49df14bb0433245681 Mon Sep 17 00:00:00 2001 From: nyscherm Date: Tue, 15 May 2018 14:40:20 -0700 Subject: [PATCH 4/5] Add PWA features Add service worker with Workbox to allow caching of static assets and index page Expand on site.webmanifest --- .babelrc.js | 2 +- .env.sample | 3 + package.json | 3 +- public/site.webmanifest | 8 +- src/components/Html.js | 2 + src/server.js | 4 +- src/service-worker.js | 23 ++++++ tools/webpack.config.js | 10 ++- yarn.lock | 157 +++++++++++++++++++++++++++++++++++++++- 9 files changed, 201 insertions(+), 11 deletions(-) create mode 100644 src/service-worker.js diff --git a/.babelrc.js b/.babelrc.js index 92e416027..8dad6ed0a 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -22,7 +22,7 @@ module.exports = { }, }, ], - '@babel/preset-stage-2', + ["@babel/preset-stage-2", { "decoratorsLegacy": true }], '@babel/preset-flow', '@babel/preset-react', ], diff --git a/.env.sample b/.env.sample index 324ffe812..2d528adad 100644 --- a/.env.sample +++ b/.env.sample @@ -31,3 +31,6 @@ HONEYBADGER_API_KEY= # SendGrid info for email notifications SENDGRID_API_KEY= + +# Set as true to run https locally, add self-signed certificate in cert folder to trusted certificates +USE_HTTPS= diff --git a/package.json b/package.json index e941b0eb2..1f8e5e27b 100644 --- a/package.json +++ b/package.json @@ -188,7 +188,8 @@ "webpack-bundle-analyzer": "^2.11.1", "webpack-dev-middleware": "^3.1.2", "webpack-hot-middleware": "^2.21.2", - "webpack-node-externals": "^1.7.2" + "webpack-node-externals": "^1.7.2", + "workbox-webpack-plugin": "^3.2.0" }, "lint-staged": { "*.{js,jsx}": ["eslint --no-ignore --fix", "git add --force"], diff --git a/public/site.webmanifest b/public/site.webmanifest index 3992b48d7..4b8c7661e 100644 --- a/public/site.webmanifest +++ b/public/site.webmanifest @@ -1,4 +1,7 @@ { + "short_name": "Lunch", + "name": "Lunch", + "description": "An app for groups to decide on nearby lunch options.", "icons": [ { "src": "icon.png", @@ -6,5 +9,8 @@ "type": "image/png" } ], - "start_url": "/" + "start_url": "/", + "display": "standalone", + "theme_color": "#FFC0CB", + "background_color": "#FFF" } diff --git a/src/components/Html.js b/src/components/Html.js index 3a51e3257..5a922484a 100644 --- a/src/components/Html.js +++ b/src/components/Html.js @@ -74,6 +74,7 @@ class Html extends Component { + {scripts.map(script => ( @@ -92,6 +93,7 @@ class Html extends Component {