This commit is contained in:
Tom Moor 2017-07-15 16:18:06 -07:00
parent 66e4995885
commit 852fe991c5
No known key found for this signature in database
GPG Key ID: 495FE29B5F21BD41
4 changed files with 16 additions and 13 deletions

View File

@ -12,7 +12,7 @@ function KeyboardShortcuts() {
return (
<Flex column>
<HelpText>
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.
</HelpText>
<HtmlContent dangerouslySetInnerHTML={{ __html: htmlContent }} />

View File

@ -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 (
<Container column auto>
@ -185,9 +186,9 @@ type Props = {
<LoadingState />
</CenteredContent>}
{!isFetching &&
this.document &&
document &&
<StyledDropToImport
documentId={this.document.id}
documentId={document.id}
history={this.props.history}
onDragEnter={this.onStartDragging}
onDragLeave={this.onStopDragging}
@ -196,20 +197,20 @@ type Props = {
>
<Flex justify="center" auto>
<Prompt
when={this.document.hasPendingChanges}
when={document.hasPendingChanges}
message={DISCARD_CHANGES}
/>
<Editor
key={this.document.id}
text={this.document.text}
key={document.id}
text={document.text}
onImageUploadStart={this.onImageUploadStart}
onImageUploadStop={this.onImageUploadStop}
onChange={this.onChange}
onSave={this.onSave}
onCancel={this.onCancel}
onStar={this.document.star}
onUnstar={this.document.unstar}
starred={this.document.starred}
onStar={document.star}
onUnstar={document.unstar}
starred={document.starred}
heading={this.renderHeading(!!isEditing)}
readOnly={!isEditing}
/>
@ -225,7 +226,7 @@ type Props = {
/>
: <a onClick={this.onClickEdit}>Edit</a>}
</HeaderAction>
{!isEditing && <Menu document={this.document} />}
{!isEditing && <Menu document={document} />}
</Flex>
</Meta>
</Flex>

View File

@ -1,3 +1,4 @@
/* eslint-disable */
export default {
client: {
post: jest.fn(() => Promise.resolve),

View File

@ -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,
};