Merge branch 'master' into rm-immutable-js

This commit is contained in:
Kim Gardner
2017-08-15 11:27:45 +01:00
committed by GitHub
12 changed files with 82 additions and 67 deletions
@@ -17,11 +17,11 @@ const ActivityWidget = ({assets}) => {
? assets.map((asset) => {
return (
<div className={styles.rowLinkify} key={asset.id}>
<Link className={styles.linkToModerate} to={`/admin/moderate/flagged/${asset.id}`}>Moderate</Link>
<Link className={styles.linkToModerate} to={`/admin/moderate/${asset.id}`}>Moderate</Link>
<p className={styles.widgetCount}>{asset.commentCount}</p>
<Link className={styles.linkToAsset} to={`${asset.url}#coralStreamEmbed_iframe`} target="_blank">
<a className={styles.linkToAsset} href={`${asset.url}`} target="_blank">
<p className={styles.assetTitle}>{asset.title}</p>
</Link>
</a>
<p className={styles.lede}>{asset.author} Published: {new Date(asset.created_at).toLocaleDateString()}</p>
</div>
);
@@ -24,11 +24,11 @@ const FlagWidget = ({assets}) => {
return (
<div className={styles.rowLinkify} key={asset.id}>
<Link className={styles.linkToModerate} to={`/admin/moderate/flagged/${asset.id}`}>Moderate</Link>
<Link className={styles.linkToModerate} to={`/admin/moderate/reported/${asset.id}`}>Moderate</Link>
<p className={styles.widgetCount}>{flagSummary ? flagSummary.actionCount : 0}</p>
<Link className={styles.linkToAsset} to={`${asset.url}#coralStreamEmbed_iframe`} target="_blank">
<a className={styles.linkToAsset} href={`${asset.url}`} target="_blank">
<p className={styles.assetTitle}>{asset.title}</p>
</Link>
</a>
<p className={styles.lede}>{asset.author} Published: {new Date(asset.created_at).toLocaleDateString()}</p>
</div>
);
@@ -19,11 +19,11 @@ const LikeWidget = ({assets}) => {
const likeSummary = asset.action_summaries.find((s) => s.type === 'LikeAssetActionSummary');
return (
<div className={styles.rowLinkify} key={asset.id}>
<Link className={styles.linkToModerate} to={`/admin/moderate/flagged/${asset.id}`}>Moderate</Link>
<Link className={styles.linkToModerate} to={`/admin/moderate/${asset.id}`}>Moderate</Link>
<p className={styles.widgetCount}>{likeSummary ? likeSummary.actionCount : 0}</p>
<Link className={styles.linkToAsset} to={`${asset.url}#coralStreamEmbed_iframe`} target="_blank">
<a className={styles.linkToAsset} href={`${asset.url}`} target="_blank">
<p className={styles.assetTitle}>{asset.title}</p>
</Link>
</a>
<p className={styles.lede}>{asset.author} Published: {new Date(asset.created_at).toLocaleDateString()}</p>
</div>
);
+1 -1
View File
@@ -13,7 +13,7 @@ body {
width: 100%;
font-size: 14px;
margin: 0px;
padding: 0px 0px 50px 0px;
padding: 0px 0px 100px 0px;
height: auto !important;
}
+2 -2
View File
@@ -92,13 +92,13 @@ export default (document, config = {}) => (WrappedComponent) => {
// Do not run updates when we have mutation errors.
return prev;
}
return map[key](prev, result);
return map[key](prev, result) || prev;
};
} else {
const existing = res[key];
res[key] = (prev, result) => {
const next = existing(prev, result);
return map[key](next, result);
return map[key](next, result) || next;
};
}
});
+4 -2
View File
@@ -128,8 +128,10 @@ export default (document, config = {}) => (WrappedComponent) => {
const reducer = withSkipOnErrors(
reducerCallbacks.reduce(
(a, b) => (prev, ...rest) =>
b(a(prev, ...rest), ...rest),
(a, b) => (prev, ...rest) => {
const next = a(prev, ...rest);
return b(next, ...rest) || next;
}
));
return {
@@ -32,7 +32,7 @@ const CreateUsernameDialog = ({
className={styles.fakeComment}
username={formData.username}
created_at={Date.now()}
comment={{body:t('createdisplay.fake_comment_body')}}
body={t('createdisplay.fake_comment_body')}
/>
<p className={styles.ifyoudont}>
{t('createdisplay.if_you_dont_change_your_name')}
@@ -0,0 +1,37 @@
.root {
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
margin-bottom: 10px;
padding: 8px 0px 10px 0px;
position: relative;
}
.body {
}
.footer {
display: flex;
justify-content: space-between;
}
.button {
color: #2a2a2a;
margin: 5px 10px 5px 0px;
background: none;
padding: 0px;
border: none;
font-size: inherit;
vertical-align: middle;
&:hover {
color: #767676;
cursor: pointer;
}
}
.icon {
font-size: 12px;
padding: 0 2px 0 5px;
vertical-align: middle;
}
@@ -2,65 +2,43 @@ import React from 'react';
import t from 'coral-framework/services/i18n';
import {ReplyButton} from 'talk-plugin-replies';
import PubDate from 'talk-plugin-pubdate/PubDate';
import Slot from 'coral-framework/components/Slot';
import AuthorName from 'talk-plugin-author-name/AuthorName';
import styles from 'coral-embed-stream/src/components/Comment.css';
import styles from './FakeComment.css';
import {Icon} from 'plugin-api/beta/client/components/ui';
export const FakeComment = ({username, created_at, comment}) => (
<div className={`comment ${styles.Comment}`} style={{marginLeft: 0 * 30}}>
<hr aria-hidden={true} />
<AuthorName author={{name: username}} />
export const FakeComment = ({username, created_at, body}) => (
<div className={styles.root}>
<AuthorName author={{username}} />
<PubDate created_at={created_at} />
<Slot comment={comment} />
<div className="commentActionsLeft comment__action-container">
<div className={`${'talk-plugin-likes'}-container`}>
<button className={'talk-plugin-likes-button'}>
<span className={'talk-plugin-likes-button-text'}>
<div className={styles.body}>
{body}
</div>
<div className={styles.footer}>
<div>
<button className={styles.button}>
<span className={styles.label}>
{t('like')}
</span>
<i
className={`${'talk-plugin-likes'}-icon material-icons`}
aria-hidden={true}
>
thumb_up
</i>
<Icon name="thumb_up" className={styles.icon} />
</button>
<ReplyButton
onClick={() => {}}
parentCommentId={'commentID'}
currentUserId={{}}
/>
</div>
<ReplyButton
onClick={() => {}}
parentCommentId={'commentID'}
currentUserId={{}}
/>
</div>
<div className="commentActionsRight comment__action-container">
<div className="talk-plugin-permalinks-container">
<button className="talk-plugin-permalinks-button">
<span
className={`comment__action-button comment__action-button--nowrap ${'talk-plugin-flags'}-button-text`}
>
<div>
<button className={styles.button}>
<span className={styles.label}>
{t('permalink')}
</span>
<i
className="talk-plugin-permalinks-icon material-icons"
aria-hidden={true}
>
link
</i>
<Icon name="link" className={styles.icon} />
</button>
</div>
<div className={`${'talk-plugin-flags'}-container`}>
<button className={`${'talk-plugin-flags'}-button`}>
<span
className={`comment__action-button comment__action-button--nowrap ${'talk-plugin-flags'}-button-text`}
>
<button className={styles.button}>
<span className={styles.label}>
{t('report')}
</span>
<i
className={`${'talk-plugin-flags'}-icon material-icons`}
aria-hidden={true}
>
flag
</i>
<Icon name="flag" className={styles.icon} />
</button>
</div>
</div>
@@ -26,6 +26,9 @@ export default {
IgnoreUser: ({variables}) => ({
updateQueries: {
CoralEmbedStream_Embed: (previous) => {
if (!previous.asset.featuredComments) {
return previous;
}
const ignoredUserId = variables.id;
const newNodes = previous.asset.featuredComments.nodes.filter((n) => n.user.id !== ignoredUserId);
const removedCount = previous.asset.featuredComments.nodes.length - newNodes.length;
@@ -16,7 +16,6 @@ export default class OffTopicFilter extends React.Component {
this.props.removeCommentClassName(idx);
this.props.toggleCheckbox();
}
this.props.closeViewingOptions();
}
render() {
@@ -3,9 +3,6 @@ import {bindActionCreators} from 'redux';
import {toggleCheckbox} from '../actions';
import {commentClassNamesSelector} from 'plugin-api/alpha/client/selectors';
import OffTopicFilter from '../components/OffTopicFilter';
import {
closeViewingOptions
} from 'plugins/talk-plugin-viewing-options/client/actions';
import {
addCommentClassName,
removeCommentClassName
@@ -20,7 +17,6 @@ const mapDispatchToProps = (dispatch) =>
bindActionCreators(
{
toggleCheckbox,
closeViewingOptions,
addCommentClassName,
removeCommentClassName
},