Add some icons/color to Config Settings UI

Summary: This adds status icons, locked, hidden, editable, customized, to the list of options in config. Makes it easier to read and assertain state.

Test Plan:
View a hidden, customized, editable, and locked.

{F1796320}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16475
This commit is contained in:
Chad Little
2016-08-30 12:53:09 -07:00
parent 7ce5853936
commit eac8171a63
4 changed files with 38 additions and 15 deletions

View File

@@ -77,6 +77,24 @@ final class PhabricatorConfigGroupController
->setHref('/config/edit/'.$option->getKey().'/')
->addAttribute($summary);
$label = pht('Current Value:');
$color = null;
$db_value = idx($db_values, $option->getKey());
if ($db_value && !$db_value->getIsDeleted()) {
$item->setEffect('visited');
$color = 'violet';
$label = pht('Customized Value:');
}
if ($option->getHidden()) {
$item->setStatusIcon('fa-eye-slash grey', pht('Hidden'));
$item->setDisabled(true);
} else if ($option->getLocked()) {
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
} else {
$item->setStatusIcon('fa-pencil-square-o '.$color, pht('Editable'));
}
if (!$option->getHidden()) {
$current_value = PhabricatorEnv::getEnvConfig($option->getKey());
$current_value = PhabricatorConfigJSON::prettyPrintJSON(
@@ -87,24 +105,13 @@ final class PhabricatorConfigGroupController
'class' => 'config-options-current-value',
),
array(
phutil_tag('span', array(), pht('Current Value:')),
phutil_tag('span', array(), $label),
' '.$current_value,
));
$item->appendChild($current_value);
}
$db_value = idx($db_values, $option->getKey());
if ($db_value && !$db_value->getIsDeleted()) {
$item->addIcon('fa-edit', pht('Customized'));
}
if ($option->getHidden()) {
$item->addIcon('fa-eye-slash', pht('Hidden'));
} else if ($option->getLocked()) {
$item->addIcon('fa-lock', pht('Locked'));
}
$list->addItem($item);
}