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

Simplify dashboard panel creation

Summary: Ref T10390. Basically hides policy controls when creating a panel on a dashboard. Shows when you edit them or through normal workflow. I think we should maybe also get rid of view policy? Not sure the benefit since results will be filtered anyways. Maybe Text panels? Not sure the use case.

Test Plan: Add a panel, edit a panel.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: hskiba, Korvin

Maniphest Tasks: T10390

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

+19 -15
+17 -13
src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
··· 193 193 ->setLabel(pht('Name')) 194 194 ->setName('name') 195 195 ->setValue($v_name) 196 - ->setError($e_name)) 197 - ->appendChild( 198 - id(new AphrontFormPolicyControl()) 199 - ->setName('viewPolicy') 200 - ->setPolicyObject($panel) 201 - ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 202 - ->setPolicies($policies)) 203 - ->appendChild( 204 - id(new AphrontFormPolicyControl()) 205 - ->setName('editPolicy') 206 - ->setPolicyObject($panel) 207 - ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) 208 - ->setPolicies($policies)); 196 + ->setError($e_name)); 197 + 198 + if (!$request->isAjax() || !$is_create) { 199 + $form 200 + ->appendChild( 201 + id(new AphrontFormPolicyControl()) 202 + ->setName('viewPolicy') 203 + ->setPolicyObject($panel) 204 + ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 205 + ->setPolicies($policies)) 206 + ->appendChild( 207 + id(new AphrontFormPolicyControl()) 208 + ->setName('editPolicy') 209 + ->setPolicyObject($panel) 210 + ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) 211 + ->setPolicies($policies)); 212 + } 209 213 210 214 $field_list->appendFieldsToForm($form); 211 215
+1 -1
src/applications/dashboard/storage/PhabricatorDashboard.php
··· 32 32 return id(new PhabricatorDashboard()) 33 33 ->setName('') 34 34 ->setIcon('fa-dashboard') 35 - ->setViewPolicy(PhabricatorPolicies::POLICY_USER) 35 + ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy()) 36 36 ->setEditPolicy($actor->getPHID()) 37 37 ->setStatus(self::STATUS_ACTIVE) 38 38 ->setAuthorPHID($actor->getPHID())
+1 -1
src/applications/dashboard/storage/PhabricatorDashboardPanel.php
··· 27 27 return id(new PhabricatorDashboardPanel()) 28 28 ->setName('') 29 29 ->setAuthorPHID($actor->getPHID()) 30 - ->setViewPolicy(PhabricatorPolicies::POLICY_USER) 30 + ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy()) 31 31 ->setEditPolicy($actor->getPHID()); 32 32 } 33 33