@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Show current value in configuration list; show default vs non-default values

Summary:
- When viewing a config list, show the current effective value.
- Add an icon showing default vs nondefault values.

Test Plan: {F28475}

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4313

+40 -1
+33 -1
src/applications/config/controller/PhabricatorConfigGroupController.php
··· 53 53 private function buildOptionList(array $options) { 54 54 assert_instances_of($options, 'PhabricatorConfigOption'); 55 55 56 + require_celerity_resource('config-options-css'); 57 + 58 + $db_values = array(); 59 + if ($options) { 60 + $db_values = id(new PhabricatorConfigEntry())->loadAllWhere( 61 + 'configKey IN (%Ls) AND namespace = %s', 62 + mpull($options, 'getKey'), 63 + 'default'); 64 + $db_values = mpull($db_values, null, 'getConfigKey'); 65 + } 66 + 67 + 56 68 $list = new PhabricatorObjectItemListView(); 57 69 foreach ($options as $option) { 70 + $current_value = PhabricatorEnv::getEnvConfig($option->getKey()); 71 + $current_value = $this->prettyPrintJSON($current_value); 72 + $current_value = phutil_render_tag( 73 + 'div', 74 + array( 75 + 'class' => 'config-options-current-value', 76 + ), 77 + '<span>'.pht('Current Value:').'</span> '. 78 + phutil_escape_html($current_value)); 79 + 80 + 58 81 $item = id(new PhabricatorObjectItemView()) 59 82 ->setHeader($option->getKey()) 60 83 ->setHref('/config/edit/'.$option->getKey().'/') 61 - ->addAttribute(phutil_escape_html($option->getSummary())); 84 + ->addAttribute(phutil_escape_html($option->getSummary())) 85 + ->appendChild($current_value); 86 + 87 + $db_value = idx($db_values, $option->getKey()); 88 + if ($db_value && !$db_value->getIsDeleted()) { 89 + $item->addIcon('edit', pht('Customized')); 90 + } else { 91 + $item->addIcon('edit-grey', pht('Default')); 92 + } 93 + 62 94 $list->addItem($item); 63 95 } 64 96
+7
webroot/rsrc/css/application/config/config-options.css
··· 37 37 background: #e0e0e0; 38 38 } 39 39 40 + .config-options-current-value { 41 + padding: 0 6px 2px; 42 + white-space: pre-wrap; 43 + } 40 44 45 + .config-options-current-value span { 46 + color: #666666; 47 + }