From 65f7ee2ab3ef3cdcd1d7baec3bab33067b2eae6f Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 12 Jun 2017 19:09:42 -0300 Subject: [PATCH] coral-plugin-commnet-content --- .eslintignore | 1 + .gitignore | 1 + .../src/components/Comment.js | 4 +--- .../CommentContent.js | 17 -------------- .../__tests__/commentContent.spec.js | 11 --------- client/coral-plugin-history/Comment.js | 7 +++--- .../client/components/CreateUsernameDialog.js | 2 +- .../client/components/FakeComment.js | 8 +++---- .../client/.babelrc | 14 +++++++++++ .../client/.eslintrc.json | 23 +++++++++++++++++++ .../client/components/CommentContent.js | 23 +++++++++++++++++++ .../client/components/Link.js | 13 +++++++++++ .../client/components/styles.css | 8 +++++++ .../client/helpers/isLink.js | 5 ++++ .../client/index.js | 7 ++++++ plugins/coral-plugin-comment-content/index.js | 1 + 16 files changed, 106 insertions(+), 39 deletions(-) delete mode 100644 client/coral-plugin-commentcontent/CommentContent.js delete mode 100644 client/coral-plugin-commentcontent/__tests__/commentContent.spec.js create mode 100644 plugins/coral-plugin-comment-content/client/.babelrc create mode 100644 plugins/coral-plugin-comment-content/client/.eslintrc.json create mode 100644 plugins/coral-plugin-comment-content/client/components/CommentContent.js create mode 100644 plugins/coral-plugin-comment-content/client/components/Link.js create mode 100644 plugins/coral-plugin-comment-content/client/components/styles.css create mode 100644 plugins/coral-plugin-comment-content/client/helpers/isLink.js create mode 100644 plugins/coral-plugin-comment-content/client/index.js create mode 100644 plugins/coral-plugin-comment-content/index.js diff --git a/.eslintignore b/.eslintignore index 6fecd9d9b..8a8c3a213 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,4 +11,5 @@ plugins/* !plugins/coral-plugin-mod !plugins/coral-plugin-love !plugins/coral-plugin-viewing-options +!plugins/coral-plugin-comment-content node_modules diff --git a/.gitignore b/.gitignore index abd490356..b3e0eaa73 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,6 @@ plugins/* !plugins/coral-plugin-mod !plugins/coral-plugin-love !plugins/coral-plugin-viewing-options +!plugins/coral-plugin-comment-content **/node_modules/* diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 92c59d936..82befeb2a 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -3,7 +3,6 @@ import React, {PropTypes} from 'react'; import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton'; import AuthorName from 'coral-plugin-author-name/AuthorName'; import TagLabel from 'coral-plugin-tag-label/TagLabel'; -import Content from 'coral-plugin-commentcontent/CommentContent'; import PubDate from 'coral-plugin-pubdate/PubDate'; import {ReplyBox, ReplyButton} from 'coral-plugin-replies'; import FlagComment from 'coral-plugin-flags/FlagComment'; @@ -466,8 +465,7 @@ export default class Comment extends React.Component { stopEditing={this.stopEditing} /> :
- - +
} diff --git a/client/coral-plugin-commentcontent/CommentContent.js b/client/coral-plugin-commentcontent/CommentContent.js deleted file mode 100644 index 501005b3d..000000000 --- a/client/coral-plugin-commentcontent/CommentContent.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -const name = 'coral-plugin-commentcontent'; - -const Content = ({body, styles}) => { - const textbreaks = body.split('\n'); - return
- { - textbreaks.map((line, i) => - {line}
-
) - } -
; -}; - -export default Content; diff --git a/client/coral-plugin-commentcontent/__tests__/commentContent.spec.js b/client/coral-plugin-commentcontent/__tests__/commentContent.spec.js deleted file mode 100644 index 377726b6d..000000000 --- a/client/coral-plugin-commentcontent/__tests__/commentContent.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import {shallow} from 'enzyme'; -import {expect} from 'chai'; -import CommentContent from '../CommentContent'; - -describe('CommentContent', () => { - it('should render content', () => { - const render = shallow(); - expect(render.contains('test')).to.be.truthy; - }); -}); diff --git a/client/coral-plugin-history/Comment.js b/client/coral-plugin-history/Comment.js index cb188e53e..d85b7fb1c 100644 --- a/client/coral-plugin-history/Comment.js +++ b/client/coral-plugin-history/Comment.js @@ -1,8 +1,8 @@ import React, {PropTypes} from 'react'; import {Icon} from '../coral-ui'; import styles from './Comment.css'; +import Slot from 'coral-framework/components/Slot'; import PubDate from '../coral-plugin-pubdate/PubDate'; -import Content from '../coral-plugin-commentcontent/CommentContent'; import t from 'coral-framework/services/i18n'; @@ -10,9 +10,10 @@ const Comment = (props) => { return (
-

{t('createdisplay.if_you_dont_change_your_name')} diff --git a/plugins/coral-plugin-auth/client/components/FakeComment.js b/plugins/coral-plugin-auth/client/components/FakeComment.js index 390dd409b..5517b72aa 100644 --- a/plugins/coral-plugin-auth/client/components/FakeComment.js +++ b/plugins/coral-plugin-auth/client/components/FakeComment.js @@ -1,17 +1,17 @@ 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 Slot from 'coral-framework/components/Slot'; import AuthorName from 'coral-plugin-author-name/AuthorName'; -import Content from 'coral-plugin-commentcontent/CommentContent'; import styles from 'coral-embed-stream/src/components/Comment.css'; -import t from 'coral-framework/services/i18n'; -export const FakeComment = ({username, created_at, body}) => ( +export const FakeComment = ({username, created_at, comment}) => (


- +