mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-26 11:10:16 +01:00
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
This commit is contained in:
parent
4540ae028a
commit
568a3877d1
3 changed files with 19 additions and 15 deletions
|
@ -193,19 +193,23 @@ final class PhabricatorDashboardPanelEditController
|
|||
->setLabel(pht('Name'))
|
||||
->setName('name')
|
||||
->setValue($v_name)
|
||||
->setError($e_name))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('viewPolicy')
|
||||
->setPolicyObject($panel)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
||||
->setPolicies($policies))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('editPolicy')
|
||||
->setPolicyObject($panel)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
||||
->setPolicies($policies));
|
||||
->setError($e_name));
|
||||
|
||||
if (!$request->isAjax() || !$is_create) {
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('viewPolicy')
|
||||
->setPolicyObject($panel)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
||||
->setPolicies($policies))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('editPolicy')
|
||||
->setPolicyObject($panel)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
||||
->setPolicies($policies));
|
||||
}
|
||||
|
||||
$field_list->appendFieldsToForm($form);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
|
|||
return id(new PhabricatorDashboard())
|
||||
->setName('')
|
||||
->setIcon('fa-dashboard')
|
||||
->setViewPolicy(PhabricatorPolicies::POLICY_USER)
|
||||
->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy())
|
||||
->setEditPolicy($actor->getPHID())
|
||||
->setStatus(self::STATUS_ACTIVE)
|
||||
->setAuthorPHID($actor->getPHID())
|
||||
|
|
|
@ -27,7 +27,7 @@ final class PhabricatorDashboardPanel
|
|||
return id(new PhabricatorDashboardPanel())
|
||||
->setName('')
|
||||
->setAuthorPHID($actor->getPHID())
|
||||
->setViewPolicy(PhabricatorPolicies::POLICY_USER)
|
||||
->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy())
|
||||
->setEditPolicy($actor->getPHID());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue