-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable archive comment + wrap up #1275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the APIs so that archived comments aren't passed back to the user?
"/comment/<int:comment_id>/text/", | ||
methods=["PUT"], | ||
) | ||
def edit_comment(comment_id: int, **fields): | ||
def edit_comment_text(comment_id: int, **fields): | ||
assert_can_edit_and_delete(comment_id=comment_id) | ||
return logic.edit_comment(comment_id=comment_id, **fields) | ||
|
||
|
||
@register( | ||
"/comment/<int:comment_id>/", | ||
methods=["DELETE"], | ||
"/comment/<int:comment_id>/archive/", | ||
methods=["PUT"], | ||
) | ||
def remove_comment(comment_id: int): | ||
def archive_comment(comment_id: int, **fields): | ||
assert_can_edit_and_delete(comment_id=comment_id) | ||
return logic.remove_comment(comment_id=comment_id) | ||
logic.edit_comment(comment_id=comment_id, **fields) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment update & soft delete in CommentResource are using the previous edit_comment
endpoint, these two are not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little bit confused, why can't we use the same methods before, but change remove comment to soft delete?
"/comment/<int:comment_id>/text/", | ||
methods=["PUT"], | ||
) | ||
def edit_comment(comment_id: int, **fields): | ||
def edit_comment_text(comment_id: int, **fields): | ||
assert_can_edit_and_delete(comment_id=comment_id) | ||
return logic.edit_comment(comment_id=comment_id, **fields) | ||
|
||
|
||
@register( | ||
"/comment/<int:comment_id>/", | ||
methods=["DELETE"], | ||
"/comment/<int:comment_id>/archive/", | ||
methods=["PUT"], | ||
) | ||
def remove_comment(comment_id: int): | ||
def archive_comment(comment_id: int, **fields): | ||
assert_can_edit_and_delete(comment_id=comment_id) | ||
return logic.remove_comment(comment_id=comment_id) | ||
logic.edit_comment(comment_id=comment_id, **fields) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little bit confused, why can't we use the same methods before, but change remove comment to soft delete?
archived: true, | ||
}; | ||
draft.commentsById[commentId].archived = true; | ||
draft.commentsById[commentId].text = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this line doesn't matter, I dont think we need to remove the text in user's redux yet
* ui: fix richtext not clearing * fix popover position issue * archive * clean * clean * add table * update * update * update * update * update
enable archive comment + add archived comment ui
add clearing to draftjs editor (known issue by draftjs)
tried to make reactions unique in db but db will say some emojis are the same
using formik bc react doesnt like state change along with forwardref?
add commenting for tables
Screen.Recording.2023-06-21.at.4.58.27.PM.mov