Monorepo for Tangled tangled.org

appview: unified comment fragments/handlers #1276

open opened by boltless.me targeting master from sl/comment

share as much handlers/fragments as possible. PR has still /.../comment endpoint to serve comment form htmx fragment. Due to how it is designed.

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mimbhgiqjb22
+5 -5
Interdiff #8 #9
appview/db/comments.go

This file has not been changed.

appview/ingester.go

This patch was likely rebased, as context lines do not match.

appview/issues/issues.go

This patch was likely rebased, as context lines do not match.

appview/issues/router.go

This file has not been changed.

appview/models/comment.go

This file has not been changed.

appview/pages/pages.go

This patch was likely rebased, as context lines do not match.

appview/pages/templates/fragments/comment/commentBody.html

This file has not been changed.

appview/pages/templates/fragments/comment/commentHeader.html

This file has not been changed.

appview/pages/templates/fragments/comment/edit.html

This file has not been changed.

appview/pages/templates/fragments/comment/reply.html

This file has not been changed.

appview/pages/templates/fragments/comment/replyPlaceholder.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/commentList.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/newComment.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/replyComment.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/replyIssueCommentPlaceholder.html

This file has not been changed.

appview/pages/templates/repo/pulls/fragments/pullActions.html

This file has not been changed.

appview/pages/templates/repo/pulls/fragments/pullNewComment.html

This file has not been changed.

appview/pages/templates/repo/pulls/pull.html

This file has not been changed.

appview/pulls/pulls.go

This patch was likely rebased, as context lines do not match.

appview/pulls/router.go

This file has not been changed.

+5 -5
appview/state/comment.go
··· 179 179 } 180 180 181 181 comment := models.Comment{ 182 - Did: syntax.DID(user.Active.Did), 182 + Did: syntax.DID(user.Did), 183 183 Collection: tangled.FeedCommentNSID, 184 184 Rkey: syntax.RecordKey(tid.TID()), 185 185 ··· 259 259 return 260 260 } 261 261 262 - if comment.Did.String() != user.Active.Did { 263 - l.Error("unauthorized comment edit", "expectedDid", comment.Did, "gotDid", user.Active.Did) 262 + if comment.Did.String() != user.Did { 263 + l.Error("unauthorized comment edit", "expectedDid", comment.Did, "gotDid", user.Did) 264 264 s.pages.Notice(w, noticeId, "You are not the author of this comment") 265 265 return 266 266 } ··· 357 357 return 358 358 } 359 359 360 - if comment.Did.String() != user.Active.Did { 361 - l.Error("unauthorized action", "expectedDid", comment.Did, "gotDid", user.Active.Did) 360 + if comment.Did.String() != user.Did { 361 + l.Error("unauthorized action", "expectedDid", comment.Did, "gotDid", user.Did) 362 362 s.pages.Notice(w, noticeId, "you are not the author of this comment") 363 363 return 364 364 }
appview/state/router.go

This file has not been changed.

appview/strings/strings.go

This patch was likely rebased, as context lines do not match.

History

10 rounds 4 comments
sign up or login to add to the discussion
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
no conflicts, ready to merge
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 4 comments

appview/pages/templates/fragments/comment/edit.html:2 now opens with form, I don't see a /form close in this diff tho

appview/state/comment.go:385-388 also how about a db.DeleteComments() from our sqlite?

appview/state/comment.go:249-268 comment.Validate() warranted just in case?

now opens with form, I don't see a /form close in this diff tho

how could I miss that. Thanks for pointing out.

how about a db.DeleteComments() from our sqlite?

I didn't do that on purpose. Comment deletion event will/should be ingested from appview ingester. For create/update events, it makes sense to do that on web handler because we can avoid parsing markdown again. But for delete event, we just don't need to delete records on web handler. Even if something goes wrong, it's ingester's job to retry, not web handlers.

comment.Validate() warranted just in case?

good idea. will add it.

1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments
1 commit
expand
appview: unified comment fragments/handlers
3/3 failed
expand
expand 0 comments