mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Remove Differential "View Policy" field
Summary: Ref T11114. Obsoleted by EditEngine. Test Plan: Edited the view policy of a revision. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17082
This commit is contained in:
parent
84572a3b93
commit
f552a20c61
3 changed files with 0 additions and 53 deletions
|
@ -582,7 +582,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php',
|
'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php',
|
||||||
'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php',
|
'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php',
|
||||||
'DifferentialUpdateRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php',
|
'DifferentialUpdateRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php',
|
||||||
'DifferentialViewPolicyField' => 'applications/differential/customfield/DifferentialViewPolicyField.php',
|
|
||||||
'DiffusionAuditorDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorDatasource.php',
|
'DiffusionAuditorDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorDatasource.php',
|
||||||
'DiffusionAuditorFunctionDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorFunctionDatasource.php',
|
'DiffusionAuditorFunctionDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorFunctionDatasource.php',
|
||||||
'DiffusionAuditorsAddAuditorsHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsAddAuditorsHeraldAction.php',
|
'DiffusionAuditorsAddAuditorsHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsAddAuditorsHeraldAction.php',
|
||||||
|
@ -5247,7 +5246,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialUnitStatus' => 'Phobject',
|
'DifferentialUnitStatus' => 'Phobject',
|
||||||
'DifferentialUnitTestResult' => 'Phobject',
|
'DifferentialUnitTestResult' => 'Phobject',
|
||||||
'DifferentialUpdateRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
'DifferentialUpdateRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||||
'DifferentialViewPolicyField' => 'DifferentialCoreCustomField',
|
|
||||||
'DiffusionAuditorDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
'DiffusionAuditorDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||||
'DiffusionAuditorFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
'DiffusionAuditorFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||||
'DiffusionAuditorsAddAuditorsHeraldAction' => 'DiffusionAuditorsHeraldAction',
|
'DiffusionAuditorsAddAuditorsHeraldAction' => 'DiffusionAuditorsHeraldAction',
|
||||||
|
|
|
@ -31,7 +31,6 @@ final class PhabricatorDifferentialConfigOptions
|
||||||
new DifferentialReviewersField(),
|
new DifferentialReviewersField(),
|
||||||
new DifferentialProjectReviewersField(),
|
new DifferentialProjectReviewersField(),
|
||||||
new DifferentialRepositoryField(),
|
new DifferentialRepositoryField(),
|
||||||
new DifferentialViewPolicyField(),
|
|
||||||
|
|
||||||
new DifferentialManiphestTasksField(),
|
new DifferentialManiphestTasksField(),
|
||||||
new DifferentialCommitsField(),
|
new DifferentialCommitsField(),
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DifferentialViewPolicyField
|
|
||||||
extends DifferentialCoreCustomField {
|
|
||||||
|
|
||||||
public function getFieldKey() {
|
|
||||||
return 'differential:view-policy';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFieldName() {
|
|
||||||
return pht('View Policy');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFieldDescription() {
|
|
||||||
return pht('Controls visibility.');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function readValueFromRevision(
|
|
||||||
DifferentialRevision $revision) {
|
|
||||||
return $revision->getViewPolicy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function readValueFromRequest(AphrontRequest $request) {
|
|
||||||
$this->setValue($request->getStr($this->getFieldKey()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function renderEditControl(array $handles) {
|
|
||||||
$viewer = $this->getViewer();
|
|
||||||
$revision = $this->getObject();
|
|
||||||
|
|
||||||
$policies = id(new PhabricatorPolicyQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->setObject($revision)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
return id(new AphrontFormPolicyControl())
|
|
||||||
->setUser($viewer)
|
|
||||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
|
||||||
->setPolicyObject($revision)
|
|
||||||
->setPolicies($policies)
|
|
||||||
->setName($this->getFieldKey())
|
|
||||||
->setValue($this->getValue())
|
|
||||||
->setError($this->getFieldError());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getApplicationTransactionType() {
|
|
||||||
return PhabricatorTransactions::TYPE_VIEW_POLICY;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue