diff --git a/conf/default.conf.php b/conf/default.conf.php index 647e97863b..43e4d35a57 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -836,6 +836,8 @@ return array( // eggs. 'phabricator.serious-business' => false, + // Should Phabricator show beta applications on the homepage + 'phabricator.show-beta-applications' => false, // -- Files ----------------------------------------------------------------- // diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index e707686e4b..bdd59e9585 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -2400,7 +2400,7 @@ celerity_register_resource_map(array( ), 'phabricator-application-launch-view-css' => array( - 'uri' => '/res/ed5d60cc/rsrc/css/application/base/phabricator-application-launch-view.css', + 'uri' => '/res/d6b6235b/rsrc/css/application/base/phabricator-application-launch-view.css', 'type' => 'css', 'requires' => array( diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 3f1a352f0b..2bf099ba88 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -62,6 +62,10 @@ abstract class PhabricatorApplication { return true; } + public function isBeta() { + return false; + } + public function getPHID() { return 'PHID-APPS-'.get_class($this); } diff --git a/src/applications/calendar/application/PhabricatorApplicationCalendar.php b/src/applications/calendar/application/PhabricatorApplicationCalendar.php index e61568b5ee..15c3016551 100644 --- a/src/applications/calendar/application/PhabricatorApplicationCalendar.php +++ b/src/applications/calendar/application/PhabricatorApplicationCalendar.php @@ -28,6 +28,10 @@ final class PhabricatorApplicationCalendar extends PhabricatorApplication { return self::GROUP_COMMUNICATION; } + public function isBeta() { + return true; + } + public function getRoutes() { return array( '/calendar/' => array( diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php index a80de1b154..68c8d48233 100644 --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -50,6 +50,12 @@ final class PhabricatorCoreConfigOptions ->addExample('America/Chicago', pht('US Central (CDT)')) ->addExample('America/Boise', pht('US Mountain (MDT)')) ->addExample('America/Los_Angeles', pht('US West (PDT)')), + $this->newOption('phabricator.show-beta-applications', 'bool', false) + ->setBoolOptions( + array( + pht('Visible'), + pht('Invisible') + ))->setDescription(pht('Show beta applications on the home page.')), $this->newOption('phabricator.serious-business', 'bool', false) ->setBoolOptions( array( diff --git a/src/applications/directory/controller/PhabricatorDirectoryController.php b/src/applications/directory/controller/PhabricatorDirectoryController.php index 041b88f14e..66dcc6c8bc 100644 --- a/src/applications/directory/controller/PhabricatorDirectoryController.php +++ b/src/applications/directory/controller/PhabricatorDirectoryController.php @@ -22,8 +22,13 @@ abstract class PhabricatorDirectoryController extends PhabricatorController { $nav->setBaseURI(new PhutilURI('/')); $applications = PhabricatorApplication::getAllInstalledApplications(); + $show_beta = + PhabricatorEnv::getEnvConfig('phabricator.show-beta-applications'); foreach ($applications as $key => $application) { + if (!$show_beta && $application->isBeta()) { + unset($applications[$key]); + } if (!$application->shouldAppearInLaunchView()) { // Remove hidden applications (usually internal stuff). unset($applications[$key]); diff --git a/src/applications/drydock/application/PhabricatorApplicationDrydock.php b/src/applications/drydock/application/PhabricatorApplicationDrydock.php index 23bc9877b7..02c41e2e2b 100644 --- a/src/applications/drydock/application/PhabricatorApplicationDrydock.php +++ b/src/applications/drydock/application/PhabricatorApplicationDrydock.php @@ -26,6 +26,10 @@ final class PhabricatorApplicationDrydock extends PhabricatorApplication { return self::GROUP_UTILITIES; } + public function isBeta() { + return true; + } + public function getRoutes() { return array( '/drydock/' => array( diff --git a/src/applications/fact/application/PhabricatorApplicationFact.php b/src/applications/fact/application/PhabricatorApplicationFact.php index 0246f35097..ac7b0c55ab 100644 --- a/src/applications/fact/application/PhabricatorApplicationFact.php +++ b/src/applications/fact/application/PhabricatorApplicationFact.php @@ -18,6 +18,10 @@ final class PhabricatorApplicationFact extends PhabricatorApplication { return self::GROUP_UTILITIES; } + public function isBeta() { + return true; + } + public function getRoutes() { return array( '/fact/' => array( diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php index 09b77611c7..101b240520 100644 --- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php +++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php @@ -37,6 +37,15 @@ final class PhabricatorApplicationLaunchView extends AphrontView { ), phutil_escape_html($application->getName())); + if ($application->isBeta()) { + $content[] = phutil_render_tag( + 'span', + array( + 'class' => 'phabricator-application-beta', + ), + "\xCE\xB2"); + } + if ($this->fullWidth) { $content[] = phutil_render_tag( 'span', diff --git a/src/applications/phame/application/PhabricatorApplicationPhame.php b/src/applications/phame/application/PhabricatorApplicationPhame.php index 72eb6366f8..3af2955dc8 100644 --- a/src/applications/phame/application/PhabricatorApplicationPhame.php +++ b/src/applications/phame/application/PhabricatorApplicationPhame.php @@ -26,6 +26,10 @@ final class PhabricatorApplicationPhame extends PhabricatorApplication { return self::GROUP_COMMUNICATION; } + public function isBeta() { + return true; + } + public function getRoutes() { return array( '/phame/' => array( diff --git a/src/applications/pholio/application/PhabricatorApplicationPholio.php b/src/applications/pholio/application/PhabricatorApplicationPholio.php index 707e77eac2..522eb17505 100644 --- a/src/applications/pholio/application/PhabricatorApplicationPholio.php +++ b/src/applications/pholio/application/PhabricatorApplicationPholio.php @@ -35,6 +35,10 @@ final class PhabricatorApplicationPholio extends PhabricatorApplication { return self::GROUP_COMMUNICATION; } + public function isBeta() { + return true; + } + public function getRoutes() { return array( '/M(?P[1-9]\d*)' => 'PholioMockViewController', diff --git a/src/applications/ponder/application/PhabricatorApplicationPonder.php b/src/applications/ponder/application/PhabricatorApplicationPonder.php index 4a6e55d5f8..e83b0fd89d 100644 --- a/src/applications/ponder/application/PhabricatorApplicationPonder.php +++ b/src/applications/ponder/application/PhabricatorApplicationPonder.php @@ -35,6 +35,10 @@ final class PhabricatorApplicationPonder extends PhabricatorApplication { return self::GROUP_COMMUNICATION; } + public function isBeta() { + return true; + } + public function getroutes() { return array( '/Q(?P[1-9]\d*)' => 'PonderQuestionViewController', diff --git a/webroot/rsrc/css/application/base/phabricator-application-launch-view.css b/webroot/rsrc/css/application/base/phabricator-application-launch-view.css index 15ca7b4a49..e67e14fdc4 100644 --- a/webroot/rsrc/css/application/base/phabricator-application-launch-view.css +++ b/webroot/rsrc/css/application/base/phabricator-application-launch-view.css @@ -90,11 +90,10 @@ a.phabricator-application-launch-container:hover { margin-left: 52px; } +.phabricator-application-beta, .phabricator-application-launch-attention { position: absolute; - right: 4px; top: 4px; - background: rgb(0, 122, 255); border-radius: 10px; color: white; font-weight: bold; @@ -104,7 +103,18 @@ a.phabricator-application-launch-container:hover { box-shadow: 0 0px 2px #000; } +.phabricator-application-launch-attention { + right: 4px; + background-color: rgb(0, 122, 255); +} + +.phabricator-application-beta { + left: 4px; + background-color: #ff8f00; +} + .application-tile-full .phabricator-application-launch-attention { top: 16px; right: 12px; } +