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

Un-implement MarkupInterface from Mocks and Images in Pholio

Summary: Depends on D19911. Ref T11351. `MarkupInterface` has mostly been replaced with `PHUIRemarkupView`, and isn't really doing anything for us here. Get rid of it to simplify the code.

Test Plan: Viewed various mocks with descriptions and image descriptions, saw remarkup presented properly.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11351

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

+4 -87
-2
src/__phutil_library_map__.php
··· 10946 10946 'PholioDefaultViewCapability' => 'PhabricatorPolicyCapability', 10947 10947 'PholioImage' => array( 10948 10948 'PholioDAO', 10949 - 'PhabricatorMarkupInterface', 10950 10949 'PhabricatorPolicyInterface', 10951 10950 ), 10952 10951 'PholioImageDescriptionTransaction' => 'PholioImageTransactionType', ··· 10962 10961 'PholioInlineListController' => 'PholioController', 10963 10962 'PholioMock' => array( 10964 10963 'PholioDAO', 10965 - 'PhabricatorMarkupInterface', 10966 10964 'PhabricatorPolicyInterface', 10967 10965 'PhabricatorSubscribableInterface', 10968 10966 'PhabricatorTokenReceiverInterface',
+1 -6
src/applications/pholio/controller/PholioMockViewController.php
··· 37 37 PholioMockHasTaskEdgeType::EDGECONST); 38 38 $this->setManiphestTaskPHIDs($phids); 39 39 40 - $engine = id(new PhabricatorMarkupEngine()) 41 - ->setViewer($viewer); 42 - $engine->addObject($mock, PholioMock::MARKUP_FIELD_DESCRIPTION); 43 - 44 40 $title = $mock->getName(); 45 41 46 42 if ($mock->isClosed()) { ··· 62 58 63 59 $timeline = $this->buildTransactionTimeline( 64 60 $mock, 65 - new PholioTransactionQuery(), 66 - $engine); 61 + new PholioTransactionQuery()); 67 62 $timeline->setMock($mock); 68 63 69 64 $curtain = $this->buildCurtainView($mock);
+1 -27
src/applications/pholio/storage/PholioImage.php
··· 2 2 3 3 final class PholioImage extends PholioDAO 4 4 implements 5 - PhabricatorMarkupInterface, 6 5 PhabricatorPolicyInterface { 7 - 8 - const MARKUP_FIELD_DESCRIPTION = 'markup:description'; 9 6 10 7 protected $mockID; 11 8 protected $filePHID; ··· 86 83 } 87 84 88 85 89 - /* -( PhabricatorMarkupInterface )----------------------------------------- */ 90 - 86 + /* -( PhabricatorPolicyInterface Implementation )-------------------------- */ 91 87 92 - public function getMarkupFieldKey($field) { 93 - $content = $this->getMarkupText($field); 94 - return PhabricatorMarkupEngine::digestRemarkupContent($this, $content); 95 - } 96 - 97 - public function newMarkupEngine($field) { 98 - return PhabricatorMarkupEngine::newMarkupEngine(array()); 99 - } 100 - 101 - public function getMarkupText($field) { 102 - return $this->getDescription(); 103 - } 104 - 105 - public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { 106 - return $output; 107 - } 108 - 109 - public function shouldUseMarkupCache($field) { 110 - return (bool)$this->getID(); 111 - } 112 - 113 - /* -( PhabricatorPolicyInterface Implementation )-------------------------- */ 114 88 115 89 public function getCapabilities() { 116 90 return $this->getMock()->getCapabilities();
-38
src/applications/pholio/storage/PholioMock.php
··· 2 2 3 3 final class PholioMock extends PholioDAO 4 4 implements 5 - PhabricatorMarkupInterface, 6 5 PhabricatorPolicyInterface, 7 6 PhabricatorSubscribableInterface, 8 7 PhabricatorTokenReceiverInterface, ··· 14 13 PhabricatorMentionableInterface, 15 14 PhabricatorFulltextInterface, 16 15 PhabricatorFerretInterface { 17 - 18 - const MARKUP_FIELD_DESCRIPTION = 'markup:description'; 19 16 20 17 const STATUS_OPEN = 'open'; 21 18 const STATUS_CLOSED = 'closed'; ··· 213 210 214 211 public function describeAutomaticCapability($capability) { 215 212 return pht("A mock's owner can always view and edit it."); 216 - } 217 - 218 - 219 - /* -( PhabricatorMarkupInterface )----------------------------------------- */ 220 - 221 - 222 - public function getMarkupFieldKey($field) { 223 - $content = $this->getMarkupText($field); 224 - return PhabricatorMarkupEngine::digestRemarkupContent($this, $content); 225 - } 226 - 227 - public function newMarkupEngine($field) { 228 - return PhabricatorMarkupEngine::newMarkupEngine(array()); 229 - } 230 - 231 - public function getMarkupText($field) { 232 - if ($this->getDescription()) { 233 - return $this->getDescription(); 234 - } 235 - 236 - return null; 237 - } 238 - 239 - public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { 240 - require_celerity_resource('phabricator-remarkup-css'); 241 - return phutil_tag( 242 - 'div', 243 - array( 244 - 'class' => 'phabricator-remarkup', 245 - ), 246 - $output); 247 - } 248 - 249 - public function shouldUseMarkupCache($field) { 250 - return (bool)$this->getID(); 251 213 } 252 214 253 215
+2 -14
src/applications/pholio/view/PholioMockImagesView.php
··· 72 72 73 73 $default = PhabricatorFile::loadBuiltin($viewer, 'image-100x100.png'); 74 74 75 - $engine = id(new PhabricatorMarkupEngine()) 76 - ->setViewer($this->getUser()); 77 - foreach ($mock->getAllImages() as $image) { 78 - $engine->addObject($image, 'default'); 79 - } 80 - $engine->process(); 81 - 82 75 $images = array(); 83 76 $current_set = 0; 84 77 foreach ($mock->getAllImages() as $image) { ··· 92 85 $current_set++; 93 86 } 94 87 95 - $description = $engine->getOutput($image, 'default'); 88 + $description = $image->getDescription(); 96 89 if (strlen($description)) { 97 - $description = phutil_tag( 98 - 'div', 99 - array( 100 - 'class' => 'phabricator-remarkup', 101 - ), 102 - $description); 90 + $description = new PHUIRemarkupView($viewer, $description); 103 91 } 104 92 105 93 $history_uri = '/pholio/image/history/'.$image->getID().'/';