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

Move search, new room into thread column in Conpherence

Summary:
Moves search and new room out of crumb bar and into the thread column. This opens up space to add "Edit Room" into the crumbs area as an action link. Also removed 'widget-edit' pathways and javascript.

Fixes T8972

Test Plan:
Search, New, Edit rooms. Click different rooms, see correct URL each time.

{F1813226}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8972

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

authored by

Chad Little and committed by
chad
d25a9530 105be01d

+104 -81
+17 -17
resources/celerity/map.php
··· 45 45 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 46 46 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 47 47 'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 48 - 'rsrc/css/application/conpherence/menu.css' => '3a0fd18a', 48 + 'rsrc/css/application/conpherence/menu.css' => '4c959efa', 49 49 'rsrc/css/application/conpherence/message-pane.css' => '31dc663d', 50 50 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 51 51 'rsrc/css/application/conpherence/transaction.css' => '2c71247c', ··· 438 438 'rsrc/js/application/conpherence/behavior-menu.js' => '1d45c74d', 439 439 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 440 440 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 441 - 'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'a8458711', 441 + 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '65845387', 442 442 'rsrc/js/application/countdown/timer.js' => 'e4cc26b3', 443 443 'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145', 444 444 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', ··· 614 614 'config-options-css' => '0ede4c9b', 615 615 'config-page-css' => '8798e14f', 616 616 'conpherence-durable-column-view' => '194ac487', 617 - 'conpherence-menu-css' => '3a0fd18a', 617 + 'conpherence-menu-css' => '4c959efa', 618 618 'conpherence-message-pane-css' => '31dc663d', 619 619 'conpherence-notification-css' => '6cdcc253', 620 620 'conpherence-thread-manager' => '01774ab2', ··· 664 664 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 665 665 'javelin-behavior-conpherence-menu' => '1d45c74d', 666 666 'javelin-behavior-conpherence-pontificate' => '21ba5861', 667 - 'javelin-behavior-conpherence-widget-pane' => 'a8458711', 667 + 'javelin-behavior-conpherence-widget-pane' => '65845387', 668 668 'javelin-behavior-countdown-timer' => 'e4cc26b3', 669 669 'javelin-behavior-dark-console' => 'f411b6ae', 670 670 'javelin-behavior-dashboard-async-panel' => '469c0d9e', ··· 1479 1479 'javelin-request', 1480 1480 'javelin-workflow', 1481 1481 ), 1482 + 65845387 => array( 1483 + 'javelin-behavior', 1484 + 'javelin-dom', 1485 + 'javelin-stratcom', 1486 + 'javelin-workflow', 1487 + 'javelin-util', 1488 + 'phabricator-notification', 1489 + 'javelin-behavior-device', 1490 + 'phuix-dropdown-menu', 1491 + 'phuix-action-list-view', 1492 + 'phuix-action-view', 1493 + 'conpherence-thread-manager', 1494 + ), 1482 1495 '680ea2c8' => array( 1483 1496 'javelin-install', 1484 1497 'javelin-dom', ··· 1783 1796 'javelin-behavior', 1784 1797 'javelin-stratcom', 1785 1798 'javelin-dom', 1786 - ), 1787 - 'a8458711' => array( 1788 - 'javelin-behavior', 1789 - 'javelin-dom', 1790 - 'javelin-stratcom', 1791 - 'javelin-workflow', 1792 - 'javelin-util', 1793 - 'phabricator-notification', 1794 - 'javelin-behavior-device', 1795 - 'phuix-dropdown-menu', 1796 - 'phuix-action-list-view', 1797 - 'phuix-action-view', 1798 - 'conpherence-thread-manager', 1799 1799 ), 1800 1800 'a8d8459d' => array( 1801 1801 'javelin-behavior',
-6
src/applications/conpherence/constants/ConpherenceWidgetConfigConstants.php
··· 36 36 'deviceOnly' => false, 37 37 'hasCreate' => false, 38 38 ), 39 - 'widgets-edit' => array( 40 - 'name' => pht('Edit Room'), 41 - 'icon' => 'fa-pencil', 42 - 'deviceOnly' => false, 43 - 'hasCreate' => false, 44 - ), 45 39 ); 46 40 } 47 41
+17 -21
src/applications/conpherence/controller/ConpherenceController.php
··· 38 38 $crumbs = parent::buildApplicationCrumbs(); 39 39 $crumbs->setBorder(true); 40 40 41 - $crumbs->addAction( 42 - id(new PHUIListItemView()) 43 - ->setName(pht('Search')) 44 - ->setHref($this->getApplicationURI('search/')) 45 - ->setIcon('fa-search')); 46 - 47 - if ($is_rooms) { 41 + if (!$is_rooms) { 48 42 $crumbs 49 43 ->addAction( 50 44 id(new PHUIListItemView()) 51 - ->setName(pht('New Room')) 52 - ->setHref($this->getApplicationURI('new/')) 53 - ->setIcon('fa-plus-square') 54 - ->setWorkflow(true)); 55 - } else { 56 - $crumbs 57 - ->addAction( 58 - id(new PHUIListItemView()) 59 - ->setName(pht('New Room')) 60 - ->setHref($this->getApplicationURI('new/')) 61 - ->setIcon('fa-plus-square') 62 - ->setWorkflow(true)) 63 - ->addAction( 64 - id(new PHUIListItemView()) 65 45 ->setName(pht('Room')) 66 46 ->setHref('#') 67 47 ->setIcon('fa-bars') ··· 76 56 ConpherenceThread $conpherence, 77 57 array $policy_objects) { 78 58 assert_instances_of($policy_objects, 'PhabricatorPolicy'); 59 + $viewer = $this->getViewer(); 79 60 80 61 $crumbs = $this->buildApplicationCrumbs(); 81 62 $data = $conpherence->getDisplayData($this->getViewer()); ··· 83 64 id(new PHUICrumbView()) 84 65 ->setName($data['title']) 85 66 ->setHref('/'.$conpherence->getMonogram())); 67 + 68 + $can_edit = PhabricatorPolicyFilter::hasCapability( 69 + $viewer, 70 + $conpherence, 71 + PhabricatorPolicyCapability::CAN_EDIT); 72 + 73 + $crumbs 74 + ->addAction( 75 + id(new PHUIListItemView()) 76 + ->setName(pht('Edit Room')) 77 + ->setHref( 78 + $this->getApplicationURI('update/'.$conpherence->getID()).'/') 79 + ->setIcon('fa-pencil') 80 + ->setDisabled(!$can_edit) 81 + ->setWorkflow(true)); 86 82 87 83 return hsprintf( 88 84 '%s',
-7
src/applications/conpherence/controller/ConpherenceWidgetController.php
··· 82 82 'style' => 'display: none', 83 83 ), 84 84 $this->renderSettingsWidgetPaneContent()); 85 - $widgets[] = phutil_tag( 86 - 'div', 87 - array( 88 - 'class' => 'widgets-body', 89 - 'id' => 'widgets-edit', 90 - 'style' => 'display: none', 91 - )); 92 85 93 86 // without this implosion we get "," between each element in our widgets 94 87 // array
+47 -7
src/applications/conpherence/view/ConpherenceThreadListView.php
··· 99 99 array $rooms, 100 100 array $policy_objects) { 101 101 102 - $header = $this->renderMenuItemHeader( 103 - pht('Rooms'), 104 - 'conpherence-room-list-header'); 102 + $header = $this->renderMenuItemHeader(); 105 103 $menu->addMenuItem($header); 106 104 107 105 if (empty($rooms)) { ··· 189 187 return $menu; 190 188 } 191 189 192 - private function renderMenuItemHeader($title, $class = null) { 190 + private function renderMenuItemHeader() { 191 + $rooms = phutil_tag( 192 + 'a', 193 + array( 194 + 'class' => 'room-list-href', 195 + 'href' => '/conpherence/search/', 196 + ), 197 + pht('Rooms')); 198 + 199 + $new_icon = id(new PHUIIconView()) 200 + ->setIcon('fa-plus-square') 201 + ->addSigil('has-tooltip') 202 + ->setHref('/conpherence/new/') 203 + ->setWorkflow(true) 204 + ->setMetaData(array( 205 + 'tip' => pht('New Room'), 206 + )); 207 + 208 + $search_icon = id(new PHUIIconView()) 209 + ->setIcon('fa-search') 210 + ->addSigil('has-tooltip') 211 + ->setHref('/conpherence/search/') 212 + ->setMetaData(array( 213 + 'tip' => pht('Search Rooms'), 214 + )); 215 + 216 + $icons = phutil_tag( 217 + 'span', 218 + array( 219 + 'class' => 'room-list-icons', 220 + ), 221 + array( 222 + $new_icon, 223 + $search_icon, 224 + )); 225 + 226 + $new_icon = id(new PHUIIconView()) 227 + ->setIcon('fa-plus-square') 228 + ->setHref('/conpherence/new/') 229 + ->setWorkflow(true); 230 + 231 + $custom = array($rooms, $icons); 232 + 193 233 $item = id(new PHUIListItemView()) 194 - ->setType(PHUIListItemView::TYPE_LABEL) 195 - ->setName($title) 196 - ->addClass($class); 234 + ->setType(PHUIListItemView::TYPE_CUSTOM) 235 + ->setName($custom) 236 + ->addClass('conpherence-room-list-header'); 197 237 return $item; 198 238 } 199 239
+18 -2
webroot/rsrc/css/application/conpherence/menu.css
··· 51 51 display: none; 52 52 } 53 53 54 - .conpherence-menu-pane.phabricator-side-menu .phui-list-item-type-label { 54 + .conpherence-menu-pane.phabricator-side-menu .room-list-href { 55 55 padding: 10px 0 9px 8px; 56 + display: inline-block; 57 + text-transform: uppercase; 58 + color: {$darkgreytext}; 59 + font-weight: bold; 60 + font-size: {$smallerfontsize}; 61 + } 62 + 63 + .conpherence-menu-pane.phabricator-side-menu .room-list-icons { 64 + display: inline-block; 65 + float: right; 66 + padding: 8px 0 5px; 67 + } 68 + 69 + .conpherence-menu-pane .conpherence-room-list-header { 70 + clear: both; 71 + overflow: hidden; 56 72 } 57 73 58 74 .conpherence-menu-pane .conpherence-room-list-header ··· 60 76 font-weight: bold; 61 77 float: right; 62 78 text-transform: none; 63 - margin: 0px 8px 0px 0px; 79 + padding: 4px; 64 80 } 65 81 66 82 .conpherence-menu-pane .conpherence-room-list-header
+5 -21
webroot/rsrc/js/application/conpherence/behavior-widget-pane.js
··· 83 83 84 84 var handler; 85 85 var href; 86 - if (widget == 'widgets-edit') { 87 - var threadManager = JX.ConpherenceThreadManager.getInstance(); 88 - handler = function(e) { 89 - e.prevent(); 90 - menu.close(); 91 - threadManager.runUpdateWorkflowFromLink( 92 - e.getTarget(), 93 - { 94 - action : 'metadata', 95 - force_ajax : true, 96 - stage : 'submit' 97 - }); 98 - }; 99 - href = threadManager._getUpdateURI(); 100 - } else { 101 - handler = JX.bind(null, function(widget, e) { 102 - toggleWidget({widget: widget}); 103 - e.prevent(); 104 - menu.close(); 105 - }, widget); 106 - } 86 + handler = JX.bind(null, function(widget, e) { 87 + toggleWidget({widget: widget}); 88 + e.prevent(); 89 + menu.close(); 90 + }, widget); 107 91 var item = new JX.PHUIXActionView() 108 92 .setIcon(widget_data.icon || 'none') 109 93 .setName(widget_data.name)