Disabled Uninstall state for essential applications
Summary: Disabled Uninstall state for essential applications of Phabricator. Information provided why they cannot uninstall these applications. Also take care of users trying to install an application which cannot be uninstalled by editing the URI. Test Plan: Manually tested Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4743
This commit is contained in:
committed by
epriestley
parent
363f292fd8
commit
2703a2e997
@@ -64,30 +64,38 @@ final class PhabricatorApplicationDetailViewController
|
||||
private function buildActionView(
|
||||
PhabricatorUser $user, PhabricatorApplication $selected) {
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($user);
|
||||
|
||||
if ($selected->canUninstall()) {
|
||||
if ($selected->isInstalled()) {
|
||||
|
||||
return id(new PhabricatorActionListView())
|
||||
->setUser($user)
|
||||
->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Uninstall'))
|
||||
->setIcon('delete')
|
||||
->setHref(
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Uninstall'))
|
||||
->setIcon('delete')
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/uninstall/'))
|
||||
);
|
||||
);
|
||||
} else {
|
||||
return id(new PhabricatorActionListView())
|
||||
->setUser($user)
|
||||
->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Install'))
|
||||
->setIcon('new')
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/install/'))
|
||||
);
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Install'))
|
||||
->setIcon('new')
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/install/'))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Uninstall'))
|
||||
->setIcon('delete')
|
||||
->setDisabled(true)
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/uninstall/'))
|
||||
);
|
||||
}
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user