Merge pull request #1374 from coralproject/spam-fixes

Fixes for Spam Plugin
This commit is contained in:
Kim Gardner
2018-02-16 16:51:37 -05:00
committed by GitHub
9 changed files with 6 additions and 20 deletions
@@ -143,7 +143,6 @@
i {
font-size: 12px;
top: 2px;
position: relative;
}
}
+1
View File
@@ -10,6 +10,7 @@
line-height: 22px;
min-width: 80px;
text-align: center;
vertical-align: text-top;
}
.icon {
@@ -5,7 +5,7 @@ import { t } from 'plugin-api/beta/client/services';
const SpamLabel = () => (
<CommentDetail
icon={'add_box'}
icon={'bug_report'}
header={t('talk-plugin-akismet.spam_comment')}
info={t('talk-plugin-akismet.detected')}
/>
@@ -3,7 +3,7 @@ import { FlagLabel } from 'plugin-api/beta/client/components/ui';
import { t } from 'plugin-api/beta/client/services';
const SpamLabel = () => (
<FlagLabel iconName="add_box">{t('talk-plugin-akismet.spam')}</FlagLabel>
<FlagLabel iconName="bug_report">{t('talk-plugin-akismet.spam')}</FlagLabel>
);
export default SpamLabel;
@@ -5,7 +5,7 @@ import { isSpam } from '../utils';
const enhance = compose(
excludeIf(
({ comment: { spam, actions } }) => spam === null || isSpam(actions)
({ comment: { spam, actions } }) => spam === null || !isSpam(actions)
)
);
@@ -1,12 +0,0 @@
import { compose } from 'react-apollo';
import { excludeIf } from 'plugin-api/beta/client/hocs';
import SpamDetail from './SpamDetail';
import { isSpam } from '../utils';
const enhance = compose(
excludeIf(
({ comment: { spam, actions } }) => spam === null || !isSpam(actions)
)
);
export default enhance(SpamDetail);
@@ -2,7 +2,6 @@ import translations from './translations.yml';
import CheckSpamHook from './containers/CheckSpamHook';
import SpamLabel from './containers/SpamLabel';
import SpamCommentDetail from './containers/SpamCommentDetail';
import SpamCommentFlagDetail from './containers/SpamCommentFlagDetail';
export default {
translations,
@@ -10,6 +9,5 @@ export default {
commentInputDetailArea: [CheckSpamHook],
adminCommentLabels: [SpamLabel],
adminCommentMoreDetails: [SpamCommentDetail],
adminCommentMoreFlagDetails: [SpamCommentFlagDetail],
},
};
@@ -29,7 +29,7 @@ const getInfo = (toxicity, actions) => {
const ToxicLabel = ({ comment: { actions, toxicity } }) => (
<CommentDetail
icon={'add_box'}
icon={'error'}
header={t('talk-plugin-toxic-comments.toxic_comment')}
info={getInfo(toxicity, actions)}
/>
@@ -1,6 +1,6 @@
import React from 'react';
import { FlagLabel } from 'plugin-api/beta/client/components/ui';
const ToxicLabel = () => <FlagLabel iconName="add_box">Toxic</FlagLabel>;
const ToxicLabel = () => <FlagLabel iconName="error">Toxic</FlagLabel>;
export default ToxicLabel;