1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Remove DifferentialFieldSelector

Summary: Ref T2222. Gets rid of DifferentialFieldSelector, favoring `differential.fields`.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8472
This commit is contained in:
epriestley 2014-03-09 12:43:07 -07:00
parent 40b471faea
commit 7cd4e70ef2
6 changed files with 1 additions and 131 deletions

View file

@ -794,8 +794,6 @@ return array(
'/\.l?hs$/',
),
'differential.field-selector' => 'DifferentialDefaultFieldSelector',
// Differential has a required "Test Plan" field by default. You can make it
// optional by setting this to false. You can also completely remove it above,
// if you prefer.

View file

@ -375,7 +375,6 @@ phutil_register_library_map(array(
'DifferentialDAO' => 'applications/differential/storage/DifferentialDAO.php',
'DifferentialDateCreatedFieldSpecification' => 'applications/differential/field/specification/DifferentialDateCreatedFieldSpecification.php',
'DifferentialDateModifiedFieldSpecification' => 'applications/differential/field/specification/DifferentialDateModifiedFieldSpecification.php',
'DifferentialDefaultFieldSelector' => 'applications/differential/field/selector/DifferentialDefaultFieldSelector.php',
'DifferentialDependenciesField' => 'applications/differential/customfield/DifferentialDependenciesField.php',
'DifferentialDependenciesFieldSpecification' => 'applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php',
'DifferentialDependsOnField' => 'applications/differential/customfield/DifferentialDependsOnField.php',
@ -397,7 +396,6 @@ phutil_register_library_map(array(
'DifferentialExportPatchFieldSpecification' => 'applications/differential/field/specification/DifferentialExportPatchFieldSpecification.php',
'DifferentialFieldDataNotAvailableException' => 'applications/differential/field/exception/DifferentialFieldDataNotAvailableException.php',
'DifferentialFieldParseException' => 'applications/differential/field/exception/DifferentialFieldParseException.php',
'DifferentialFieldSelector' => 'applications/differential/field/selector/DifferentialFieldSelector.php',
'DifferentialFieldSpecification' => 'applications/differential/field/specification/DifferentialFieldSpecification.php',
'DifferentialFieldSpecificationIncompleteException' => 'applications/differential/field/exception/DifferentialFieldSpecificationIncompleteException.php',
'DifferentialFieldValidationException' => 'applications/differential/field/exception/DifferentialFieldValidationException.php',
@ -2941,7 +2939,6 @@ phutil_register_library_map(array(
'DifferentialDAO' => 'PhabricatorLiskDAO',
'DifferentialDateCreatedFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialDateModifiedFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialDefaultFieldSelector' => 'DifferentialFieldSelector',
'DifferentialDependenciesField' => 'DifferentialCustomField',
'DifferentialDependenciesFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialDependsOnField' => 'DifferentialCustomField',

View file

@ -189,6 +189,7 @@ final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck {
'Obsolete; use standard rendering events instead.'),
'differential.show-host-field' => $differential_field_reason,
'differential.show-test-plan-field' => $differential_field_reason,
'differential.field-selector' => $differential_field_reason,
);
return $ancient_config;

View file

@ -77,12 +77,6 @@ final class PhabricatorDifferentialConfigOptions
pht(
"List of file regexps where whitespace is meaningful and should ".
"not use 'ignore-all' by default")),
$this->newOption(
'differential.field-selector',
'class',
'DifferentialDefaultFieldSelector')
->setBaseClass('DifferentialFieldSelector')
->setDescription(pht('Field selector class')),
$this->newOption('differential.require-test-plan-field', 'bool', true)
->setBoolOptions(
array(

View file

@ -1,95 +0,0 @@
<?php
final class DifferentialDefaultFieldSelector
extends DifferentialFieldSelector {
public function getFieldSpecifications() {
$fields = array(
new DifferentialTitleFieldSpecification(),
new DifferentialSummaryFieldSpecification(),
new DifferentialTestPlanFieldSpecification(),
new DifferentialRevisionStatusFieldSpecification(),
new DifferentialAuthorFieldSpecification(),
new DifferentialReviewersFieldSpecification(),
new DifferentialProjectReviewersFieldSpecification(),
new DifferentialReviewedByFieldSpecification(),
new DifferentialCCsFieldSpecification(),
new DifferentialRepositoryFieldSpecification(),
new DifferentialViewPolicyFieldSpecification(),
new DifferentialEditPolicyFieldSpecification(),
new DifferentialLintFieldSpecification(),
new DifferentialUnitFieldSpecification(),
new DifferentialCommitsFieldSpecification(),
new DifferentialDependsOnFieldSpecification(),
new DifferentialDependenciesFieldSpecification(),
new DifferentialManiphestTasksFieldSpecification(),
new DifferentialHostFieldSpecification(),
new DifferentialPathFieldSpecification(),
new DifferentialBranchFieldSpecification(),
new DifferentialArcanistProjectFieldSpecification(),
new DifferentialApplyPatchFieldSpecification(),
new DifferentialRevisionIDFieldSpecification(),
new DifferentialGitSVNIDFieldSpecification(),
new DifferentialConflictsFieldSpecification(),
new DifferentialDateModifiedFieldSpecification(),
new DifferentialDateCreatedFieldSpecification(),
new DifferentialAuditorsFieldSpecification(),
new DifferentialDiffViewPolicyFieldSpecification(),
new DifferentialAsanaRepresentationFieldSpecification(),
);
if (PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider()) {
$fields[] = new DifferentialJIRAIssuesFieldSpecification();
}
return $fields;
}
public function sortFieldsForRevisionList(array $fields) {
assert_instances_of($fields, 'DifferentialFieldSpecification');
$map = array();
foreach ($fields as $field) {
$map[get_class($field)] = $field;
}
$map = array_select_keys(
$map,
array(
'DifferentialRevisionIDFieldSpecification',
'DifferentialTitleFieldSpecification',
'DifferentialRevisionStatusFieldSpecification',
'DifferentialAuthorFieldSpecification',
'DifferentialReviewersFieldSpecification',
'DifferentialDateModifiedFieldSpecification',
'DifferentialDateCreatedFieldSpecification',
)) + $map;
return array_values($map);
}
public function sortFieldsForMail(array $fields) {
assert_instances_of($fields, 'DifferentialFieldSpecification');
$map = array();
foreach ($fields as $field) {
$map[get_class($field)] = $field;
}
$map = array_select_keys(
$map,
array(
'DifferentialReviewersFieldSpecification',
'DifferentialSummaryFieldSpecification',
'DifferentialTestPlanFieldSpecification',
'DifferentialRevisionIDFieldSpecification',
'DifferentialManiphestTasksFieldSpecification',
'DifferentialBranchFieldSpecification',
'DifferentialArcanistProjectFieldSpecification',
'DifferentialCommitsFieldSpecification',
)) + $map;
return array_values($map);
}
}

View file

@ -1,25 +0,0 @@
<?php
abstract class DifferentialFieldSelector {
final public function __construct() {
// <empty>
}
final public static function newSelector() {
return PhabricatorEnv::newObjectFromConfig('differential.field-selector');
}
abstract public function getFieldSpecifications();
public function sortFieldsForRevisionList(array $fields) {
assert_instances_of($fields, 'DifferentialFieldSpecification');
return $fields;
}
public function sortFieldsForMail(array $fields) {
assert_instances_of($fields, 'DifferentialFieldSpecification');
return $fields;
}
}