diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index 4bfd373c2b..dd909da1d6 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -94,35 +94,10 @@ final class DifferentialDiffViewController extends DifferentialController { $diff->getID()); $props = mpull($props, 'getData', 'getName'); - $aux_fields = DifferentialFieldSelector::newSelector() - ->getFieldSpecifications(); - foreach ($aux_fields as $key => $aux_field) { - if (!$aux_field->shouldAppearOnDiffView()) { - unset($aux_fields[$key]); - } else { - $aux_field->setUser($this->getRequest()->getUser()); - } - } - - $dict = array(); - foreach ($aux_fields as $key => $aux_field) { - $aux_field->setDiff($diff); - $aux_field->setManualDiff($diff); - $aux_field->setDiffProperties($props); - $value = $aux_field->renderValueForDiffView(); - if (strlen($value)) { - $label = rtrim($aux_field->renderLabelForDiffView(), ':'); - $dict[$label] = $value; - } - } - $property_head = id(new PHUIHeaderView()) ->setHeader(pht('Properties')); $property_view = new PHUIPropertyListView(); - foreach ($dict as $key => $value) { - $property_view->addProperty($key, $value); - } $changesets = $diff->loadChangesets(); $changesets = msort($changesets, 'getSortKey'); diff --git a/src/applications/differential/controller/DifferentialRevisionListController.php b/src/applications/differential/controller/DifferentialRevisionListController.php index 331d353a1b..d3048325ab 100644 --- a/src/applications/differential/controller/DifferentialRevisionListController.php +++ b/src/applications/differential/controller/DifferentialRevisionListController.php @@ -30,8 +30,7 @@ final class DifferentialRevisionListController extends DifferentialController $user = $this->getRequest()->getUser(); $template = id(new DifferentialRevisionListView()) - ->setUser($user) - ->setFields(DifferentialRevisionListView::getDefaultFields($user)); + ->setUser($user); $views = array(); if ($query->getQueryKey() == 'active') { diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 9b919d1244..026f664dad 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -766,7 +766,6 @@ final class DifferentialRevisionViewController extends DifferentialController { $view = id(new DifferentialRevisionListView()) ->setRevisions($revisions) - ->setFields(DifferentialRevisionListView::getDefaultFields($user)) ->setUser($user); $phids = $view->getRequiredHandlePHIDs(); diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index ad7f32f303..636390feaa 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -7,7 +7,6 @@ final class DifferentialRevisionListView extends AphrontView { private $revisions; private $handles; - private $fields; private $highlightAge; private $header; private $noDataString; @@ -22,12 +21,6 @@ final class DifferentialRevisionListView extends AphrontView { return $this; } - public function setFields(array $fields) { - assert_instances_of($fields, 'DifferentialFieldSpecification'); - $this->fields = $fields; - return $this; - } - public function setRevisions(array $revisions) { assert_instances_of($revisions, 'DifferentialRevision'); $this->revisions = $revisions; @@ -41,10 +34,12 @@ final class DifferentialRevisionListView extends AphrontView { public function getRequiredHandlePHIDs() { $phids = array(); - foreach ($this->fields as $field) { - foreach ($this->revisions as $revision) { - $phids[] = $field->getRequiredHandlePHIDsForRevisionList($revision); - } + foreach ($this->revisions as $revision) { + $phids[] = array($revision->getAuthorPHID()); + + // TODO: Switch to getReviewerStatus(), but not all callers pass us + // revisions with this data loaded. + $phids[] = $revision->getReviewers(); } return array_mergev($phids); } @@ -79,10 +74,6 @@ final class DifferentialRevisionListView extends AphrontView { $this->initBehavior('phabricator-tooltips', array()); $this->requireResource('aphront-tooltip-css'); - foreach ($this->fields as $field) { - $field->setHandles($this->handles); - } - $list = new PHUIObjectItemListView(); $list->setCards(true); @@ -90,7 +81,6 @@ final class DifferentialRevisionListView extends AphrontView { $item = id(new PHUIObjectItemView()) ->setUser($user); - $rev_fields = array(); $icons = array(); $phid = $revision->getPHID(); @@ -116,21 +106,12 @@ final class DifferentialRevisionListView extends AphrontView { $this->highlightAge && !$revision->isClosed(); - $object_age = PHUIObjectItemView::AGE_FRESH; - foreach ($this->fields as $field) { - if ($show_age) { - if ($field instanceof DifferentialDateModifiedFieldSpecification) { - if ($stale && $modified < $stale) { - $object_age = PHUIObjectItemView::AGE_OLD; - } else if ($fresh && $modified < $fresh) { - $object_age = PHUIObjectItemView::AGE_STALE; - } - } - } - - $rev_header = $field->renderHeaderForRevisionList(); - $rev_fields[$rev_header] = $field - ->renderValueForRevisionList($revision); + if ($stale && $modified < $stale) { + $object_age = PHUIObjectItemView::AGE_OLD; + } else if ($fresh && $modified < $fresh) { + $object_age = PHUIObjectItemView::AGE_STALE; + } else { + $object_age = PHUIObjectItemView::AGE_FRESH; } $status_name = @@ -163,20 +144,19 @@ final class DifferentialRevisionListView extends AphrontView { $author_handle = $this->handles[$revision->getAuthorPHID()]; $item->addByline(pht('Author: %s', $author_handle->renderLink())); - // Reviewers - $item->addAttribute(pht('Reviewers: %s', $rev_fields['Reviewers'])); - - $item->setEpoch($revision->getDateModified(), $object_age); - - // First remove the fields we already have - $count = 7; - $rev_fields = array_slice($rev_fields, $count); - - // Then add each one of them - // TODO: Add render-to-foot-icon support - foreach ($rev_fields as $header => $field) { - $item->addAttribute(pht('%s: %s', $header, $field)); + $reviewers = array(); + // TODO: As above, this should be based on `getReviewerStatus()`. + foreach ($revision->getReviewers() as $reviewer) { + $reviewers[] = $this->handles[$reviewer]->renderLink(); } + if (!$reviewers) { + $reviewers = phutil_tag('em', array(), pht('None')); + } else { + $reviewers = phutil_implode_html(', ', $reviewers); + } + + $item->addAttribute(pht('Reviewers: %s', $reviewers)); + $item->setEpoch($revision->getDateModified(), $object_age); switch ($status) { case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW: @@ -205,23 +185,4 @@ final class DifferentialRevisionListView extends AphrontView { return $list; } - public static function getDefaultFields(PhabricatorUser $user) { - $selector = DifferentialFieldSelector::newSelector(); - $fields = $selector->getFieldSpecifications(); - foreach ($fields as $key => $field) { - $field->setUser($user); - if (!$field->shouldAppearOnRevisionList()) { - unset($fields[$key]); - } - } - - if (!$fields) { - throw new Exception( - "Phabricator configuration has no fields that appear on the list ". - "interface!"); - } - - return $selector->sortFieldsForRevisionList($fields); - } - } diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index 0c1a7325e2..ce1f14cab3 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -211,7 +211,6 @@ abstract class DiffusionBrowseController extends DiffusionController { $view = id(new DifferentialRevisionListView()) ->setRevisions($revisions) - ->setFields(DifferentialRevisionListView::getDefaultFields($user)) ->setUser($user); $phids = $view->getRequiredHandlePHIDs(); diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php index 86c7396f43..488d73da66 100644 --- a/src/applications/home/controller/PhabricatorHomeMainController.php +++ b/src/applications/home/controller/PhabricatorHomeMainController.php @@ -219,7 +219,6 @@ final class PhabricatorHomeMainController $revision_view = id(new DifferentialRevisionListView()) ->setHighlightAge(true) ->setRevisions(array_merge($blocking, $active)) - ->setFields(DifferentialRevisionListView::getDefaultFields($user)) ->setUser($user); $phids = array_merge( array($user_phid),