diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 40c5e00249..0a5debf55c 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2501,7 +2501,6 @@ phutil_register_library_map(array( 'ReleephController' => 'applications/releeph/controller/ReleephController.php', 'ReleephDAO' => 'applications/releeph/storage/ReleephDAO.php', 'ReleephDefaultFieldSelector' => 'applications/releeph/field/selector/ReleephDefaultFieldSelector.php', - 'ReleephDefaultUserView' => 'applications/releeph/view/user/ReleephDefaultUserView.php', 'ReleephDependsOnFieldSpecification' => 'applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php', 'ReleephDiffChurnFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php', 'ReleephDiffMessageFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php', @@ -2554,7 +2553,6 @@ phutil_register_library_map(array( 'ReleephSeverityFieldSpecification' => 'applications/releeph/field/specification/ReleephSeverityFieldSpecification.php', 'ReleephStatusFieldSpecification' => 'applications/releeph/field/specification/ReleephStatusFieldSpecification.php', 'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php', - 'ReleephUserView' => 'applications/releeph/view/user/ReleephUserView.php', 'ShellLogView' => 'applications/harbormaster/view/ShellLogView.php', 'SlowvoteEmbedView' => 'applications/slowvote/view/SlowvoteEmbedView.php', 'SlowvoteRemarkupRule' => 'applications/slowvote/remarkup/SlowvoteRemarkupRule.php', @@ -5473,7 +5471,6 @@ phutil_register_library_map(array( 'ReleephController' => 'PhabricatorController', 'ReleephDAO' => 'PhabricatorLiskDAO', 'ReleephDefaultFieldSelector' => 'ReleephFieldSelector', - 'ReleephDefaultUserView' => 'ReleephUserView', 'ReleephDependsOnFieldSpecification' => 'ReleephFieldSpecification', 'ReleephDiffChurnFieldSpecification' => 'ReleephFieldSpecification', 'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification', @@ -5545,7 +5542,6 @@ phutil_register_library_map(array( 'ReleephSeverityFieldSpecification' => 'ReleephLevelFieldSpecification', 'ReleephStatusFieldSpecification' => 'ReleephFieldSpecification', 'ReleephSummaryFieldSpecification' => 'ReleephFieldSpecification', - 'ReleephUserView' => 'AphrontView', 'ShellLogView' => 'AphrontView', 'SlowvoteEmbedView' => 'AphrontView', 'SlowvoteRemarkupRule' => 'PhabricatorRemarkupRuleObject', diff --git a/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php b/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php index 224711e6f3..d16416b935 100644 --- a/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php +++ b/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php @@ -59,18 +59,6 @@ final class PhabricatorApplicationReleephConfigOptions "stable.")), $this->newOption('releeph.fields', $custom_field_type, $default) ->setCustomData('ReleephFieldSpecification'), - $this->newOption( - 'releeph.user-view', - 'class', - 'ReleephDefaultUserView') - ->setBaseClass('ReleephUserView') - ->setSummary(pht('Extra markup when rendering usernames')) - ->setDescription( - pht( - "A wrapper to render Phabricator users in Releeph, with custom ". - "markup. For example, Facebook extends this to render additional ". - "information about requestors, to each Releeph project's ". - "pushers.")), $this->newOption( 'releeph.default-branch-template', 'string', diff --git a/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php b/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php index f2092263ac..1963fe0f8e 100644 --- a/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php @@ -17,11 +17,6 @@ final class ReleephAuthorFieldSpecification self::$authorMap[$releeph_request->getPHID()] = $author_phid; } } - - ReleephUserView::getNewInstance() - ->setUser($this->getUser()) - ->setReleephProject($this->getReleephProject()) - ->load(self::$authorMap); } public function getName() { @@ -32,9 +27,11 @@ final class ReleephAuthorFieldSpecification $rr = $this->getReleephRequest(); $author_phid = idx(self::$authorMap, $rr->getPHID()); if ($author_phid) { - return ReleephUserView::getNewInstance() - ->setRenderUserPHID($author_phid) - ->render(); + $handle = id(new PhabricatorHandleQuery()) + ->setViewer($this->getUser()) + ->withPHIDs(array($author_phid)) + ->executeOne(); + return $handle->renderLink(); } else { return 'Unknown Author'; } diff --git a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php index a6dd00b5d5..9bb4261470 100644 --- a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php @@ -7,23 +7,17 @@ final class ReleephRequestorFieldSpecification return 'requestor'; } - public function bulkLoad(array $releeph_requests) { - $phids = mpull($releeph_requests, 'getRequestUserPHID'); - ReleephUserView::getNewInstance() - ->setUser($this->getUser()) - ->setReleephProject($this->getReleephProject()) - ->load($phids); - } - public function getName() { return 'Requestor'; } public function renderValueForHeaderView() { $phid = $this->getReleephRequest()->getRequestUserPHID(); - return ReleephUserView::getNewInstance() - ->setRenderUserPHID($phid) - ->render(); + $handle = id(new PhabricatorHandleQuery()) + ->setViewer($this->getUser()) + ->withPHIDs(array($phid)) + ->executeOne(); + return $handle->renderLink(); } public function shouldAppearOnCommitMessage() { diff --git a/src/applications/releeph/view/user/ReleephDefaultUserView.php b/src/applications/releeph/view/user/ReleephDefaultUserView.php deleted file mode 100644 index 93819cdad3..0000000000 --- a/src/applications/releeph/view/user/ReleephDefaultUserView.php +++ /dev/null @@ -1,9 +0,0 @@ -getHandle()->renderLink(); - } - -} diff --git a/src/applications/releeph/view/user/ReleephUserView.php b/src/applications/releeph/view/user/ReleephUserView.php deleted file mode 100644 index e09dc6d1da..0000000000 --- a/src/applications/releeph/view/user/ReleephUserView.php +++ /dev/null @@ -1,75 +0,0 @@ - $phid) { - if (!idx(self::$seen, $phid)) { - $todo[$key] = $phid; - self::$seen[$phid] = true; - } - } - - if ($todo) { - self::$handles = array_merge( - self::$handles, - id(new PhabricatorHandleQuery()) - ->setViewer($this->getUser()) - ->withPHIDs($todo) - ->execute()); - $this->loadInner($todo); - } - } - - private $phid; - private $releephProject; - - final public function setRenderUserPHID($phid) { - $this->phid = $phid; - return $this; - } - - final public function setReleephProject(ReleephProject $project) { - $this->releephProject = $project; - return $this; - } - - final protected function getRenderUserPHID() { - return $this->phid; - } - - final protected function getReleephProject() { - return $this->releephProject; - } - - final protected function getHandle() { - return self::$handles[$this->phid]; - } - -}