Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into ablaze
Browse files Browse the repository at this point in the history
  • Loading branch information
mxstbr committed Oct 4, 2017
2 parents 7300bc2 + 811823f commit 6a3a611
Show file tree
Hide file tree
Showing 90 changed files with 2,022 additions and 600 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
"transform-flow-strip-types",
"transform-object-rest-spread",
"babel-plugin-transform-react-jsx",
"syntax-dynamic-import",
"preval",
"babel-macros"
"syntax-dynamic-import"
]
}
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowIssue
esproposal.class_instance_fields=enable
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=spectrum
Expand Down
4 changes: 1 addition & 3 deletions admin/src/components/modals/modalContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const ModalContainer = ({
<CloseButton onClick={() => closeModal()} glyph="view-close" />
</Header>

<ModalContent>
{children}
</ModalContent>
<ModalContent>{children}</ModalContent>
</ModalBody>
);
};
Expand Down
16 changes: 4 additions & 12 deletions admin/src/components/profileHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ export const ProfileHeader = ({ user }) => {
<Row>
<Avatar size={48} radius={48} src={user.profilePhoto} />
<Column>
<Name>
{user.name}
</Name>
<Username>
@{user.username}
</Username>
<Name>{user.name}</Name>
<Username>@{user.username}</Username>
</Column>
</Row>

Expand All @@ -37,12 +33,8 @@ export const CommunityProfileHeader = ({ community }) => {
<Row>
<Avatar size={48} radius={8} src={community.profilePhoto} />
<Column>
<Name>
{community.name}
</Name>
<Username>
{community.metaData.members} members
</Username>
<Name>{community.name}</Name>
<Username>{community.metaData.members} members</Username>
</Column>
</Row>

Expand Down
25 changes: 14 additions & 11 deletions admin/src/components/titlebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,22 @@ class Titlebar extends Component {
const { title, subtitle, provideBack } = this.props;
return (
<TitleBar>
{provideBack
? <IconButton
glyph="view-back"
color="text.reverse"
onClick={this.handleBack}
/>
: <Spacer />}
{provideBack ? (
<IconButton
glyph="view-back"
color="text.reverse"
onClick={this.handleBack}
/>
) : (
<Spacer />
)}
<Text>
{subtitle && <Subtitle>{subtitle}</Subtitle>}
{title
? <Title large={subtitle ? false : true}>{title}</Title>
: <Icon glyph="logo" />}

{title ? (
<Title large={subtitle ? false : true}>{title}</Title>
) : (
<Icon glyph="logo" />
)}
</Text>
</TitleBar>
);
Expand Down
4 changes: 3 additions & 1 deletion admin/src/utils/get-growth-per-day.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const getGrowthPerDay = (

let growthData = [];
for (var i = 0; i < amountOfDays; i++) {
const currentDate = moment(startDay).add(i, 'days').toString();
const currentDate = moment(startDay)
.add(i, 'days')
.toString();
const currentDatesGrowth = growthByDay[currentDate];
if (currentDatesGrowth) {
const amount = amountGetter(currentDatesGrowth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class CommunityList extends Component {

return (
<ListCard>
<Label>
{label}
</Label>
<Label>{label}</Label>
{sorted.map(community => {
return (
<CommunityItem key={community.id}>
Expand Down
17 changes: 6 additions & 11 deletions admin/src/views/communities/components/communitySettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,12 @@ class CommunitySettings extends Component {
<Row>
<Avatar size={32} radius={4} src={community.profilePhoto} />
<Column>
<Name>
{community.name}
</Name>
<Username>
{role.substr(2)}
</Username>
<Name>{community.name}</Name>
<Username>{role.substr(2)}</Username>
</Column>
</Row>

{isEditing &&
{isEditing && (
<EditForm>
<List>
{permissions.map(perm => {
Expand All @@ -141,9 +137,7 @@ class CommunitySettings extends Component {
onChange={this.changePermission}
key={perm}
>
<span>
{perm}
</span>
<span>{perm}</span>
</Checkbox>
);
})}
Expand All @@ -153,7 +147,8 @@ class CommunitySettings extends Component {
Save
</Button>
</Save>
</EditForm>}
</EditForm>
)}
</Container>
);
}
Expand Down
20 changes: 12 additions & 8 deletions admin/src/views/communities/components/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,11 @@ class Search extends Component {

return (
<ComposerInputWrapper>
{searchIsLoading &&
{searchIsLoading && (
<SearchSpinnerContainer>
<Spinner size={16} color={'brand.default'} />
</SearchSpinnerContainer>}
</SearchSpinnerContainer>
)}

<ComposerInput
ref="input"
Expand All @@ -210,7 +211,7 @@ class Search extends Component {
/>

{// user has typed in a search string
searchString &&
searchString && (
//if there are selected users already, we manually shift
// the search results position down
<SearchResultsDropdown>
Expand All @@ -232,24 +233,27 @@ class Search extends Component {
<SearchResultDisplayName>
{community.name}
</SearchResultDisplayName>
{community.metaData &&
{community.metaData && (
<SearchResultUsername>
{community.metaData.members} members
</SearchResultUsername>}
</SearchResultUsername>
)}
</SearchResultTextContainer>
</SearchResult>
);
})}

{searchResults.length === 0 &&
{searchResults.length === 0 && (
<SearchResult>
<SearchResultTextContainer>
<SearchResultNull>
No communities found matching "{searchString}"
</SearchResultNull>
</SearchResultTextContainer>
</SearchResult>}
</SearchResultsDropdown>}
</SearchResult>
)}
</SearchResultsDropdown>
)}
</ComposerInputWrapper>
);
}
Expand Down
26 changes: 14 additions & 12 deletions admin/src/views/users/components/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ class Search extends Component {
this.setState({
searchResults: searchUsers.length > 0 ? searchUsers : [],
searchIsLoading: false,
focusedSearchResult: searchUsers.length > 0
? searchUsers[0].id
: '',
focusedSearchResult:
searchUsers.length > 0 ? searchUsers[0].id : '',
});
} else {
this.setState({
Expand Down Expand Up @@ -195,10 +194,11 @@ class Search extends Component {

return (
<ComposerInputWrapper>
{searchIsLoading &&
{searchIsLoading && (
<SearchSpinnerContainer>
<Spinner size={16} color={'brand.default'} />
</SearchSpinnerContainer>}
</SearchSpinnerContainer>
)}

<ComposerInput
ref="input"
Expand All @@ -210,11 +210,10 @@ class Search extends Component {
/>

{// user has typed in a search string
searchString &&
searchString && (
//if there are selected users already, we manually shift
// the search results position down
<SearchResultsDropdown>

{searchResults.length > 0 &&
searchResults.map(user => {
return (
Expand All @@ -233,24 +232,27 @@ class Search extends Component {
<SearchResultDisplayName>
{user.name}
</SearchResultDisplayName>
{user.username &&
{user.username && (
<SearchResultUsername>
@{user.username}
</SearchResultUsername>}
</SearchResultUsername>
)}
</SearchResultTextContainer>
</SearchResult>
);
})}

{searchResults.length === 0 &&
{searchResults.length === 0 && (
<SearchResult>
<SearchResultTextContainer>
<SearchResultNull>
No users found matching "{searchString}"
</SearchResultNull>
</SearchResultTextContainer>
</SearchResult>}
</SearchResultsDropdown>}
</SearchResult>
)}
</SearchResultsDropdown>
)}
</ComposerInputWrapper>
);
}
Expand Down
18 changes: 9 additions & 9 deletions admin/src/views/users/components/userCommunitySettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ class UserCommunitySettings extends Component {
const roles = Object.keys(community.communityPermissions).filter(
key => community.communityPermissions[key] && key.indexOf('__') === -1
);
const role = roles.indexOf('isOwner') > -1
? 'isOwner'
: (roles && roles[0]) || '';
const role =
roles.indexOf('isOwner') > -1 ? 'isOwner' : (roles && roles[0]) || '';
const permissions = Object.keys(this.state.permissions);

return (
Expand All @@ -127,7 +126,7 @@ class UserCommunitySettings extends Component {
</Column>
</Row>

{isEditing &&
{isEditing && (
<EditForm>
<List>
{permissions.map(perm => {
Expand All @@ -138,17 +137,18 @@ class UserCommunitySettings extends Component {
onChange={this.changePermission}
key={perm}
>
<span>
{perm}
</span>
<span>{perm}</span>
</Checkbox>
);
})}
</List>
<Save>
<Button onClick={this.save} loading={isLoading}>Save</Button>
<Button onClick={this.save} loading={isLoading}>
Save
</Button>
</Save>
</EditForm>}
</EditForm>
)}
</Container>
);
}
Expand Down
6 changes: 5 additions & 1 deletion athena/models/slackImports.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ export const saveSlackImportData = (
importId: string,
members: Array<Object>
): Promise<Array<string>> => {
return db.table('slackImports').get(importId).update({ members }).run();
return db
.table('slackImports')
.get(importId)
.update({ members })
.run();
};
4 changes: 2 additions & 2 deletions athena/utils/group-replies.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

const groupReplies = replies => {
let newReplies = [];
replies.forEach((reply, index) => {
if (
replies[index - 1] && replies[index - 1].sender.id === reply.sender.id
replies[index - 1] &&
replies[index - 1].sender.id === reply.sender.id
) {
newReplies[newReplies.length - 1].content.body =
newReplies[newReplies.length - 1].content.body +
Expand Down
1 change: 0 additions & 1 deletion athena/utils/sentencify.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

type Options = {
max?: number,
overflowPostfix?: string,
Expand Down
18 changes: 9 additions & 9 deletions chronos/queues/process-digest-email.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// @flow
const debug = require('debug')('chronos:queue:send-digest-email');
import Raven from 'raven';
import commitHash from '../../shared/get-commit-hash';
Raven.config(
'https://3bd8523edd5d43d7998f9b85562d6924:[email protected]/154812',
{
environment: process.env.NODE_ENV,
release: commitHash,
tags: { git_commit: commitHash },
}
).install();
// import commitHash from '../../shared/get-commit-hash';
// Raven.config(
// 'https://3bd8523edd5d43d7998f9b85562d6924:[email protected]/154812',
// {
// environment: process.env.NODE_ENV,
// release: commitHash,
// tags: { git_commit: commitHash },
// }
// ).install();
import intersection from 'lodash.intersection';
import createQueue from '../../shared/bull/create-queue';
import {
Expand Down
5 changes: 0 additions & 5 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

const rewireStyledComponents = require('react-app-rewire-styled-components');
const swPrecachePlugin = require('sw-precache-webpack-plugin');
const { injectBabelPlugin } = require('react-app-rewired');
const fs = require('fs');
const match = require('micromatch');
const WriteFilePlugin = require('write-file-webpack-plugin');
Expand All @@ -32,9 +31,5 @@ const setCustomSwPrecacheOptions = config => {
module.exports = function override(config, env) {
setCustomSwPrecacheOptions(config);
config.plugins.push(WriteFilePlugin());
injectBabelPlugin('babel-macros', config);
injectBabelPlugin('preval', config);
// Necessary for babel-macros to work
config.node.module = 'empty';
return rewireStyledComponents(config, env, { ssr: true });
};
Loading

0 comments on commit 6a3a611

Please sign in to comment.