mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Post follow and updates notifications V1 (#111)
* It is now possible to follow a post in order to receive updates about it * Notifications are now sent when updates are published * Post status changes are now tracked * Update sidebar now shows the post status history * Mark a comment as a post update using the comment form * ... more ...
This commit is contained in:
committed by
GitHub
parent
ce7be1b30c
commit
dad382d2b1
@@ -23,6 +23,7 @@ interface Props {
|
||||
requestComments(postId: number, page?: number): void;
|
||||
toggleCommentReply(commentId: number): void;
|
||||
setCommentReplyBody(commentId: number, body: string): void;
|
||||
toggleCommentIsPostUpdateFlag(): void;
|
||||
toggleCommentIsPostUpdate(
|
||||
postId: number,
|
||||
commentId: number,
|
||||
@@ -33,6 +34,7 @@ interface Props {
|
||||
postId: number,
|
||||
body: string,
|
||||
parentId: number,
|
||||
isPostUpdate: boolean,
|
||||
authenticityToken: string,
|
||||
): void;
|
||||
}
|
||||
@@ -51,11 +53,12 @@ class CommentsP extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
_handleSubmitComment = (body: string, parentId: number) => {
|
||||
_handleSubmitComment = (body: string, parentId: number, isPostUpdate: boolean) => {
|
||||
this.props.submitComment(
|
||||
this.props.postId,
|
||||
body,
|
||||
parentId,
|
||||
isPostUpdate,
|
||||
this.props.authenticityToken,
|
||||
);
|
||||
}
|
||||
@@ -73,6 +76,7 @@ class CommentsP extends React.Component<Props> {
|
||||
|
||||
toggleCommentReply,
|
||||
setCommentReplyBody,
|
||||
toggleCommentIsPostUpdateFlag,
|
||||
} = this.props;
|
||||
|
||||
const postReply = replyForms.find(replyForm => replyForm.commentId === null);
|
||||
@@ -82,6 +86,7 @@ class CommentsP extends React.Component<Props> {
|
||||
<NewComment
|
||||
body={postReply && postReply.body}
|
||||
parentId={null}
|
||||
postUpdateFlagValue={postReply && postReply.isPostUpdate}
|
||||
isSubmitting={postReply && postReply.isSubmitting}
|
||||
error={postReply && postReply.error}
|
||||
handleChange={
|
||||
@@ -89,9 +94,11 @@ class CommentsP extends React.Component<Props> {
|
||||
setCommentReplyBody(null, (e.target as HTMLTextAreaElement).value)
|
||||
)
|
||||
}
|
||||
handlePostUpdateFlag={toggleCommentIsPostUpdateFlag}
|
||||
handleSubmit={this._handleSubmitComment}
|
||||
|
||||
isLoggedIn={isLoggedIn}
|
||||
isPowerUser={isPowerUser}
|
||||
userEmail={userEmail}
|
||||
/>
|
||||
|
||||
@@ -99,7 +106,7 @@ class CommentsP extends React.Component<Props> {
|
||||
{ error ? <DangerText>{error}</DangerText> : null }
|
||||
|
||||
<div className="commentsTitle">
|
||||
activity • {comments.length} comments
|
||||
activity • {comments.length} comment{comments.length === 1 ? '' : 's'}
|
||||
</div>
|
||||
|
||||
<CommentList
|
||||
|
||||
Reference in New Issue
Block a user