mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-26 15:30:58 +01:00
Remove the "authored" subheader from commits
Summary: Ref T13552. I'm trying to reduce the number of direct callers to commit authorship metadata. This header seems low-value enough to simply remove; this information is shown more clearly and prominently in the "Provenance" UI. In particular, commits have multiple dates (authored, committed, pushed) but this header shows only one. It currently shows the author identity and the commit date, which isn't entirely correct. And it potentially uses an "Identity" as a timeline actor, which is conceptually fine but not entirely firm ground. Test Plan: Viewed a commit, saw no more subheader. Maniphest Tasks: T13552 Differential Revision: https://secure.phabricator.com/D21406
This commit is contained in:
parent
7fd6bf26a9
commit
60e9f64190
1 changed files with 0 additions and 48 deletions
|
@ -183,7 +183,6 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
}
|
||||
|
||||
$curtain = $this->buildCurtain($commit, $repository);
|
||||
$subheader = $this->buildSubheaderView($commit, $commit_data);
|
||||
$details = $this->buildPropertyListView(
|
||||
$commit,
|
||||
$commit_data,
|
||||
|
@ -483,7 +482,6 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn(
|
||||
array(
|
||||
|
@ -760,52 +758,6 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
return $view;
|
||||
}
|
||||
|
||||
private function buildSubheaderView(
|
||||
PhabricatorRepositoryCommit $commit,
|
||||
PhabricatorRepositoryCommitData $data) {
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
if ($repository->isSVN()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$author_phid = $commit->getAuthorDisplayPHID();
|
||||
$author_name = $data->getAuthorName();
|
||||
$author_epoch = $data->getCommitDetail('authorEpoch');
|
||||
$date = null;
|
||||
if ($author_epoch !== null) {
|
||||
$date = phabricator_datetime($author_epoch, $viewer);
|
||||
}
|
||||
|
||||
if ($author_phid) {
|
||||
$handles = $viewer->loadHandles(array($author_phid));
|
||||
$image_uri = $handles[$author_phid]->getImageURI();
|
||||
$image_href = $handles[$author_phid]->getURI();
|
||||
$author = $handles[$author_phid]->renderLink();
|
||||
} else if (strlen($author_name)) {
|
||||
$author = $author_name;
|
||||
$image_uri = null;
|
||||
$image_href = null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
$author = phutil_tag('strong', array(), $author);
|
||||
if ($date) {
|
||||
$content = pht('Authored by %s on %s.', $author, $date);
|
||||
} else {
|
||||
$content = pht('Authored by %s.', $author);
|
||||
}
|
||||
|
||||
return id(new PHUIHeadThingView())
|
||||
->setImage($image_uri)
|
||||
->setImageHref($image_href)
|
||||
->setContent($content);
|
||||
}
|
||||
|
||||
private function buildComments(PhabricatorRepositoryCommit $commit) {
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
$commit,
|
||||
|
|
Loading…
Reference in a new issue