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

Config - improve lock message for option `phabricator.uninstalled-applications`

Summary: Fixes T6175. This particular option is only editable via the Applications application so let the user know that.

Test Plan: saw error message and clicked through to applications app. tried another locked option and saw old message

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6175

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

+25 -3
+1 -3
src/applications/config/controller/PhabricatorConfigEditController.php
··· 120 120 ->setSeverity(AphrontErrorView::SEVERITY_WARNING) 121 121 ->appendChild(phutil_tag('p', array(), $msg)); 122 122 } else if ($option->getLocked()) { 123 - $msg = pht( 124 - 'This configuration is locked and can not be edited from the web '. 125 - 'interface. Use `./bin/config` in `phabricator/` to edit it.'); 126 123 124 + $msg = $option->getLockedMessage(); 127 125 $error_view = id(new AphrontErrorView()) 128 126 ->setTitle(pht('Configuration Locked')) 129 127 ->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
+15
src/applications/config/option/PhabricatorConfigOption.php
··· 14 14 private $group; 15 15 private $examples; 16 16 private $locked; 17 + private $lockedMessage; 17 18 private $hidden; 18 19 private $masked; 19 20 private $baseClass; ··· 83 84 PhabricatorEnv::getEnvConfig('config.lock'), 84 85 $this->getKey(), 85 86 false); 87 + } 88 + 89 + public function setLockedMessage($message) { 90 + $this->lockedMessage = $message; 91 + return $this; 92 + } 93 + 94 + public function getLockedMessage() { 95 + if ($this->lockedMessage !== null) { 96 + return $this->lockedMessage; 97 + } 98 + return pht( 99 + 'This configuration is locked and can not be edited from the web '. 100 + 'interface. Use `./bin/config` in `phabricator/` to edit it.'); 86 101 } 87 102 88 103 public function addExample($value, $description) {
+9
src/applications/config/option/PhabricatorCoreConfigOptions.php
··· 27 27 $proto_doc_href = PhabricatorEnv::getDoclink( 28 28 'User Guide: Prototype Applications'); 29 29 $proto_doc_name = pht('User Guide: Prototype Applications'); 30 + $applications_app_href = '/applications/'; 30 31 31 32 return array( 32 33 $this->newOption('phabricator.base-uri', 'string', null) ··· 183 184 ->setDescription(pht('Unit test value.')), 184 185 $this->newOption('phabricator.uninstalled-applications', 'set', array()) 185 186 ->setLocked(true) 187 + ->setLockedMessage(pht( 188 + 'Use the %s to manage installed applications.', 189 + phutil_tag( 190 + 'a', 191 + array( 192 + 'href' => $applications_app_href, 193 + ), 194 + pht('Applications application')))) 186 195 ->setDescription( 187 196 pht('Array containing list of Uninstalled applications.')), 188 197 $this->newOption('phabricator.application-settings', 'wild', array())