@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.

Restore quote and warning behaviors to Differential EditEngine comment area

Summary: Ref T11114. This restores warnings (e.g., failing unit tests) and fixes "Quote" behavior for comments.

Test Plan:
- Quoted a comment.
- Viewed a warning.

{F2283275}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

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

+55 -20
+36 -20
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 255 255 $target, 256 256 $revision); 257 257 258 - $comment_view = $this->buildTransactions( 258 + $timeline = $this->buildTransactions( 259 259 $revision, 260 260 $diff_vs ? $diffs[$diff_vs] : $target, 261 261 $target, 262 262 $old_ids, 263 263 $new_ids); 264 264 265 - if (!$viewer_is_anonymous) { 266 - $comment_view->setQuoteRef('D'.$revision->getID()); 267 - $comment_view->setQuoteTargetID('comment-content'); 268 - } 265 + $timeline->setQuoteRef($revision->getMonogram()); 269 266 270 267 $changeset_view = id(new DifferentialChangesetListView()) 271 268 ->setChangesets($changesets) ··· 421 418 ); 422 419 } 423 420 424 - $footer[] = id(new DifferentialRevisionEditEngine()) 421 + $comment_view = id(new DifferentialRevisionEditEngine()) 425 422 ->setViewer($viewer) 426 423 ->buildEditEngineCommentView($revision); 427 424 428 - $object_id = 'D'.$revision->getID(); 425 + $comment_view->setTransactionTimeline($timeline); 426 + 427 + $review_warnings = array(); 428 + foreach ($field_list->getFields() as $field) { 429 + $review_warnings[] = $field->getWarningsForDetailView(); 430 + } 431 + $review_warnings = array_mergev($review_warnings); 432 + 433 + if ($review_warnings) { 434 + $warnings_view = id(new PHUIInfoView()) 435 + ->setSeverity(PHUIInfoView::SEVERITY_WARNING) 436 + ->setErrors($review_warnings); 437 + 438 + $comment_view->setInfoView($warnings_view); 439 + } 440 + 441 + $footer[] = $comment_view; 442 + 443 + $monogram = $revision->getMonogram(); 429 444 $operations_box = $this->buildOperationsBox($revision); 430 445 431 446 $crumbs = $this->buildApplicationCrumbs(); 432 - $crumbs->addTextCrumb($object_id, '/'.$object_id); 447 + $crumbs->addTextCrumb($monogram, $revision->getURI()); 433 448 $crumbs->setBorder(true); 434 449 435 450 $filetree_on = $viewer->compareUserSetting( ··· 442 457 $collapsed_value = $viewer->getUserSetting($collapsed_key); 443 458 444 459 $nav = id(new DifferentialChangesetFileTreeSideNavBuilder()) 445 - ->setTitle('D'.$revision->getID()) 446 - ->setBaseURI(new PhutilURI('/D'.$revision->getID())) 460 + ->setTitle($monogram) 461 + ->setBaseURI(new PhutilURI($revision->getURI())) 447 462 ->setCollapsed((bool)$collapsed_value) 448 463 ->build($changesets); 449 464 } ··· 454 469 ->setHeader($header) 455 470 ->setSubheader($subheader) 456 471 ->setCurtain($curtain) 457 - ->setMainColumn(array( 458 - $operations_box, 459 - $info_view, 460 - $details, 461 - $diff_detail_box, 462 - $unit_box, 463 - $comment_view, 464 - $signature_message, 465 - )) 472 + ->setMainColumn( 473 + array( 474 + $operations_box, 475 + $info_view, 476 + $details, 477 + $diff_detail_box, 478 + $unit_box, 479 + $timeline, 480 + $signature_message, 481 + )) 466 482 ->setFooter($footer); 467 483 468 484 $page = $this->newPage() 469 - ->setTitle($object_id.' '.$revision->getTitle()) 485 + ->setTitle($monogram.' '.$revision->getTitle()) 470 486 ->setCrumbs($crumbs) 471 487 ->setPageObjectPHIDs(array($revision->getPHID())) 472 488 ->appendChild($view);
+19
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 20 20 private $headerText; 21 21 private $noPermission; 22 22 private $fullWidth; 23 + private $infoView; 23 24 24 25 private $currentVersion; 25 26 private $versionedDraft; ··· 107 108 public function setFullWidth($fw) { 108 109 $this->fullWidth = $fw; 109 110 return $this; 111 + } 112 + 113 + public function setInfoView(PHUIInfoView $info_view) { 114 + $this->infoView = $info_view; 115 + return $this; 116 + } 117 + 118 + public function getInfoView() { 119 + return $this->infoView; 110 120 } 111 121 112 122 public function setCommentActions(array $comment_actions) { ··· 334 344 )); 335 345 336 346 $form->appendChild($action_bar); 347 + 348 + $info_view = $this->getInfoView(); 349 + if ($info_view) { 350 + $info_box = id(new PHUIBoxView()) 351 + ->addMargin(PHUI::MARGIN_LARGE) 352 + ->appendChild($info_view); 353 + $form->appendChild($info_box); 354 + } 355 + 337 356 $form->appendChild($invisi_bar); 338 357 $form->addClass('phui-comment-has-actions'); 339 358