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

Give Phriction a real dropdown

Summary:
Fixes T8150. Small generalization:

- Timeline has a dropdown with no special logic; make that generic.
- Use it in Phriction.

Test Plan:
- Used Phriction dropdown on desktop and mobile.
- Used timeline dropdown.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8150

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

+43 -56
+13 -15
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '79e995d7', 11 - 'core.pkg.js' => 'a2f2598e', 10 + 'core.pkg.css' => 'e3ba62e8', 11 + 'core.pkg.js' => '328799d0', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'bb338e4b', 14 14 'differential.pkg.js' => '45b3b51d', ··· 38 38 'rsrc/css/application/base/notification-menu.css' => '3c9d8aa1', 39 39 'rsrc/css/application/base/phabricator-application-launch-view.css' => '16ca323f', 40 40 'rsrc/css/application/base/standard-page-view.css' => '61e68a55', 41 - 'rsrc/css/application/calendar/calendar-icon.css' => '98ce946d', 42 41 'rsrc/css/application/chatlog/chatlog.css' => '852140ff', 43 42 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 44 43 'rsrc/css/application/config/config-options.css' => '7fedf08b', ··· 46 45 'rsrc/css/application/config/config-welcome.css' => '6abd79be', 47 46 'rsrc/css/application/config/setup-issue.css' => '22270af2', 48 47 'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', 49 - 'rsrc/css/application/conpherence/durable-column.css' => '8c43d6ac', 48 + 'rsrc/css/application/conpherence/durable-column.css' => '4331cbe9', 50 49 'rsrc/css/application/conpherence/menu.css' => 'f389e048', 51 50 'rsrc/css/application/conpherence/message-pane.css' => '5bb4b76d', 52 51 'rsrc/css/application/conpherence/notification.css' => '919974b6', ··· 472 471 'rsrc/js/core/behavior-watch-anchor.js' => '9f36c42d', 473 472 'rsrc/js/core/behavior-workflow.js' => '0a3f3021', 474 473 'rsrc/js/core/phtize.js' => 'd254d646', 474 + 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '54733475', 475 475 'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836', 476 - 'rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js' => '4d94d9c3', 477 476 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 478 477 'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262', 479 478 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', ··· 493 492 'aphront-two-column-view-css' => '16ab3ad2', 494 493 'aphront-typeahead-control-css' => '0e403212', 495 494 'auth-css' => '44975d4b', 496 - 'calendar-icon-css' => '98ce946d', 497 495 'changeset-view-manager' => '58562350', 498 496 'conduit-api-css' => '7bc725c4', 499 497 'config-options-css' => '7fedf08b', 500 498 'config-welcome-css' => '6abd79be', 501 - 'conpherence-durable-column-view' => '8c43d6ac', 499 + 'conpherence-durable-column-view' => '4331cbe9', 502 500 'conpherence-menu-css' => 'f389e048', 503 501 'conpherence-message-pane-css' => '5bb4b76d', 504 502 'conpherence-notification-css' => '919974b6', ··· 618 616 'javelin-behavior-phame-post-preview' => 'be807912', 619 617 'javelin-behavior-pholio-mock-edit' => '246dc085', 620 618 'javelin-behavior-pholio-mock-view' => 'fbe497e7', 619 + 'javelin-behavior-phui-dropdown-menu' => '54733475', 621 620 'javelin-behavior-phui-object-box-tabs' => '2bfa2836', 622 - 'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3', 623 621 'javelin-behavior-policy-control' => '9a340b3d', 624 622 'javelin-behavior-policy-rule-editor' => '5e9f347c', 625 623 'javelin-behavior-ponder-votebox' => '4e9b766b', ··· 1135 1133 '4cebc641' => array( 1136 1134 'javelin-install', 1137 1135 ), 1138 - '4d94d9c3' => array( 1139 - 'javelin-behavior', 1140 - 'javelin-stratcom', 1141 - 'javelin-dom', 1142 - 'phuix-dropdown-menu', 1143 - ), 1144 1136 '4e3e79a6' => array( 1145 1137 'javelin-behavior', 1146 1138 'javelin-stratcom', ··· 1174 1166 'javelin-websocket', 1175 1167 'javelin-leader', 1176 1168 'javelin-json', 1169 + ), 1170 + 54733475 => array( 1171 + 'javelin-behavior', 1172 + 'javelin-stratcom', 1173 + 'javelin-dom', 1174 + 'phuix-dropdown-menu', 1177 1175 ), 1178 1176 '54b612ba' => array( 1179 1177 'javelin-color', ··· 2147 2145 'phabricator-draggable-list', 2148 2146 'javelin-behavior-phabricator-transaction-list', 2149 2147 'javelin-behavior-phabricator-show-older-transactions', 2150 - 'javelin-behavior-phui-timeline-dropdown-menu', 2148 + 'javelin-behavior-phui-dropdown-menu', 2151 2149 'javelin-behavior-doorkeeper-tag', 2152 2150 'phabricator-title', 2153 2151 'javelin-leader',
+1 -1
resources/celerity/packages.php
··· 66 66 'phabricator-draggable-list', 67 67 'javelin-behavior-phabricator-transaction-list', 68 68 'javelin-behavior-phabricator-show-older-transactions', 69 - 'javelin-behavior-phui-timeline-dropdown-menu', 69 + 'javelin-behavior-phui-dropdown-menu', 70 70 'javelin-behavior-doorkeeper-tag', 71 71 'phabricator-title', 72 72 'javelin-leader',
+10 -5
src/applications/phriction/controller/PhrictionDocumentController.php
··· 192 192 $crumbs->addCrumb($view); 193 193 } 194 194 195 + $action_button = id(new PHUIButtonView()) 196 + ->setTag('a') 197 + ->setText(pht('Actions')) 198 + ->setHref('#') 199 + ->setIconFont('fa-bars') 200 + ->addClass('phui-mobile-menu') 201 + ->setDropdownMenu($actions); 202 + 195 203 $header = id(new PHUIHeaderView()) 196 204 ->setUser($user) 197 205 ->setPolicyObject($document) 198 - ->setHeader($page_title); 206 + ->setHeader($page_title) 207 + ->addActionLink($action_button); 199 208 200 209 if ($content) { 201 210 $header->setEpoch($content->getDateCreated()); ··· 206 215 $prop_list = new PHUIPropertyGroupView(); 207 216 $prop_list->addPropertyList($properties); 208 217 } 209 - $action_id = celerity_generate_unique_node_id(); 210 - $actions->setID($action_id); 211 218 212 219 $page_content = id(new PHUIDocumentView()) 213 220 ->setFontKit(PHUIDocumentView::FONT_SOURCE_SANS) 214 221 ->setHeader($header) 215 - ->setActionListID($action_id) 216 222 ->appendChild( 217 223 array( 218 - $actions, 219 224 $prop_list, 220 225 $version_note, 221 226 $move_notice,
+12
src/view/phui/PHUIButtonView.php
··· 103 103 return $this->tag; 104 104 } 105 105 106 + public function setDropdownMenu(PhabricatorActionListView $actions) { 107 + Javelin::initBehavior('phui-dropdown-menu'); 108 + 109 + $this->addSigil('phui-dropdown-menu'); 110 + $this->setMetadata( 111 + array( 112 + 'items' => $actions, 113 + )); 114 + 115 + return $this; 116 + } 117 + 106 118 protected function getTagAttributes() { 107 119 108 120 require_celerity_resource('phui-button-css');
-28
src/view/phui/PHUIDocumentView.php
··· 16 16 private $bookdescription; 17 17 private $mobileview; 18 18 private $fontKit; 19 - private $actionListID; 20 19 private $fluid; 21 20 22 21 public function setOffset($offset) { ··· 56 55 57 56 public function setFontKit($kit) { 58 57 $this->fontKit = $kit; 59 - return $this; 60 - } 61 - 62 - public function setActionListID($id) { 63 - $this->actionListID = $id; 64 58 return $this; 65 59 } 66 60 ··· 164 158 $this->renderChildren()); 165 159 } else { 166 160 $main_content = $this->renderChildren(); 167 - } 168 - 169 - if ($this->actionListID) { 170 - $icon_id = celerity_generate_unique_node_id(); 171 - $icon = id(new PHUIIconView()) 172 - ->setIconFont('fa-bars'); 173 - $meta = array( 174 - 'map' => array( 175 - $this->actionListID => 'phabricator-action-list-toggle', 176 - $icon_id => 'phuix-dropdown-open', 177 - ), 178 - ); 179 - $mobile_menu = id(new PHUIButtonView()) 180 - ->setTag('a') 181 - ->setText(pht('Actions')) 182 - ->setHref('#') 183 - ->setIcon($icon) 184 - ->addClass('phui-mobile-menu') 185 - ->setID($icon_id) 186 - ->addSigil('jx-toggle-class') 187 - ->setMetadata($meta); 188 - $this->header->addActionLink($mobile_menu); 189 161 } 190 162 191 163 $content_inner = phutil_tag(
+2 -2
src/view/phui/PHUITimelineEventView.php
··· 290 290 pht('Comment Actions')); 291 291 292 292 if ($items) { 293 - $sigil = 'phui-timeline-menu'; 294 - Javelin::initBehavior('phui-timeline-dropdown-menu'); 293 + $sigil = 'phui-dropdown-menu'; 294 + Javelin::initBehavior('phui-dropdown-menu'); 295 295 } else { 296 296 $sigil = null; 297 297 }
+5 -5
webroot/rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js webroot/rsrc/js/phui/behavior-phui-dropdown-menu.js
··· 1 1 /** 2 - * @provides javelin-behavior-phui-timeline-dropdown-menu 2 + * @provides javelin-behavior-phui-dropdown-menu 3 3 * @requires javelin-behavior 4 4 * javelin-stratcom 5 5 * javelin-dom 6 6 * phuix-dropdown-menu 7 7 */ 8 8 9 - JX.behavior('phui-timeline-dropdown-menu', function() { 9 + JX.behavior('phui-dropdown-menu', function() { 10 10 11 - JX.Stratcom.listen('click', 'phui-timeline-menu', function(e) { 12 - var data = e.getNodeData('phui-timeline-menu'); 11 + JX.Stratcom.listen('click', 'phui-dropdown-menu', function(e) { 12 + var data = e.getNodeData('phui-dropdown-menu'); 13 13 if (data.menu) { 14 14 return; 15 15 } ··· 18 18 19 19 var list = JX.$H(data.items).getFragment().firstChild; 20 20 21 - var icon = e.getNode('phui-timeline-menu'); 21 + var icon = e.getNode('phui-dropdown-menu'); 22 22 data.menu = new JX.PHUIXDropdownMenu(icon); 23 23 data.menu.setContent(list); 24 24 data.menu.open();