Make DiffusionCommitSearch accept modern (string) constants

Summary:
Depends on D19650. Ref T13197. Allow `SearchCheckboxesField` to have a "deprecated" map of older aliases, then convert them to modern values.

On the API method page, show all the values.

This technically resolves the issue in PHI841, although I still plan to migrate behind this.

Test Plan:
{F5875363}

- Queried audits, fiddled with `?status=1,audited`, etc.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13197

Differential Revision: https://secure.phabricator.com/D19651
This commit is contained in:
epriestley
2018-09-10 12:07:36 -07:00
parent 853a816b3c
commit 8eb8e8e1d8
5 changed files with 73 additions and 20 deletions

View File

@@ -92,7 +92,9 @@ final class PhabricatorCommitSearchEngine
->setLabel(pht('Audit Status'))
->setKey('statuses')
->setAliases(array('status'))
->setOptions(PhabricatorAuditCommitStatusConstants::getStatusNameMap())
->setOptions(PhabricatorAuditCommitStatusConstants::newOptions())
->setDeprecatedOptions(
PhabricatorAuditCommitStatusConstants::newDeprecatedOptions())
->setDescription(pht('Find commits with given audit statuses.')),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Repositories'))