mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
More Refactoring
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
const prefix = 'TALK_EMBED_STREAM_COMMENT_BOX';
|
||||
|
||||
export const ADD_TAG = `${prefix}_ADD_TAG`;
|
||||
export const REMOVE_TAG = `${prefix}_REMOVE_TAG`;
|
||||
export const CLEAR_TAGS = `${prefix}_CLEAR_TAGS`;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ADD_TAG, REMOVE_TAG, CLEAR_TAGS } from './constants';
|
||||
import { ADD_TAG, REMOVE_TAG, CLEAR_TAGS } from '../constants/commentBox';
|
||||
|
||||
const initialState = {
|
||||
tags: [],
|
||||
@@ -4,7 +4,7 @@ import embed from './embed';
|
||||
import config from './config';
|
||||
import configure from './configure';
|
||||
import stream from './stream';
|
||||
import { reducer as commentBox } from '../../../talk-plugin-commentbox';
|
||||
import commentBox from './commentBox';
|
||||
|
||||
export default {
|
||||
auth,
|
||||
|
||||
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
||||
|
||||
import TagLabel from './TagLabel';
|
||||
import CommentTimestamp from 'coral-framework/components/CommentTimestamp';
|
||||
import { ReplyBox, ReplyButton } from 'talk-plugin-replies';
|
||||
import { ReplyButton } from 'talk-plugin-replies';
|
||||
import ReplyBox from './ReplyBox';
|
||||
import { FlagComment } from 'talk-plugin-flags';
|
||||
import { can } from 'coral-framework/services/perms';
|
||||
import { TransitionGroup } from 'react-transition-group';
|
||||
|
||||
+3
-2
@@ -4,8 +4,9 @@ import { Button } from 'coral-ui';
|
||||
import cn from 'classnames';
|
||||
import Slot from 'coral-framework/components/Slot';
|
||||
|
||||
import { name } from './CommentBox';
|
||||
import styles from './styles.css';
|
||||
// TODO: need to change this.
|
||||
import { name } from '../containers/CommentBox';
|
||||
import styles from './CommentForm.css';
|
||||
|
||||
import t from 'coral-framework/services/i18n';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { notifyForNewCommentStatus } from 'talk-plugin-commentbox/CommentBox';
|
||||
import { CommentForm } from 'talk-plugin-commentbox/CommentForm';
|
||||
|
||||
// TODO: move this function.
|
||||
import { notifyForNewCommentStatus } from '../containers/CommentBox';
|
||||
import { CommentForm } from './CommentForm';
|
||||
import styles from './Comment.css';
|
||||
import { CountdownSeconds } from './CountdownSeconds';
|
||||
import { getEditableUntilDate } from './util';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import Markdown from 'coral-framework/components/Markdown';
|
||||
|
||||
// TODO: remove this.
|
||||
const packagename = 'talk-plugin-infobox';
|
||||
|
||||
const InfoBox = ({ enable, content }) => (
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CommentBox from '../talk-plugin-commentbox/CommentBox';
|
||||
import CommentBox from '../containers/CommentBox';
|
||||
|
||||
// TODO: remove this..
|
||||
const name = 'talk-plugin-replies';
|
||||
|
||||
class ReplyBox extends Component {
|
||||
@@ -10,7 +10,7 @@ import { can } from 'coral-framework/services/perms';
|
||||
import ModerationLink from './ModerationLink';
|
||||
import RestrictedMessageBox from 'coral-framework/components/RestrictedMessageBox';
|
||||
import t, { timeago } from 'coral-framework/services/i18n';
|
||||
import CommentBox from 'talk-plugin-commentbox/CommentBox';
|
||||
import CommentBox from '../containers/CommentBox';
|
||||
import QuestionBox from '../../../components/QuestionBox';
|
||||
import { isCommentActive } from 'coral-framework/utils';
|
||||
import { Tab, TabCount, TabPane } from 'coral-ui';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
// TODO: change className.
|
||||
|
||||
const TagLabel = ({ children }) => (
|
||||
<div className="talk-plugin-tag-label">{children}</div>
|
||||
);
|
||||
|
||||
+2
-1
@@ -6,8 +6,9 @@ import { can } from 'coral-framework/services/perms';
|
||||
|
||||
import Slot from 'coral-framework/components/Slot';
|
||||
import { connect } from 'react-redux';
|
||||
import { CommentForm } from './CommentForm';
|
||||
import { CommentForm } from '../components/CommentForm';
|
||||
|
||||
// TODO: change this...
|
||||
export const name = 'talk-plugin-commentbox';
|
||||
|
||||
const notifyReasons = ['LINKS', 'TRUST'];
|
||||
@@ -1,3 +0,0 @@
|
||||
export const ADD_TAG = 'ADD_TAG';
|
||||
export const REMOVE_TAG = 'REMOVE_TAG';
|
||||
export const CLEAR_TAGS = 'CLEAR_TAGS';
|
||||
@@ -1 +0,0 @@
|
||||
export { default as reducer } from './reducer';
|
||||
@@ -1,4 +1 @@
|
||||
import ReplyBox from './ReplyBox';
|
||||
import ReplyButton from './ReplyButton';
|
||||
|
||||
export { ReplyBox, ReplyButton };
|
||||
export { default as ReplyButton } from './ReplyButton';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { addTag, removeTag } from 'talk-plugin-commentbox/actions';
|
||||
export { addTag, removeTag } from 'coral-embed-stream/src/actions/commentBox';
|
||||
export {
|
||||
addCommentClassName,
|
||||
removeCommentClassName,
|
||||
|
||||
@@ -84,7 +84,6 @@ module.exports = class CommentsService {
|
||||
* @param {String} status the new Comment status
|
||||
*/
|
||||
static async edit({ id, author_id, body, status }) {
|
||||
console.log(status);
|
||||
const EDITABLE_STATUSES = ['NONE', 'PREMOD', 'ACCEPTED'];
|
||||
|
||||
const query = {
|
||||
@@ -210,7 +209,6 @@ module.exports = class CommentsService {
|
||||
|
||||
await events.emitAsync(COMMENTS_EDIT, originalComment, editedComment);
|
||||
|
||||
console.log(editedComment);
|
||||
return editedComment;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user