1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Use new Guide layout in Config->Welcome

Summary: Ref T11132, swaps in new UI for welcome page using guide modules

Test Plan: Test instance and non instance guides. Test each setting. Unclear on how to test people / Phacility. Just change the URL link?

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11132

Differential Revision: https://secure.phabricator.com/D16482
This commit is contained in:
Chad Little 2016-09-02 21:16:20 -07:00
parent 31c5f39506
commit 36fa4e5380
15 changed files with 176 additions and 602 deletions

View file

@ -42,7 +42,6 @@ return array(
'rsrc/css/application/config/config-options.css' => '0ede4c9b', 'rsrc/css/application/config/config-options.css' => '0ede4c9b',
'rsrc/css/application/config/config-page.css' => '8798e14f', 'rsrc/css/application/config/config-page.css' => '8798e14f',
'rsrc/css/application/config/config-template.css' => '8e6c6fcd', 'rsrc/css/application/config/config-template.css' => '8e6c6fcd',
'rsrc/css/application/config/config-welcome.css' => '035aa483',
'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3',
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '86396117', 'rsrc/css/application/conpherence/durable-column.css' => '86396117',
@ -549,7 +548,6 @@ return array(
'conduit-api-css' => '7bc725c4', 'conduit-api-css' => '7bc725c4',
'config-options-css' => '0ede4c9b', 'config-options-css' => '0ede4c9b',
'config-page-css' => '8798e14f', 'config-page-css' => '8798e14f',
'config-welcome-css' => '035aa483',
'conpherence-durable-column-view' => '86396117', 'conpherence-durable-column-view' => '86396117',
'conpherence-menu-css' => '90bdf85c', 'conpherence-menu-css' => '90bdf85c',
'conpherence-message-pane-css' => '5c7b7b17', 'conpherence-message-pane-css' => '5c7b7b17',

View file

@ -2210,7 +2210,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php', 'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php',
'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php', 'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php',
'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php', 'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php',
'PhabricatorConfigWelcomeController' => 'applications/config/controller/PhabricatorConfigWelcomeController.php',
'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php', 'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php',
'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php', 'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php',
'PhabricatorConpherenceNotificationsSetting' => 'applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php', 'PhabricatorConpherenceNotificationsSetting' => 'applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php',
@ -2646,7 +2645,6 @@ phutil_register_library_map(array(
'PhabricatorGuideModule' => 'applications/guides/module/PhabricatorGuideModule.php', 'PhabricatorGuideModule' => 'applications/guides/module/PhabricatorGuideModule.php',
'PhabricatorGuideModuleController' => 'applications/guides/controller/PhabricatorGuideModuleController.php', 'PhabricatorGuideModuleController' => 'applications/guides/controller/PhabricatorGuideModuleController.php',
'PhabricatorGuideQuickStartModule' => 'applications/guides/module/PhabricatorGuideQuickStartModule.php', 'PhabricatorGuideQuickStartModule' => 'applications/guides/module/PhabricatorGuideQuickStartModule.php',
'PhabricatorGuideWelcomeModule' => 'applications/guides/module/PhabricatorGuideWelcomeModule.php',
'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php', 'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php',
'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php', 'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php',
'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php', 'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php',
@ -6964,7 +6962,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorConfigValidationException' => 'Exception', 'PhabricatorConfigValidationException' => 'Exception',
'PhabricatorConfigVersionController' => 'PhabricatorConfigController', 'PhabricatorConfigVersionController' => 'PhabricatorConfigController',
'PhabricatorConfigWelcomeController' => 'PhabricatorConfigController',
'PhabricatorConpherenceApplication' => 'PhabricatorApplication', 'PhabricatorConpherenceApplication' => 'PhabricatorApplication',
'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting', 'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting',
'PhabricatorConpherenceNotificationsSetting' => 'PhabricatorSelectSetting', 'PhabricatorConpherenceNotificationsSetting' => 'PhabricatorSelectSetting',
@ -7464,7 +7461,6 @@ phutil_register_library_map(array(
'PhabricatorGuideModule' => 'Phobject', 'PhabricatorGuideModule' => 'Phobject',
'PhabricatorGuideModuleController' => 'PhabricatorGuideController', 'PhabricatorGuideModuleController' => 'PhabricatorGuideController',
'PhabricatorGuideQuickStartModule' => 'PhabricatorGuideModule', 'PhabricatorGuideQuickStartModule' => 'PhabricatorGuideModule',
'PhabricatorGuideWelcomeModule' => 'PhabricatorGuideModule',
'PhabricatorHTTPParameterTypeTableView' => 'AphrontView', 'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',
'PhabricatorHandleList' => array( 'PhabricatorHandleList' => array(
'Phobject', 'Phobject',

View file

@ -44,7 +44,6 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController', 'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController',
'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController', 'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController',
'version/' => 'PhabricatorConfigVersionController', 'version/' => 'PhabricatorConfigVersionController',
'welcome/' => 'PhabricatorConfigWelcomeController',
'database/'. 'database/'.
'(?:(?P<database>[^/]+)/'. '(?:(?P<database>[^/]+)/'.
'(?:(?P<table>[^/]+)/'. '(?:(?P<table>[^/]+)/'.

View file

@ -7,33 +7,47 @@ abstract class PhabricatorConfigController extends PhabricatorController {
} }
public function buildSideNavView($filter = null, $for_app = false) { public function buildSideNavView($filter = null, $for_app = false) {
$user = $this->getRequest()->getUser();
$guide_href = new PhutilURI('/guides/');
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel(pht('Configuration')); $nav->addLabel(pht('Configuration'));
$nav->addFilter('/', pht('Core Settings')); $nav->addFilter('/',
$nav->addFilter('application/', pht('Application Settings')); pht('Core Settings'), null, 'fa-gear');
$nav->addFilter('history/', pht('Settings History')); $nav->addFilter('application/',
$nav->addFilter('version/', pht('Version Information')); pht('Application Settings'), null, 'fa-globe');
$nav->addFilter('all/', pht('All Settings')); $nav->addFilter('history/',
pht('Settings History'), null, 'fa-history');
$nav->addFilter('version/',
pht('Version Information'), null, 'fa-download');
$nav->addFilter('all/',
pht('All Settings'), null, 'fa-list-ul');
$nav->addLabel(pht('Setup')); $nav->addLabel(pht('Setup'));
$nav->addFilter('issue/', pht('Setup Issues')); $nav->addFilter('issue/',
$nav->addFilter('welcome/', pht('Installation Guide')); pht('Setup Issues'), null, 'fa-warning');
$nav->addFilter(null,
pht('Installation Guide'), $guide_href, 'fa-book');
$nav->addLabel(pht('Database')); $nav->addLabel(pht('Database'));
$nav->addFilter('database/', pht('Database Status')); $nav->addFilter('database/',
$nav->addFilter('dbissue/', pht('Database Issues')); pht('Database Status'), null, 'fa-heartbeat');
$nav->addFilter('dbissue/',
pht('Database Issues'), null, 'fa-exclamation-circle');
$nav->addLabel(pht('Cache')); $nav->addLabel(pht('Cache'));
$nav->addFilter('cache/', pht('Cache Status')); $nav->addFilter('cache/',
pht('Cache Status'), null, 'fa-home');
$nav->addLabel(pht('Cluster')); $nav->addLabel(pht('Cluster'));
$nav->addFilter('cluster/databases/', pht('Database Servers')); $nav->addFilter('cluster/databases/',
$nav->addFilter('cluster/notifications/', pht('Notification Servers')); pht('Database Servers'), null, 'fa-database');
$nav->addFilter('cluster/repositories/', pht('Repository Servers')); $nav->addFilter('cluster/notifications/',
pht('Notification Servers'), null, 'fa-bell-o');
$nav->addFilter('cluster/repositories/',
pht('Repository Servers'), null, 'fa-code');
$nav->addLabel(pht('Modules')); $nav->addLabel(pht('Modules'));
$modules = PhabricatorConfigModule::getAllModules(); $modules = PhabricatorConfigModule::getAllModules();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
$nav->addFilter('module/'.$key.'/', $module->getModuleName()); $nav->addFilter('module/'.$key.'/',
$module->getModuleName(), null, 'fa-puzzle-piece');
} }
return $nav; return $nav;

View file

@ -1,411 +0,0 @@
<?php
final class PhabricatorConfigWelcomeController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('welcome/');
$title = pht('Installation Guide');
$header = id(new PHUIHeaderView())
->setHeader($title)
->setProfileHeader(true);
$crumbs = $this
->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$content = id(new PhabricatorConfigPageView())
->setHeader($header)
->setContent($this->buildWelcomeScreen($request));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content)
->addClass('white-background');
}
public function buildWelcomeScreen(AphrontRequest $request) {
$viewer = $request->getUser();
$this->requireResource('config-welcome-css');
$content = pht(
"=== Install Phabricator ===\n\n".
"You have successfully installed Phabricator. This screen will guide ".
"you through configuration and orientation. ".
"These steps are optional, and you can go through them in any order. ".
"If you want to get back to this screen later on, you can find it in ".
"the **Config** application under **Welcome Screen**.");
$setup = array();
$setup[] = $this->newItem(
$request,
'fa-check-square-o green',
$content);
$issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueKeys();
$setup_href = PhabricatorEnv::getURI('/config/issue/');
if ($issues_resolved) {
$content = pht(
"=== Resolve Setup Issues ===\n\n".
"You've resolved (or ignored) all outstanding setup issues. ".
"You can review issues in the **Config** application, under ".
"**[[ %s | Setup Issues ]]**.",
$setup_href);
$icon = 'fa-check-square-o green';
} else {
$content = pht(
"=== Resolve Setup Issues ===\n\n".
"You have some unresolved setup issues to take care of. Click ".
"the link in the yellow banner at the top of the screen to see ".
"them, or find them in the **Config** application under ".
"**[[ %s | Setup Issues ]]**. ".
"Although most setup issues should be resolved, sometimes an issue ".
"is not applicable to an install. ".
"If you don't intend to fix a setup issue (or don't want to fix ".
"it for now), you can use the \"Ignore\" action to mark it as ".
"something you don't plan to deal with.",
$setup_href);
$icon = 'fa-warning red';
}
$setup[] = $this->newItem(
$request,
$icon,
$content);
$configs = id(new PhabricatorAuthProviderConfigQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->execute();
$auth_href = PhabricatorEnv::getURI('/auth/');
$have_auth = (bool)$configs;
if ($have_auth) {
$content = pht(
"=== Login and Registration ===\n\n".
"You've configured at least one authentication provider, so users ".
"can register or log in. ".
"To configure more providers or adjust settings, use the ".
"**[[ %s | Auth Application ]]**.",
$auth_href);
$icon = 'fa-check-square-o green';
} else {
$content = pht(
"=== Login and Registration ===\n\n".
"You haven't configured any authentication providers yet. ".
"Authentication providers allow users to register accounts and ".
"log in to Phabricator. You can configure Phabricator to accept ".
"credentials like username and password, LDAP, or Google OAuth. ".
"You can configure authentication using the ".
"**[[ %s | Auth Application ]]**.",
$auth_href);
$icon = 'fa-warning red';
}
$setup[] = $this->newItem(
$request,
$icon,
$content);
$config_href = PhabricatorEnv::getURI('/config/');
// Just load any config value at all; if one exists the install has figured
// out how to configure things.
$have_config = (bool)id(new PhabricatorConfigEntry())->loadAllWhere(
'1 = 1 LIMIT 1');
if ($have_config) {
$content = pht(
"=== Configure Phabricator Settings ===\n\n".
"You've configured at least one setting from the web interface. ".
"To configure more settings later, use the ".
"**[[ %s | Config Application ]]**.",
$config_href);
$icon = 'fa-check-square-o green';
} else {
$content = pht(
"=== Configure Phabricator Settings ===\n\n".
'Many aspects of Phabricator are configurable. To explore and '.
'adjust settings, use the **[[ %s | Config Application ]]**.',
$config_href);
$icon = 'fa-info-circle';
}
$setup[] = $this->newItem(
$request,
$icon,
$content);
$settings_href = PhabricatorEnv::getURI('/settings/');
$preferences = id(new PhabricatorUserPreferencesQuery())
->setViewer($viewer)
->withUsers(array($viewer))
->executeOne();
$have_settings = ($preferences && $preferences->getPreferences());
if ($have_settings) {
$content = pht(
"=== Adjust Account Settings ===\n\n".
"You've adjusted at least one setting on your account. ".
"To make more adjustments, visit the ".
"**[[ %s | Settings Application ]]**.",
$settings_href);
$icon = 'fa-check-square-o green';
} else {
$content = pht(
"=== Adjust Account Settings ===\n\n".
'You can configure settings for your account by clicking the '.
'wrench icon in the main menu bar, or visiting the '.
'**[[ %s | Settings Application ]]** directly.',
$settings_href);
$icon = 'fa-info-circle';
}
$setup[] = $this->newItem(
$request,
$icon,
$content);
$dashboard_href = PhabricatorEnv::getURI('/dashboard/');
$have_dashboard = (bool)PhabricatorDashboardInstall::getDashboard(
$viewer,
PhabricatorHomeApplication::DASHBOARD_DEFAULT,
'PhabricatorHomeApplication');
if ($have_dashboard) {
$content = pht(
"=== Customize Home Page ===\n\n".
"You've installed a default dashboard to replace this welcome screen ".
"on the home page. ".
"You can still visit the welcome screen here at any time if you ".
"have steps you want to complete later, or if you feel lonely. ".
"If you've changed your mind about the dashboard you installed, ".
"you can install a different default dashboard with the ".
"**[[ %s | Dashboards Application ]]**.",
$dashboard_href);
$icon = 'fa-check-square-o green';
} else {
$content = pht(
"=== Customize Home Page ===\n\n".
"When you're done setting things up, you can create a custom ".
"dashboard and install it. Your dashboard will replace this ".
"welcome screen on the Phabricator home page. ".
"Dashboards can show users the information that's most important to ".
"your organization. You can configure them to display things like: ".
"a custom welcome message, a feed of recent activity, or a list of ".
"open tasks, waiting reviews, recent commits, and so on. ".
"After you install a default dashboard, it will replace this page. ".
"You can find this page later by visiting the **Config** ".
"application, under **Welcome Page**. ".
"To get started building a dashboard, use the ".
"**[[ %s | Dashboards Application ]]**. ",
$dashboard_href);
$icon = 'fa-info-circle';
}
$setup[] = $this->newItem(
$request,
$icon,
$content);
$apps_href = PhabricatorEnv::getURI('/applications/');
$content = pht(
"=== Explore Applications ===\n\n".
"Phabricator is a large suite of applications that work together to ".
"help you develop software, manage tasks, and communicate. A few of ".
"the most commonly used applications are pinned to the left navigation ".
"bar by default.\n\n".
"To explore all of the Phabricator applications, adjust settings, or ".
"uninstall applications you don't plan to use, visit the ".
"**[[ %s | Applications Application ]]**. You can also click the ".
"**Applications** button in the left navigation menu, or search for an ".
"application by name in the main menu bar. ",
$apps_href);
$explore = array();
$explore[] = $this->newItem(
$request,
'fa-globe',
$content);
// TODO: Restore some sort of "Support" link here, but just nuke it for
// now as we figure stuff out.
$differential_uri = PhabricatorEnv::getURI('/differential/');
$differential_create_uri = PhabricatorEnv::getURI(
'/differential/diff/create/');
$differential_all_uri = PhabricatorEnv::getURI('/differential/query/all/');
$differential_user_guide = PhabricatorEnv::getDoclink(
'Differential User Guide');
$differential_vs_uri = PhabricatorEnv::getDoclink(
'User Guide: Review vs Audit');
$quick = array();
$quick[] = $this->newItem(
$request,
'fa-gear',
pht(
"=== Quick Start: Code Review ===\n\n".
"Review code with **[[ %s | Differential ]]**. ".
"Engineers can use Differential to share, review, and approve ".
"changes to source code. ".
"To get started with code review:\n\n".
" - **[[ %s | Create a Revision ]]** //(Copy and paste a diff from ".
" the command line into the web UI to quickly get a feel for ".
" review.)//\n".
" - **[[ %s | View All Revisions ]]**\n\n".
"For more information, see these articles in the documentation:\n\n".
" - **[[ %s | Differential User Guide ]]**, for a general overview ".
" of Differential.\n".
" - **[[ %s | User Guide: Review vs Audit ]]**, for a discussion ".
" of different code review workflows.",
$differential_uri,
$differential_create_uri,
$differential_all_uri,
$differential_user_guide,
$differential_vs_uri));
$maniphest_uri = PhabricatorEnv::getURI('/maniphest/');
$maniphest_create_uri = PhabricatorEnv::getURI('/maniphest/task/edit/');
$maniphest_all_uri = PhabricatorEnv::getURI('/maniphest/query/all/');
$quick[] = $this->newItem(
$request,
'fa-anchor',
pht(
"=== Quick Start: Bugs and Tasks ===\n\n".
"Track bugs and tasks in Phabricator with ".
"**[[ %s | Maniphest ]]**. ".
"Users in all roles can use Maniphest to manage current and ".
"planned work and to track bugs and issues. ".
"To get started with bugs and tasks:\n\n".
" - **[[ %s | Create a Task ]]**\n".
" - **[[ %s | View All Tasks ]]**\n",
$maniphest_uri,
$maniphest_create_uri,
$maniphest_all_uri));
$pholio_uri = PhabricatorEnv::getURI('/pholio/');
$pholio_create_uri = PhabricatorEnv::getURI('/pholio/new/');
$pholio_all_uri = PhabricatorEnv::getURI('/pholio/query/all/');
$quick[] = $this->newItem(
$request,
'fa-camera-retro',
pht(
"=== Quick Start: Design Review ===\n\n".
"Review proposed designs with **[[ %s | Pholio ]]**. ".
"Designers can use Pholio to share images of what they're working on ".
"and show off things they've made. ".
"To get started with design review:\n\n".
" - **[[ %s | Create a Mock ]]**\n".
" - **[[ %s | View All Mocks ]]**",
$pholio_uri,
$pholio_create_uri,
$pholio_all_uri));
$diffusion_uri = PhabricatorEnv::getURI('/diffusion/edit/');
$diffusion_create_uri = PhabricatorEnv::getURI('/diffusion/create/');
$diffusion_all_uri = PhabricatorEnv::getURI('/diffusion/query/all/');
$diffusion_user_guide = PhabricatorEnv::getDoclink('Diffusion User Guide');
$diffusion_setup_guide = PhabricatorEnv::getDoclink(
'Diffusion User Guide: Repository Hosting');
$quick[] = $this->newItem(
$request,
'fa-code',
pht(
"=== Quick Start: Repositories ===\n\n".
"Manage and browse source code repositories with ".
"**[[ %s | Diffusion ]]**. ".
"Engineers can use Diffusion to browse and audit source code. ".
"You can configure Phabricator to host repositories, or have it ".
"track existing repositories hosted elsewhere (like GitHub, ".
"Bitbucket, or an internal server). ".
"To get started with repositories:\n\n".
" - **[[ %s | Create a New Repository ]]**\n".
" - **[[ %s | View All Repositories ]]**\n\n".
"For more information, see these articles in the documentation:\n\n".
" - **[[ %s | Diffusion User Guide ]]**, for a general overview of ".
" Diffusion.\n".
" - **[[ %s | Diffusion User Guide: Repository Hosting ]]**, ".
" for instructions on configuring repository hosting.\n\n".
"Phabricator supports Git, Mercurial and Subversion.",
$diffusion_uri,
$diffusion_create_uri,
$diffusion_all_uri,
$diffusion_user_guide,
$diffusion_setup_guide));
$setup_header = new PHUIRemarkupView(
$viewer, pht('=Setup and Configuration'));
$explore_header = new PHUIRemarkupView(
$viewer, pht('=Explore Phabricator'));
$quick_header = new PHUIRemarkupView(
$viewer, pht('=Quick Start Guide'));
$document = id(new PHUIDocumentViewPro())
->setFluid(true)
->appendChild($setup_header)
->appendChild($setup)
->appendChild($explore_header)
->appendChild($explore)
->appendChild($quick_header)
->appendChild($quick);
return id(new PHUIBoxView())
->appendChild($document);
}
private function newItem(AphrontRequest $request, $icon, $content) {
$viewer = $request->getUser();
$icon = id(new PHUIIconView())
->setIcon($icon.' fa-2x');
$content = new PHUIRemarkupView($viewer, $content);
$icon = phutil_tag(
'div',
array(
'class' => 'config-welcome-icon',
),
$icon);
$content = phutil_tag(
'div',
array(
'class' => 'config-welcome-content',
),
$content);
$view = phutil_tag(
'div',
array(
'class' => 'config-welcome-box grouped',
),
array(
$icon,
$content,
));
return $view;
}
}

View file

@ -18,10 +18,6 @@ final class PhabricatorGuideApplication extends PhabricatorApplication {
return 'fa-map-o'; return 'fa-map-o';
} }
public function isPrototype() {
return true;
}
public function getApplicationGroup() { public function getApplicationGroup() {
return self::GROUP_UTILITIES; return self::GROUP_UTILITIES;
} }

View file

@ -8,7 +8,7 @@ abstract class PhabricatorGuideController extends PhabricatorController {
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel(pht('Guides')); $nav->addLabel(pht('Guides'));
$modules = PhabricatorGuideModule::getAllModules(); $modules = PhabricatorGuideModule::getEnabledModules();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
$nav->addFilter($key.'/', $module->getModuleName()); $nav->addFilter($key.'/', $module->getModuleName());
} }

View file

@ -7,10 +7,11 @@ final class PhabricatorGuideModuleController
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$key = $request->getURIData('module'); $key = $request->getURIData('module');
$all_modules = PhabricatorGuideModule::getEnabledModules();
if (!$key) { if (!$key) {
$key = 'welcome'; $key = key($all_modules);
} }
$all_modules = PhabricatorGuideModule::getAllModules();
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter($key.'/'); $nav->selectFilter($key.'/');

View file

@ -14,6 +14,13 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
return 20; return 20;
} }
public function getIsModuleEnabled() {
if (PhabricatorEnv::getEnvConfig('cluster.instance')) {
return false;
}
return true;
}
public function renderModuleStatus(AphrontRequest $request) { public function renderModuleStatus(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
@ -25,13 +32,11 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
if ($issues_resolved) { if ($issues_resolved) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've resolved (or ignored) all outstanding setup issues."); "You've resolved (or ignored) all outstanding setup issues.");
} else { } else {
$icon = 'fa-warning'; $icon = 'fa-warning';
$icon_bg = 'bg-red'; $icon_bg = 'bg-red';
$skip = '#';
$description = $description =
pht('You have some unresolved setup issues to take care of.'); pht('You have some unresolved setup issues to take care of.');
} }
@ -41,7 +46,6 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
@ -55,13 +59,11 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
if ($have_auth) { if ($have_auth) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've configured at least one authentication provider."); "You've configured at least one authentication provider.");
} else { } else {
$icon = 'fa-key'; $icon = 'fa-key';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = pht( $description = pht(
'Authentication providers allow users to register accounts and '. 'Authentication providers allow users to register accounts and '.
'log in to Phabricator.'); 'log in to Phabricator.');
@ -72,7 +74,6 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
@ -88,13 +89,11 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
if ($have_config) { if ($have_config) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've configured at least one setting from the web interface."); "You've configured at least one setting from the web interface.");
} else { } else {
$icon = 'fa-sliders'; $icon = 'fa-sliders';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = pht( $description = pht(
'Learn how to configure mail and other options in Phabricator.'); 'Learn how to configure mail and other options in Phabricator.');
} }
@ -104,7 +103,6 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
@ -120,13 +118,11 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
if ($have_settings) { if ($have_settings) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've adjusted at least one setting on your account."); "You've adjusted at least one setting on your account.");
} else { } else {
$icon = 'fa-wrench'; $icon = 'fa-wrench';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = pht( $description = pht(
'Configure account settings for all users, or just yourself'); 'Configure account settings for all users, or just yourself');
} }
@ -136,25 +132,21 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
$title = pht('Notification Server'); $title = pht('Notification Server');
$href = PhabricatorEnv::getURI('/config/notifications/'); $href = PhabricatorEnv::getURI('/config/edit/notification.servers/');
// TODO: Wire up a notifications check $have_notifications = PhabricatorEnv::getEnvConfig('notification.servers');
$have_notifications = false;
if ($have_notifications) { if ($have_notifications) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've set up a real-time notification server."); "You've set up a real-time notification server.");
} else { } else {
$icon = 'fa-bell'; $icon = 'fa-bell';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = pht( $description = pht(
'Phabricator can deliver notifications in real-time with WebSockets.'); 'Phabricator can deliver notifications in real-time with WebSockets.');
} }
@ -164,12 +156,23 @@ final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
return $guide_items; $intro = pht(
'Phabricator has been successfully installed. These next guides will '.
'take you through configuration and new user orientation. '.
'These steps are optional, and you can go through them in any order. '.
'If you want to get back to this guide later on, you can find it in '.
'{icon globe} **Applications** under {icon map-o} **Guides**.');
$intro = new PHUIRemarkupView($viewer, $intro);
$intro = id(new PHUIDocumentViewPro())
->appendChild($intro);
return array($intro, $guide_items);
} }

