Fix some beta/install Application issues

Summary:
Currently, we give you an "Install" button for Beta apps even when "phabricator.show-beta-applications" is disabled. This is unclear.

Instead, disable the button and tell the user about the config when it is clicked.

Arguably, we should restructure this so you can selectively install "Beta" apps without setting the config, but almost all the beta apps are terrible so just make things consistent for now.

Test Plan: Tried to install a beta app without beta apps enabled.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D5652
This commit is contained in:
epriestley
2013-04-10 14:52:20 -07:00
parent 9087e4805e
commit 9bbce8de42
2 changed files with 36 additions and 17 deletions

View File

@@ -36,7 +36,6 @@ final class PhabricatorApplicationDetailViewController
if ($selected->isInstalled()) {
$status_tag->setName(pht('Installed'));
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN);
} else {
$status_tag->setName(pht('Uninstalled'));
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_RED);
@@ -50,7 +49,6 @@ final class PhabricatorApplicationDetailViewController
$header->addTag($beta_tag);
}
$header->addTag($status_tag);
$properties = $this->buildPropertyView($selected);
@@ -93,13 +91,20 @@ final class PhabricatorApplicationDetailViewController
->setHref(
$this->getApplicationURI(get_class($selected).'/uninstall/')));
} else {
$view->addAction(
id(new PhabricatorActionView())
->setName(pht('Install'))
->setIcon('new')
->setWorkflow(true)
->setHref(
$this->getApplicationURI(get_class($selected).'/install/')));
$action = id(new PhabricatorActionView())
->setName(pht('Install'))
->setIcon('new')
->setWorkflow(true)
->setHref(
$this->getApplicationURI(get_class($selected).'/install/'));
$beta_enabled = PhabricatorEnv::getEnvConfig(
'phabricator.show-beta-applications');
if ($selected->isBeta() && !$beta_enabled) {
$action->setDisabled(true);
}
$view->addAction($action);
}
} else {
$view->addAction(