@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+36 -17
+14 -9
src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
··· 36 36 if ($selected->isInstalled()) { 37 37 $status_tag->setName(pht('Installed')); 38 38 $status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN); 39 - 40 39 } else { 41 40 $status_tag->setName(pht('Uninstalled')); 42 41 $status_tag->setBackgroundColor(PhabricatorTagView::COLOR_RED); ··· 49 48 ->setBackgroundColor(PhabricatorTagView::COLOR_GREY); 50 49 $header->addTag($beta_tag); 51 50 } 52 - 53 51 54 52 $header->addTag($status_tag); 55 53 ··· 93 91 ->setHref( 94 92 $this->getApplicationURI(get_class($selected).'/uninstall/'))); 95 93 } else { 96 - $view->addAction( 97 - id(new PhabricatorActionView()) 98 - ->setName(pht('Install')) 99 - ->setIcon('new') 100 - ->setWorkflow(true) 101 - ->setHref( 102 - $this->getApplicationURI(get_class($selected).'/install/'))); 94 + $action = id(new PhabricatorActionView()) 95 + ->setName(pht('Install')) 96 + ->setIcon('new') 97 + ->setWorkflow(true) 98 + ->setHref( 99 + $this->getApplicationURI(get_class($selected).'/install/')); 100 + 101 + $beta_enabled = PhabricatorEnv::getEnvConfig( 102 + 'phabricator.show-beta-applications'); 103 + if ($selected->isBeta() && !$beta_enabled) { 104 + $action->setDisabled(true); 105 + } 106 + 107 + $view->addAction($action); 103 108 } 104 109 } else { 105 110 $view->addAction(
+22 -8
src/applications/meta/controller/PhabricatorApplicationUninstallController.php
··· 23 23 24 24 $view_uri = $this->getApplicationURI('view/'.$this->application); 25 25 26 - if ($request->isDialogFormPost()) { 27 - $this->manageApplication(); 28 - return id(new AphrontRedirectResponse())->setURI($view_uri); 29 - } 26 + $beta_enabled = PhabricatorEnv::getEnvConfig( 27 + 'phabricator.show-beta-applications'); 30 28 31 29 $dialog = id(new AphrontDialogView()) 32 30 ->setUser($user) 33 31 ->addCancelButton($view_uri); 34 32 33 + if ($selected->isBeta() && !$beta_enabled) { 34 + $dialog 35 + ->setTitle(pht('Beta Applications Not Enabled')) 36 + ->appendChild( 37 + pht( 38 + 'To manage beta applications, enable them by setting %s in your '. 39 + 'Phabricator configuration.', 40 + phutil_tag('tt', array(), 'phabricator.show-beta-applications'))); 41 + return id(new AphrontDialogResponse())->setDialog($dialog); 42 + } 43 + 44 + if ($request->isDialogFormPost()) { 45 + $this->manageApplication(); 46 + return id(new AphrontRedirectResponse())->setURI($view_uri); 47 + } 48 + 35 49 if ($this->action == 'install') { 36 50 if ($selected->canUninstall()) { 37 51 $dialog->setTitle('Confirmation') 38 52 ->appendChild( 39 - 'Install '. $selected->getName(). ' application ?') 53 + 'Install '. $selected->getName(). ' application?') 40 54 ->addSubmitButton('Install'); 41 55 42 56 } else { 43 57 $dialog->setTitle('Information') 44 - ->appendChild('You cannot install a installed application.'); 58 + ->appendChild('You cannot install an installed application.'); 45 59 } 46 60 } else { 47 61 if ($selected->canUninstall()) { 48 62 $dialog->setTitle('Confirmation') 49 63 ->appendChild( 50 - 'Really Uninstall '. $selected->getName(). ' application ?') 64 + 'Really Uninstall '. $selected->getName(). ' application?') 51 65 ->addSubmitButton('Uninstall'); 52 66 } else { 53 67 $dialog->setTitle('Information') ··· 65 79 $list = $config_entry->getValue(); 66 80 $uninstalled = PhabricatorEnv::getEnvConfig($key); 67 81 68 - if ($uninstalled[$this->application]) { 82 + if (isset($uninstalled[$this->application])) { 69 83 unset($list[$this->application]); 70 84 } else { 71 85 $list[$this->application] = true;