Skip to content

Commit c95447e

Browse files
authored
Merge pull request #229 from CaptainFact/staging
Release 0.8.16
2 parents 1cf32f0 + ae6b824 commit c95447e

File tree

148 files changed

+15154
-8502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+15154
-8502
lines changed

.babelrc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"presets": ["es2015", "react"],
2+
"presets": [
3+
"es2015",
4+
"react"
5+
],
36
"plugins": [
47
"transform-decorators-legacy",
58
"transform-runtime",
69
"transform-class-properties",
7-
"transform-object-rest-spread",
8-
["inline-json-import", {}]
10+
"transform-object-rest-spread"
911
]
10-
}
12+
}

.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ rules:
6060
specialLink: ['To']
6161
jsx-a11y/alt-text: ['warn']
6262
jsx-a11y/label-has-for: ['warn']
63+
jsx-a11y/label-has-associated-control:
64+
- warn
65+
- controlComponents:
66+
- "Field"
6367
jsx-a11y/click-events-have-key-events: ['warn']
6468
jsx-a11y/no-static-element-interactions: ['warn']
6569
jsx-a11y/media-has-caption: ['warn']

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# CaptainFact frontend container
22
# You must attach a volume containing cert.pem + privkey.pem at /etc/nginx/cert/
3-
FROM betree/centos-nginx-nodejs-sass:latest
3+
FROM betree/centos-nginx-nodejs:latest
44
MAINTAINER Benjamin Piouffle <benjamin.piouffle@gmail.com>
55

66
WORKDIR /opt/app
77

88
# Cache dependencies
9-
COPY package.json .
9+
COPY package.json package-lock.json ./
1010
RUN npm install
1111

1212
# Build project

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<a href="./LICENSE"><img src="https://img.shields.io/github/license/CaptainFact/captain-fact-frontend.svg" alt="AGPL3"></a>
77
<a href="https://travis-ci.org/CaptainFact/captain-fact-frontend"><img src="https://travis-ci.org/CaptainFact/captain-fact-frontend.svg?branch=travis-configuration" alt="Build Status" /></a>
88
<a href='https://coveralls.io/github/CaptainFact/captain-fact-frontend?branch=master'><img src='https://coveralls.io/repos/github/CaptainFact/captain-fact-frontend/badge.svg?branch=master' alt='Coverage Status' /></a>
9+
<a href='https://greenkeeper.io/'><img src='https://badges.greenkeeper.io/CaptainFact/captain-fact-frontend.svg' alt='Greenkeeper badge' /></a>
910
</p>
1011
<hr/>
1112
<p align="center">
@@ -21,12 +22,14 @@ If you're already have the API running locally, a simple `npm install && npm sta
2122
should be enough. Otherwise follow the procedure below:
2223

2324
* Install (if you don't have them):
24-
* [Docker](https://docs.docker.com/install/) (to start the API easily)
25+
* [Docker](https://docs.docker.com/install/)
26+
and [docker-compose](https://docs.docker.com/compose/install/)
27+
(to start the API easily)
2528
* NodeJS, ideally using [asdf](https://github.com/asdf-vm/asdf) with `NODEJS_CHECK_SIGNATURES=no asdf install`
2629
* App dependencies: `npm install`
2730

2831
* Run:
29-
* `./dev/start_api.sh` - Start the API (with an Elixir console attached)
32+
* `docker-compose up` - Start the API
3033
* `npm start` - Start the frontend
3134
* `npm run test` - run all unit tests
3235

app/components/App/LanguageSelector.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Map } from 'immutable'
33
import classNames from 'classnames'
4-
import { translate } from 'react-i18next'
4+
import { withNamespaces } from 'react-i18next'
55

66
import { Icon } from '../Utils/Icon'
77

@@ -11,7 +11,7 @@ const defaultLocales = new Map({
1111
fr: 'Français'
1212
})
1313

14-
@translate() // Force waiting for translations to be loaded
14+
@withNamespaces() // Force waiting for translations to be loaded
1515
export default class LanguageSelector extends React.PureComponent {
1616
render() {
1717
const sizeClass = this.props.size ? `is-${this.props.size}` : null

app/components/App/Sidebar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
33
import { Link } from 'react-router'
4-
import { translate } from 'react-i18next'
4+
import { withNamespaces } from 'react-i18next'
55
import classNames from 'classnames'
66
import capitalize from 'voca/capitalize'
77

@@ -24,7 +24,7 @@ import Button from '../Utils/Button'
2424
isLoadingUser: state.CurrentUser.isLoading,
2525
sidebarExpended: state.UserPreferences.sidebarExpended
2626
}), {logout, toggleSidebar, closeSidebar})
27-
@translate('main')
27+
@withNamespaces('main')
2828
export default class Sidebar extends React.PureComponent {
2929
constructor(props) {
3030
super(props)

app/components/Comments/CommentActions.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { translate } from 'react-i18next'
2+
import { withNamespaces } from 'react-i18next'
33

44
import OwnCommentActions from './OwnCommentActions'
55
import OtherCommentActions from './OtherCommentActions'
@@ -44,4 +44,4 @@ const CommentActions = ({
4444
</nav>
4545
)
4646

47-
export default translate('videoDebate')(CommentActions)
47+
export default withNamespaces('videoDebate')(CommentActions)

app/components/Comments/CommentDisplay.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
3-
import { translate } from 'react-i18next'
3+
import { withNamespaces } from 'react-i18next'
44
import { change } from 'redux-form'
55
import classNames from 'classnames'
66

@@ -28,7 +28,7 @@ import { CommentsList } from './CommentsList'
2828
replies: state.VideoDebate.comments.replies.get(comment.id),
2929
isFlagged: state.VideoDebate.comments.myFlags.has(comment.id)
3030
}), {addModal, deleteComment, flagComment, commentVote, change, flashErrorUnauthenticated})
31-
@translate('main')
31+
@withNamespaces('main')
3232
export class CommentDisplay extends React.PureComponent {
3333
constructor(props) {
3434
super(props)

app/components/Comments/CommentForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
33
import { Field, reduxForm, getFormValues } from 'redux-form'
4-
import { translate } from 'react-i18next'
4+
import { withNamespaces } from 'react-i18next'
55
import isURL from 'validator/lib/isURL'
66
import { withRouter } from 'react-router'
77

@@ -47,7 +47,7 @@ const validate = ({ source, text }) => {
4747
}
4848
}, {postComment, flashErrorUnauthenticated})
4949
@reduxForm({form: 'commentForm', validate})
50-
@translate('videoDebate')
50+
@withNamespaces('videoDebate')
5151
@withRouter
5252
export class CommentForm extends React.Component {
5353
state = { isCollapsed: true }

app/components/Comments/CommentHeader.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { translate } from 'react-i18next'
2+
import { withNamespaces } from 'react-i18next'
33

44
import { USER_PICTURE_SMALL } from '../../constants'
55
import UserPicture from '../Users/UserPicture'
@@ -24,4 +24,4 @@ const CommentHeader = ({t, comment: {user, inserted_at}, withoutActions}) => (
2424
</div>
2525
)
2626

27-
export default translate('main')(CommentHeader)
27+
export default withNamespaces('main')(CommentHeader)

0 commit comments

Comments
 (0)