Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.8.12 #154

Merged
merged 52 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
aef3d60
Basic minify of HTML (doesn't strip comments)
Betree Jul 2, 2018
7052277
Merge pull request #138 from CaptainFact/improvement/minify-html
Betree Jul 2, 2018
e1f1b53
config for opengraph application
julien-leclercq Jul 5, 2018
b3b7e2a
Minor improvements to release + script to check nginx config
Betree Jul 5, 2018
1e454f1
Merge pull request #141 from CaptainFact/improvement/release
Betree Jul 5, 2018
41eae73
Merge remote-tracking branch 'origin/staging' into feature/opengraph
Betree Jul 5, 2018
82c5737
Working nginx config. PLEASE USE --network=host TO TEST DOCKER SCRIPT
Betree Jul 5, 2018
30d8980
Merge pull request #140 from CaptainFact/feature/opengraph
Betree Jul 9, 2018
759b7df
Update help pages with new limitations and fix typos
Betree Jul 10, 2018
38dde6f
Update reputations constants
Betree Jul 10, 2018
2915664
Add store snapshot testing for modals and help
Betree Jul 10, 2018
41dc1ce
Strip `https` from OG_URL in run.sh
Betree Jul 11, 2018
2354700
Merge pull request #145 from CaptainFact/improvement/help
Betree Jul 11, 2018
c6f2737
refine videos filters
julien-leclercq Jul 13, 2018
c14212c
update reducer test
julien-leclercq Jul 13, 2018
ebb0c3b
Merge pull request #147 from CaptainFact/improvement/videos-filter
Betree Jul 13, 2018
ea4d8f6
Update errors.js
spidersouris Jul 14, 2018
0d54081
Update help.js
spidersouris Jul 14, 2018
19a2f87
Update home.js
spidersouris Jul 14, 2018
cf5ceb5
Update main.js
spidersouris Jul 14, 2018
ac9d8aa
Update user.js
spidersouris Jul 14, 2018
9cd2338
Update videoDebate.js
spidersouris Jul 14, 2018
df8c8c1
Update achievements.js
spidersouris Jul 14, 2018
6b0e252
Update errors.js
spidersouris Jul 14, 2018
442b829
Update extension.js
spidersouris Jul 14, 2018
12c501d
Update help.js
spidersouris Jul 14, 2018
04f1f9b
Update home.js
spidersouris Jul 14, 2018
04cc26e
Update main.js
spidersouris Jul 14, 2018
fb745c9
Update user.js
spidersouris Jul 14, 2018
7128aab
Update videoDebate.js
spidersouris Jul 14, 2018
7ad7672
Merge pull request #149 from Spidersouris/master
Betree Jul 14, 2018
0eab5de
Patch updates
Betree Jul 16, 2018
4cbd527
Update package-lock.json
Betree Jul 16, 2018
db84db3
Minor updates
Betree Jul 16, 2018
6cdde74
Major updates (+disable browser launch in webpack dev config)
Betree Jul 16, 2018
6b16751
Non-semver updates (bulma + mini-css-extract-plugin)
Betree Jul 16, 2018
0c8919e
Fix chat button right border
Betree Jul 16, 2018
2e8e7f0
Merge pull request #151 from CaptainFact/improvement/chat-button
Betree Jul 16, 2018
83d4b92
Merge pull request #150 from CaptainFact/improvement/update-dependencies
Betree Jul 16, 2018
a752044
Fix dev config FRONTEND_URL
Betree Jul 17, 2018
ab7238e
Show if video was added by partner or user on card
Betree Jul 17, 2018
a851fdd
Remove unwanted `console.log`
Betree Jul 17, 2018
7fabc7a
Add tests shortcuts to snapshot store and reducers
Betree Jul 17, 2018
d6f996a
Add tests for presence reducer
Betree Jul 17, 2018
d83ac63
Merge branch 'staging' into feature/store-snapshot-testing
Betree Jul 17, 2018
12951d7
Rename test to `.spec` and fix tuser_preferences reducer test
Betree Jul 17, 2018
4d32c3d
Merge pull request #146 from CaptainFact/feature/store-snapshot-testing
Betree Jul 18, 2018
866c6d5
Merge pull request #153 from CaptainFact/feature/videos-list-show-par…
Betree Jul 18, 2018
59b5177
Fix tests
Betree Jul 18, 2018
1dd6f79
Bump version to 0.8.12
Betree Jul 18, 2018
7796e88
Add video form: Accept url as URL param (/videos/add?url=xxx)
Betree Jul 18, 2018
a5efd7b
Merge pull request #155 from CaptainFact/improvement/add-video-form
Betree Jul 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ rules:
react/react-in-jsx-scope: off # Generates erros in tests
react/sort-comp: off
react/require-default-props: off
react/jsx-one-expression-per-line: off

globals:
snapshot: false # For tests
# For tests
snapshot: false
snapshotReducer: false
snapshotComponent: false
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CaptainFact frontend container
# You must attach a volume containing cert.pem + privkey.pem at /etc/nginx/cert/
FROM betree/centos-nginx-nodejs-brunch-sass:latest
FROM betree/centos-nginx-nodejs-sass:latest
MAINTAINER Benjamin Piouffle <benjamin.piouffle@gmail.com>

WORKDIR /opt/app
Expand Down
23 changes: 12 additions & 11 deletions app/assets/assets/help/en/privileges.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ Judgement actions such as voting and flagging are limited to avoid abusing them
| 0 | Create statements
| 0 | Vote Up
| 15 | Vote Down
| 30 | Update statement
| 75 | Add / create speakers
| 75 | Update speaker
| 75 | Flag inappropriate content
| 125 | Remove / restore statement
| 125 | No more new user restrictions
| 200 | Shift all video's statements
| 200 | Remove / restore speaker
| 200 | Add videos (weekly limitation)
| 200 | Access to the moderation platform

| 15 | Update statement
| 15 | Update speaker
| 15 | Flag inappropriate content
| 30 | Add / create speakers
| 75 | Remove / restore statement
| 75 | Shift all video's statements
| 75 | Remove speaker
| 125 | No more new user restrictions
| 125 | Access to the moderation platform
| 125 | Restore speaker
| 200 | Add videos (weekly limitation)
| 200 | Self-vote

# New user restrictions

Expand Down
23 changes: 12 additions & 11 deletions app/assets/assets/help/fr/privileges.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ renforcer leur signification.
| 0 | Ajouter des citations
| 0 | Voter positivement
| 15 | Voter négativement
| 30 | Mettre à jour une citation
| 75 | Ajouter ou créer des intervenants
| 75 | Mettre à jour un intervenant
| 75 | Signaler un contenu inapproprié
| 125 | Supprimer / restaurer une citation
| 125 | Plus de restrictions spécifiques aux nouveaux utilisateurs
| 200 | Déplacer toutes les citations d'une vidéo (time shift)
| 200 | Supprimer / restaurer un intervenant
| 200 | Ajouter une vidéo
| 200 | Accès aux outils de modération

| 15 | Mettre à jour une citation
| 15 | Mettre à jour un intervenant
| 15 | Signaler un contenu inapproprié
| 30 | Ajouter ou créer des intervenants
| 75 | Supprimer / restaurer une citation
| 75 | Déplacer toutes les citations d'une vidéo (time shift)
| 75 | Supprimer un intervenant
| 125 | Moins de restrictions spécifiques aux nouveaux utilisateurs
| 125 | Accès aux outils de modération collective
| 125 | Restaurer un intervenant
| 200 | Ajouter une vidéo (limitation hebdomadaire)
| 200 | Voter pour soi-même

# Restrictions spécifiques aux nouveaux utilisateurs

Expand Down
2 changes: 1 addition & 1 deletion app/assets/assets/help/fr/reputation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ montée du nombre d'utilisateurs.
| Un de vos commentaires recoit un vote positif | +2pts
| Un de vos commentaires **sourcé** recoit un vote positif | +3pts
| Quelqu'un approuve une de vos modifications dans l'historique | +5pts
| Un de vos signalements est comfirmé | +3pts
| Un de vos signalements est confirmé | +3pts

# Vous perdez de la réputation quand...

Expand Down
6 changes: 3 additions & 3 deletions app/components/Utils/__tests__/Icon.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Icon from '../Icon'

test('render icon', () => {
snapshot(<Icon name="plus"/>)
snapshotComponent(<Icon name="plus"/>)
})

test('set size', () => {
snapshot(<Icon name="plus" size="large"/>)
snapshotComponent(<Icon name="plus" size="large"/>)
})

test('other props get passed to container', () => {
snapshot(<Icon name="plus" title="Add some stuff"/>)
snapshotComponent(<Icon name="plus" title="Add some stuff"/>)
})
8 changes: 4 additions & 4 deletions app/components/Utils/__tests__/Message.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Message from '../Message'

test('render message', () => {
snapshot(<Message>Hello</Message>)
snapshotComponent(<Message>Hello</Message>)
})

test('can set type', () => {
snapshot(<Message type="warning">Alert !</Message>)
snapshotComponent(<Message type="warning">Alert !</Message>)
})

test('can set header', () => {
snapshot(<Message header="Awesome title">Hellooow</Message>)
snapshotComponent(<Message header="Awesome title">Hellooow</Message>)
})

test('without body', () => {
snapshot(<Message/>)
snapshotComponent(<Message/>)
})
8 changes: 4 additions & 4 deletions app/components/Utils/__tests__/Notification.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Notification from '../Notification'

test('render message', () => {
snapshot(<Notification>Hello</Notification>)
snapshotComponent(<Notification>Hello</Notification>)
})

test('can set type', () => {
snapshot(<Notification type="warning">Alert !</Notification>)
snapshotComponent(<Notification type="warning">Alert !</Notification>)
})

test('pass props', () => {
snapshot(<Notification title="my title">Hellooow</Notification>)
snapshotComponent(<Notification title="my title">Hellooow</Notification>)
})

test('without body', () => {
snapshot(<Notification/>)
snapshotComponent(<Notification/>)
})
2 changes: 1 addition & 1 deletion app/components/Utils/__tests__/RawIcon.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RawIcon from '../RawIcon'

test('render icon', () => {
snapshot(<RawIcon name="plus"/>)
snapshotComponent(<RawIcon name="plus"/>)
})
4 changes: 2 additions & 2 deletions app/components/Utils/__tests__/Tag.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Tag from '../Tag'

test('render tag', () => {
snapshot(<Tag>Test</Tag>)
snapshotComponent(<Tag>Test</Tag>)
})

test('set size', () => {
snapshot(<Tag type="info">Test</Tag>)
snapshotComponent(<Tag type="info">Test</Tag>)
})
7 changes: 4 additions & 3 deletions app/components/Videos/AddVideoForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ const validate = ({ url }) => {

@withRouter
@connect((state, props) => ({
initialValues: {url: props.params.videoUrl},
initialValues: {url: props.params.videoUrl || props.location.query.url},
isSubmitting: state.Videos.isSubmitting,
isAuthenticated: isAuthenticated(state)
}), {postVideo, searchVideo})
@reduxForm({form: 'AddVideo', validate})
export class AddVideoForm extends React.PureComponent {
componentDidMount() {
if (this.props.params.videoUrl) {
this.props.searchVideo(decodeURI(this.props.params.videoUrl)).then(action => {
const videoUrl = this.props.params.videoUrl || this.props.location.query.url
if (videoUrl) {
this.props.searchVideo(decodeURI(videoUrl)).then(action => {
if (!action.error && action.payload !== null)
this.props.router.push(`/videos/${action.payload.id}`)
})
Expand Down
16 changes: 7 additions & 9 deletions app/components/Videos/FilterOnlyFromPartners.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React from 'react'
import { translate } from 'react-i18next'
import { ALL_VIDEOS, ONLY_PARTNERS, ONLY_COMMUNITY } from '../../constants'


const PARTNERS_KEY = 'partners'
const USERS_KEY = 'users'

const FilterOnlyFromPartners = ({value, onChange, t}) => (
const FilterOnlyFromPartners = ({ value, onChange, t }) => (
<div className="select">
<select
value={value ? PARTNERS_KEY : USERS_KEY}
onChange={e => onChange(e.target.value === PARTNERS_KEY)}
value={value}
onChange={e => onChange(e.target.value)}
>
<option value={PARTNERS_KEY}>{t(PARTNERS_KEY)}</option>
<option value={USERS_KEY}>{t(USERS_KEY)}</option>
<option value={ALL_VIDEOS}>{t('all')}</option>
<option value={ONLY_PARTNERS}>{t('partners')}</option>
<option value={ONLY_COMMUNITY}>{t('users')}</option>
</select>
</div>
)
Expand Down
34 changes: 20 additions & 14 deletions app/components/Videos/PublicVideos.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import { Map } from 'immutable'
import { merge, Map } from 'immutable'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { translate } from 'react-i18next'
import capitalize from 'voca/capitalize'

import { MIN_REPUTATION_ADD_VIDEO } from '../../constants'
import { MIN_REPUTATION_ADD_VIDEO, ALL_VIDEOS, ONLY_PARTNERS, ONLY_COMMUNITY } from '../../constants'
import ReputationGuard from '../Utils/ReputationGuard'
import { VideosGrid } from '../Videos'
import { LoadingFrame, Icon } from '../Utils'
Expand All @@ -23,7 +23,7 @@ import FilterOnlyFromPartners from './FilterOnlyFromPartners'
error: state.Videos.error,
languageFilter: state.UserPreferences.videosLanguageFilter,
onlyFromPartners: state.UserPreferences.videosOnlyFromPartners,
}), {fetchPublicVideos, reset, changeVideosLanguageFilter, setVideosOnlyFromPartners})
}), { fetchPublicVideos, reset, changeVideosLanguageFilter, setVideosOnlyFromPartners })
@translate('main')
export class PublicVideos extends React.PureComponent {
componentDidMount() {
Expand All @@ -36,7 +36,7 @@ export class PublicVideos extends React.PureComponent {

componentDidUpdate(oldProps) {
if (oldProps.languageFilter !== this.props.languageFilter ||
oldProps.onlyFromPartners !== this.props.onlyFromPartners) {
oldProps.onlyFromPartners !== this.props.onlyFromPartners) {
this.props.fetchPublicVideos(this.buildFilters())
}
}
Expand All @@ -46,12 +46,12 @@ export class PublicVideos extends React.PureComponent {
<div className="videos-page">
<section className="header">
<h2 className="title is-2">
<Icon name="television"/>
<Icon name="television" />
<span> {capitalize(this.props.t('entities.video_plural'))}</span>
</h2>
<ReputationGuard requiredRep={MIN_REPUTATION_ADD_VIDEO}>
<Link to="/videos/add" className="button is-primary">
<Icon name="plus-circle"/>
<Icon name="plus-circle" />
<span>{this.props.t('videos.add')}</span>
</Link>
</ReputationGuard>
Expand All @@ -65,7 +65,7 @@ export class PublicVideos extends React.PureComponent {
renderFilterBar() {
return (
<nav className="level videos-filter">
<div className="level-left"/>
<div className="level-left" />
<div className="level-right">
<div className="filter">
<span>Source:</span>
Expand Down Expand Up @@ -94,11 +94,11 @@ export class PublicVideos extends React.PureComponent {
if (this.props.isLoading)
return <LoadingFrame />
else if (this.props.error)
return <ErrorView error={this.props.error}/>
return <ErrorView error={this.props.error} />
else if (this.props.videos.size === 0)
return <h2>{this.props.t('errors:client.noVideoAvailable')}</h2>

return <VideosGrid videos={this.props.videos}/>
return <VideosGrid videos={this.props.videos} />
}

onVideosFilterChange(value) {
Expand All @@ -107,10 +107,16 @@ export class PublicVideos extends React.PureComponent {
}

buildFilters() {
const {languageFilter, onlyFromPartners} = this.props
const filters = {is_partner: onlyFromPartners}
if (languageFilter)
filters.language = languageFilter
return filters
const { languageFilter, onlyFromPartners } = this.props

const partnerFilter = {
[ALL_VIDEOS]: {},
[ONLY_PARTNERS]: { is_partner: true },
[ONLY_COMMUNITY]: { is_partner: false }
}[onlyFromPartners]

const languageVideosFilter = languageFilter ? { language: languageFilter } : {}

return merge({}, partnerFilter, languageVideosFilter)
}
}
Loading