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

Remove "Create Empty Task" workflow callouts and some other clutter

Summary:
Ref T9908. This removes the "Create Another Empty Task", "Create A Similar Task" and "Create Another Subtask of Same Parent Task" workflow callouts on the task detail page, which are actions that show up after creating a task or creating a subtask.

- I think "Create Empty" isn't relevant now that we have "Create Task" nearby and the quick create menu?
- I'm not sure if "Create Similar" is worth keeping. If we do want to retain it, I'd maybe like to find a way to do it generically.
- I'm likewise not sure if "Create another subtask" is worth keeping.

Overall, these actions are weird/unusual and I'm not sure how valuable they are. I'm open to keeping "Similar" and/or "Subtask" but I'd like to verify that they're still valuable and make sure we have a reasonable design for them if we retain them.

For example, if we want to retain "Similar", maybe a better approach is just to add "Create Similar Object" to every action menu (which is now possible for EditEngine applications)? There's at least some interest in "Create Similar Repository" in Diffusion.

Also removes a very very old piece of "attached files" code.

Test Plan: Created and viewed some tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

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

+7 -121
-2
src/__phutil_library_map__.php
··· 2238 2238 'PhabricatorFileImageMacro' => 'applications/macro/storage/PhabricatorFileImageMacro.php', 2239 2239 'PhabricatorFileImageTransform' => 'applications/files/transform/PhabricatorFileImageTransform.php', 2240 2240 'PhabricatorFileInfoController' => 'applications/files/controller/PhabricatorFileInfoController.php', 2241 - 'PhabricatorFileLinkListView' => 'view/layout/PhabricatorFileLinkListView.php', 2242 2241 'PhabricatorFileLinkView' => 'view/layout/PhabricatorFileLinkView.php', 2243 2242 'PhabricatorFileListController' => 'applications/files/controller/PhabricatorFileListController.php', 2244 2243 'PhabricatorFileQuery' => 'applications/files/query/PhabricatorFileQuery.php', ··· 6396 6395 ), 6397 6396 'PhabricatorFileImageTransform' => 'PhabricatorFileTransform', 6398 6397 'PhabricatorFileInfoController' => 'PhabricatorFileController', 6399 - 'PhabricatorFileLinkListView' => 'AphrontView', 6400 6398 'PhabricatorFileLinkView' => 'AphrontView', 6401 6399 'PhabricatorFileListController' => 'PhabricatorFileController', 6402 6400 'PhabricatorFileQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+4 -82
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 10 10 $viewer = $this->getViewer(); 11 11 $id = $request->getURIData('id'); 12 12 13 - $e_title = null; 14 - 15 - $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); 16 - 17 13 $task = id(new ManiphestTaskQuery()) 18 14 ->setViewer($viewer) 19 15 ->withIDs(array($id)) ··· 21 17 ->executeOne(); 22 18 if (!$task) { 23 19 return new Aphront404Response(); 24 - } 25 - 26 - $workflow = $request->getStr('workflow'); 27 - $parent_task = null; 28 - if ($workflow && is_numeric($workflow)) { 29 - $parent_task = id(new ManiphestTaskQuery()) 30 - ->setViewer($viewer) 31 - ->withIDs(array($workflow)) 32 - ->executeOne(); 33 20 } 34 21 35 22 $field_list = PhabricatorCustomField::getObjectFields( ··· 65 52 } 66 53 $phids[$task->getAuthorPHID()] = true; 67 54 68 - $attached = $task->getAttached(); 69 - foreach ($attached as $type => $list) { 70 - foreach ($list as $phid => $info) { 71 - $phids[$phid] = true; 72 - } 73 - } 74 - 75 - if ($parent_task) { 76 - $phids[$parent_task->getPHID()] = true; 77 - } 78 - 79 55 $phids = array_keys($phids); 80 56 $handles = $viewer->loadHandles($phids); 81 57 82 - $info_view = null; 83 - if ($parent_task) { 84 - $info_view = new PHUIInfoView(); 85 - $info_view->setSeverity(PHUIInfoView::SEVERITY_NOTICE); 86 - $info_view->addButton( 87 - id(new PHUIButtonView()) 88 - ->setTag('a') 89 - ->setHref('/maniphest/task/create/?parent='.$parent_task->getID()) 90 - ->setText(pht('Create Another Subtask'))); 91 - 92 - $info_view->appendChild(hsprintf( 93 - 'Created a subtask of <strong>%s</strong>.', 94 - $handles->renderHandle($parent_task->getPHID()))); 95 - } else if ($workflow == 'create') { 96 - $info_view = new PHUIInfoView(); 97 - $info_view->setSeverity(PHUIInfoView::SEVERITY_NOTICE); 98 - $info_view->addButton( 99 - id(new PHUIButtonView()) 100 - ->setTag('a') 101 - ->setHref('/maniphest/task/create/?template='.$task->getID()) 102 - ->setText(pht('Similar Task'))); 103 - $info_view->addButton( 104 - id(new PHUIButtonView()) 105 - ->setTag('a') 106 - ->setHref('/maniphest/task/create/') 107 - ->setText(pht('Empty Task'))); 108 - $info_view->appendChild(pht('New task created. Create another?')); 109 - } 110 - 111 - $engine = new PhabricatorMarkupEngine(); 112 - $engine->setViewer($viewer); 113 - $engine->setContextObject($task); 114 - $engine->addObject($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION); 58 + $engine = id(new PhabricatorMarkupEngine()) 59 + ->setViewer($viewer) 60 + ->setContextObject($task) 61 + ->addObject($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION); 115 62 116 63 $timeline = $this->buildTransactionTimeline( 117 64 $task, ··· 155 102 )) 156 103 ->appendChild( 157 104 array( 158 - $info_view, 159 105 $object_box, 160 106 $timeline, 161 107 $comment_view, ··· 323 269 $view->addProperty( 324 270 pht('Commits'), 325 271 phutil_implode_html(phutil_tag('br'), $revisions_commits)); 326 - } 327 - 328 - $attached = $task->getAttached(); 329 - if (!is_array($attached)) { 330 - $attached = array(); 331 - } 332 - 333 - $file_infos = idx($attached, PhabricatorFileFilePHIDType::TYPECONST); 334 - if ($file_infos) { 335 - $file_phids = array_keys($file_infos); 336 - 337 - // TODO: These should probably be handles or something; clean this up 338 - // as we sort out file attachments. 339 - $files = id(new PhabricatorFileQuery()) 340 - ->setViewer($viewer) 341 - ->withPHIDs($file_phids) 342 - ->execute(); 343 - 344 - $file_view = new PhabricatorFileLinkListView(); 345 - $file_view->setFiles($files); 346 - 347 - $view->addProperty( 348 - pht('Files'), 349 - $file_view->render()); 350 272 } 351 273 352 274 $view->invokeWillRenderEvent();
+3 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 32 32 protected $viewPolicy = PhabricatorPolicies::POLICY_USER; 33 33 protected $editPolicy = PhabricatorPolicies::POLICY_USER; 34 34 35 - protected $attached = array(); 36 35 protected $projectPHIDs = array(); 37 36 38 37 protected $ownerOrdering; ··· 42 41 private $groupByProjectPHID = self::ATTACHABLE; 43 42 private $customFields = self::ATTACHABLE; 44 43 private $edgeProjectPHIDs = self::ATTACHABLE; 44 + 45 + // TODO: This field is unused and should eventually be removed. 46 + protected $attached = array(); 45 47 46 48 public static function initializeNewTask(PhabricatorUser $actor) { 47 49 $app = id(new PhabricatorApplicationQuery())
-36
src/view/layout/PhabricatorFileLinkListView.php
··· 1 - <?php 2 - 3 - final class PhabricatorFileLinkListView extends AphrontView { 4 - private $files; 5 - 6 - public function setFiles(array $files) { 7 - assert_instances_of($files, 'PhabricatorFile'); 8 - $this->files = $files; 9 - return $this; 10 - } 11 - private function getFiles() { 12 - return $this->files; 13 - } 14 - 15 - public function render() { 16 - $files = $this->getFiles(); 17 - if (!$files) { 18 - return ''; 19 - } 20 - 21 - require_celerity_resource('phabricator-remarkup-css'); 22 - 23 - $file_links = array(); 24 - foreach ($this->getFiles() as $file) { 25 - $view = id(new PhabricatorFileLinkView()) 26 - ->setFilePHID($file->getPHID()) 27 - ->setFileName($file->getName()) 28 - ->setFileDownloadURI($file->getDownloadURI()) 29 - ->setFileViewURI($file->getBestURI()) 30 - ->setFileViewable($file->isViewableImage()); 31 - $file_links[] = $view->render(); 32 - } 33 - 34 - return phutil_implode_html(phutil_tag('br'), $file_links); 35 - } 36 - }