From 1c64b40a22b9250533d7ef44761cbc38a4668993 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 31 Jan 2013 11:49:52 -0800 Subject: [PATCH] Minor improvements to Applications application Summary: I missed these in review, but here are a couple of tweaks: - Call `setWorkflow(true)` on the actions. This makes the dialogs pop up on the same page with Javascript if it's available. - When the user installs/uninstalls an application, send them back to the application's detail page, not the application list. Test Plan: - Uninstalled an application (saw dialog, got sent back to detail page). - Installed an application (saw dialog, got sent back to detail page). - Canceled an application uninstall. Reviewers: Afaque_Hussain Reviewed By: Afaque_Hussain CC: aran Differential Revision: https://secure.phabricator.com/D4762 --- .../PhabricatorApplicationDetailViewController.php | 3 +++ .../PhabricatorApplicationUninstallController.php | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php index 0fa192f5a3..370fdb97ca 100644 --- a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php +++ b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php @@ -90,6 +90,7 @@ final class PhabricatorApplicationDetailViewController id(new PhabricatorActionView()) ->setName(pht('Uninstall')) ->setIcon('delete') + ->setWorkflow(true) ->setHref( $this->getApplicationURI(get_class($selected).'/uninstall/')) ); @@ -98,6 +99,7 @@ final class PhabricatorApplicationDetailViewController id(new PhabricatorActionView()) ->setName(pht('Install')) ->setIcon('new') + ->setWorkflow(true) ->setHref( $this->getApplicationURI(get_class($selected).'/install/')) ); @@ -107,6 +109,7 @@ final class PhabricatorApplicationDetailViewController id(new PhabricatorActionView()) ->setName(pht('Uninstall')) ->setIcon('delete') + ->setWorkflow(true) ->setDisabled(true) ->setHref( $this->getApplicationURI(get_class($selected).'/uninstall/')) diff --git a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php index 51b03cb08b..feebbed9c8 100644 --- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php +++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php @@ -21,14 +21,16 @@ final class PhabricatorApplicationUninstallController return new Aphront404Response(); } + $view_uri = $this->getApplicationURI('view/'.$this->application); + if ($request->isDialogFormPost()) { $this->manageApplication(); - return id(new AphrontRedirectResponse())->setURI('/applications/'); + return id(new AphrontRedirectResponse())->setURI($view_uri); } $dialog = id(new AphrontDialogView()) ->setUser($user) - ->addCancelButton('/applications/view/'.$this->application); + ->addCancelButton($view_uri); if ($this->action == 'install') { if ($selected->canUninstall()) {