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

Add getGroup to ConfigOptions

Summary: Adds core and apps grouping to configuration options, makes it somewhat easier to browse config options.

Test Plan: Set each option, review list. Breakdown is nearly 50/50 apps/core.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11722
This commit is contained in:
Chad Little 2015-02-09 13:10:56 -08:00
parent 4af3a37d6c
commit ae7dc8b9d2
46 changed files with 196 additions and 12 deletions

View file

@ -2286,7 +2286,7 @@ phutil_register_library_map(array(
'PhabricatorRepositoryCommitParserWorker' => 'applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php',
'PhabricatorRepositoryCommitRef' => 'applications/repository/engine/PhabricatorRepositoryCommitRef.php',
'PhabricatorRepositoryCommitSearchIndexer' => 'applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php',
'PhabricatorRepositoryConfigOptions' => 'applications/repository/PhabricatorRepositoryConfigOptions.php',
'PhabricatorRepositoryConfigOptions' => 'applications/repository/config/PhabricatorRepositoryConfigOptions.php',
'PhabricatorRepositoryController' => 'applications/repository/controller/PhabricatorRepositoryController.php',
'PhabricatorRepositoryDAO' => 'applications/repository/storage/PhabricatorRepositoryDAO.php',
'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php',

View file

@ -11,17 +11,23 @@ final class PhabricatorConfigListController
$nav->selectFilter('/');
$groups = PhabricatorApplicationConfigOptions::loadAll();
$list = $this->buildConfigOptionsList($groups);
$core_list = $this->buildConfigOptionsList($groups, 'core');
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
$title = pht('Phabricator Configuration');
$box = id(new PHUIObjectBoxView())
$core = id(new PHUIObjectBoxView())
->setHeaderText($title)
->appendChild($list);
->appendChild($core_list);
$apps = id(new PHUIObjectBoxView())
->setHeaderText(pht('Applications Configuration'))
->appendChild($apps_list);
$nav->appendChild(
array(
$box,
$core,
$apps,
));
$crumbs = $this
@ -37,19 +43,21 @@ final class PhabricatorConfigListController
));
}
private function buildConfigOptionsList(array $groups) {
private function buildConfigOptionsList(array $groups, $type) {
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
$list = new PHUIObjectItemListView();
$list->setStackable(true);
$groups = msort($groups, 'getName');
foreach ($groups as $group) {
$item = id(new PHUIObjectItemView())
->setHeader($group->getName())
->setHref('/config/group/'.$group->getKey().'/')
->addAttribute($group->getDescription())
->setFontIcon($group->getFontIcon());
$list->addItem($item);
if ($group->getGroup() == $type) {
$item = id(new PHUIObjectItemView())
->setHeader($group->getName())
->setHref('/config/group/'.$group->getKey().'/')
->addAttribute($group->getDescription())
->setFontIcon($group->getFontIcon());
$list->addItem($item);
}
}
return $list;

View file

@ -15,6 +15,10 @@ final class PhabricatorAWSConfigOptions
return 'fa-server';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('amazon-ses.access-key', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorAccessLogConfigOptions
return 'fa-list';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$common_map = array(
'C' => pht('The controller or workflow which handled the request.'),

View file

@ -15,6 +15,10 @@ final class PhabricatorAuthenticationConfigOptions
return 'fa-key';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('auth.require-email-verification', 'bool', false)

View file

@ -15,6 +15,10 @@ final class PhabricatorClusterConfigOptions
return 'fa-sitemap';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('cluster.addresses', 'list<string>', array())

View file

@ -15,6 +15,10 @@ final class PhabricatorCoreConfigOptions
return 'fa-bullseye';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
if (phutil_is_windows()) {
$paths = array();

View file

@ -15,6 +15,10 @@ final class PhabricatorDeveloperConfigOptions
return 'fa-bug';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('darkconsole.enabled', 'bool', false)

View file

@ -15,6 +15,10 @@ final class PhabricatorDisqusConfigOptions
return 'fa-comment';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('disqus.shortname', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorExtendingPhabricatorConfigOptions
return 'fa-rocket';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('load-libraries', 'list<string>', array())

View file

@ -15,6 +15,10 @@ final class PhabricatorGarbageCollectorConfigOptions
return 'fa-trash-o';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$options = array(

View file

@ -15,6 +15,10 @@ final class PhabricatorMailgunConfigOptions
return 'fa-send-o';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('mailgun.domain', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorMetaMTAConfigOptions
return 'fa-send';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$send_as_user_desc = $this->deformat(pht(<<<EODOC
When a user takes an action which generates an email notification (like

View file

@ -15,6 +15,10 @@ final class PhabricatorMySQLConfigOptions
return 'fa-database';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('mysql.host', 'string', 'localhost')

View file

@ -15,6 +15,10 @@ final class PhabricatorNotificationConfigOptions
return 'fa-bell';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('notification.enabled', 'bool', false)

View file

@ -15,6 +15,10 @@ final class PhabricatorPHDConfigOptions
return 'fa-pied-piper-alt';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('phd.pid-directory', 'string', '/var/tmp/phd/pid')

View file

@ -15,6 +15,10 @@ final class PhabricatorPHPMailerConfigOptions
return 'fa-send-o';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('phpmailer.mailer', 'string', 'smtp')

View file

@ -15,6 +15,10 @@ final class PhabricatorRecaptchaConfigOptions
return 'fa-recycle';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(

View file

@ -15,6 +15,10 @@ final class PhabricatorSMSConfigOptions
return 'fa-mobile';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$adapter_description = $this->deformat(pht(<<<EODOC
Adapter class to use to transmit SMS to an external provider. A given external

View file

@ -15,6 +15,10 @@ final class PhabricatorSecurityConfigOptions
return 'fa-lock';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$support_href = PhabricatorEnv::getDoclink('Give Feedback! Get Support!');

View file

@ -15,6 +15,10 @@ final class PhabricatorSendGridConfigOptions
return 'fa-send-o';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('sendgrid.api-user', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorSyntaxHighlightingConfigOptions
return 'fa-code';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$caches_href = PhabricatorEnv::getDocLink('Managing Caches');

View file

@ -15,6 +15,10 @@ final class PhabricatorTranslationsConfigOptions
return 'fa-globe';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorUIConfigOptions
return 'fa-magnet';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
$manifest = PHUIIconView::getSheetManifest('main-header');

View file

@ -15,6 +15,10 @@ final class ConpherenceConfigOptions
return 'fa-comments';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorDifferentialConfigOptions
return 'fa-cog';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';

View file

@ -15,6 +15,10 @@ final class PhabricatorDiffusionConfigOptions
return 'fa-code';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorAsanaConfigOptions
return 'fa-exchange';
}
public function getGroup() {
return 'core';
}
public function getOptions() {
return array(
$this->newOption('asana.workspace-id', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorFeedConfigOptions
return 'fa-newspaper-o';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('feed.public', 'bool', false)

View file

@ -15,6 +15,10 @@ final class PhabricatorFilesConfigOptions
return 'fa-file';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$viewable_default = array(
'image/jpeg' => 'image/jpeg',

View file

@ -15,6 +15,10 @@ final class PhabricatorHarbormasterConfigOptions
return 'fa-ship';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array();
}

View file

@ -15,6 +15,10 @@ final class PhabricatorLegalpadConfigOptions
return 'fa-gavel';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorMacroConfigOptions
return 'fa-file-image-o';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('metamta.macro.reply-handler-domain', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorManiphestConfigOptions
return 'fa-anchor';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$priority_defaults = array(

View file

@ -15,6 +15,10 @@ final class PhabricatorOwnersConfigOptions
return 'fa-gift';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorPasteConfigOptions
return 'fa-paste';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorUserConfigOptions
return 'fa-users';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$default = array(

View file

@ -15,6 +15,10 @@ final class PhabricatorPhameConfigOptions
return 'fa-star';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorPholioConfigOptions
return 'fa-camera-retro';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('metamta.pholio.reply-handler-domain', 'string', null)

View file

@ -15,6 +15,10 @@ final class PhabricatorPhrequentConfigOptions
return 'fa-clock-o';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array();
}

View file

@ -15,6 +15,10 @@ final class PhabricatorPhrictionConfigOptions
return 'fa-book';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(

View file

@ -15,6 +15,10 @@ final class PhabricatorPolicyConfigOptions
return 'fa-lock';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$policy_locked_type = 'custom:PolicyLockOptionType';
$policy_locked_example = array(

View file

@ -15,6 +15,10 @@ final class PhabricatorProjectConfigOptions
return 'fa-briefcase';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$default_fields = array(
'std:project:internal:description' => true,

View file

@ -15,6 +15,10 @@ final class PhabricatorReleephApplicationConfigOptions
return 'fa-flag-checkered';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$default_fields = array(
new ReleephSummaryFieldSpecification(),

View file

@ -15,6 +15,10 @@ final class PhabricatorRepositoryConfigOptions
return 'fa-hdd-o';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('repository.default-local-path', 'string', '/var/repo/')

View file

@ -15,6 +15,10 @@ final class PhabricatorSearchConfigOptions
return 'fa-search';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(