@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.

Shuffle various parts of the config edit UI around

Summary:
Fixes T9339.

- Don't show edit control for locked config at all.
- Don't show a "Cancel" button either.
- Change "Value" label to "Database Value" for non-custom config.
- Highlight effective value.
- Move examples under current state.
- Tweak some formatting.

Test Plan: {F777878}

Reviewers: chad, avivey

Reviewed By: chad, avivey

Subscribers: avivey

Maniphest Tasks: T9339

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

+50 -34
+9 -9
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => 'eb8c668d', 10 + 'core.pkg.css' => '994de4ed', 11 11 'core.pkg.js' => '47dc9ebb', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', ··· 40 40 'rsrc/css/application/calendar/calendar-icon.css' => 'c69aa59f', 41 41 'rsrc/css/application/chatlog/chatlog.css' => 'd295b020', 42 42 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 43 - 'rsrc/css/application/config/config-options.css' => '7fedf08b', 43 + 'rsrc/css/application/config/config-options.css' => '0ede4c9b', 44 44 'rsrc/css/application/config/config-template.css' => '8e6c6fcd', 45 45 'rsrc/css/application/config/config-welcome.css' => '6abd79be', 46 46 'rsrc/css/application/config/setup-issue.css' => 'db7e9c40', ··· 93 93 'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 94 94 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 95 95 'rsrc/css/application/policy/policy.css' => '957ea14c', 96 - 'rsrc/css/application/ponder/ponder-view.css' => '7b0df4da', 96 + 'rsrc/css/application/ponder/ponder-view.css' => 'bef48f86', 97 97 'rsrc/css/application/projects/project-icon.css' => '4e3eaa5a', 98 98 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 99 99 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', ··· 104 104 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 105 105 'rsrc/css/application/uiexample/example.css' => '528b19de', 106 106 'rsrc/css/core/core.css' => 'a76cefc9', 107 - 'rsrc/css/core/remarkup.css' => 'ef286a6e', 107 + 'rsrc/css/core/remarkup.css' => '73fc4395', 108 108 'rsrc/css/core/syntax.css' => '9fd11da8', 109 109 'rsrc/css/core/z-index.css' => '57ddcaa2', 110 110 'rsrc/css/diviner/diviner-shared.css' => '5a337049', ··· 141 141 'rsrc/css/phui/phui-object-item-list-view.css' => 'ab1bf393', 142 142 'rsrc/css/phui/phui-pager.css' => 'bea33d23', 143 143 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 144 - 'rsrc/css/phui/phui-property-list-view.css' => '03904f6b', 144 + 'rsrc/css/phui/phui-property-list-view.css' => '318d4dea', 145 145 'rsrc/css/phui/phui-remarkup-preview.css' => '867f85b3', 146 146 'rsrc/css/phui/phui-spacing.css' => '042804d6', 147 147 'rsrc/css/phui/phui-status.css' => '888cedb8', ··· 505 505 'calendar-icon-css' => 'c69aa59f', 506 506 'changeset-view-manager' => '58562350', 507 507 'conduit-api-css' => '7bc725c4', 508 - 'config-options-css' => '7fedf08b', 508 + 'config-options-css' => '0ede4c9b', 509 509 'config-welcome-css' => '6abd79be', 510 510 'conpherence-durable-column-view' => '86396117', 511 511 'conpherence-menu-css' => 'f99fee4c', ··· 737 737 'phabricator-object-selector-css' => '85ee8ce6', 738 738 'phabricator-phtize' => 'd254d646', 739 739 'phabricator-prefab' => '6920d200', 740 - 'phabricator-remarkup-css' => 'ef286a6e', 740 + 'phabricator-remarkup-css' => '73fc4395', 741 741 'phabricator-search-results-css' => '7dea472c', 742 742 'phabricator-shaped-request' => '7cbe244b', 743 743 'phabricator-side-menu-view-css' => 'bec2458e', ··· 794 794 'phui-object-item-list-view-css' => 'ab1bf393', 795 795 'phui-pager-css' => 'bea33d23', 796 796 'phui-pinboard-view-css' => '2495140e', 797 - 'phui-property-list-view-css' => '03904f6b', 797 + 'phui-property-list-view-css' => '318d4dea', 798 798 'phui-remarkup-preview-css' => '867f85b3', 799 799 'phui-spacing-css' => '042804d6', 800 800 'phui-status-list-view-css' => '888cedb8', ··· 811 811 'policy-css' => '957ea14c', 812 812 'policy-edit-css' => '815c66f7', 813 813 'policy-transaction-detail-css' => '82100a43', 814 - 'ponder-view-css' => '7b0df4da', 814 + 'ponder-view-css' => 'bef48f86', 815 815 'project-icon-css' => '4e3eaa5a', 816 816 'raphael-core' => '51ee6b43', 817 817 'raphael-g' => '40dde778',
+33 -22
src/applications/config/controller/PhabricatorConfigEditController.php
··· 122 122 ->appendChild(phutil_tag('p', array(), $msg)); 123 123 } 124 124 125 - if ($option->getHidden()) { 125 + if ($option->getHidden() || $option->getLocked()) { 126 126 $control = null; 127 127 } else { 128 128 $control = $this->renderControl( ··· 164 164 $form 165 165 ->appendChild($control); 166 166 167 - $submit_control = id(new AphrontFormSubmitControl()) 168 - ->addCancelButton($done_uri); 169 167 170 168 if (!$option->getLocked()) { 171 - $submit_control->setValue(pht('Save Config Entry')); 169 + $form->appendChild( 170 + id(new AphrontFormSubmitControl()) 171 + ->addCancelButton($done_uri) 172 + ->setValue(pht('Save Config Entry'))); 172 173 } 173 174 174 - $form->appendChild($submit_control); 175 + if (!$option->getHidden()) { 176 + $form->appendChild( 177 + id(new AphrontFormMarkupControl()) 178 + ->setLabel(pht('Current Configuration')) 179 + ->setValue($this->renderDefaults($option, $config_entry))); 180 + } 175 181 176 182 $examples = $this->renderExamples($option); 177 183 if ($examples) { ··· 179 185 id(new AphrontFormMarkupControl()) 180 186 ->setLabel(pht('Examples')) 181 187 ->setValue($examples)); 182 - } 183 - 184 - if (!$option->getHidden()) { 185 - $form->appendChild( 186 - id(new AphrontFormMarkupControl()) 187 - ->setLabel(pht('Default')) 188 - ->setValue($this->renderDefaults($option, $config_entry))); 189 188 } 190 189 191 190 $title = pht('Edit %s', $key); ··· 438 437 } 439 438 440 439 $control 441 - ->setLabel(pht('Value')) 440 + ->setLabel(pht('Database Value')) 442 441 ->setError($e_value) 443 442 ->setValue($display_value) 444 443 ->setName('value'); 445 - } 446 - 447 - if ($option->getLocked()) { 448 - $control->setDisabled(true); 449 444 } 450 445 451 446 return $control; ··· 501 496 phutil_tag('th', array(), pht('Source')), 502 497 phutil_tag('th', array(), pht('Value')), 503 498 )); 499 + 500 + $is_effective_value = true; 504 501 foreach ($stack as $key => $source) { 502 + $row_classes = array( 503 + 'column-labels', 504 + ); 505 + 505 506 $value = $source->getKeys( 506 507 array( 507 508 $option->getKey(), 508 509 )); 509 510 510 511 if (!array_key_exists($option->getKey(), $value)) { 511 - $value = phutil_tag('em', array(), pht('(empty)')); 512 + $value = phutil_tag('em', array(), pht('(No Value Configured)')); 512 513 } else { 513 514 $value = $this->getDisplayValue( 514 515 $option, 515 516 $entry, 516 517 $value[$option->getKey()]); 518 + 519 + if ($is_effective_value) { 520 + $is_effective_value = false; 521 + $row_classes[] = 'config-options-effective-value'; 522 + } 517 523 } 518 524 519 - $table[] = phutil_tag('tr', array('class' => 'column-labels'), array( 520 - phutil_tag('th', array(), $source->getName()), 521 - phutil_tag('td', array(), $value), 522 - )); 525 + $table[] = phutil_tag( 526 + 'tr', 527 + array( 528 + 'class' => implode(' ', $row_classes), 529 + ), 530 + array( 531 + phutil_tag('th', array(), $source->getName()), 532 + phutil_tag('td', array(), $value), 533 + )); 523 534 } 524 535 525 536 require_celerity_resource('config-options-css');
+3 -3
src/applications/config/option/PhabricatorConfigOption.php
··· 76 76 } 77 77 return pht( 78 78 'This configuration is locked and can not be edited from the web '. 79 - 'interface. Use `%s` in `%s` to edit it.', 80 - './bin/config', 81 - 'phabricator/'); 79 + 'interface. Use %s in %s to edit it.', 80 + phutil_tag('tt', array(), './bin/config'), 81 + phutil_tag('tt', array(), 'phabricator/')); 82 82 } 83 83 84 84 public function addExample($value, $description) {
+5
webroot/rsrc/css/application/config/config-options.css
··· 49 49 .config-options-current-value span { 50 50 color: {$greytext}; 51 51 } 52 + 53 + .config-options-effective-value, 54 + .config-option-table .config-options-effective-value th { 55 + background: {$lightyellow}; 56 + }