1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Diffusion History List cleanup

Summary: Removes the odd circle buttons, adds copy-pasta button.

Test Plan: Review new layout locally.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18057
This commit is contained in:
Chad Little 2017-06-01 06:47:23 -07:00
parent c001781264
commit fbb7673439

View file

@ -10,19 +10,8 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-history-css');
Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('phabricator-tooltips');
$buildables = $this->loadBuildables(
mpull($this->getHistory(), 'getCommit'));
$show_revisions = PhabricatorApplication::isClassInstalledForViewer(
'PhabricatorDifferentialApplication',
$viewer);
$handles = $viewer->loadHandles($this->getRequiredHandlePHIDs()); $handles = $viewer->loadHandles($this->getRequiredHandlePHIDs());
$show_builds = PhabricatorApplication::isClassInstalledForViewer(
'PhabricatorHarbormasterApplication',
$this->getUser());
$rows = array(); $rows = array();
$ii = 0; $ii = 0;
$cur_date = 0; $cur_date = 0;
@ -97,14 +86,6 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
$commit_desc = phutil_tag('em', array(), pht("Importing\xE2\x80\xA6")); $commit_desc = phutil_tag('em', array(), pht("Importing\xE2\x80\xA6"));
} }
$build_view = null;
if ($show_builds) {
$buildable = idx($buildables, $commit->getPHID());
if ($buildable !== null) {
$build_view = $this->renderBuildable($buildable);
}
}
$browse_button = $this->linkBrowse( $browse_button = $this->linkBrowse(
$history->getPath(), $history->getPath(),
array( array(
@ -114,63 +95,6 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
), ),
true); true);
$differential_view = null;
if ($show_revisions && $commit) {
$d_id = idx($this->getRevisions(), $commit->getPHID());
if ($d_id) {
$differential_view = id(new PHUIIconCircleView())
->setIcon('fa-gear')
->setColor('green')
->setState(PHUIIconCircleView::STATE_SUCCESS)
->addSigil('has-tooltip')
->setSize(PHUIIconCircleView::SMALL)
->setHref('/D'.$d_id)
->addClass('mmr')
->setMetadata(
array(
'tip' => 'Revision D'.$d_id,
));
}
}
$status = $commit->getAuditStatus();
$icon = PhabricatorAuditCommitStatusConstants::getStatusIcon($status);
$color = PhabricatorAuditCommitStatusConstants::getStatusColor($status);
$name = PhabricatorAuditCommitStatusConstants::getStatusName($status);
$audit_view = id(new PHUIIconCircleView())
->setIcon('fa-code')
->setColor($color)
->setState($icon)
->addSigil('has-tooltip')
->setSize(PHUIIconCircleView::SMALL)
->addClass('mmr')
->setMetadata(
array(
'tip' => $name,
));
if ($show_builds) {
$buildable = idx($buildables, $commit->getPHID());
if ($buildable !== null) {
$status = $buildable->getBuildableStatus();
$icon = HarbormasterBuildable::getBuildableStatusIcon($status);
$color = HarbormasterBuildable::getBuildableStatusColor($status);
$name = HarbormasterBuildable::getBuildableStatusName($status);
$build_view = id(new PHUIIconCircleView())
->setIcon('fa-recycle')
->setColor($color)
->setState($icon)
->addSigil('has-tooltip')
->setSize(PHUIIconCircleView::SMALL)
->setHref('/'.$buildable->getMonogram())
->addClass('mmr')
->setMetadata(
array(
'tip' => $name,
));
}
}
$message = null; $message = null;
$commit_link = $repository->getCommitURI( $commit_link = $repository->getCommitURI(
$history->getCommitIdentifier()); $history->getCommitIdentifier());
@ -193,6 +117,27 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
->setColor(PHUITagView::COLOR_INDIGO) ->setColor(PHUITagView::COLOR_INDIGO)
->setSlimShady(true); ->setSlimShady(true);
$clippy = null;
if ($commit) {
Javelin::initBehavior('phabricator-clipboard-copy');
$clippy = id(new PHUIButtonView())
->setIcon('fa-clipboard')
->setHref('#')
->setTag('a')
->addSigil('has-tooltip')
->addSigil('clipboard-copy')
->addClass('clipboard-copy')
->addClass('mmr')
->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE)
->setMetadata(
array(
'text' => $history->getCommitIdentifier(),
'tip' => pht('Copy'),
'align' => 'N',
'size' => 'auto',
));
}
$item = id(new PHUIObjectItemView()) $item = id(new PHUIObjectItemView())
->setHeader($commit_desc) ->setHeader($commit_desc)
->setHref($commit_link) ->setHref($commit_link)
@ -202,9 +147,7 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
->addAttribute($commit_tag) ->addAttribute($commit_tag)
->addAttribute($authored) ->addAttribute($authored)
->setSideColumn(array( ->setSideColumn(array(
$differential_view, $clippy,
$audit_view,
$build_view,
$browse_button, $browse_button,
)); ));