1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

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
This commit is contained in:
epriestley 2013-01-31 11:49:52 -08:00
parent 8b86ec6c72
commit 1c64b40a22
2 changed files with 7 additions and 2 deletions

View file

@ -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/'))

View file

@ -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()) {