From 852fe991c50eada89cfb906769311179f8baa3df Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 15 Jul 2017 16:18:06 -0700 Subject: [PATCH] :green_heart: --- .../KeyboardShortcuts/KeyboardShortcuts.js | 2 +- frontend/scenes/Document/Document.js | 19 ++++++++++--------- frontend/utils/__mocks__/ApiClient.js | 1 + server/api/auth.js | 7 ++++--- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/frontend/components/KeyboardShortcuts/KeyboardShortcuts.js b/frontend/components/KeyboardShortcuts/KeyboardShortcuts.js index c8aa58b5a..8aeb5f606 100644 --- a/frontend/components/KeyboardShortcuts/KeyboardShortcuts.js +++ b/frontend/components/KeyboardShortcuts/KeyboardShortcuts.js @@ -12,7 +12,7 @@ function KeyboardShortcuts() { return ( - Atlas is designed to be super fast and easy to use. + Atlas is designed to be super fast and easy to use. All of your usual keyboard shortcuts work here. diff --git a/frontend/scenes/Document/Document.js b/frontend/scenes/Document/Document.js index 08f589e14..e26d3f9f1 100644 --- a/frontend/scenes/Document/Document.js +++ b/frontend/scenes/Document/Document.js @@ -171,6 +171,7 @@ type Props = { const isEditing = !!this.props.match.params.edit || isNew; const isFetching = !this.document; const titleText = get(this.document, 'title', 'Loading'); + const document = this.document; return ( @@ -185,9 +186,9 @@ type Props = { } {!isFetching && - this.document && + document && @@ -225,7 +226,7 @@ type Props = { /> : Edit} - {!isEditing && } + {!isEditing && } diff --git a/frontend/utils/__mocks__/ApiClient.js b/frontend/utils/__mocks__/ApiClient.js index d53d1d2dc..6ee89e52f 100644 --- a/frontend/utils/__mocks__/ApiClient.js +++ b/frontend/utils/__mocks__/ApiClient.js @@ -1,3 +1,4 @@ +/* eslint-disable */ export default { client: { post: jest.fn(() => Promise.resolve), diff --git a/server/api/auth.js b/server/api/auth.js index 8ae10466a..811055cf5 100644 --- a/server/api/auth.js +++ b/server/api/auth.js @@ -91,7 +91,7 @@ router.post('auth.slack', async ctx => { const body = { client_id: process.env.SLACK_KEY, client_secret: process.env.SLACK_SECRET, - redirect_uri: `${process.env.URL}/auth/slack`, + redirect_uri: `${process.env.URL || ''}/auth/slack`, code, }; @@ -108,7 +108,8 @@ router.post('auth.slack', async ctx => { if (!data.ok) throw httpErrors.BadRequest(data.error); // Temp to block - const allowedSlackDomains = process.env.ALLOWED_SLACK_DOMAINS.split(','); + const allowedSlackDomains = (process.env.ALLOWED_SLACK_DOMAINS || '') + .split(','); if (!allowedSlackDomains.includes(data.team.domain)) { throw apiError( 400, @@ -171,7 +172,7 @@ router.post('auth.slackCommands', async ctx => { const body = { client_id: process.env.SLACK_KEY, client_secret: process.env.SLACK_SECRET, - redirect_uri: `${process.env.URL}/auth/slack/commands`, + redirect_uri: `${process.env.URL || ''}/auth/slack/commands`, code, };