From 30b201bade403a18aa78920e410f7f488fb25525 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 11 Feb 2015 15:24:54 -0800 Subject: [PATCH] Allow Home and Dashboards to be uninstalled Summary: Ref T7143. This is the simplest fix for adding a new route for Home, at the cost of possibly letting users break instances. However: - It's kind of hard to get to the option to uninstall Home anyway. - It's hard to imagine anyone will really uninstall Home by accident, right? Right? - Put a really scary warning on the action just in case. Dashboards was only required because Home was required, I think, so just drop that too. Test Plan: Uninstalled home. Reviewers: btrahan Reviewed By: btrahan Subscribers: chad, epriestley Maniphest Tasks: T7143 Differential Revision: https://secure.phabricator.com/D11753 --- .../PhabricatorDashboardApplication.php | 4 --- .../PhabricatorHomeApplication.php | 4 --- ...bricatorApplicationUninstallController.php | 26 ++++++++++++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/applications/dashboard/application/PhabricatorDashboardApplication.php b/src/applications/dashboard/application/PhabricatorDashboardApplication.php index 1e76c1e57b..5e55ade04e 100644 --- a/src/applications/dashboard/application/PhabricatorDashboardApplication.php +++ b/src/applications/dashboard/application/PhabricatorDashboardApplication.php @@ -55,8 +55,4 @@ final class PhabricatorDashboardApplication extends PhabricatorApplication { ); } - public function canUninstall() { - return false; - } - } diff --git a/src/applications/home/application/PhabricatorHomeApplication.php b/src/applications/home/application/PhabricatorHomeApplication.php index 88329023da..b2b77f7c30 100644 --- a/src/applications/home/application/PhabricatorHomeApplication.php +++ b/src/applications/home/application/PhabricatorHomeApplication.php @@ -34,10 +34,6 @@ final class PhabricatorHomeApplication extends PhabricatorApplication { return false; } - public function canUninstall() { - return false; - } - public function getApplicationOrder() { return 9; } diff --git a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php index 883d1d6ba0..744e9598f8 100644 --- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php +++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php @@ -63,10 +63,28 @@ final class PhabricatorApplicationUninstallController } } else { if ($selected->canUninstall()) { - $dialog->setTitle('Confirmation') - ->appendChild( - 'Really Uninstall '.$selected->getName().' application?') - ->addSubmitButton('Uninstall'); + $dialog->setTitle(pht('Really Uninstall Application?')); + + if ($selected instanceof PhabricatorHomeApplication) { + $dialog + ->appendParagraph( + pht( + 'Are you absolutely certain you want to uninstall the Home '. + 'application?')) + ->appendParagraph( + pht( + 'This is very unusual and will leave you without any '. + 'content on the Phabricator home page. You should only '. + 'do this if you are certain you know what you are doing.')) + ->addSubmitButton(pht('Completely Break Phabricator')); + } else { + $dialog + ->appendParagraph( + pht( + 'Really uninstall the %s application?', + $selected->getName())) + ->addSubmitButton(pht('Uninstall')); + } } else { $dialog->setTitle('Information') ->appendChild(