From 8065433ee8dcfd31ca544c52b3bcc620db9df13f Mon Sep 17 00:00:00 2001 From: Austin McKinley Date: Fri, 17 Aug 2018 12:24:53 -0700 Subject: [PATCH] Migrate DiffusionBlameController to use repo identities Summary: Now on the blame page, identities get `avatar.png` and there are little tooltips that show a few characters of the committer identity string. Also add a default icon for repo identities. Test Plan: Loaded some blame pages for files touched by users with and without repo identities attached. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D19587 --- .../diffusion/controller/DiffusionBlameController.php | 5 +---- .../phid/PhabricatorRepositoryIdentityPHIDType.php | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionBlameController.php b/src/applications/diffusion/controller/DiffusionBlameController.php index 42cabbc0d9..95cc039217 100644 --- a/src/applications/diffusion/controller/DiffusionBlameController.php +++ b/src/applications/diffusion/controller/DiffusionBlameController.php @@ -118,10 +118,6 @@ final class DiffusionBlameController extends DiffusionController { $author_phid = $commit->getAuthorDisplayPHID(); } - if (!$author_phid && $revision) { - $author_phid = $revision->getAuthorPHID(); - } - if (!$author_phid) { // This means we couldn't identify an author for the commit or the // revision. We just render a blank for alignment. @@ -137,6 +133,7 @@ final class DiffusionBlameController extends DiffusionController { $author_meta = array( 'tip' => $handles[$author_phid]->getName(), 'align' => 'E', + 'size' => 'auto', ); } diff --git a/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php b/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php index 5d9b06e0a3..873cfbbae6 100644 --- a/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php +++ b/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php @@ -30,6 +30,7 @@ final class PhabricatorRepositoryIdentityPHIDType array $handles, array $objects) { + $avatar_uri = celerity_get_resource_uri('/rsrc/image/avatar.png'); foreach ($handles as $phid => $handle) { $identity = $objects[$phid]; @@ -40,6 +41,7 @@ final class PhabricatorRepositoryIdentityPHIDType $handle->setName($name); $handle->setURI($identity->getURI()); $handle->setIcon('fa-user'); + $handle->setImageURI($avatar_uri); } } -- 2.51.2