Merge branch 'master' into feature/talk-plugin-toxic-comments

This commit is contained in:
Kim Gardner
2017-07-27 11:05:17 -04:00
committed by GitHub
437 changed files with 20317 additions and 13391 deletions
@@ -1,9 +0,0 @@
import React from 'react';
import styles from './styles.css';
export default (props) => (
<div className={styles.box}>
Comment Status: {props.comment.status}
</div>
);
@@ -1,32 +0,0 @@
import React from 'react';
import Box from './Box';
import {Button} from 'plugin-api/beta/client/components/ui';
import styles from './styles.css';
export default class Footer extends React.Component {
constructor() {
super();
this.state = {
show: false
};
}
handleClick = () => {
this.setState((state) => ({
show: !state.show
}));
}
render() {
const {show} = this.state;
return (
<div className={styles.container}>
<Button cStyle="darkGrey" onClick={this.handleClick}>
Show Comment Status
</Button>
{show ? <Box comment={this.props.comment} /> : null}
</div>
);
}
}
@@ -1,8 +0,0 @@
.container {
padding: 0 14px 10px;
}
.box {
font-size: 12px;
padding: 10px 14px;
}
-7
View File
@@ -1,7 +0,0 @@
import Container from './components/Container';
export default {
slots: {
adminCommentDetailArea: [Container],
}
};
-2
View File
@@ -1,2 +0,0 @@
module.exports = {};
@@ -1,14 +0,0 @@
{
"presets": [
"es2015"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-react-jsx"
]
}
@@ -1,23 +0,0 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }]
}
}
@@ -1,9 +0,0 @@
import {VIEWING_OPTIONS_OPEN, VIEWING_OPTIONS_CLOSE} from './constants';
export const openViewingOptions = () => ({
type: VIEWING_OPTIONS_OPEN
});
export const closeViewingOptions = () => ({
type: VIEWING_OPTIONS_CLOSE
});
@@ -1,2 +0,0 @@
export const VIEWING_OPTIONS_OPEN = 'VIEWING_OPTIONS_OPEN';
export const VIEWING_OPTIONS_CLOSE = 'VIEWING_OPTIONS_CLOSE';
@@ -1,9 +1,9 @@
import React from 'react';
import t from 'coral-framework/services/i18n';
import {ReplyButton} from 'coral-plugin-replies';
import PubDate from 'coral-plugin-pubdate/PubDate';
import {ReplyButton} from 'talk-plugin-replies';
import PubDate from 'talk-plugin-pubdate/PubDate';
import Slot from 'coral-framework/components/Slot';
import AuthorName from 'coral-plugin-author-name/AuthorName';
import AuthorName from 'talk-plugin-author-name/AuthorName';
import styles from 'coral-embed-stream/src/components/Comment.css';
export const FakeComment = ({username, created_at, comment}) => (
@@ -13,13 +13,13 @@ export const FakeComment = ({username, created_at, comment}) => (
<PubDate created_at={created_at} />
<Slot comment={comment} />
<div className="commentActionsLeft comment__action-container">
<div className={`${'coral-plugin-likes'}-container`}>
<button className={'coral-plugin-likes-button'}>
<span className={'coral-plugin-likes-button-text'}>
<div className={`${'talk-plugin-likes'}-container`}>
<button className={'talk-plugin-likes-button'}>
<span className={'talk-plugin-likes-button-text'}>
{t('like')}
</span>
<i
className={`${'coral-plugin-likes'}-icon material-icons`}
className={`${'talk-plugin-likes'}-icon material-icons`}
aria-hidden={true}
>
thumb_up
@@ -33,30 +33,30 @@ export const FakeComment = ({username, created_at, comment}) => (
/>
</div>
<div className="commentActionsRight comment__action-container">
<div className="coral-plugin-permalinks-container">
<button className="coral-plugin-permalinks-button">
<div className="talk-plugin-permalinks-container">
<button className="talk-plugin-permalinks-button">
<span
className={`comment__action-button comment__action-button--nowrap ${'coral-plugin-flags'}-button-text`}
className={`comment__action-button comment__action-button--nowrap ${'talk-plugin-flags'}-button-text`}
>
{t('permalink')}
</span>
<i
className="coral-plugin-permalinks-icon material-icons"
className="talk-plugin-permalinks-icon material-icons"
aria-hidden={true}
>
link
</i>
</button>
</div>
<div className={`${'coral-plugin-flags'}-container`}>
<button className={`${'coral-plugin-flags'}-button`}>
<div className={`${'talk-plugin-flags'}-container`}>
<button className={`${'talk-plugin-flags'}-button`}>
<span
className={`comment__action-button comment__action-button--nowrap ${'coral-plugin-flags'}-button-text`}
className={`comment__action-button comment__action-button--nowrap ${'talk-plugin-flags'}-button-text`}
>
{t('report')}
</span>
<i
className={`${'coral-plugin-flags'}-icon material-icons`}
className={`${'talk-plugin-flags'}-icon material-icons`}
aria-hidden={true}
>
flag
@@ -1,7 +1,7 @@
import React from 'react';
import Linkify from 'react-linkify';
const name = 'coral-plugin-comment-content';
const name = 'talk-plugin-comment-content';
const CommentContent = ({comment}) => {
const textbreaks = comment.body.split('\n');
@@ -1,5 +1,5 @@
{
"name": "coral-plugin-comment-content",
"name": "talk-plugin-comment-content",
"version": "1.0.0",
"description": "",
"main": "index.js",
@@ -1,4 +1,4 @@
# coral-plugin-facebook-auth
# talk-plugin-facebook-auth
This plugin provides facebook authentication support for Talk.
@@ -1,5 +1,5 @@
{
"name": "coral-plugin-facebook-auth",
"name": "talk-plugin-facebook-auth",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
@@ -1,2 +1,4 @@
export const SHOW_TOOLTIP = 'SHOW_TOOLTIP';
export const HIDE_TOOLTIP = 'HIDE_TOOLTIP';
const prefix = 'TALK_FEATURED_COMMENTS';
export const SHOW_TOOLTIP = `${prefix}_SHOW_TOOLTIP`;
export const HIDE_TOOLTIP = `${prefix}_HIDE_TOOLTIP`;
@@ -5,7 +5,7 @@ import {t, can} from 'plugin-api/beta/client/services';
import {Icon} from 'plugin-api/beta/client/components/ui';
import cn from 'classnames';
const plugin = 'coral-plugin-like';
const plugin = 'talk-plugin-like';
class LikeButton extends React.Component {
handleClick = () => {
@@ -46,7 +46,7 @@ class LikeButton extends React.Component {
onClick={this.handleClick}
>
<span className={cn(`${plugin}-label`, styles.label)}>
{t(alreadyReacted ? 'coral-plugin-like.liked' : 'coral-plugin-like.like')}
{t(alreadyReacted ? 'talk-plugin-like.liked' : 'talk-plugin-like.like')}
</span>
<Icon name="thumb_up" className={cn(`${plugin}-icon`, styles.icon)} />
<span className={`${plugin}-count`}>{count > 0 && count}</span>
@@ -1,9 +1,9 @@
en:
coral-plugin-like:
talk-plugin-like:
like: Like
liked: Liked
es:
coral-plugin-like:
talk-plugin-like:
like: Me Gusta
liked: Me Gustó
@@ -5,7 +5,7 @@ import {t, can} from 'plugin-api/beta/client/services';
import {Icon} from 'plugin-api/beta/client/components/ui';
import cn from 'classnames';
const plugin = 'coral-plugin-love';
const plugin = 'talk-plugin-love';
class LoveButton extends React.Component {
handleClick = () => {
@@ -46,7 +46,7 @@ class LoveButton extends React.Component {
onClick={this.handleClick}
>
<span className={cn(`${plugin}-label`, styles.label)}>
{t(alreadyReacted ? 'coral-plugin-love.loved' : 'coral-plugin-love.love')}
{t(alreadyReacted ? 'talk-plugin-love.loved' : 'talk-plugin-love.love')}
</span>
<Icon name="favorite" className={cn(`${plugin}-icon`, styles.icon)} />
<span className={`${plugin}-count`}>{count > 0 && count}</span>
@@ -1,9 +1,9 @@
en:
coral-plugin-love:
talk-plugin-love:
love: Love
loved: Loved
es:
coral-plugin-love:
talk-plugin-love:
love: Amo
loved: Amé
@@ -4,7 +4,7 @@ import styles from './styles.css';
export default class OffTopicFilter extends React.Component {
tag = 'OFF_TOPIC';
className = 'coral-plugin-off-topic-comment';
className = 'talk-plugin-off-topic-comment';
cn = {[this.className] : {tags: [this.tag]}};
handleChange = (e) => {
@@ -8,10 +8,10 @@
}
.tag {
background: #3D73D5;
background: #D2D7D3;
font-size: 12px;
font-weight: bold;
color: white;
color: #4A4A4A;
display: inline-block;
margin: 0px 5px;
padding: 5px 5px;
@@ -22,6 +22,6 @@
padding: 5px 0;
}
:global(.coral-plugin-off-topic-comment) {
:global(.talk-plugin-off-topic-comment) {
display: none;
}
@@ -5,7 +5,7 @@ import {commentClassNamesSelector} from 'plugin-api/alpha/client/selectors';
import OffTopicFilter from '../components/OffTopicFilter';
import {
closeViewingOptions
} from 'plugins/coral-plugin-viewing-options/client/actions';
} from 'plugins/talk-plugin-viewing-options/client/actions';
import {
addCommentClassName,
removeCommentClassName
@@ -5,7 +5,7 @@ import OffTopicCheckbox from './containers/OffTopicCheckbox';
import reducer from './reducer';
/**
* coral-plugin-offtopic depends on coral-plugin-viewing-options
* talk-plugin-offtopic depends on talk-plugin-viewing-options
* in other to display filter and use the streamViewingOptions slot
*/
@@ -5,7 +5,7 @@ import {withReaction} from 'plugin-api/beta/client/hocs';
import {t, can} from 'plugin-api/beta/client/services';
import cn from 'classnames';
const plugin = 'coral-plugin-respect';
const plugin = 'talk-plugin-respect';
class RespectButton extends React.Component {
handleClick = () => {
@@ -46,7 +46,7 @@ class RespectButton extends React.Component {
onClick={this.handleClick}
>
<span className={cn(`${plugin}-label`, styles.label)}>
{t(alreadyReacted ? 'coral-plugin-respect.respected' : 'coral-plugin-respect.respect')}
{t(alreadyReacted ? 'talk-plugin-respect.respected' : 'talk-plugin-respect.respect')}
</span>
<Icon className={cn(styles.icon, `${plugin}-icon`)} />
<span className={cn(`${plugin}-count`)}>{count > 0 && count}</span>
@@ -1,9 +1,9 @@
en:
coral-plugin-respect:
talk-plugin-respect:
respect: Respect
respected: Respected
es:
coral-plugin-respect:
talk-plugin-respect:
respect: Respetar
respected: Respetado
@@ -0,0 +1,9 @@
import {OPEN_MENU, CLOSE_MENU} from './constants';
export const openMenu = () => ({
type: OPEN_MENU,
});
export const closeMenu = () => ({
type: CLOSE_MENU,
});
@@ -8,21 +8,21 @@ import {Slot, ClickOutside} from 'plugin-api/beta/client/components';
const ViewingOptions = (props) => {
const toggleOpen = () => {
if (!props.open) {
props.openViewingOptions();
props.openMenu();
} else {
props.closeViewingOptions();
props.closeMenu();
}
};
const handleClickOutside = () => {
if (props.open) {
props.closeViewingOptions();
props.closeMenu();
}
};
return (
<ClickOutside onClickOutside={handleClickOutside}>
<div className={cn([styles.root, 'coral-plugin-viewing-options'])}>
<div className={cn([styles.root, 'talk-plugin-viewing-options'])}>
<div>
<button className={styles.button} onClick={toggleOpen}>
<Icon className={styles.filterIcon} name="filter_list" />
@@ -32,12 +32,12 @@ const ViewingOptions = (props) => {
</div>
{
props.open ? (
<div className={cn([styles.list, 'coral-plugin-viewing-options-list'])}>
<div className={cn([styles.list, 'talk-plugin-viewing-options-list'])}>
<ul>
{
React.Children.map(<Slot fill="viewingOptions" />, (component) => {
return React.createElement('li', {
className: 'coral-plugin-viewing-options-item'
className: 'talk-plugin-viewing-options-item'
}, component);
})
}
@@ -0,0 +1,5 @@
const prefix = 'TALK_VIEWING_OPTIONS';
export const OPEN_MENU = `${prefix}_OPEN_MENU`;
export const CLOSE_MENU = `${prefix}_CLOSE_MENU`;
@@ -1,13 +1,13 @@
import {connect} from 'plugin-api/beta/client/hocs';
import {bindActionCreators} from 'redux';
import ViewingOptions from '../components/ViewingOptions';
import {openViewingOptions, closeViewingOptions} from '../actions';
import {openMenu, closeMenu} from '../actions';
const mapStateToProps = ({coralPluginViewingOptions: state}) => ({
const mapStateToProps = ({talkPluginViewingOptions: state}) => ({
open: state.open
});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({openViewingOptions, closeViewingOptions}, dispatch);
bindActionCreators({openMenu, closeMenu}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(ViewingOptions);
@@ -1,17 +1,17 @@
import {VIEWING_OPTIONS_OPEN, VIEWING_OPTIONS_CLOSE} from './constants';
import {OPEN_MENU, CLOSE_MENU} from './constants';
const initialState = {
open: false
};
export default function offTopic (state = initialState, action) {
export default function reducer(state = initialState, action) {
switch (action.type) {
case VIEWING_OPTIONS_OPEN:
case OPEN_MENU:
return {
...state,
open: true
};
case VIEWING_OPTIONS_CLOSE:
case CLOSE_MENU:
return {
...state,
open: false