1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-17 10:11:10 +01:00

[Redesign] Remove remaining barColor callsites

Summary: Ref T8099, Fixes T8341. Switches all remaining callsites to setBarColor to use setStatusIcon (sans workboards).

Test Plan: Test each of the applications I changed as I could (not Releeph).

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8341, T8099

Differential Revision: https://secure.phabricator.com/D13059
This commit is contained in:
Chad Little 2015-05-28 15:17:34 -07:00
parent fd47a047e5
commit 13f9f209df
9 changed files with 30 additions and 14 deletions

View file

@ -157,17 +157,17 @@ final class PhabricatorAuditListView extends AphrontView {
->setObjectName($commit_name) ->setObjectName($commit_name)
->setHeader($commit_desc) ->setHeader($commit_desc)
->setHref($commit_link) ->setHref($commit_link)
->addAttribute($status_text) ->addAttribute(pht('Author: %s', $author_name))
->addAttribute($reasons) ->addAttribute($reasons)
->addIcon('none', $committed) ->addIcon('none', $committed);
->setSubHead(pht('Author: %s', $author_name));
if (!empty($auditors)) { if (!empty($auditors)) {
$item->addByLine(pht('Auditors: %s', $auditors)); $item->addByLine(pht('Auditors: %s', $auditors));
} }
if ($status_color) { if ($status_color) {
$item->setStatusIcon('fa-exclamation-triangle '.$status_color); $item->setStatusIcon(
'fa-exclamation-triangle '.$status_color, $status_text);
} }
$list->addItem($item); $list->addItem($item);

View file

@ -206,7 +206,8 @@ final class HarbormasterBuildableSearchEngine
$item->addIcon('fa-wrench grey', pht('Manual')); $item->addIcon('fa-wrench grey', pht('Manual'));
} }
$item->setBarColor(HarbormasterBuildable::getBuildableStatusColor( $item->setStatusIcon('fa-wrench '.
HarbormasterBuildable::getBuildableStatusColor(
$buildable->getBuildableStatus())); $buildable->getBuildableStatus()));
$item->addByline(HarbormasterBuildable::getBuildableStatusName( $item->addByline(HarbormasterBuildable::getBuildableStatusName(
$buildable->getBuildableStatus())); $buildable->getBuildableStatus()));

View file

@ -143,7 +143,7 @@ final class PhortuneAccountViewController extends PhortuneController {
switch ($method->getStatus()) { switch ($method->getStatus()) {
case PhortunePaymentMethod::STATUS_ACTIVE: case PhortunePaymentMethod::STATUS_ACTIVE:
$item->setBarColor('green'); $item->setStatusIcon('fa-check green');
$disable_uri = $this->getApplicationURI('card/'.$id.'/disable/'); $disable_uri = $this->getApplicationURI('card/'.$id.'/disable/');
$item->addAction( $item->addAction(
@ -154,6 +154,7 @@ final class PhortuneAccountViewController extends PhortuneController {
->setWorkflow(true)); ->setWorkflow(true));
break; break;
case PhortunePaymentMethod::STATUS_DISABLED: case PhortunePaymentMethod::STATUS_DISABLED:
$item->setStatusIcon('fa-ban lightbluetext');
$item->setDisabled(true); $item->setDisabled(true);
break; break;
} }

View file

@ -229,9 +229,9 @@ final class PhortuneMerchantViewController
if ($provider->isEnabled()) { if ($provider->isEnabled()) {
if ($provider->isAcceptingLivePayments()) { if ($provider->isAcceptingLivePayments()) {
$item->setBarColor('green'); $item->setStatusIcon('fa-check green');
} else { } else {
$item->setBarColor('yellow'); $item->setStatusIcon('fa-warning yellow');
$item->addIcon('fa-exclamation-triangle', pht('Test Mode')); $item->addIcon('fa-exclamation-triangle', pht('Test Mode'));
} }

View file

@ -183,7 +183,7 @@ final class PhrequentSearchEngine extends PhabricatorApplicationSearchEngine {
'/phrequent/track/stop/'. '/phrequent/track/stop/'.
$usertime->getObjectPHID().'/')); $usertime->getObjectPHID().'/'));
} }
$item->setBarColor('green'); $item->setStatusIcon('fa-clock-o green');
} }
$view->addItem($item); $view->addItem($item);

View file

@ -22,10 +22,20 @@ final class PonderQuestionStatus extends PonderConstants {
public static function getQuestionStatusTagColor($status) { public static function getQuestionStatusTagColor($status) {
$map = array( $map = array(
self::STATUS_OPEN => PHUITagView::COLOR_BLUE,
self::STATUS_CLOSED => PHUITagView::COLOR_BLACK, self::STATUS_CLOSED => PHUITagView::COLOR_BLACK,
); );
return idx($map, $status); return idx($map, $status);
} }
public static function getQuestionStatusIcon($status) {
$map = array(
self::STATUS_OPEN => 'fa-question-circle',
self::STATUS_CLOSED => 'fa-check-square-o',
);
return idx($map, $status);
}
} }

View file

@ -144,14 +144,18 @@ final class PonderQuestionSearchEngine
->setUser($viewer); ->setUser($viewer);
foreach ($questions as $question) { foreach ($questions as $question) {
$color = PonderQuestionStatus::getQuestionStatusTagColor(
$question->getStatus());
$icon = PonderQuestionStatus::getQuestionStatusIcon(
$question->getStatus());
$full_status = PonderQuestionStatus::getQuestionStatusFullName(
$question->getStatus());
$item = new PHUIObjectItemView(); $item = new PHUIObjectItemView();
$item->setObjectName('Q'.$question->getID()); $item->setObjectName('Q'.$question->getID());
$item->setHeader($question->getTitle()); $item->setHeader($question->getTitle());
$item->setHref('/Q'.$question->getID()); $item->setHref('/Q'.$question->getID());
$item->setObject($question); $item->setObject($question);
$item->setBarColor( $item->setStatusIcon($icon.' '.$color, $full_status);
PonderQuestionStatus::getQuestionStatusTagColor(
$question->getStatus()));
$created_date = phabricator_date($question->getDateCreated(), $viewer); $created_date = phabricator_date($question->getDateCreated(), $viewer);
$item->addIcon('none', $created_date); $item->addIcon('none', $created_date);

View file

@ -112,7 +112,7 @@ final class ReleephProductViewController extends ReleephProductController
$open_count = count(idx($requests, $branch->getID(), array())); $open_count = count(idx($requests, $branch->getID(), array()));
if ($open_count) { if ($open_count) {
$item->setBarColor('orange'); $item->setStatusIcon('fa-code-fork orange');
$item->addIcon( $item->addIcon(
'fa-code-fork', 'fa-code-fork',
pht('%d Open Pull Request(s)', new PhutilNumber($open_count))); pht('%d Open Pull Request(s)', new PhutilNumber($open_count)));

View file

@ -79,7 +79,7 @@ final class PhabricatorCustomFieldConfigOptionType
->addSigil('field-spec-toggle') ->addSigil('field-spec-toggle')
->setIcon('fa-plus')); ->setIcon('fa-plus'));
$enabled_item->setBarColor('green'); $enabled_item->setStatusIcon('fa-check green');
if (!$field->canDisableField()) { if (!$field->canDisableField()) {
$enabled_item->addAction( $enabled_item->addAction(