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

Don't show Conpherence controls if not in a Conpherence

Summary: We currently try to build crumbs out even if the user has no membership in any. This removes these useless controls.

Test Plan: Leave all Rooms, see NUX state with no "Edit Room", blank title, or "Collapse Column" controls.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+37 -35
+37 -35
src/applications/conpherence/controller/ConpherenceController.php
··· 59 59 $viewer = $this->getViewer(); 60 60 61 61 $crumbs = $this->buildApplicationCrumbs(); 62 - $data = $conpherence->getDisplayData($this->getViewer()); 63 - $crumbs->addCrumb( 64 - id(new PHUICrumbView()) 65 - ->setName($data['title']) 66 - ->setHref('/'.$conpherence->getMonogram())); 67 62 68 - $can_edit = PhabricatorPolicyFilter::hasCapability( 69 - $viewer, 70 - $conpherence, 71 - PhabricatorPolicyCapability::CAN_EDIT); 63 + if ($conpherence->getID()) { 64 + $data = $conpherence->getDisplayData($this->getViewer()); 65 + $crumbs->addCrumb( 66 + id(new PHUICrumbView()) 67 + ->setName($data['title']) 68 + ->setHref('/'.$conpherence->getMonogram())); 69 + $can_edit = PhabricatorPolicyFilter::hasCapability( 70 + $viewer, 71 + $conpherence, 72 + PhabricatorPolicyCapability::CAN_EDIT); 72 73 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)); 74 + $crumbs 75 + ->addAction( 76 + id(new PHUIListItemView()) 77 + ->setName(pht('Edit Room')) 78 + ->setHref( 79 + $this->getApplicationURI('update/'.$conpherence->getID()).'/') 80 + ->setIcon('fa-pencil') 81 + ->setDisabled(!$can_edit) 82 + ->setWorkflow(true)); 82 83 83 - $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY; 84 - $widget_view = (bool)$viewer->getUserSetting($widget_key, false); 84 + $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY; 85 + $widget_view = (bool)$viewer->getUserSetting($widget_key, false); 85 86 86 - $divider = id(new PHUIListItemView()) 87 - ->setType(PHUIListItemView::TYPE_DIVIDER) 88 - ->addClass('conpherence-header-desktop-item'); 89 - $crumbs->addAction($divider); 87 + $divider = id(new PHUIListItemView()) 88 + ->setType(PHUIListItemView::TYPE_DIVIDER) 89 + ->addClass('conpherence-header-desktop-item'); 90 + $crumbs->addAction($divider); 90 91 91 - Javelin::initBehavior( 92 - 'toggle-widget', 93 - array( 94 - 'show' => (int)$widget_view, 95 - 'settingsURI' => '/settings/adjust/?key='.$widget_key, 96 - )); 92 + Javelin::initBehavior( 93 + 'toggle-widget', 94 + array( 95 + 'show' => (int)$widget_view, 96 + 'settingsURI' => '/settings/adjust/?key='.$widget_key, 97 + )); 97 98 98 - $crumbs->addAction( 99 - id(new PHUIListItemView()) 100 - ->addSigil('conpherence-widget-toggle') 101 - ->setIcon('fa-columns') 102 - ->addClass('conpherence-header-desktop-item')); 99 + $crumbs->addAction( 100 + id(new PHUIListItemView()) 101 + ->addSigil('conpherence-widget-toggle') 102 + ->setIcon('fa-columns') 103 + ->addClass('conpherence-header-desktop-item')); 104 + } 103 105 104 106 return hsprintf( 105 107 '%s',