mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Edit Comment UI reflects expired edit comment window
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const CommentsService = require('../../services/comments');
|
||||
|
||||
const Comment = {
|
||||
parent({parent_id}, _, {loaders: {Comments}}) {
|
||||
if (parent_id == null) {
|
||||
@@ -45,6 +47,14 @@ const Comment = {
|
||||
},
|
||||
asset({asset_id}, _, {loaders: {Assets}}) {
|
||||
return Assets.getByID.load(asset_id);
|
||||
},
|
||||
editing(comment) {
|
||||
const editableUntil = CommentsService.getEditableUntilDate(comment);
|
||||
const edited = comment.body_history.length > 1;
|
||||
return {
|
||||
edited,
|
||||
editableUntil,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -166,6 +166,11 @@ input CommentCountQuery {
|
||||
tag: [String]
|
||||
}
|
||||
|
||||
type EditInfo {
|
||||
edited: Boolean!
|
||||
editableUntil: Date
|
||||
}
|
||||
|
||||
# Comment is the base representation of user interaction in Talk.
|
||||
type Comment {
|
||||
|
||||
@@ -207,6 +212,9 @@ type Comment {
|
||||
|
||||
# The time when the comment was created
|
||||
created_at: Date!
|
||||
|
||||
# describes how the comment can be edited
|
||||
editing: EditInfo
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user