mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 15:22:41 +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:
parent
786232c4bc
commit
aeb3a12e13
3 changed files with 25 additions and 3 deletions
|
@ -120,10 +120,8 @@ final class PhabricatorConfigEditController
|
|||
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
|
||||
->appendChild(phutil_tag('p', array(), $msg));
|
||||
} 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())
|
||||
->setTitle(pht('Configuration Locked'))
|
||||
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
|
||||
|
|
|
@ -14,6 +14,7 @@ final class PhabricatorConfigOption
|
|||
private $group;
|
||||
private $examples;
|
||||
private $locked;
|
||||
private $lockedMessage;
|
||||
private $hidden;
|
||||
private $masked;
|
||||
private $baseClass;
|
||||
|
@ -85,6 +86,20 @@ final class PhabricatorConfigOption
|
|||
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) {
|
||||
$this->examples[] = array($value, $description);
|
||||
return $this;
|
||||
|
|
|
@ -27,6 +27,7 @@ final class PhabricatorCoreConfigOptions
|
|||
$proto_doc_href = PhabricatorEnv::getDoclink(
|
||||
'User Guide: Prototype Applications');
|
||||
$proto_doc_name = pht('User Guide: Prototype Applications');
|
||||
$applications_app_href = '/applications/';
|
||||
|
||||
return array(
|
||||
$this->newOption('phabricator.base-uri', 'string', null)
|
||||
|
@ -183,6 +184,14 @@ final class PhabricatorCoreConfigOptions
|
|||
->setDescription(pht('Unit test value.')),
|
||||
$this->newOption('phabricator.uninstalled-applications', 'set', array())
|
||||
->setLocked(true)
|
||||
->setLockedMessage(pht(
|
||||
'Use the %s to manage installed applications.',
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $applications_app_href,
|
||||
),
|
||||
pht('Applications application'))))
|
||||
->setDescription(
|
||||
pht('Array containing list of Uninstalled applications.')),
|
||||
$this->newOption('phabricator.application-settings', 'wild', array())
|
||||
|
|
Loading…
Reference in a new issue