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

Prevent users from hiding unpublished inlines

Summary: Fixes T9135. This is (probably) never intended and can be confusing.

Test Plan: Saw no hide button on unpublished inlines. Saw hide button on published inlines. Clicked hide button.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9135

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

+30 -7
+30 -7
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 211 211 ->addSigil('differential-inline-next') 212 212 ->setMustCapture(true); 213 213 214 - $hide = id(new PHUIButtonView()) 215 - ->setTag('a') 216 - ->setTooltip(pht('Hide Comment')) 217 - ->setIconFont('fa-times') 218 - ->addSigil('hide-inline') 219 - ->setMustCapture(true); 214 + if ($this->canHide()) { 215 + $hide = id(new PHUIButtonView()) 216 + ->setTag('a') 217 + ->setTooltip(pht('Hide Comment')) 218 + ->setIconFont('fa-times') 219 + ->addSigil('hide-inline') 220 + ->setMustCapture(true); 220 221 221 - if ($viewer_phid && $inline->getID() && $inline->supportsHiding()) { 222 222 $nextprev->addButton($hide); 223 223 } 224 224 ··· 454 454 )); 455 455 456 456 return $markup; 457 + } 458 + 459 + private function canHide() { 460 + $inline = $this->inlineComment; 461 + 462 + if ($inline->isDraft()) { 463 + return false; 464 + } 465 + 466 + if (!$inline->getID()) { 467 + return false; 468 + } 469 + 470 + $viewer = $this->getUser(); 471 + if (!$viewer->isLoggedIn()) { 472 + return false; 473 + } 474 + 475 + if (!$inline->supportsHiding()) { 476 + return false; 477 + } 478 + 479 + return true; 457 480 } 458 481 459 482 }