1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +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() {
$show_packages = PhabricatorApplication::isClassInstalled(
'PhabricatorPackagesApplication');
return array(
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Responsible Users'))
@ -118,6 +120,7 @@ final class PhabricatorCommitSearchEngine
->setConduitKey('packages')
->setAliases(array('package', 'packages', 'packagePHID'))
->setDatasource(new PhabricatorOwnersPackageDatasource())
->setIsHidden(!$show_packages)
->setDescription(
pht('Find commits which affect given packages.')),
id(new PhabricatorSearchThreeStateField())