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

Convert Maniphest to curtain view

Summary: Moves Maniphest over, and allows application to provide ad-hoc panels more easily.

Test Plan: {F1160591}

Reviewers: chad

Reviewed By: chad

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

+45 -46
+34 -46
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 73 73 $header = $this->buildHeaderView($task); 74 74 $details = $this->buildPropertyView($task, $field_list, $edges, $handles); 75 75 $description = $this->buildDescriptionView($task, $engine); 76 - $actions = $this->buildActionView($task); 77 - $properties = $this->buildPropertyListView($task, $handles); 76 + $curtain = $this->buildCurtain($task); 78 77 79 78 $title = pht('%s %s', $monogram, $task->getTitle()); 80 79 ··· 87 86 88 87 $view = id(new PHUITwoColumnView()) 89 88 ->setHeader($header) 89 + ->setCurtain($curtain) 90 90 ->setMainColumn(array( 91 91 $timeline, 92 92 $comment_view, 93 93 )) 94 94 ->addPropertySection(pht('DETAILS'), $details) 95 - ->addPropertySection(pht('DESCRIPTION'), $description) 96 - ->setPropertyList($properties) 97 - ->setActionList($actions); 95 + ->addPropertySection(pht('DESCRIPTION'), $description); 98 96 99 97 return $this->newPage() 100 98 ->setTitle($title) ··· 148 146 } 149 147 150 148 151 - private function buildActionView(ManiphestTask $task) { 152 - $viewer = $this->getRequest()->getUser(); 149 + private function buildCurtain(ManiphestTask $task) { 150 + $viewer = $this->getViewer(); 153 151 154 152 $id = $task->getID(); 155 153 $phid = $task->getPHID(); ··· 159 157 $task, 160 158 PhabricatorPolicyCapability::CAN_EDIT); 161 159 162 - $view = id(new PhabricatorActionListView()) 163 - ->setUser($viewer) 164 - ->setObject($task); 160 + $curtain = $this->newCurtainView($task); 165 161 166 - $view->addAction( 162 + $curtain->addAction( 167 163 id(new PhabricatorActionView()) 168 164 ->setName(pht('Edit Task')) 169 165 ->setIcon('fa-pencil') ··· 171 167 ->setDisabled(!$can_edit) 172 168 ->setWorkflow(!$can_edit)); 173 169 174 - $view->addAction( 170 + $curtain->addAction( 175 171 id(new PhabricatorActionView()) 176 172 ->setName(pht('Merge Duplicates In')) 177 173 ->setHref("/search/attach/{$phid}/TASK/merge/") ··· 199 195 $edit_uri = $this->getApplicationURI($edit_uri); 200 196 } 201 197 202 - $view->addAction( 198 + $curtain->addAction( 203 199 id(new PhabricatorActionView()) 204 200 ->setName(pht('Create Subtask')) 205 201 ->setHref($edit_uri) ··· 207 203 ->setDisabled(!$can_create) 208 204 ->setWorkflow(!$can_create)); 209 205 210 - $view->addAction( 206 + $curtain->addAction( 211 207 id(new PhabricatorActionView()) 212 208 ->setName(pht('Edit Blocking Tasks')) 213 209 ->setHref("/search/attach/{$phid}/TASK/blocks/") ··· 216 212 ->setDisabled(!$can_edit) 217 213 ->setWorkflow(true)); 218 214 219 - return $view; 215 + 216 + $owner_phid = $task->getOwnerPHID(); 217 + if ($owner_phid) { 218 + $assigned_to = $viewer 219 + ->renderHandle($owner_phid) 220 + ->setShowHovercard(true); 221 + } else { 222 + $assigned_to = phutil_tag('em', array(), pht('None')); 223 + } 224 + 225 + $curtain->newPanel() 226 + ->setHeaderText(pht('Assigned To')) 227 + ->appendChild($assigned_to); 228 + 229 + $author_phid = $task->getAuthorPHID(); 230 + $author = $viewer 231 + ->renderHandle($author_phid) 232 + ->setShowHovercard(true); 233 + 234 + $curtain->newPanel() 235 + ->setHeaderText(pht('Author')) 236 + ->appendChild($author); 237 + 238 + return $curtain; 220 239 } 221 240 222 241 private function buildPropertyView( ··· 305 324 } 306 325 307 326 return null; 308 - } 309 - 310 - private function buildPropertyListView(ManiphestTask $task, $handles) { 311 - $viewer = $this->getRequest()->getUser(); 312 - $view = id(new PHUIPropertyListView()) 313 - ->setUser($viewer) 314 - ->setObject($task); 315 - 316 - $view->invokeWillRenderEvent(); 317 - 318 - $owner_phid = $task->getOwnerPHID(); 319 - if ($owner_phid) { 320 - $assigned_to = $handles 321 - ->renderHandle($owner_phid) 322 - ->setShowHovercard(true); 323 - } else { 324 - $assigned_to = phutil_tag('em', array(), pht('None')); 325 - } 326 - 327 - $view->addProperty(pht('Assigned To'), $assigned_to); 328 - 329 - $author_phid = $task->getAuthorPHID(); 330 - $author = $handles 331 - ->renderHandle($author_phid) 332 - ->setShowHovercard(true); 333 - 334 - $date = phabricator_datetime($task->getDateCreated(), $viewer); 335 - 336 - $view->addProperty(pht('Author'), $author); 337 - 338 - return $view; 339 327 } 340 328 341 329 private function buildDescriptionView(
+11
src/view/layout/PHUICurtainView.php
··· 15 15 return $this; 16 16 } 17 17 18 + public function newPanel() { 19 + $panel = new PHUICurtainPanelView(); 20 + $this->addPanel($panel); 21 + 22 + // By default, application panels go at the bottom of the curtain, below 23 + // extension panels. 24 + $panel->setOrder(100000); 25 + 26 + return $panel; 27 + } 28 + 18 29 public function setActionList(PhabricatorActionListView $action_list) { 19 30 $this->actionList = $action_list; 20 31 return $this;