mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 10:52:41 +01:00
Added beta status for applications
Summary: Fixes T2338 Test Plan: bjhb Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, chad Maniphest Tasks: T2338 Differential Revision: https://secure.phabricator.com/D4529
This commit is contained in:
parent
2888d58034
commit
2a6060a763
13 changed files with 63 additions and 3 deletions
|
@ -836,6 +836,8 @@ return array(
|
||||||
// eggs.
|
// eggs.
|
||||||
'phabricator.serious-business' => false,
|
'phabricator.serious-business' => false,
|
||||||
|
|
||||||
|
// Should Phabricator show beta applications on the homepage
|
||||||
|
'phabricator.show-beta-applications' => false,
|
||||||
|
|
||||||
// -- Files ----------------------------------------------------------------- //
|
// -- Files ----------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
|
@ -2400,7 +2400,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-application-launch-view-css' =>
|
'phabricator-application-launch-view-css' =>
|
||||||
array(
|
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',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -62,6 +62,10 @@ abstract class PhabricatorApplication {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getPHID() {
|
public function getPHID() {
|
||||||
return 'PHID-APPS-'.get_class($this);
|
return 'PHID-APPS-'.get_class($this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,10 @@ final class PhabricatorApplicationCalendar extends PhabricatorApplication {
|
||||||
return self::GROUP_COMMUNICATION;
|
return self::GROUP_COMMUNICATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/calendar/' => array(
|
'/calendar/' => array(
|
||||||
|
|
|
@ -50,6 +50,12 @@ final class PhabricatorCoreConfigOptions
|
||||||
->addExample('America/Chicago', pht('US Central (CDT)'))
|
->addExample('America/Chicago', pht('US Central (CDT)'))
|
||||||
->addExample('America/Boise', pht('US Mountain (MDT)'))
|
->addExample('America/Boise', pht('US Mountain (MDT)'))
|
||||||
->addExample('America/Los_Angeles', pht('US West (PDT)')),
|
->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)
|
$this->newOption('phabricator.serious-business', 'bool', false)
|
||||||
->setBoolOptions(
|
->setBoolOptions(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -22,8 +22,13 @@ abstract class PhabricatorDirectoryController extends PhabricatorController {
|
||||||
$nav->setBaseURI(new PhutilURI('/'));
|
$nav->setBaseURI(new PhutilURI('/'));
|
||||||
|
|
||||||
$applications = PhabricatorApplication::getAllInstalledApplications();
|
$applications = PhabricatorApplication::getAllInstalledApplications();
|
||||||
|
$show_beta =
|
||||||
|
PhabricatorEnv::getEnvConfig('phabricator.show-beta-applications');
|
||||||
|
|
||||||
foreach ($applications as $key => $application) {
|
foreach ($applications as $key => $application) {
|
||||||
|
if (!$show_beta && $application->isBeta()) {
|
||||||
|
unset($applications[$key]);
|
||||||
|
}
|
||||||
if (!$application->shouldAppearInLaunchView()) {
|
if (!$application->shouldAppearInLaunchView()) {
|
||||||
// Remove hidden applications (usually internal stuff).
|
// Remove hidden applications (usually internal stuff).
|
||||||
unset($applications[$key]);
|
unset($applications[$key]);
|
||||||
|
|
|
@ -26,6 +26,10 @@ final class PhabricatorApplicationDrydock extends PhabricatorApplication {
|
||||||
return self::GROUP_UTILITIES;
|
return self::GROUP_UTILITIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/drydock/' => array(
|
'/drydock/' => array(
|
||||||
|
|
|
@ -18,6 +18,10 @@ final class PhabricatorApplicationFact extends PhabricatorApplication {
|
||||||
return self::GROUP_UTILITIES;
|
return self::GROUP_UTILITIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/fact/' => array(
|
'/fact/' => array(
|
||||||
|
|
|
@ -37,6 +37,15 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
||||||
),
|
),
|
||||||
phutil_escape_html($application->getName()));
|
phutil_escape_html($application->getName()));
|
||||||
|
|
||||||
|
if ($application->isBeta()) {
|
||||||
|
$content[] = phutil_render_tag(
|
||||||
|
'span',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-application-beta',
|
||||||
|
),
|
||||||
|
"\xCE\xB2");
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->fullWidth) {
|
if ($this->fullWidth) {
|
||||||
$content[] = phutil_render_tag(
|
$content[] = phutil_render_tag(
|
||||||
'span',
|
'span',
|
||||||
|
|
|
@ -26,6 +26,10 @@ final class PhabricatorApplicationPhame extends PhabricatorApplication {
|
||||||
return self::GROUP_COMMUNICATION;
|
return self::GROUP_COMMUNICATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/phame/' => array(
|
'/phame/' => array(
|
||||||
|
|
|
@ -35,6 +35,10 @@ final class PhabricatorApplicationPholio extends PhabricatorApplication {
|
||||||
return self::GROUP_COMMUNICATION;
|
return self::GROUP_COMMUNICATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/M(?P<id>[1-9]\d*)' => 'PholioMockViewController',
|
'/M(?P<id>[1-9]\d*)' => 'PholioMockViewController',
|
||||||
|
|
|
@ -35,6 +35,10 @@ final class PhabricatorApplicationPonder extends PhabricatorApplication {
|
||||||
return self::GROUP_COMMUNICATION;
|
return self::GROUP_COMMUNICATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isBeta() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function getroutes() {
|
public function getroutes() {
|
||||||
return array(
|
return array(
|
||||||
'/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController',
|
'/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController',
|
||||||
|
|
|
@ -90,11 +90,10 @@ a.phabricator-application-launch-container:hover {
|
||||||
margin-left: 52px;
|
margin-left: 52px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phabricator-application-beta,
|
||||||
.phabricator-application-launch-attention {
|
.phabricator-application-launch-attention {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 4px;
|
|
||||||
top: 4px;
|
top: 4px;
|
||||||
background: rgb(0, 122, 255);
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -104,7 +103,18 @@ a.phabricator-application-launch-container:hover {
|
||||||
box-shadow: 0 0px 2px #000;
|
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 {
|
.application-tile-full .phabricator-application-launch-attention {
|
||||||
top: 16px;
|
top: 16px;
|
||||||
right: 12px;
|
right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue