@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Build separate comments for each inline comment in Audit

Summary:
Ref T4896. Moves us closer to migrating comments to transactions by building a transaction per inline.

This makes the UI a little wonky, and it will get slightly worse until we swap to the new UI and grouping/collapsing starts working. It's still usable, there's just a box per inline.

Test Plan:
- Added a comment.
- Added an inline comment.
- Added a comment and an inline comment.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T4896

Differential Revision: https://secure.phabricator.com/D10023

+22 -8
+1
src/applications/audit/constants/PhabricatorAuditActionConstants.php
··· 9 9 const CLOSE = 'close'; 10 10 const ADD_CCS = 'add_ccs'; 11 11 const ADD_AUDITORS = 'add_auditors'; 12 + const INLINE = 'audit:inline'; 12 13 13 14 public static function getActionNameMap() { 14 15 $map = array(
+21 -8
src/applications/audit/editor/PhabricatorAuditCommentEditor.php
··· 57 57 ->save(); 58 58 59 59 $content_blocks = array($comment->getContent()); 60 - 61 - if ($inline_comments) { 62 - foreach ($inline_comments as $inline) { 63 - $inline->setAuditCommentID($comment->getID()); 64 - $inline->save(); 65 - $content_blocks[] = $inline->getContent(); 66 - } 60 + foreach ($inline_comments as $inline) { 61 + $content_blocks[] = $inline->getContent(); 67 62 } 68 63 69 64 $ccs = $this->ccs; ··· 280 275 $commit->updateAuditStatus($requests); 281 276 $commit->save(); 282 277 278 + $comments = array($comment); 279 + foreach ($inline_comments as $inline) { 280 + $xaction = id(new PhabricatorAuditComment()) 281 + ->setAction(PhabricatorAuditActionConstants::INLINE) 282 + ->setActorPHID($actor->getPHID()) 283 + ->setTargetPHID($commit->getPHID()) 284 + ->save(); 285 + 286 + $inline->setAuditCommentID($xaction->getID()); 287 + $inline->save(); 288 + 289 + $comments[] = $xaction; 290 + } 291 + 283 292 $feed_dont_publish_phids = array(); 284 293 foreach ($requests as $request) { 285 294 $status = $request->getAuditStatus(); ··· 305 314 306 315 if (!$this->noEmail) { 307 316 $this->sendMail( 308 - array($comment), 317 + $comments, 309 318 $other_comments, 310 319 $inline_comments, 311 320 $requests); ··· 530 539 531 540 $body = new PhabricatorMetaMTAMailBody(); 532 541 foreach ($comments as $comment) { 542 + if ($comment->getAction() == PhabricatorAuditActionConstants::INLINE) { 543 + continue; 544 + } 545 + 533 546 $verb = PhabricatorAuditActionConstants::getActionPastTenseVerb( 534 547 $comment->getAction()); 535 548