mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Stop threading handles through the CustomField + ApplicationSearch pipeline
Summary: Ref T8441. Ref T7715. - These are obsolete after the Viewer/HandlePool changes. - These are unused after the typeahead parameterization changes. Test Plan: `grep`, poked around. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7715, T8441 Differential Revision: https://secure.phabricator.com/D13176
This commit is contained in:
parent
cdef3e8bc8
commit
ecc4c531c9
11 changed files with 12 additions and 68 deletions
|
@ -1111,30 +1111,10 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
|
|||
return;
|
||||
}
|
||||
|
||||
$phids = array();
|
||||
foreach ($list->getFields() as $field) {
|
||||
$key = $this->getKeyForCustomField($field);
|
||||
$value = $saved->getParameter($key);
|
||||
$phids[$key] = $field->getRequiredHandlePHIDsForApplicationSearch($value);
|
||||
}
|
||||
$all_phids = array_mergev($phids);
|
||||
|
||||
$handles = array();
|
||||
if ($all_phids) {
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
->setViewer($this->requireViewer())
|
||||
->withPHIDs($all_phids)
|
||||
->execute();
|
||||
}
|
||||
|
||||
foreach ($list->getFields() as $field) {
|
||||
$key = $this->getKeyForCustomField($field);
|
||||
$value = $saved->getParameter($key);
|
||||
$field->appendToApplicationSearchForm(
|
||||
$this,
|
||||
$form,
|
||||
$value,
|
||||
array_select_keys($handles, $phids[$key]));
|
||||
$field->appendToApplicationSearchForm($this, $form, $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -768,49 +768,28 @@ abstract class PhabricatorCustomField {
|
|||
|
||||
|
||||
/**
|
||||
* Append search controls to the interface. If you need handles, use
|
||||
* @{method:getRequiredHandlePHIDsForApplicationSearch} to get them.
|
||||
* Append search controls to the interface.
|
||||
*
|
||||
* @param PhabricatorApplicationSearchEngine Engine constructing the form.
|
||||
* @param AphrontFormView The form to update.
|
||||
* @param wild Value from the saved query.
|
||||
* @param list<PhabricatorObjectHandle> List of handles.
|
||||
* @return void
|
||||
* @task appsearch
|
||||
*/
|
||||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
if ($this->proxy) {
|
||||
return $this->proxy->appendToApplicationSearchForm(
|
||||
$engine,
|
||||
$form,
|
||||
$value,
|
||||
$handles);
|
||||
$value);
|
||||
}
|
||||
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of PHIDs which @{method:appendToApplicationSearchForm} needs
|
||||
* handles for. This is primarily useful if the field stores PHIDs and you
|
||||
* need to (for example) render a tokenizer control.
|
||||
*
|
||||
* @param wild Value from the saved query.
|
||||
* @return list<phid> List of PHIDs.
|
||||
* @task appsearch
|
||||
*/
|
||||
public function getRequiredHandlePHIDsForApplicationSearch($value) {
|
||||
if ($this->proxy) {
|
||||
return $this->proxy->getRequiredHandlePHIDsForApplicationSearch($value);
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/* -( ApplicationTransactions )-------------------------------------------- */
|
||||
|
||||
|
||||
|
|
|
@ -282,8 +282,7 @@ abstract class PhabricatorStandardCustomField
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,8 +65,7 @@ final class PhabricatorStandardCustomFieldBool
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
|
|
|
@ -133,8 +133,7 @@ final class PhabricatorStandardCustomFieldDate
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
if (!is_array($value)) {
|
||||
$value = array();
|
||||
|
|
|
@ -62,8 +62,7 @@ final class PhabricatorStandardCustomFieldInt
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
|
|
|
@ -57,8 +57,7 @@ final class PhabricatorStandardCustomFieldLink
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
|
|
|
@ -61,13 +61,6 @@ abstract class PhabricatorStandardCustomFieldPHIDs
|
|||
}
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDsForApplicationSearch($value) {
|
||||
if ($value) {
|
||||
return $value;
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDsForPropertyView() {
|
||||
$value = $this->getFieldValue();
|
||||
if ($value) {
|
||||
|
|
|
@ -38,8 +38,7 @@ final class PhabricatorStandardCustomFieldSelect
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
if (!is_array($value)) {
|
||||
$value = array();
|
||||
|
|
|
@ -40,8 +40,7 @@ final class PhabricatorStandardCustomFieldText
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
|
|
|
@ -29,8 +29,7 @@ final class PhabricatorStandardCustomFieldUsers
|
|||
public function appendToApplicationSearchForm(
|
||||
PhabricatorApplicationSearchEngine $engine,
|
||||
AphrontFormView $form,
|
||||
$value,
|
||||
array $handles) {
|
||||
$value) {
|
||||
|
||||
$control = id(new AphrontFormTokenizerControl())
|
||||
->setLabel($this->getFieldName())
|
||||
|
|
Loading…
Reference in a new issue