View file

@ -5,6 +5,7 @@ abstract class PhabricatorGuideModule extends Phobject {
abstract public function getModuleKey(); abstract public function getModuleKey();
abstract public function getModuleName(); abstract public function getModuleName();
abstract public function getModulePosition(); abstract public function getModulePosition();
abstract public function getIsModuleEnabled();
abstract public function renderModuleStatus(AphrontRequest $request); abstract public function renderModuleStatus(AphrontRequest $request);
final public static function getAllModules() { final public static function getAllModules() {
@ -15,4 +16,13 @@ abstract class PhabricatorGuideModule extends Phobject {
->execute(); ->execute();
} }
final public static function getEnabledModules() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
->setUniqueMethod('getModuleKey')
->setSortMethod('getModulePosition')
->setFilterMethod('getIsModuleEnabled')
->execute();
}
} }

View file

@ -14,78 +14,29 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
return 30; return 30;
} }
public function getIsModuleEnabled() {
return true;
}
public function renderModuleStatus(AphrontRequest $request) { public function renderModuleStatus(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
$instance = PhabricatorEnv::getEnvConfig('cluster.instance');
$guide_items = new PhabricatorGuideListView(); $guide_items = new PhabricatorGuideListView();
$title = pht('Configure Applications');
$apps_check = true;
$href = PhabricatorEnv::getURI('/applications/');
if ($apps_check) {
$icon = 'fa-check';
$icon_bg = 'bg-green';
$skip = null;
$description = pht(
"You've uninstalled any unneeded applications for now.");
} else {
$icon = 'fa-globe';
$icon_bg = 'bg-sky';
$skip = '#';
$description =
pht('Use all our applications, or uninstall the ones you don\'t want.');
}
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description);
$guide_items->addItem($item);
$title = pht('Invite Collaborators');
$people_check = true;
$href = PhabricatorEnv::getURI('/people/invite/');
if ($people_check) {
$icon = 'fa-check';
$icon_bg = 'bg-green';
$skip = null;
$description = pht(
'You will not be alone on this journey.');
} else {
$icon = 'fa-group';
$icon_bg = 'bg-sky';
$skip = '#';
$description =
pht('Invite the rest of your team to get started on Phabricator.');
}
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description);
$guide_items->addItem($item);
$title = pht('Create a Repository'); $title = pht('Create a Repository');
$repository_check = true; $repository_check = id(new PhabricatorRepositoryQuery())
->setViewer($viewer)
->execute();
$href = PhabricatorEnv::getURI('/diffusion/'); $href = PhabricatorEnv::getURI('/diffusion/');
if ($repository_check) { if ($repository_check) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've created at least one repository."); "You've created at least one repository.");
} else { } else {
$icon = 'fa-code'; $icon = 'fa-code';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = $description =
pht('If you are here for code review, let\'s set up your first '. pht('If you are here for code review, let\'s set up your first '.
'repository.'); 'repository.');
@ -96,24 +47,23 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
$title = pht('Create a Project'); $title = pht('Create a Project');
$project_check = true; $project_check = id(new PhabricatorProjectQuery())
->setViewer($viewer)
->execute();
$href = PhabricatorEnv::getURI('/project/'); $href = PhabricatorEnv::getURI('/project/');
if ($project_check) { if ($project_check) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've created at least one project."); "You've created at least one project.");
} else { } else {
$icon = 'fa-briefcase'; $icon = 'fa-briefcase';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = $description =
pht('Project tags define everything. Create them for teams, tags, '. pht('Project tags define everything. Create them for teams, tags, '.
'or actual projects.'); 'or actual projects.');
@ -124,24 +74,49 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
$title = pht('Build a Dashboard'); $title = pht('Create a Task');
$dashboard_check = true; $task_check = id(new ManiphestTaskQuery())
$href = PhabricatorEnv::getURI('/dashboard/'); ->setViewer($viewer)
if ($dashboard_check) { ->execute();
$href = PhabricatorEnv::getURI('/maniphest/');
if ($task_check) {
$icon = 'fa-check';
$icon_bg = 'bg-green';
$description = pht(
"You've created at least one task.");
} else {
$icon = 'fa-anchor';
$icon_bg = 'bg-sky';
$description =
pht('Create some work for the interns in Maniphest.');
}
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setDescription($description);
$guide_items->addItem($item);
$title = pht('Build a Dashboard');
$have_dashboard = (bool)PhabricatorDashboardInstall::getDashboard(
$viewer,
PhabricatorHomeApplication::DASHBOARD_DEFAULT,
'PhabricatorHomeApplication');
$href = PhabricatorEnv::getURI('/dashboard/');
if ($have_dashboard) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
"You've created at least one dashboard."); "You've created at least one dashboard.");
} else { } else {
$icon = 'fa-dashboard'; $icon = 'fa-dashboard';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = $description =
pht('Customize the default homepage layout and items.'); pht('Customize the default homepage layout and items.');
} }
@ -151,24 +126,21 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
$title = pht('Personalize your Install'); $title = pht('Personalize your Install');
$ui_check = true; $wordmark = PhabricatorEnv::getEnvConfig('ui.logo');
$href = PhabricatorEnv::getURI('/config/group/ui/'); $href = PhabricatorEnv::getURI('/config/edit/ui.logo/');
if ($dashboard_check) { if ($wordmark) {
$icon = 'fa-check'; $icon = 'fa-check';
$icon_bg = 'bg-green'; $icon_bg = 'bg-green';
$skip = null;
$description = pht( $description = pht(
'It looks amazing, good work. Home Sweet Home.'); 'It looks amazing, good work. Home Sweet Home.');
} else { } else {
$icon = 'fa-home'; $icon = 'fa-home';
$icon_bg = 'bg-sky'; $icon_bg = 'bg-sky';
$skip = '#';
$description = $description =
pht('Change the name and add your company logo, just to give it a '. pht('Change the name and add your company logo, just to give it a '.
'little extra polish.'); 'little extra polish.');
@ -179,11 +151,65 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
->setHref($href) ->setHref($href)
->setIcon($icon) ->setIcon($icon)
->setIconBackground($icon_bg) ->setIconBackground($icon_bg)
->setSkipHref($skip)
->setDescription($description); ->setDescription($description);
$guide_items->addItem($item); $guide_items->addItem($item);
return $guide_items; $title = pht('Explore Applications');
$href = PhabricatorEnv::getURI('/applications/');
$icon = 'fa-globe';
$icon_bg = 'bg-sky';
$description =
pht('See all the applications included in Phabricator.');
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setDescription($description);
$guide_items->addItem($item);
if (!$instance) {
$title = pht('Invite Collaborators');
$people_check = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->execute();
$people = count($people_check);
$href = PhabricatorEnv::getURI('/people/invite/send/');
if ($people > 1) {
$icon = 'fa-check';
$icon_bg = 'bg-green';
$description = pht(
'Your invitations have been accepted. You will not be alone on '.
'this journey.');
} else {
$icon = 'fa-group';
$icon_bg = 'bg-sky';
$description =
pht('Invite the rest of your team to get started on Phabricator.');
}
}
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setDescription($description);
$guide_items->addItem($item);
$intro = pht(
'If your new to Phabricator, these optional steps can help you learn '.
'the basics. Conceptually, Phabricator is structured as a graph, and '.
'repositories, tasks, and projects are all independent from each other. '.
'Feel free to set up Phabricator for how you work best, and explore '.
'these features at your own pace.');
$intro = new PHUIRemarkupView($viewer, $intro);
$intro = id(new PHUIDocumentViewPro())
->appendChild($intro);
return array($intro, $guide_items);
} }

View file

@ -1,34 +0,0 @@
<?php
final class PhabricatorGuideWelcomeModule extends PhabricatorGuideModule {
public function getModuleKey() {
return 'welcome';
}
public function getModuleName() {
return pht('Welcome');
}
public function getModulePosition() {
return 10;
}
public function renderModuleStatus(AphrontRequest $request) {
$viewer = $request->getViewer();
$content = pht(
'You have successfully installed Phabricator. These next guides will '.
'take you through configuration and new user orientation. '.
'These steps are optional, and you can go through them in any order. '.
'If you want to get back to this guide later on, you can find it in '.
'the **Config** application under **Welcome Guide**.');
$content = new PHUIRemarkupView($viewer, $content);
return id(new PHUIDocumentViewPro())
->appendChild($content);
}
}

View file

@ -209,7 +209,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController {
$content = pht(<<<EOT $content = pht(<<<EOT
Welcome to Phabricator, here are some links to get you started: Welcome to Phabricator, here are some links to get you started:
- [[ /config/ | Configure Phabricator ]] - [[ /config/ | Configure Phabricator ]]
- [[ /config/welcome/ | Quick Start Guide ]] - [[ /guides/ | Quick Start Guide ]]
- [[ /diffusion/ | Create a Repository ]] - [[ /diffusion/ | Create a Repository ]]
- [[ /people/invite/send/ | Invite People ]] - [[ /people/invite/send/ | Invite People ]]
- [[ https://twitter.com/phabricator/ | Follow us on Twitter ]] - [[ https://twitter.com/phabricator/ | Follow us on Twitter ]]
@ -218,7 +218,7 @@ EOT
} else { } else {
$content = pht(<<<EOT $content = pht(<<<EOT
Welcome to Phabricator, here are some links to get you started: Welcome to Phabricator, here are some links to get you started:
- [[ /config/welcome/ | Quick Start Guide ]] - [[ /guides/ | Quick Start Guide ]]
- [[ /diffusion/ | Create a Repository ]] - [[ /diffusion/ | Create a Repository ]]
- [[ https://twitter.com/phabricator/ | Follow us on Twitter ]] - [[ https://twitter.com/phabricator/ | Follow us on Twitter ]]
EOT EOT

View file

@ -95,9 +95,9 @@ final class AphrontSideNavFilterView extends AphrontView {
return $this->menu; return $this->menu;
} }
public function addFilter($key, $name, $uri = null) { public function addFilter($key, $name, $uri = null, $icon = null) {
return $this->addThing( return $this->addThing(
$key, $name, $uri, PHUIListItemView::TYPE_LINK); $key, $name, $uri, PHUIListItemView::TYPE_LINK, $icon);
} }
public function addButton($key, $name, $uri = null) { public function addButton($key, $name, $uri = null) {
@ -105,11 +105,15 @@ final class AphrontSideNavFilterView extends AphrontView {
$key, $name, $uri, PHUIListItemView::TYPE_BUTTON); $key, $name, $uri, PHUIListItemView::TYPE_BUTTON);
} }
private function addThing($key, $name, $uri, $type) { private function addThing($key, $name, $uri, $type, $icon) {
$item = id(new PHUIListItemView()) $item = id(new PHUIListItemView())
->setName($name) ->setName($name)
->setType($type); ->setType($type);
if (strlen($icon)) {
$item->setIcon($icon);
}
if (strlen($key)) { if (strlen($key)) {
$item->setKey($key); $item->setKey($key);

View file

@ -1,28 +0,0 @@
/**
* @provides config-welcome-css
*/
.phui-document-content .config-welcome-box .phabricator-remarkup {
padding: 0 16px 16px;
position: relative;
}
.config-welcome-box {
padding: 8px 0;
}
.config-welcome-content {
margin-left: 44px;
}
.config-welcome-box .config-welcome-icon {
width: 32px;
float: left;
text-align: center;
}
.phui-document-view-pro .phui-document-content .config-welcome-box
.phabricator-remarkup {
margin: 0;
padding: 0;
}