•  
     
    story #32316 Update comments
Summary
Empty
Update comments
Empty

I can only update my own comments. Keep time tracking of the comment (date / hour of editing)
Only comment done in markdown are editable.
New REST routes should be created :

  • PATCH pull_request_comments/{id}
  • PATCH pull_request_inline_comments/{id}

Front end :

  • new button
  • edit mode with preview table
  • help button

https://www.figma.com/file/it3BHQkoGPDLTPIV8V6i3h/Git---Pull-requests?type=design&mode=design&t=A7cCmb6XRFTv4WUw-1

Notifications:

  • When comment is saved, a notification is sent (as for new comments)
  • Notification subject: same as new comment
  • Notification message:
$AUTHOR updated their comment on #$PR_ID: $PR_SUMMARY

$NEW_COMMENT
Empty
Empty
Status
Pull Request
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#32316
Marie Ange Garnier (marieange)
2023-12-06 09:29
2023-06-19 11:14
35570

References
Referencing story #32316

Git commit

tuleap/tuleap/stable

feat: introduce edit button feature flag 6b1ed6d3fd
feat: comments representations have a raw_content attribute a2724ed5e0
refactor: Extract replies as sub elements 0a62af8f42
refactor: replace threads reply forms with <tuleap-pullrequest-new-comment-form/> cabf5db3f3
feat: toggle an edition form 58a7eccb91
Be able to edit a pull request comment via REST route 6abcf65cc1
refactor: extract action events from <tuleap-pullrequest-comment/> 7993bbf5eb
refactor: Retrieve comment with `CommentRetriever` object instead of `Factory` a031d5522d
refactor: Interface to retrieve inline comment b2fded73c3
refactor: Pullrequests apps stubs should not be coupled with Jest/Vitest stubs bab3bd5ff3
refactor: Create dedicated objects to retrieve pull request and pull request with its git reference 4f52e58ea8
feat: add a nullable last_edition_date column to comments tables cf8ee2bf04
refactor: Make CommentRepresentation class immutable d0b57387ec
feat: Make checks before editing inline comment 19a302b57a
feat: Save edited inline comment 985baee1a9
chore: Move stubs in the correct folders fe4d6bbee1
feat: Extract cross-refs from new content of inline comment 3ea2e89a33
Returns the CommentRepresentation in PATCH pull_request_comments/:id f8d00e72ec
chore: Move stubs and builders in the correct folders ace5479b8e
feat: Extract cross-refs from new content of global comment e227908416
feat: Save the last update date of inline comments 357b50b911
refactor: Stop relying on the the god Factory class in PullRequestUpdatedNotificationToProcessBuilder a08febf803
chore: Tests for InlineCommentDAO dff7a6b421
refactor: Stop relying on the the god PullRequest/Factory class in new 89e9397ba5
refactor: Build InlineComment representations with business objects 21323175d0
Add REST test for pull request comment fc21d94fd0
refactor: Have a business object to create inline comments 7d1a644f57
fix: project from source repository should be used when extracting 4aec274623
refactor: extract POSTHandler with unit tests 0842845792
Do not return the project id in `CommentRepresentation` d417f1e665
refactor: Build inline comment 979cfaf1f6
refactor: InlineCommentRepresentation is mutation-free 9774adfb64
feat: PATCH inline comment returns a representation 407110c310
chore: add REST test for inline comment f33c51ef8c
feat: save edited comments c9183f4bb8
Return the last edition date in TimelineInlineCommentRepresentation c20f175510
Add missing attribute in the `InlineCommentRepresentation` 356833c7a7
feat: Check source Git repo exists 8cae14f017
feat: Add git repo ID to error message 0c5bfd023f
feat: Display last edition date 4ab5f16836
refactor: remove TimelineInlineCommentRepresentation 3d1ff1aed9
chore: Tests for CommentDAO 31179e0745
refactor: Option.fromNullable in TypeScript c1f6283e8d
refactor: Use DateTimeImmutable for last edition dates ab7d93517d
Send notification when user edits his comment fd4d3f424c
Send notification when user edits his inline comment 8f29bd1cbb
refactor: Use DateTimeImmutable for post dates ed76c4c4fd
refactor: Stop relying on the the god PullRequest/Factory class in some 36d6ff3172
refactor: Remove HTML from email translated strings in comment 5ab877ff0b
refactor: Stop relying on the the god PullRequest/Factory class in new ed52f710ae
refactor: Remove HTML from email translated strings (part 2) 42d394dc7f
refactor: Remove remaining HTML from email translated strings db7c564fec
refactor: CommentCreator class to group DB queries together 6e1607bade
feat: Remove edit comments feature flag 1a664d20d0
refactor: extract POST Handler for comments eb1df4a632
refactor: Have a business object to create comments 502f896502

Follow-ups

User avatar
Joris MASSON (jmasson)2023-12-05 11:20
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Is related to
    • Added is Covered by:
User avatar
Joris MASSON (jmasson)2023-11-30 17:36

gerrit #29914 (refactor: Stop relying on the the god PullRequest/Factory class in new ItemLabeledCollector) integrated in Tuleap 15.2.99.149

User avatar
Joris MASSON (jmasson)2023-11-21 11:19
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2023-11-15 14:26

gerrit #29781 (refactor: Stop relying on the the god PullRequest/Factory class in new comment notification) integrated in Tuleap 15.2.99.39

User avatar
Joris MASSON (jmasson)2023-11-14 14:08

gerrit #29770 (refactor: Stop relying on the the god Factory class in PullRequestUpdatedNotificationToProcessBuilder) integrated in Tuleap 15.2.99.26

User avatar
Joris MASSON (jmasson)2023-11-02 14:33

gerrit #29625 (refactor: Create dedicated objects to retrieve pull request and pull request with its git reference) integrated in Tuleap 15.1.99.82

User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2023-10-20 10:01

PUT -> PATCH. We don't want to send everything, just the modified markdown content.

Also, the routes are not nested under /pull_request/{id} anymore. Doing so would require the caller to know the pull request ID, but it's not a necessary information to give. We can retrieve the comment by its ID in the database directly, and from there, we can retrieve its parent pull request, git repository and project. Seeing as we already applied this pattern for many routes (taskboard cards, gitlab groups, kanban items, etc.), it's not shocking to consider the comments and inline comments as "resources" instead of "sub-resources".


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gorka (tgorka)2023-09-13 11:06
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • So that
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Category set to Pull Request