1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Revert some changes to Diffusion History List

Summary: Ref rPf2fcafb40dde94ddf4ee22716fea74fca0334a64#38208, I think this is a more usable layout. Gets rid of clippy, audit. Adds back Differential link as tag, Build Status as button.

Test Plan: Faked data on this for Differential, Builds, should all work though. Test on real and fake repositories.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18061
This commit is contained in:
Chad Little 2017-06-01 12:36:20 -07:00
parent b69174a4c8
commit 0d8aba8550
4 changed files with 86 additions and 35 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => 'ff161f2d', 'conpherence.pkg.css' => 'ff161f2d',
'conpherence.pkg.js' => 'b5b51108', 'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => 'eb39b754', 'core.pkg.css' => '38689e09',
'core.pkg.js' => '1475bd91', 'core.pkg.js' => '1475bd91',
'darkconsole.pkg.js' => '1f9a31bc', 'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => 'a2755617', 'differential.pkg.css' => 'a2755617',
@ -71,7 +71,7 @@ return array(
'rsrc/css/application/differential/revision-history.css' => '0e8eb855', 'rsrc/css/application/differential/revision-history.css' => '0e8eb855',
'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33',
'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55', 'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55',
'rsrc/css/application/diffusion/diffusion-history.css' => '4faf40cd', 'rsrc/css/application/diffusion/diffusion-history.css' => 'de70e348',
'rsrc/css/application/diffusion/diffusion-icons.css' => 'a6a1e2ba', 'rsrc/css/application/diffusion/diffusion-icons.css' => 'a6a1e2ba',
'rsrc/css/application/diffusion/diffusion-readme.css' => '18bd3910', 'rsrc/css/application/diffusion/diffusion-readme.css' => '18bd3910',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
@ -140,7 +140,7 @@ return array(
'rsrc/css/phui/phui-basic-nav-view.css' => 'a0705f53', 'rsrc/css/phui/phui-basic-nav-view.css' => 'a0705f53',
'rsrc/css/phui/phui-big-info-view.css' => 'bd903741', 'rsrc/css/phui/phui-big-info-view.css' => 'bd903741',
'rsrc/css/phui/phui-box.css' => '269cbc99', 'rsrc/css/phui/phui-box.css' => '269cbc99',
'rsrc/css/phui/phui-button.css' => '7ffbeee7', 'rsrc/css/phui/phui-button.css' => '836844c9',
'rsrc/css/phui/phui-chart.css' => '6bf6f78e', 'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
'rsrc/css/phui/phui-cms.css' => '504b4b23', 'rsrc/css/phui/phui-cms.css' => '504b4b23',
'rsrc/css/phui/phui-comment-form.css' => '57af2e14', 'rsrc/css/phui/phui-comment-form.css' => '57af2e14',
@ -565,7 +565,7 @@ return array(
'differential-revision-history-css' => '0e8eb855', 'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33', 'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55', 'differential-table-of-contents-css' => 'ae4b7a55',
'diffusion-history-css' => '4faf40cd', 'diffusion-history-css' => 'de70e348',
'diffusion-icons-css' => 'a6a1e2ba', 'diffusion-icons-css' => 'a6a1e2ba',
'diffusion-readme-css' => '18bd3910', 'diffusion-readme-css' => '18bd3910',
'diffusion-source-css' => '750add59', 'diffusion-source-css' => '750add59',
@ -817,7 +817,7 @@ return array(
'phui-basic-nav-view-css' => 'a0705f53', 'phui-basic-nav-view-css' => 'a0705f53',
'phui-big-info-view-css' => 'bd903741', 'phui-big-info-view-css' => 'bd903741',
'phui-box-css' => '269cbc99', 'phui-box-css' => '269cbc99',
'phui-button-css' => '7ffbeee7', 'phui-button-css' => '836844c9',
'phui-calendar-css' => '477acfaa', 'phui-calendar-css' => '477acfaa',
'phui-calendar-day-css' => '572b1893', 'phui-calendar-day-css' => '572b1893',
'phui-calendar-list-css' => '576be600', 'phui-calendar-list-css' => '576be600',

View file

@ -10,8 +10,19 @@ 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;
@ -95,6 +106,40 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
), ),
true); true);
$diff_tag = null;
if ($show_revisions && $commit) {
$d_id = idx($this->getRevisions(), $commit->getPHID());
if ($d_id) {
$diff_tag = id(new PHUITagView())
->setName('D'.$d_id)
->setType(PHUITagView::TYPE_SHADE)
->setColor(PHUITagView::COLOR_BLUE)
->setHref('/D'.$d_id)
->addClass('diffusion-differential-tag')
->setSlimShady(true);
}
}
$build_view = null;
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 PHUIButtonView())
->setTag('a')
->setText($name)
->setIcon($icon)
->setColor($color)
->setHref('/'.$buildable->getMonogram())
->addClass('mmr')
->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE)
->addClass('diffusion-list-build-status');
}
}
$message = null; $message = null;
$commit_link = $repository->getCommitURI( $commit_link = $repository->getCommitURI(
$history->getCommitIdentifier()); $history->getCommitIdentifier());
@ -117,37 +162,16 @@ 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)
->setDisabled($commit->isUnreachable()) ->setDisabled($commit->isUnreachable())
->setDescription($message) ->setDescription($message)
->setImageURI($author_image) ->setImageURI($author_image)
->addAttribute($commit_tag) ->addAttribute(array($commit_tag, ' ', $diff_tag)) // For Copy Pasta
->addAttribute($authored) ->addAttribute($authored)
->setSideColumn(array( ->setSideColumn(array(
$clippy, $build_view,
$browse_button, $browse_button,
)); ));

View file

@ -31,3 +31,12 @@
.diffusion-history-author-name a { .diffusion-history-author-name a {
color: {$darkbluetext}; color: {$darkbluetext};
} }
.diffusion-history-list .diffusion-differential-tag {
margin-left: 4px;
}
a.phui-tag-view:hover.diffusion-differential-tag .phui-tag-core {
border-color: transparent;
text-decoration: underline;
}

View file

@ -106,6 +106,22 @@ a.simple:visited .phui-icon-view {
color: {$lightbluetext}; color: {$lightbluetext};
} }
button.simple.red,
input[type="submit"].simple.red,
a.simple.red,
a.simple.red:visited {
background: #fff;
color: {$redtext};
border: 1px solid {$sh-redborder};
}
button.simple.red .phui-icon-view,
input[type="submit"].simple.red .phui-icon-view,
a.simple.red .phui-icon-view,
a.simple.red:visited .phui-icon-view {
color: {$redtext};
}
a.disabled, a.disabled,
button.disabled, button.disabled,
button[disabled] { button[disabled] {
@ -145,16 +161,18 @@ button.green:hover {
a.button.simple:hover, a.button.simple:hover,
button.simple:hover { button.simple:hover {
background-color: {$lightblue}; border-color: {$blueborder};
background-image: linear-gradient(to bottom, {$blue}, {$blue}); background-image: none;
color: #fff; background-color: #fff;
transition: 0s; transition: 0s;
} }
a.button.simple:hover .phui-icon-view, a.button.simple.red:hover,
button.simple:hover .phui-icon-view { button.simple.red:hover {
color: #fff; border-color: {$red};
transition: 0.1s; background-image: none;
background-color: #fff;
transition: 0s;
} }
a.button.simple .phui-icon-view { a.button.simple .phui-icon-view {