mirror of
https://github.com/wassname/talk.git
synced 2026-08-01 13:00:55 +08:00
remove most liked comments widget
This commit is contained in:
@@ -5,7 +5,8 @@ import {connect} from 'react-redux';
|
||||
import FlagWidget from './FlagWidget';
|
||||
import LikeWidget from './LikeWidget';
|
||||
import METRICS from 'coral-admin/src/graphql/queries/metrics.graphql';
|
||||
import MostLikedCommentsWidget from './MostLikedCommentsWidget';
|
||||
|
||||
// import MostLikedCommentsWidget from './MostLikedCommentsWidget';
|
||||
import {showBanUserDialog, hideBanUserDialog} from 'coral-admin/src/actions/moderation';
|
||||
import {banUser, setCommentStatus} from 'coral-admin/src/graphql/mutations';
|
||||
import {Spinner} from 'coral-ui';
|
||||
@@ -18,12 +19,14 @@ class Dashboard extends React.Component {
|
||||
return <Spinner />;
|
||||
}
|
||||
|
||||
const {data: {assetsByLike, assetsByFlag, mostLikedComments}} = this.props;
|
||||
const {moderation, settings} = this.props;
|
||||
const {data: {assetsByLike, assetsByFlag/* , mostLikedComments*/}} = this.props;
|
||||
|
||||
// const {moderation, settings} = this.props;
|
||||
|
||||
return (
|
||||
<div className={styles.Dashboard}>
|
||||
<FlagWidget assets={assetsByFlag} />
|
||||
{/*
|
||||
<MostLikedCommentsWidget
|
||||
comments={mostLikedComments}
|
||||
moderation={moderation}
|
||||
@@ -33,6 +36,7 @@ class Dashboard extends React.Component {
|
||||
handleBanUser={this.props.banUser}
|
||||
showBanUserDialog={this.props.showBanUserDialog}
|
||||
hideBanUserDialog={this.props.hideBanUserDialog} />
|
||||
*/}
|
||||
<LikeWidget assets={assetsByLike} />
|
||||
</div>
|
||||
);
|
||||
@@ -40,7 +44,7 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
|
||||
let then = new Date();
|
||||
then.setMinutes(then.getMinutes() - 205);
|
||||
then.setMinutes(then.getMinutes() - 5);
|
||||
then = then.toISOString();
|
||||
const now = new Date().toISOString();
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ const FlagWidget = (props) => {
|
||||
<th></th>{/* empty on purpose */}
|
||||
<th>{lang.t('streams.article')}</th>
|
||||
<th>{lang.t('modqueue.flagged')}</th>
|
||||
<th>{lang.t('modqueue.likes')}</th>
|
||||
<th>{lang.t('dashboard.comment_count')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -27,7 +26,6 @@ const FlagWidget = (props) => {
|
||||
assets.length
|
||||
? assets.map((asset, index) => {
|
||||
const flagSummary = asset.action_summaries.find(s => s.type === 'FlagAssetActionSummary');
|
||||
const likeSummary = asset.action_summaries.find(s => s.type === 'LikeAssetActionSummary');
|
||||
return (
|
||||
<tr key={asset.id}>
|
||||
<td>{index + 1}.</td>
|
||||
@@ -36,7 +34,6 @@ const FlagWidget = (props) => {
|
||||
<p className={styles.lede}>{asset.author} - Published: {new Date(asset.created_at).toLocaleDateString()}</p>
|
||||
</td>
|
||||
<td>{flagSummary ? flagSummary.actionCount : 0}</td>
|
||||
<td>{likeSummary ? likeSummary.actionCount : 0}</td>
|
||||
<td>{asset.commentCount}</td>
|
||||
</tr>
|
||||
);
|
||||
|
||||
@@ -18,7 +18,6 @@ const LikeWidget = (props) => {
|
||||
<tr>
|
||||
<th></th>{/* empty on purpose */}
|
||||
<th>{lang.t('streams.article')}</th>
|
||||
<th>{lang.t('modqueue.flagged')}</th>
|
||||
<th>{lang.t('modqueue.likes')}</th>
|
||||
<th>{lang.t('dashboard.comment_count')}</th>
|
||||
</tr>
|
||||
@@ -27,7 +26,6 @@ const LikeWidget = (props) => {
|
||||
{
|
||||
assets.length
|
||||
? assets.map((asset, index) => {
|
||||
const flagSummary = asset.action_summaries.find(s => s.type === 'FlagAssetActionSummary');
|
||||
const likeSummary = asset.action_summaries.find(s => s.type === 'LikeAssetActionSummary');
|
||||
return (
|
||||
<tr key={asset.id}>
|
||||
@@ -36,7 +34,6 @@ const LikeWidget = (props) => {
|
||||
<Link to={`/admin/moderate/flagged/${asset.id}`}>{asset.title}</Link>
|
||||
<p className={styles.lede}>{asset.author} - Published: {new Date(asset.created_at).toLocaleDateString()}</p>
|
||||
</td>
|
||||
<td>{flagSummary ? flagSummary.actionCount : 0}</td>
|
||||
<td>{likeSummary ? likeSummary.actionCount : 0}</td>
|
||||
<td>{asset.commentCount}</td>
|
||||
</tr>
|
||||
|
||||
@@ -19,21 +19,21 @@ query Metrics ($from: Date!, $to: Date!) {
|
||||
assetsByLike: assetMetrics(from: $from, to: $to, sort: LIKE) {
|
||||
...metrics
|
||||
}
|
||||
mostLikedComments: commentMetrics(from: $from, to: $to, sort: LIKE) {
|
||||
id
|
||||
body
|
||||
user {
|
||||
status
|
||||
username
|
||||
}
|
||||
asset {
|
||||
id
|
||||
title
|
||||
}
|
||||
created_at
|
||||
action_summaries {
|
||||
type: __typename
|
||||
count
|
||||
}
|
||||
}
|
||||
# mostLikedComments: commentMetrics(from: $from, to: $to, sort: LIKE) {
|
||||
# id
|
||||
# body
|
||||
# user {
|
||||
# status
|
||||
# username
|
||||
# }
|
||||
# asset {
|
||||
# id
|
||||
# title
|
||||
# }
|
||||
# created_at
|
||||
# action_summaries {
|
||||
# type: __typename
|
||||
# count
|
||||
# }
|
||||
# }
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
"dashboard": {
|
||||
"no_flags": "There have been no flags in the last 5 minutes! Hooray!",
|
||||
"no_likes": "There have been no likes in the last 5 minutes. All quiet.",
|
||||
"comment_count": "Comments"
|
||||
"comment_count": "comments"
|
||||
},
|
||||
"streams": {
|
||||
"empty_result": "No assets match this search. Maybe try widening your search?",
|
||||
@@ -222,7 +222,7 @@
|
||||
"dashbord": {
|
||||
"no_flags": "¡Nadie ha marcado nada en los últimos 5 minutos! ¡Bravo!",
|
||||
"no_likes": "A nadie le ha gustado algún comentario en los últimos 5 minutos. Todo tranquilo.",
|
||||
"comment_count": "Comentarios"
|
||||
"comment_count": "comentarios"
|
||||
},
|
||||
"streams": {
|
||||
"empty_result": "No se encuentro articulo con esta busqueda. Tal vez extender la busqueda?",
|
||||
|
||||
Reference in New Issue
Block a user