1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-05 17:08:27 +02: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', 'PhabricatorRepositoryCommitParserWorker' => 'applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php',
'PhabricatorRepositoryCommitRef' => 'applications/repository/engine/PhabricatorRepositoryCommitRef.php', 'PhabricatorRepositoryCommitRef' => 'applications/repository/engine/PhabricatorRepositoryCommitRef.php',
'PhabricatorRepositoryCommitSearchIndexer' => 'applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php', 'PhabricatorRepositoryCommitSearchIndexer' => 'applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php',
'PhabricatorRepositoryConfigOptions' => 'applications/repository/PhabricatorRepositoryConfigOptions.php', 'PhabricatorRepositoryConfigOptions' => 'applications/repository/config/PhabricatorRepositoryConfigOptions.php',
'PhabricatorRepositoryController' => 'applications/repository/controller/PhabricatorRepositoryController.php', 'PhabricatorRepositoryController' => 'applications/repository/controller/PhabricatorRepositoryController.php',
'PhabricatorRepositoryDAO' => 'applications/repository/storage/PhabricatorRepositoryDAO.php', 'PhabricatorRepositoryDAO' => 'applications/repository/storage/PhabricatorRepositoryDAO.php',
'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php', 'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,6 +15,10 @@ final class PhabricatorSMSConfigOptions
return 'fa-mobile'; return 'fa-mobile';
} }
public function getGroup() {
return 'core';
}
public function getOptions() { public function getOptions() {
$adapter_description = $this->deformat(pht(<<<EODOC $adapter_description = $this->deformat(pht(<<<EODOC
Adapter class to use to transmit SMS to an external provider. A given external 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'; return 'fa-lock';
} }
public function getGroup() {
return 'core';
}
public function getOptions() { public function getOptions() {
$support_href = PhabricatorEnv::getDoclink('Give Feedback! Get Support!'); $support_href = PhabricatorEnv::getDoclink('Give Feedback! Get Support!');

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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