1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +01:00

Remove some unusual UI policy hints in Phriction

Summary:
Ref T13077. We currently have these weird policy hints in Phriction that we don't use in other applications. Just remove them for consistency to make the eventual swap to EditEngine a little easier.

Also nuke some unreacahble code.

Test Plan: Loaded edit page, saw more standard UI.

Reviewers: amckinley

Maniphest Tasks: T13077

Differential Revision: https://secure.phabricator.com/D19618
This commit is contained in:
epriestley 2018-08-28 15:10:28 -07:00
parent 4afb6446d9
commit 04f8270a74
2 changed files with 8 additions and 26 deletions

View file

@ -226,13 +226,7 @@ final class PhrictionEditController
->execute(); ->execute();
$view_capability = PhabricatorPolicyCapability::CAN_VIEW; $view_capability = PhabricatorPolicyCapability::CAN_VIEW;
$edit_capability = PhabricatorPolicyCapability::CAN_EDIT; $edit_capability = PhabricatorPolicyCapability::CAN_EDIT;
$codex = id(PhabricatorPolicyCodex::newFromObject($document, $viewer))
->setCapability($view_capability);
$view_capability_description = $codex->getPolicySpecialRuleForCapability(
PhabricatorPolicyCapability::CAN_VIEW)->getDescription();
$edit_capability_description = $codex->getPolicySpecialRuleForCapability(
PhabricatorPolicyCapability::CAN_EDIT)->getDescription();
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
@ -279,15 +273,13 @@ final class PhrictionEditController
->setSpacePHID($v_space) ->setSpacePHID($v_space)
->setPolicyObject($document) ->setPolicyObject($document)
->setCapability($view_capability) ->setCapability($view_capability)
->setPolicies($policies) ->setPolicies($policies))
->setCaption($view_capability_description))
->appendChild( ->appendChild(
id(new AphrontFormPolicyControl()) id(new AphrontFormPolicyControl())
->setName('editPolicy') ->setName('editPolicy')
->setPolicyObject($document) ->setPolicyObject($document)
->setCapability($edit_capability) ->setCapability($edit_capability)
->setPolicies($policies) ->setPolicies($policies))
->setCaption($edit_capability_description))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel(pht('Edit Notes')) ->setLabel(pht('Edit Notes'))
@ -323,17 +315,17 @@ final class PhrictionEditController
$crumbs->setBorder(true); $crumbs->setBorder(true);
$view = id(new PHUITwoColumnView()) $view = id(new PHUITwoColumnView())
->setFooter(array( ->setFooter(
$draft_note, array(
$form_box, $draft_note,
$preview, $form_box,
)); $preview,
));
return $this->newPage() return $this->newPage()
->setTitle($page_title) ->setTitle($page_title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($view); ->appendChild($view);
} }
} }

View file

@ -279,7 +279,6 @@ final class AphrontFormPolicyControl extends AphrontFormControl {
->setIcon($icon); ->setIcon($icon);
} }
if ($this->templatePHIDType) { if ($this->templatePHIDType) {
$context_path = 'template/'.$this->templatePHIDType.'/'; $context_path = 'template/'.$this->templatePHIDType.'/';
} else { } else {
@ -346,15 +345,6 @@ final class AphrontFormPolicyControl extends AphrontFormControl {
)), )),
$input, $input,
)); ));
return AphrontFormSelectControl::renderSelectTag(
$this->getValue(),
$this->getOptions(),
array(
'name' => $this->getName(),
'disabled' => $this->getDisabled() ? 'disabled' : null,
'id' => $this->getID(),
));
} }
public static function getSelectCustomKey() { public static function getSelectCustomKey() {