From cb481f36c54b1473b5e4c5b59daa4d97e7055c7e Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 26 Nov 2019 15:25:58 -0800 Subject: [PATCH] Carve out a separate "Services" section of Config Summary: Depends on D20930. Ref T13362. Put all the "Services" parts of Config in their own section. Test Plan: Clicked through each section. This is just an organization / UI change with no significant behavioral impact. Maniphest Tasks: T13362 Differential Revision: https://secure.phabricator.com/D20931 --- src/__phutil_library_map__.php | 30 ++++---- .../PhabricatorConfigController.php | 17 ----- .../PhabricatorConfigCacheController.php | 15 ++-- ...icatorConfigClusterDatabasesController.php | 12 ++-- ...orConfigClusterNotificationsController.php | 14 ++-- ...torConfigClusterRepositoriesController.php | 14 ++-- ...abricatorConfigClusterSearchController.php | 14 ++-- .../PhabricatorConfigDatabaseController.php | 2 +- ...abricatorConfigDatabaseIssueController.php | 7 +- ...bricatorConfigDatabaseStatusController.php | 6 +- .../PhabricatorConfigServicesController.php | 69 +++++++++++++++++++ 11 files changed, 122 insertions(+), 78 deletions(-) rename src/applications/config/controller/{ => services}/PhabricatorConfigCacheController.php (93%) rename src/applications/config/controller/{ => services}/PhabricatorConfigClusterDatabasesController.php (95%) rename src/applications/config/controller/{ => services}/PhabricatorConfigClusterNotificationsController.php (94%) rename src/applications/config/controller/{ => services}/PhabricatorConfigClusterRepositoriesController.php (97%) rename src/applications/config/controller/{ => services}/PhabricatorConfigClusterSearchController.php (92%) rename src/applications/config/controller/{ => services}/PhabricatorConfigDatabaseController.php (95%) rename src/applications/config/controller/{ => services}/PhabricatorConfigDatabaseIssueController.php (96%) rename src/applications/config/controller/{ => services}/PhabricatorConfigDatabaseStatusController.php (99%) create mode 100644 src/applications/config/controller/services/PhabricatorConfigServicesController.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 9b042e024a..da9c6e1fb5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2801,22 +2801,22 @@ phutil_register_library_map(array( 'PhabricatorConfigAllController' => 'applications/config/controller/PhabricatorConfigAllController.php', 'PhabricatorConfigApplication' => 'applications/config/application/PhabricatorConfigApplication.php', 'PhabricatorConfigApplicationController' => 'applications/config/controller/PhabricatorConfigApplicationController.php', - 'PhabricatorConfigCacheController' => 'applications/config/controller/PhabricatorConfigCacheController.php', - 'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/PhabricatorConfigClusterDatabasesController.php', - 'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/PhabricatorConfigClusterNotificationsController.php', - 'PhabricatorConfigClusterRepositoriesController' => 'applications/config/controller/PhabricatorConfigClusterRepositoriesController.php', - 'PhabricatorConfigClusterSearchController' => 'applications/config/controller/PhabricatorConfigClusterSearchController.php', + 'PhabricatorConfigCacheController' => 'applications/config/controller/services/PhabricatorConfigCacheController.php', + 'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php', + 'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php', + 'PhabricatorConfigClusterRepositoriesController' => 'applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php', + 'PhabricatorConfigClusterSearchController' => 'applications/config/controller/services/PhabricatorConfigClusterSearchController.php', 'PhabricatorConfigCollectorsModule' => 'applications/config/module/PhabricatorConfigCollectorsModule.php', 'PhabricatorConfigColumnSchema' => 'applications/config/schema/PhabricatorConfigColumnSchema.php', 'PhabricatorConfigConfigPHIDType' => 'applications/config/phid/PhabricatorConfigConfigPHIDType.php', 'PhabricatorConfigConstants' => 'applications/config/constants/PhabricatorConfigConstants.php', 'PhabricatorConfigController' => 'applications/config/controller/PhabricatorConfigController.php', 'PhabricatorConfigCoreSchemaSpec' => 'applications/config/schema/PhabricatorConfigCoreSchemaSpec.php', - 'PhabricatorConfigDatabaseController' => 'applications/config/controller/PhabricatorConfigDatabaseController.php', - 'PhabricatorConfigDatabaseIssueController' => 'applications/config/controller/PhabricatorConfigDatabaseIssueController.php', + 'PhabricatorConfigDatabaseController' => 'applications/config/controller/services/PhabricatorConfigDatabaseController.php', + 'PhabricatorConfigDatabaseIssueController' => 'applications/config/controller/services/PhabricatorConfigDatabaseIssueController.php', 'PhabricatorConfigDatabaseSchema' => 'applications/config/schema/PhabricatorConfigDatabaseSchema.php', 'PhabricatorConfigDatabaseSource' => 'infrastructure/env/PhabricatorConfigDatabaseSource.php', - 'PhabricatorConfigDatabaseStatusController' => 'applications/config/controller/PhabricatorConfigDatabaseStatusController.php', + 'PhabricatorConfigDatabaseStatusController' => 'applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php', 'PhabricatorConfigDefaultSource' => 'infrastructure/env/PhabricatorConfigDefaultSource.php', 'PhabricatorConfigDictionarySource' => 'infrastructure/env/PhabricatorConfigDictionarySource.php', 'PhabricatorConfigEdgeModule' => 'applications/config/module/PhabricatorConfigEdgeModule.php', @@ -2861,6 +2861,7 @@ phutil_register_library_map(array( 'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php', 'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php', 'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php', + 'PhabricatorConfigServicesController' => 'applications/config/controller/services/PhabricatorConfigServicesController.php', 'PhabricatorConfigSetupCheckModule' => 'applications/config/module/PhabricatorConfigSetupCheckModule.php', 'PhabricatorConfigSiteModule' => 'applications/config/module/PhabricatorConfigSiteModule.php', 'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php', @@ -9134,18 +9135,18 @@ phutil_register_library_map(array( 'PhabricatorConfigAllController' => 'PhabricatorConfigController', 'PhabricatorConfigApplication' => 'PhabricatorApplication', 'PhabricatorConfigApplicationController' => 'PhabricatorConfigController', - 'PhabricatorConfigCacheController' => 'PhabricatorConfigController', - 'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigController', - 'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigController', - 'PhabricatorConfigClusterRepositoriesController' => 'PhabricatorConfigController', - 'PhabricatorConfigClusterSearchController' => 'PhabricatorConfigController', + 'PhabricatorConfigCacheController' => 'PhabricatorConfigServicesController', + 'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigServicesController', + 'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigServicesController', + 'PhabricatorConfigClusterRepositoriesController' => 'PhabricatorConfigServicesController', + 'PhabricatorConfigClusterSearchController' => 'PhabricatorConfigServicesController', 'PhabricatorConfigCollectorsModule' => 'PhabricatorConfigModule', 'PhabricatorConfigColumnSchema' => 'PhabricatorConfigStorageSchema', 'PhabricatorConfigConfigPHIDType' => 'PhabricatorPHIDType', 'PhabricatorConfigConstants' => 'Phobject', 'PhabricatorConfigController' => 'PhabricatorController', 'PhabricatorConfigCoreSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'PhabricatorConfigDatabaseController' => 'PhabricatorConfigController', + 'PhabricatorConfigDatabaseController' => 'PhabricatorConfigServicesController', 'PhabricatorConfigDatabaseIssueController' => 'PhabricatorConfigDatabaseController', 'PhabricatorConfigDatabaseSchema' => 'PhabricatorConfigStorageSchema', 'PhabricatorConfigDatabaseSource' => 'PhabricatorConfigProxySource', @@ -9198,6 +9199,7 @@ phutil_register_library_map(array( 'PhabricatorConfigSchemaQuery' => 'Phobject', 'PhabricatorConfigSchemaSpec' => 'Phobject', 'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema', + 'PhabricatorConfigServicesController' => 'PhabricatorConfigController', 'PhabricatorConfigSetupCheckModule' => 'PhabricatorConfigModule', 'PhabricatorConfigSiteModule' => 'PhabricatorConfigModule', 'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource', diff --git a/src/applications/config/controller/PhabricatorConfigController.php b/src/applications/config/controller/PhabricatorConfigController.php index 0b2a67a17f..1aa9946236 100644 --- a/src/applications/config/controller/PhabricatorConfigController.php +++ b/src/applications/config/controller/PhabricatorConfigController.php @@ -25,23 +25,6 @@ abstract class PhabricatorConfigController extends PhabricatorController { pht('Setup Issues'), null, 'fa-warning'); $nav->addFilter(null, pht('Installation Guide'), $guide_href, 'fa-book'); - $nav->addLabel(pht('Database')); - $nav->addFilter('database/', - pht('Database Status'), null, 'fa-heartbeat'); - $nav->addFilter('dbissue/', - pht('Database Issues'), null, 'fa-exclamation-circle'); - $nav->addLabel(pht('Cache')); - $nav->addFilter('cache/', - pht('Cache Status'), null, 'fa-home'); - $nav->addLabel(pht('Cluster')); - $nav->addFilter('cluster/databases/', - pht('Database Servers'), null, 'fa-database'); - $nav->addFilter('cluster/notifications/', - pht('Notification Servers'), null, 'fa-bell-o'); - $nav->addFilter('cluster/repositories/', - pht('Repository Servers'), null, 'fa-code'); - $nav->addFilter('cluster/search/', - pht('Search Servers'), null, 'fa-search'); return $nav; } diff --git a/src/applications/config/controller/PhabricatorConfigCacheController.php b/src/applications/config/controller/services/PhabricatorConfigCacheController.php similarity index 93% rename from src/applications/config/controller/PhabricatorConfigCacheController.php rename to src/applications/config/controller/services/PhabricatorConfigCacheController.php index 36642657c9..e79eac07bb 100644 --- a/src/applications/config/controller/PhabricatorConfigCacheController.php +++ b/src/applications/config/controller/services/PhabricatorConfigCacheController.php @@ -1,13 +1,11 @@ getViewer(); - $nav = $this->buildSideNavView(); - $nav->selectFilter('cache/'); $purge_button = id(new PHUIButtonView()) ->setText(pht('Purge Caches')) @@ -27,14 +25,15 @@ final class PhabricatorConfigCacheController $data_box, ); - $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($title) - ->setBorder(true); + $crumbs = $this->newCrumbs() + ->addTextCrumb($title); $content = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($page); + $nav = $this->newNavigation('cache'); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) @@ -92,10 +91,12 @@ final class PhabricatorConfigCacheController 'n', 'n', )); + + $table = $this->buildConfigBoxView(pht('Cache Storage'), $table); } $properties = $this->buildConfigBoxView(pht('Data Cache'), $properties); - $table = $this->buildConfigBoxView(pht('Cache Storage'), $table); + return array($properties, $table); } diff --git a/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php b/src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php similarity index 95% rename from src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php rename to src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php index 417fa9d3a1..ca22698212 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php +++ b/src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php @@ -1,13 +1,12 @@ buildSideNavView(); - $nav->selectFilter('cluster/databases/'); + $nav = $this->newNavigation('database-servers'); - $title = pht('Cluster Database Status'); + $title = pht('Database Servers'); $doc_href = PhabricatorEnv::getDoclink('Cluster: Databases'); $button = id(new PHUIButtonView()) ->setIcon('fa-book') @@ -20,9 +19,8 @@ final class PhabricatorConfigClusterDatabasesController $database_status = $this->buildClusterDatabaseStatus(); $status = $this->buildConfigBoxView(pht('Status'), $database_status); - $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($title) - ->setBorder(true); + $crumbs = $this->newCrumbs() + ->addTextCrumb($title); $content = id(new PHUITwoColumnView()) ->setHeader($header) diff --git a/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php b/src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php similarity index 94% rename from src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php rename to src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php index e9f64d411a..ba4185984a 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php +++ b/src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php @@ -1,13 +1,10 @@ buildSideNavView(); - $nav->selectFilter('cluster/notifications/'); - - $title = pht('Cluster Notifications'); + $title = pht('Notification Servers'); $doc_href = PhabricatorEnv::getDoclink('Cluster: Notifications'); $button = id(new PHUIButtonView()) ->setIcon('fa-book') @@ -22,14 +19,15 @@ final class PhabricatorConfigClusterNotificationsController pht('Notifications Status'), $notification_status); - $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($title) - ->setBorder(true); + $crumbs = $this->newCrumbs() + ->addTextCrumb($title); $content = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($status); + $nav = $this->newNavigation('notification-servers'); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) diff --git a/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php b/src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php similarity index 97% rename from src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php rename to src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php index eb83a28a2a..d6ebc314f2 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php +++ b/src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php @@ -1,13 +1,10 @@ buildSideNavView(); - $nav->selectFilter('cluster/repositories/'); - - $title = pht('Cluster Repository Status'); + $title = pht('Repository Services'); $doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories'); $button = id(new PHUIButtonView()) @@ -26,9 +23,8 @@ final class PhabricatorConfigClusterRepositoriesController $repo_errors = $this->buildConfigBoxView( pht('Repository Errors'), $repository_errors); - $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($title) - ->setBorder(true); + $crumbs = $this->newCrumbs() + ->addTextCrumb($title); $content = id(new PHUITwoColumnView()) ->setHeader($header) @@ -38,6 +34,8 @@ final class PhabricatorConfigClusterRepositoriesController $repo_errors, )); + $nav = $this->newNavigation('repository-servers'); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) diff --git a/src/applications/config/controller/PhabricatorConfigClusterSearchController.php b/src/applications/config/controller/services/PhabricatorConfigClusterSearchController.php similarity index 92% rename from src/applications/config/controller/PhabricatorConfigClusterSearchController.php rename to src/applications/config/controller/services/PhabricatorConfigClusterSearchController.php index 55caeb1cad..5e877d6b95 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterSearchController.php +++ b/src/applications/config/controller/services/PhabricatorConfigClusterSearchController.php @@ -1,13 +1,10 @@ buildSideNavView(); - $nav->selectFilter('cluster/search/'); - - $title = pht('Cluster Search'); + $title = pht('Search Servers'); $doc_href = PhabricatorEnv::getDoclink('Cluster: Search'); $button = id(new PHUIButtonView()) @@ -20,14 +17,15 @@ final class PhabricatorConfigClusterSearchController $search_status = $this->buildClusterSearchStatus(); - $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($title) - ->setBorder(true); + $crumbs = $this->newCrumbs() + ->addTextCrumb($title); $content = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($search_status); + $nav = $this->newNavigation('search-servers'); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) diff --git a/src/applications/config/controller/PhabricatorConfigDatabaseController.php b/src/applications/config/controller/services/PhabricatorConfigDatabaseController.php similarity index 95% rename from src/applications/config/controller/PhabricatorConfigDatabaseController.php rename to src/applications/config/controller/services/PhabricatorConfigDatabaseController.php index 53af9a6b92..eb08164636 100644 --- a/src/applications/config/controller/PhabricatorConfigDatabaseController.php +++ b/src/applications/config/controller/services/PhabricatorConfigDatabaseController.php @@ -1,7 +1,7 @@ buildHeaderView($title); - $nav = $this->buildSideNavView(); - $nav->selectFilter('dbissue/'); + $nav = $this->newNavigation('schemata-issues'); $view = $this->buildConfigBoxView(pht('Issues'), $table); - $crumbs = $this->buildApplicationCrumbs() + $crumbs = $this->newCrumbs() ->addTextCrumb($title) ->setBorder(true); diff --git a/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php b/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php similarity index 99% rename from src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php rename to src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php index 6831a048d5..09f4f344b5 100644 --- a/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php +++ b/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php @@ -71,8 +71,7 @@ final class PhabricatorConfigDatabaseStatusController } private function buildResponse($title, $body) { - $nav = $this->buildSideNavView(); - $nav->selectFilter('database/'); + $nav = $this->newNavigation('schemata'); if (!$title) { $title = pht('Database Status'); @@ -118,8 +117,7 @@ final class PhabricatorConfigDatabaseStatusController ); } - $crumbs = $this->buildApplicationCrumbs(); - $crumbs->setBorder(true); + $crumbs = $this->newCrumbs(); $last_key = last_key($links); foreach ($links as $link_key => $link) { diff --git a/src/applications/config/controller/services/PhabricatorConfigServicesController.php b/src/applications/config/controller/services/PhabricatorConfigServicesController.php new file mode 100644 index 0000000000..376849d6b7 --- /dev/null +++ b/src/applications/config/controller/services/PhabricatorConfigServicesController.php @@ -0,0 +1,69 @@ +getApplicationURI(); + + $nav = id(new AphrontSideNavFilterView()) + ->setBaseURI(new PhutilURI($services_uri)); + + $nav->addLabel(pht('Databases')); + + $nav->newLink('database-servers') + ->setName(pht('Database Servers')) + ->setIcon('fa-database') + ->setHref(urisprintf('%s%s/', $services_uri, 'cluster/databases')); + + $nav->newLink('schemata') + ->setName(pht('Database Schemata')) + ->setIcon('fa-table') + ->setHref(urisprintf('%s%s/', $services_uri, 'database')); + + $nav->newLink('schemata-issues') + ->setName(pht('Schemata Issues')) + ->setIcon('fa-exclamation-circle') + ->setHref(urisprintf('%s%s/', $services_uri, 'dbissue')); + + + $nav->addLabel(pht('Cache')); + + $nav->newLink('cache') + ->setName(pht('Cache Status')) + ->setIcon('fa-archive') + ->setHref(urisprintf('%s%s/', $services_uri, 'cache')); + + $nav->addLabel(pht('Other Services')); + + $nav->newLink('notification-servers') + ->setName(pht('Notification Servers')) + ->setIcon('fa-bell-o') + ->setHref(urisprintf('%s%s/', $services_uri, 'cluster/notifications')); + + $nav->newLink('repository-servers') + ->setName(pht('Repository Servers')) + ->setIcon('fa-code') + ->setHref(urisprintf('%s%s/', $services_uri, 'cluster/repositories')); + + $nav->newLink('search-servers') + ->setName(pht('Search Servers')) + ->setIcon('fa-search') + ->setHref(urisprintf('%s%s/', $services_uri, 'cluster/search')); + + if ($select_filter) { + $nav->selectFilter($select_filter); + } + + return $nav; + } + + public function newCrumbs() { + $services_uri = $this->getApplicationURI('cluster/databases/'); + + return $this->buildApplicationCrumbs() + ->addTextCrumb(pht('Services')) + ->setBorder(true); + } + +}