1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-09 19:08:40 +02: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:
Chad Little 2017-02-21 16:29:47 -08:00
parent 4540ae028a
commit 568a3877d1
3 changed files with 19 additions and 15 deletions

View file

@ -193,7 +193,10 @@ final class PhabricatorDashboardPanelEditController
->setLabel(pht('Name')) ->setLabel(pht('Name'))
->setName('name') ->setName('name')
->setValue($v_name) ->setValue($v_name)
->setError($e_name)) ->setError($e_name));
if (!$request->isAjax() || !$is_create) {
$form
->appendChild( ->appendChild(
id(new AphrontFormPolicyControl()) id(new AphrontFormPolicyControl())
->setName('viewPolicy') ->setName('viewPolicy')
@ -206,6 +209,7 @@ final class PhabricatorDashboardPanelEditController
->setPolicyObject($panel) ->setPolicyObject($panel)
->setCapability(PhabricatorPolicyCapability::CAN_EDIT) ->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
->setPolicies($policies)); ->setPolicies($policies));
}
$field_list->appendFieldsToForm($form); $field_list->appendFieldsToForm($form);

View file

@ -32,7 +32,7 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
return id(new PhabricatorDashboard()) return id(new PhabricatorDashboard())
->setName('') ->setName('')
->setIcon('fa-dashboard') ->setIcon('fa-dashboard')
->setViewPolicy(PhabricatorPolicies::POLICY_USER) ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy())
->setEditPolicy($actor->getPHID()) ->setEditPolicy($actor->getPHID())
->setStatus(self::STATUS_ACTIVE) ->setStatus(self::STATUS_ACTIVE)
->setAuthorPHID($actor->getPHID()) ->setAuthorPHID($actor->getPHID())

View file

@ -27,7 +27,7 @@ final class PhabricatorDashboardPanel
return id(new PhabricatorDashboardPanel()) return id(new PhabricatorDashboardPanel())
->setName('') ->setName('')
->setAuthorPHID($actor->getPHID()) ->setAuthorPHID($actor->getPHID())
->setViewPolicy(PhabricatorPolicies::POLICY_USER) ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy())
->setEditPolicy($actor->getPHID()); ->setEditPolicy($actor->getPHID());
} }