@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 workboard column options into a dropdown menu

Summary:
Ref T5024, T4427, T5474, T5523. Instead of separate icons in the column header for "Create Task" and "Edit Column Settings", use a dropdown menu.

- T5024 will likely add a "View Standalone" option.
- T4427 needs header space to show a count.
- T5474 likely needs "Edit Triggers..." (this seems reasonable to separate from editing the name, etc.)
- T5523 likely adds "Move all tasks..." eventually.

Test Plan: {F187414}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5523, T5474, T5024, T4427

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

+80 -43
+10 -10
resources/celerity/map.php
··· 415 415 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => 'fe9a552f', 416 416 'rsrc/js/application/ponder/behavior-votebox.js' => '4e9b766b', 417 417 'rsrc/js/application/projects/behavior-boards-dropdown.js' => '0ec56e1d', 418 - 'rsrc/js/application/projects/behavior-project-boards.js' => 'f47fa23b', 418 + 'rsrc/js/application/projects/behavior-project-boards.js' => 'd4bf1f3c', 419 419 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', 420 420 'rsrc/js/application/projects/behavior-reorder-columns.js' => '09eee344', 421 421 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', ··· 639 639 'javelin-behavior-policy-control' => 'f3fef818', 640 640 'javelin-behavior-policy-rule-editor' => 'fe9a552f', 641 641 'javelin-behavior-ponder-votebox' => '4e9b766b', 642 - 'javelin-behavior-project-boards' => 'f47fa23b', 642 + 'javelin-behavior-project-boards' => 'd4bf1f3c', 643 643 'javelin-behavior-project-create' => '065227cc', 644 644 'javelin-behavior-refresh-csrf' => '7814b593', 645 645 'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf', ··· 1700 1700 'javelin-dom', 1701 1701 'javelin-view', 1702 1702 ), 1703 + 'd4bf1f3c' => array( 1704 + 'javelin-behavior', 1705 + 'javelin-dom', 1706 + 'javelin-util', 1707 + 'javelin-stratcom', 1708 + 'javelin-workflow', 1709 + 'phabricator-draggable-list', 1710 + ), 1703 1711 'd4eecc63' => array( 1704 1712 'javelin-behavior', 1705 1713 'javelin-dom', ··· 1843 1851 'phuix-action-list-view', 1844 1852 'phuix-action-view', 1845 1853 'javelin-workflow', 1846 - ), 1847 - 'f47fa23b' => array( 1848 - 'javelin-behavior', 1849 - 'javelin-dom', 1850 - 'javelin-util', 1851 - 'javelin-stratcom', 1852 - 'javelin-workflow', 1853 - 'phabricator-draggable-list', 1854 1854 ), 1855 1855 'f51afce0' => array( 1856 1856 'javelin-behavior',
+55 -8
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 223 223 ->setHeader($column->getDisplayName()) 224 224 ->setHeaderColor($column->getHeaderColor()); 225 225 226 - $panel->setEditURI($board_uri.'column/'.$column->getID().'/'); 227 - 228 - $panel->setHeaderAction(id(new PHUIIconView()) 229 - ->setIconFont('fa-plus') 230 - ->setHref('/maniphest/task/create/') 231 - ->addSigil('column-add-task') 232 - ->setMetadata( 233 - array('columnPHID' => $column->getPHID()))); 226 + $column_menu = $this->buildColumnMenu($project, $column); 227 + $panel->addHeaderAction($column_menu); 234 228 235 229 $cards = id(new PHUIObjectItemListView()) 236 230 ->setUser($viewer) ··· 509 503 )); 510 504 511 505 return $manage_button; 506 + } 507 + 508 + private function buildColumnMenu( 509 + PhabricatorProject $project, 510 + PhabricatorProjectColumn $column) { 511 + 512 + $request = $this->getRequest(); 513 + $viewer = $request->getUser(); 514 + 515 + $can_edit = PhabricatorPolicyFilter::hasCapability( 516 + $viewer, 517 + $project, 518 + PhabricatorPolicyCapability::CAN_EDIT); 519 + 520 + $column_items = array(); 521 + 522 + $column_items[] = id(new PhabricatorActionView()) 523 + ->setIcon('fa-plus') 524 + ->setName(pht('Create Task...')) 525 + ->setHref('/maniphest/task/create/') 526 + ->addSigil('column-add-task') 527 + ->setMetadata( 528 + array( 529 + 'columnPHID' => $column->getPHID(), 530 + )) 531 + ->setDisabled(!$can_edit); 532 + 533 + $edit_uri = $this->getApplicationURI( 534 + 'board/'.$this->id.'/column/'.$column->getID().'/'); 535 + 536 + $column_items[] = id(new PhabricatorActionView()) 537 + ->setIcon('fa-pencil') 538 + ->setName(pht('Edit Column')) 539 + ->setHref($edit_uri) 540 + ->setDisabled(!$can_edit) 541 + ->setWorkflow(!$can_edit); 542 + 543 + $column_menu = id(new PhabricatorActionListView()) 544 + ->setUser($viewer); 545 + foreach ($column_items as $item) { 546 + $column_menu->addAction($item); 547 + } 548 + 549 + $column_button = id(new PHUIIconView()) 550 + ->setIconFont('fa-caret-down') 551 + ->setHref('#') 552 + ->addSigil('boards-dropdown-menu') 553 + ->setMetadata( 554 + array( 555 + 'items' => hsprintf('%s', $column_menu), 556 + )); 557 + 558 + return $column_button; 512 559 } 513 560 514 561 private function initializeWorkboardDialog(PhabricatorProject $project) {
+1 -1
src/view/phui/PHUITimelineEventView.php
··· 255 255 256 256 if ($items || $has_menu) { 257 257 $icon = id(new PHUIIconView()) 258 - ->setIconFont('fa-cog'); 258 + ->setIconFont('fa-caret-down'); 259 259 $aural = javelin_tag( 260 260 'span', 261 261 array(
+9 -23
src/view/phui/PHUIWorkpanelView.php
··· 4 4 5 5 private $cards = array(); 6 6 private $header; 7 - private $editURI; 8 - private $headerAction; 9 7 private $footerAction; 10 8 private $headerColor = PHUIActionHeaderView::HEADER_GREY; 11 - 12 - public function setHeaderAction(PHUIIconView $header_action) { 13 - $this->headerAction = $header_action; 14 - return $this; 15 - } 9 + private $headerActions = array(); 16 10 17 11 public function setCards(PHUIObjectItemListView $cards) { 18 12 $this->cards[] = $cards; ··· 24 18 return $this; 25 19 } 26 20 27 - public function setEditURI($edit_uri) { 28 - $this->editURI = $edit_uri; 29 - return $this; 30 - } 31 - 32 21 public function setFooterAction(PHUIListItemView $footer_action) { 33 22 $this->footerAction = $footer_action; 34 23 return $this; ··· 39 28 return $this; 40 29 } 41 30 31 + public function addHeaderAction(PHUIIconView $action) { 32 + $this->headerActions[] = $action; 33 + return $this; 34 + } 35 + 42 36 public function getTagAttributes() { 43 37 return array( 44 38 'class' => 'phui-workpanel-view', ··· 61 55 $footer_tag); 62 56 } 63 57 64 - $header_edit = null; 65 - if ($this->editURI) { 66 - $header_edit = id(new PHUIIconView()) 67 - ->setIconFont('fa-pencil') 68 - ->setHref($this->editURI); 69 - } 70 58 $header = id(new PHUIActionHeaderView()) 71 59 ->setHeaderTitle($this->header) 72 60 ->setHeaderColor($this->headerColor); 73 - if ($header_edit) { 74 - $header->addAction($header_edit); 75 - } 76 - if ($this->headerAction) { 77 - $header->addAction($this->headerAction); 61 + 62 + foreach ($this->headerActions as $action) { 63 + $header->addAction($action); 78 64 } 79 65 80 66 $classes[] = 'phui-workpanel-'.$this->headerColor;
+5 -1
webroot/rsrc/js/application/projects/behavior-project-boards.js
··· 163 163 'click', 164 164 ['column-add-task'], 165 165 function (e) { 166 - e.kill(); 166 + 167 + // We want the 'boards-dropdown-menu' behavior to see this event and 168 + // close the dropdown, but don't want to follow the link. 169 + e.prevent(); 170 + 167 171 var column_phid = e.getNodeData('column-add-task').columnPHID; 168 172 var request_data = { 169 173 responseType: 'card',