1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 23:32:40 +01:00

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
This commit is contained in:
Bob Trahan 2014-11-12 11:31:54 -08:00
parent 786232c4bc
commit aeb3a12e13
3 changed files with 25 additions and 3 deletions

View file

@ -120,10 +120,8 @@ final class PhabricatorConfigEditController
->setSeverity(AphrontErrorView::SEVERITY_WARNING) ->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->appendChild(phutil_tag('p', array(), $msg)); ->appendChild(phutil_tag('p', array(), $msg));
} else if ($option->getLocked()) { } else if ($option->getLocked()) {
$msg = pht(
'This configuration is locked and can not be edited from the web '.
'interface. Use `./bin/config` in `phabricator/` to edit it.');
$msg = $option->getLockedMessage();
$error_view = id(new AphrontErrorView()) $error_view = id(new AphrontErrorView())
->setTitle(pht('Configuration Locked')) ->setTitle(pht('Configuration Locked'))
->setSeverity(AphrontErrorView::SEVERITY_NOTICE) ->setSeverity(AphrontErrorView::SEVERITY_NOTICE)

View file

@ -14,6 +14,7 @@ final class PhabricatorConfigOption
private $group; private $group;
private $examples; private $examples;
private $locked; private $locked;
private $lockedMessage;
private $hidden; private $hidden;
private $masked; private $masked;
private $baseClass; private $baseClass;
@ -85,6 +86,20 @@ final class PhabricatorConfigOption
false); false);
} }
public function setLockedMessage($message) {
$this->lockedMessage = $message;
return $this;
}
public function getLockedMessage() {
if ($this->lockedMessage !== null) {
return $this->lockedMessage;
}
return pht(
'This configuration is locked and can not be edited from the web '.
'interface. Use `./bin/config` in `phabricator/` to edit it.');
}
public function addExample($value, $description) { public function addExample($value, $description) {
$this->examples[] = array($value, $description); $this->examples[] = array($value, $description);
return $this; return $this;

View file

@ -27,6 +27,7 @@ final class PhabricatorCoreConfigOptions
$proto_doc_href = PhabricatorEnv::getDoclink( $proto_doc_href = PhabricatorEnv::getDoclink(
'User Guide: Prototype Applications'); 'User Guide: Prototype Applications');
$proto_doc_name = pht('User Guide: Prototype Applications'); $proto_doc_name = pht('User Guide: Prototype Applications');
$applications_app_href = '/applications/';
return array( return array(
$this->newOption('phabricator.base-uri', 'string', null) $this->newOption('phabricator.base-uri', 'string', null)
@ -183,6 +184,14 @@ final class PhabricatorCoreConfigOptions
->setDescription(pht('Unit test value.')), ->setDescription(pht('Unit test value.')),
$this->newOption('phabricator.uninstalled-applications', 'set', array()) $this->newOption('phabricator.uninstalled-applications', 'set', array())
->setLocked(true) ->setLocked(true)
->setLockedMessage(pht(
'Use the %s to manage installed applications.',
phutil_tag(
'a',
array(
'href' => $applications_app_href,
),
pht('Applications application'))))
->setDescription( ->setDescription(
pht('Array containing list of Uninstalled applications.')), pht('Array containing list of Uninstalled applications.')),
$this->newOption('phabricator.application-settings', 'wild', array()) $this->newOption('phabricator.application-settings', 'wild', array())