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

Hide "Packages" field in Diffusion Commits query form when application uninstalled

Summary: Fixes T15698

Test Plan:
1. Uninstall Packages via `/applications/view/PhabricatorPackagesApplication/`
2. Go to `/diffusion/commit/`, expand the Query form, and see that `Packages` is not shown anymore

Reviewers: O1 Blessed Committers, 20after4

Reviewed By: O1 Blessed Committers, 20after4

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15698

Differential Revision: https://we.phorge.it/D25506
This commit is contained in:
Andre Klapper 2024-01-04 12:59:10 +01:00
parent 428f9686c4
commit d92ed9ce0c

View file

@ -70,6 +70,8 @@ final class PhabricatorCommitSearchEngine
} }
protected function buildCustomSearchFields() { protected function buildCustomSearchFields() {
$show_packages = PhabricatorApplication::isClassInstalled(
'PhabricatorPackagesApplication');
return array( return array(
id(new PhabricatorSearchDatasourceField()) id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Responsible Users')) ->setLabel(pht('Responsible Users'))
@ -118,6 +120,7 @@ final class PhabricatorCommitSearchEngine
->setConduitKey('packages') ->setConduitKey('packages')
->setAliases(array('package', 'packages', 'packagePHID')) ->setAliases(array('package', 'packages', 'packagePHID'))
->setDatasource(new PhabricatorOwnersPackageDatasource()) ->setDatasource(new PhabricatorOwnersPackageDatasource())
->setIsHidden(!$show_packages)
->setDescription( ->setDescription(
pht('Find commits which affect given packages.')), pht('Find commits which affect given packages.')),
id(new PhabricatorSearchThreeStateField()) id(new PhabricatorSearchThreeStateField())