mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Respect tokenizer limits in the bulk editor
Summary: Ref T13025. This makes limits (for fields like "Assign To") work in the bulk editor, so you can't type "Assign to: x, y, z" anymore. Test Plan: Hit limit for "Assign to" and a custom project field. No limit for "Add subscribers". Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13025 Differential Revision: https://secure.phabricator.com/D18888
This commit is contained in:
parent
fbfcc37531
commit
d9b6513a21
3 changed files with 10 additions and 2 deletions
|
@ -23,7 +23,6 @@ final class BulkTokenizerParameterType
|
|||
$template_markup = $template->render();
|
||||
|
||||
$datasource = $this->getDatasource();
|
||||
$limit = null;
|
||||
|
||||
return array(
|
||||
'markup' => (string)hsprintf('%s', $template_markup),
|
||||
|
@ -31,7 +30,7 @@ final class BulkTokenizerParameterType
|
|||
'src' => $datasource->getDatasourceURI(),
|
||||
'browseURI' => $datasource->getBrowseURI(),
|
||||
'placeholder' => $datasource->getPlaceholderText(),
|
||||
'limit' => $limit,
|
||||
'limit' => $datasource->getLimit(),
|
||||
),
|
||||
'value' => null,
|
||||
);
|
||||
|
|
|
@ -60,6 +60,10 @@ abstract class PhabricatorTokenizerEditField
|
|||
$datasource = $this->newDatasource()
|
||||
->setViewer($this->getViewer());
|
||||
|
||||
if ($this->getIsSingleValue()) {
|
||||
$datasource->setLimit(1);
|
||||
}
|
||||
|
||||
return id(new BulkTokenizerParameterType())
|
||||
->setDatasource($datasource);
|
||||
}
|
||||
|
|
|
@ -68,6 +68,11 @@ abstract class PhabricatorStandardCustomFieldTokenizer
|
|||
protected function newBulkParameterType() {
|
||||
$datasource = $this->getDatasource();
|
||||
|
||||
$limit = $this->getFieldConfigValue('limit');
|
||||
if ($limit) {
|
||||
$datasource->setLimit($limit);
|
||||
}
|
||||
|
||||
return id(new BulkTokenizerParameterType())
|
||||
->setDatasource($datasource);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue