Simplify Differential field selector
Summary: If I use my own selector then it doesn't respect Phabricator config. Also I hated this method. Test Plan: Used default selector, displayed revision. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3307
This commit is contained in:
@@ -23,15 +23,7 @@ final class DifferentialDefaultFieldSelector
|
|||||||
$fields = array(
|
$fields = array(
|
||||||
new DifferentialTitleFieldSpecification(),
|
new DifferentialTitleFieldSpecification(),
|
||||||
new DifferentialSummaryFieldSpecification(),
|
new DifferentialSummaryFieldSpecification(),
|
||||||
);
|
new DifferentialTestPlanFieldSpecification(),
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('differential.show-test-plan-field')) {
|
|
||||||
$fields[] = new DifferentialTestPlanFieldSpecification();
|
|
||||||
}
|
|
||||||
|
|
||||||
$fields = array_merge(
|
|
||||||
$fields,
|
|
||||||
array(
|
|
||||||
new DifferentialRevisionStatusFieldSpecification(),
|
new DifferentialRevisionStatusFieldSpecification(),
|
||||||
new DifferentialAuthorFieldSpecification(),
|
new DifferentialAuthorFieldSpecification(),
|
||||||
new DifferentialReviewersFieldSpecification(),
|
new DifferentialReviewersFieldSpecification(),
|
||||||
@@ -42,16 +34,8 @@ final class DifferentialDefaultFieldSelector
|
|||||||
new DifferentialCommitsFieldSpecification(),
|
new DifferentialCommitsFieldSpecification(),
|
||||||
new DifferentialDependenciesFieldSpecification(),
|
new DifferentialDependenciesFieldSpecification(),
|
||||||
new DifferentialManiphestTasksFieldSpecification(),
|
new DifferentialManiphestTasksFieldSpecification(),
|
||||||
));
|
new DifferentialHostFieldSpecification(),
|
||||||
|
new DifferentialPathFieldSpecification(),
|
||||||
if (PhabricatorEnv::getEnvConfig('differential.show-host-field')) {
|
|
||||||
$fields[] = new DifferentialHostFieldSpecification();
|
|
||||||
$fields[] = new DifferentialPathFieldSpecification();
|
|
||||||
}
|
|
||||||
|
|
||||||
$fields = array_merge(
|
|
||||||
$fields,
|
|
||||||
array(
|
|
||||||
new DifferentialBranchFieldSpecification(),
|
new DifferentialBranchFieldSpecification(),
|
||||||
new DifferentialArcanistProjectFieldSpecification(),
|
new DifferentialArcanistProjectFieldSpecification(),
|
||||||
new DifferentialApplyPatchFieldSpecification(),
|
new DifferentialApplyPatchFieldSpecification(),
|
||||||
@@ -60,7 +44,7 @@ final class DifferentialDefaultFieldSelector
|
|||||||
new DifferentialDateModifiedFieldSpecification(),
|
new DifferentialDateModifiedFieldSpecification(),
|
||||||
new DifferentialDateCreatedFieldSpecification(),
|
new DifferentialDateCreatedFieldSpecification(),
|
||||||
new DifferentialAuditorsFieldSpecification(),
|
new DifferentialAuditorsFieldSpecification(),
|
||||||
));
|
);
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -20,7 +20,7 @@ final class DifferentialHostFieldSpecification
|
|||||||
extends DifferentialFieldSpecification {
|
extends DifferentialFieldSpecification {
|
||||||
|
|
||||||
public function shouldAppearOnRevisionView() {
|
public function shouldAppearOnRevisionView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.show-host-field');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForRevisionView() {
|
public function renderLabelForRevisionView() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ final class DifferentialPathFieldSpecification
|
|||||||
extends DifferentialFieldSpecification {
|
extends DifferentialFieldSpecification {
|
||||||
|
|
||||||
public function shouldAppearOnRevisionView() {
|
public function shouldAppearOnRevisionView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.show-host-field');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForRevisionView() {
|
public function renderLabelForRevisionView() {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ final class DifferentialTestPlanFieldSpecification
|
|||||||
private $error = false;
|
private $error = false;
|
||||||
|
|
||||||
public function shouldAppearOnEdit() {
|
public function shouldAppearOnEdit() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.show-test-plan-field');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function didSetRevision() {
|
protected function didSetRevision() {
|
||||||
@@ -69,7 +69,7 @@ final class DifferentialTestPlanFieldSpecification
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearOnCommitMessage() {
|
public function shouldAppearOnCommitMessage() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.show-test-plan-field');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCommitMessageKey() {
|
public function getCommitMessageKey() {
|
||||||
|
|||||||
Reference in New Issue
Block a user