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

Improve Conduit type handling for *.edit endpoints

Summary:
Ref T9964. Three goals here:

  - Make it easier to supply Conduit documentation.
  - Make automatic documentation for `*.edit` endpoints more complete, particularly for custom fields.
  - Allow type resolution via Conduit types, so you can pass `["alincoln"]` to "subscribers" instead of needing to use PHIDs.

Test Plan:
  - Viewed and used all search and edit endpoints, including custom fields.
  - Used parameter type resolution to set subscribers to user "dog" instead of "PHID-USER-whatever".
  - Viewed HTTP parameter documentation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14796
This commit is contained in:
epriestley 2015-12-16 05:09:21 -08:00
parent 1d72c97fc9
commit 161ebad56d
41 changed files with 510 additions and 191 deletions

View file

@ -238,6 +238,7 @@ phutil_register_library_map(array(
'ConduitMethodDoesNotExistException' => 'applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php', 'ConduitMethodDoesNotExistException' => 'applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php',
'ConduitMethodNotFoundException' => 'applications/conduit/protocol/exception/ConduitMethodNotFoundException.php', 'ConduitMethodNotFoundException' => 'applications/conduit/protocol/exception/ConduitMethodNotFoundException.php',
'ConduitPHIDListParameterType' => 'applications/conduit/parametertype/ConduitPHIDListParameterType.php', 'ConduitPHIDListParameterType' => 'applications/conduit/parametertype/ConduitPHIDListParameterType.php',
'ConduitPHIDParameterType' => 'applications/conduit/parametertype/ConduitPHIDParameterType.php',
'ConduitParameterType' => 'applications/conduit/parametertype/ConduitParameterType.php', 'ConduitParameterType' => 'applications/conduit/parametertype/ConduitParameterType.php',
'ConduitPingConduitAPIMethod' => 'applications/conduit/method/ConduitPingConduitAPIMethod.php', 'ConduitPingConduitAPIMethod' => 'applications/conduit/method/ConduitPingConduitAPIMethod.php',
'ConduitProjectListParameterType' => 'applications/conduit/parametertype/ConduitProjectListParameterType.php', 'ConduitProjectListParameterType' => 'applications/conduit/parametertype/ConduitProjectListParameterType.php',
@ -248,6 +249,7 @@ phutil_register_library_map(array(
'ConduitStringParameterType' => 'applications/conduit/parametertype/ConduitStringParameterType.php', 'ConduitStringParameterType' => 'applications/conduit/parametertype/ConduitStringParameterType.php',
'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php', 'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php',
'ConduitUserListParameterType' => 'applications/conduit/parametertype/ConduitUserListParameterType.php', 'ConduitUserListParameterType' => 'applications/conduit/parametertype/ConduitUserListParameterType.php',
'ConduitWildParameterType' => 'applications/conduit/parametertype/ConduitWildParameterType.php',
'ConpherenceColumnViewController' => 'applications/conpherence/controller/ConpherenceColumnViewController.php', 'ConpherenceColumnViewController' => 'applications/conpherence/controller/ConpherenceColumnViewController.php',
'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php', 'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php',
'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php', 'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php',
@ -4103,6 +4105,7 @@ phutil_register_library_map(array(
'ConduitMethodDoesNotExistException' => 'ConduitMethodNotFoundException', 'ConduitMethodDoesNotExistException' => 'ConduitMethodNotFoundException',
'ConduitMethodNotFoundException' => 'ConduitException', 'ConduitMethodNotFoundException' => 'ConduitException',
'ConduitPHIDListParameterType' => 'ConduitListParameterType', 'ConduitPHIDListParameterType' => 'ConduitListParameterType',
'ConduitPHIDParameterType' => 'ConduitListParameterType',
'ConduitParameterType' => 'Phobject', 'ConduitParameterType' => 'Phobject',
'ConduitPingConduitAPIMethod' => 'ConduitAPIMethod', 'ConduitPingConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitProjectListParameterType' => 'ConduitListParameterType', 'ConduitProjectListParameterType' => 'ConduitListParameterType',
@ -4113,6 +4116,7 @@ phutil_register_library_map(array(
'ConduitStringParameterType' => 'ConduitListParameterType', 'ConduitStringParameterType' => 'ConduitListParameterType',
'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector', 'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector',
'ConduitUserListParameterType' => 'ConduitListParameterType', 'ConduitUserListParameterType' => 'ConduitListParameterType',
'ConduitWildParameterType' => 'ConduitListParameterType',
'ConpherenceColumnViewController' => 'ConpherenceController', 'ConpherenceColumnViewController' => 'ConpherenceController',
'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod', 'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod',
'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions', 'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions',

View file

@ -0,0 +1,35 @@
<?php
final class ConduitPHIDParameterType
extends ConduitListParameterType {
protected function getParameterValue(array $request, $key) {
$value = parent::getParameterValue($request, $key);
if (!is_string($value)) {
$this->raiseValidationException(
$request,
$key,
pht('Expected PHID, got something else.'));
}
return $value;
}
protected function getParameterTypeName() {
return 'phid';
}
protected function getParameterFormatDescriptions() {
return array(
pht('A PHID.'),
);
}
protected function getParameterExamples() {
return array(
'"PHID-WXYZ-1111222233334444"',
);
}
}

View file

@ -0,0 +1,22 @@
<?php
final class ConduitWildParameterType
extends ConduitListParameterType {
protected function getParameterTypeName() {
return 'wild';
}
protected function getParameterFormatDescriptions() {
return array(
pht('Any mixed or complex value. Check the documentation for details.'),
);
}
protected function getParameterExamples() {
return array(
pht('(Wildcard)'),
);
}
}

View file

@ -76,6 +76,8 @@ final class ManiphestEditEngine
->setKey('parent') ->setKey('parent')
->setLabel(pht('Parent Task')) ->setLabel(pht('Parent Task'))
->setDescription(pht('Task to make this a subtask of.')) ->setDescription(pht('Task to make this a subtask of.'))
->setConduitDescription(pht('Create as a subtask of another task.'))
->setConduitTypeDescription(pht('PHID of the parent task.'))
->setAliases(array('parentPHID')) ->setAliases(array('parentPHID'))
->setTransactionType(ManiphestTransaction::TYPE_PARENT) ->setTransactionType(ManiphestTransaction::TYPE_PARENT)
->setHandleParameterType(new ManiphestTaskListHTTPParameterType()) ->setHandleParameterType(new ManiphestTaskListHTTPParameterType())
@ -87,6 +89,8 @@ final class ManiphestEditEngine
->setKey('column') ->setKey('column')
->setLabel(pht('Column')) ->setLabel(pht('Column'))
->setDescription(pht('Workboard column to create this task into.')) ->setDescription(pht('Workboard column to create this task into.'))
->setConduitDescription(pht('Create into a workboard column.'))
->setConduitTypeDescription(pht('PHID of workboard column.'))
->setAliases(array('columnPHID')) ->setAliases(array('columnPHID'))
->setTransactionType(ManiphestTransaction::TYPE_COLUMN) ->setTransactionType(ManiphestTransaction::TYPE_COLUMN)
->setSingleValue(null) ->setSingleValue(null)
@ -98,6 +102,8 @@ final class ManiphestEditEngine
->setKey('title') ->setKey('title')
->setLabel(pht('Title')) ->setLabel(pht('Title'))
->setDescription(pht('Name of the task.')) ->setDescription(pht('Name of the task.'))
->setConduitDescription(pht('Rename the task.'))
->setConduitTypeDescription(pht('New task name.'))
->setTransactionType(ManiphestTransaction::TYPE_TITLE) ->setTransactionType(ManiphestTransaction::TYPE_TITLE)
->setIsRequired(true) ->setIsRequired(true)
->setValue($object->getTitle()), ->setValue($object->getTitle()),
@ -106,6 +112,9 @@ final class ManiphestEditEngine
->setAliases(array('ownerPHID', 'assign', 'assigned')) ->setAliases(array('ownerPHID', 'assign', 'assigned'))
->setLabel(pht('Assigned To')) ->setLabel(pht('Assigned To'))
->setDescription(pht('User who is responsible for the task.')) ->setDescription(pht('User who is responsible for the task.'))
->setConduitDescription(pht('Reassign the task.'))
->setConduitTypeDescription(
pht('New task owner, or `null` to unassign.'))
->setTransactionType(ManiphestTransaction::TYPE_OWNER) ->setTransactionType(ManiphestTransaction::TYPE_OWNER)
->setIsCopyable(true) ->setIsCopyable(true)
->setSingleValue($object->getOwnerPHID()) ->setSingleValue($object->getOwnerPHID())
@ -115,6 +124,8 @@ final class ManiphestEditEngine
->setKey('status') ->setKey('status')
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setDescription(pht('Status of the task.')) ->setDescription(pht('Status of the task.'))
->setConduitDescription(pht('Change the task status.'))
->setConduitTypeDescription(pht('New task status constant.'))
->setTransactionType(ManiphestTransaction::TYPE_STATUS) ->setTransactionType(ManiphestTransaction::TYPE_STATUS)
->setIsCopyable(true) ->setIsCopyable(true)
->setValue($object->getStatus()) ->setValue($object->getStatus())
@ -125,6 +136,8 @@ final class ManiphestEditEngine
->setKey('priority') ->setKey('priority')
->setLabel(pht('Priority')) ->setLabel(pht('Priority'))
->setDescription(pht('Priority of the task.')) ->setDescription(pht('Priority of the task.'))
->setConduitDescription(pht('Change the priority of the task.'))
->setConduitTypeDescription(pht('New task priority constant.'))
->setTransactionType(ManiphestTransaction::TYPE_PRIORITY) ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY)
->setIsCopyable(true) ->setIsCopyable(true)
->setValue($object->getPriority()) ->setValue($object->getPriority())
@ -134,6 +147,8 @@ final class ManiphestEditEngine
->setKey('description') ->setKey('description')
->setLabel(pht('Description')) ->setLabel(pht('Description'))
->setDescription(pht('Task description.')) ->setDescription(pht('Task description.'))
->setConduitDescription(pht('Update the task description.'))
->setConduitTypeDescription(pht('New task description.'))
->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION)
->setValue($object->getDescription()), ->setValue($object->getDescription()),
); );

View file

@ -122,9 +122,12 @@ EOTEXT
id(new PhabricatorConduitEditField()) id(new PhabricatorConduitEditField())
->setKey('paths.set') ->setKey('paths.set')
->setLabel(pht('Paths')) ->setLabel(pht('Paths'))
->setDescription(pht('Set paths for this package.'))
->setIsConduitOnly(true) ->setIsConduitOnly(true)
->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_PATHS) ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_PATHS)
->setConduitDescription(
pht('Overwrite existing package paths with new paths.'))
->setConduitTypeDescription(
pht('List of dictionaries, each describing a path.'))
->setConduitDocumentation($paths_help), ->setConduitDocumentation($paths_help),
); );
} }

View file

@ -59,38 +59,46 @@ final class PhabricatorPasteEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('title') ->setKey('title')
->setLabel(pht('Title')) ->setLabel(pht('Title'))
->setDescription(pht('Name of the paste.'))
->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE)
->setDescription(pht('The title of the paste.'))
->setConduitDescription(pht('Retitle the paste.'))
->setConduitTypeDescription(pht('New paste title.'))
->setValue($object->getTitle()), ->setValue($object->getTitle()),
id(new PhabricatorSelectEditField()) id(new PhabricatorSelectEditField())
->setKey('language') ->setKey('language')
->setLabel(pht('Language')) ->setLabel(pht('Language'))
->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE)
->setAliases(array('lang'))
->setIsCopyable(true)
->setOptions($langs)
->setDescription( ->setDescription(
pht( pht(
'Programming language to interpret the paste as for syntax '. 'Language used for syntax highlighting. By default, inferred '.
'highlighting. By default, the language is inferred from the '. 'from the title.'))
'title.')) ->setConduitDescription(
->setAliases(array('lang')) pht('Change language used for syntax highlighting.'))
->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) ->setConduitTypeDescription(pht('New highlighting language.'))
->setIsCopyable(true) ->setValue($object->getLanguage()),
->setValue($object->getLanguage())
->setOptions($langs),
id(new PhabricatorTextAreaEditField()) id(new PhabricatorTextAreaEditField())
->setKey('text') ->setKey('text')
->setLabel(pht('Text')) ->setLabel(pht('Text'))
->setDescription(pht('The main body text of the paste.'))
->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT)
->setMonospaced(true) ->setMonospaced(true)
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
->setDescription(pht('The main body text of the paste.'))
->setConduitDescription(pht('Change the paste content.'))
->setConduitTypeDescription(pht('New body content.'))
->setValue($object->getRawContent()), ->setValue($object->getRawContent()),
id(new PhabricatorSelectEditField()) id(new PhabricatorSelectEditField())
->setKey('status') ->setKey('status')
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setDescription(pht('Active or archive the paste.'))
->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS)
->setIsConduitOnly(true) ->setIsConduitOnly(true)
->setValue($object->getStatus()) ->setOptions(PhabricatorPaste::getStatusNameMap())
->setOptions(PhabricatorPaste::getStatusNameMap()), ->setDescription(pht('Active or archived status.'))
->setConduitDescription(pht('Active or archive the paste.'))
->setConduitTypeDescription(pht('New paste status constant.'))
->setValue($object->getStatus()),
); );
} }

View file

@ -81,13 +81,14 @@ final class PhabricatorPolicyEditEngineExtension
$policy_field = id(new PhabricatorPolicyEditField()) $policy_field = id(new PhabricatorPolicyEditField())
->setKey($key) ->setKey($key)
->setLabel($label) ->setLabel($label)
->setDescription($description)
->setAliases($aliases) ->setAliases($aliases)
->setIsCopyable(true) ->setIsCopyable(true)
->setCapability($capability) ->setCapability($capability)
->setPolicies($policies) ->setPolicies($policies)
->setTransactionType($type) ->setTransactionType($type)
->setEditTypeKey($edit) ->setEditTypeKey($edit)
->setConduitDescription($description)
->setConduitTypeDescription(pht('New policy PHID or constant.'))
->setValue($object->getPolicy($capability)); ->setValue($object->getPolicy($capability));
$fields[] = $policy_field; $fields[] = $policy_field;
@ -99,12 +100,14 @@ final class PhabricatorPolicyEditEngineExtension
->setKey('spacePHID') ->setKey('spacePHID')
->setLabel(pht('Space')) ->setLabel(pht('Space'))
->setEditTypeKey('space') ->setEditTypeKey('space')
->setDescription(
pht('Shifts the object in the Spaces application.'))
->setIsCopyable(true) ->setIsCopyable(true)
->setIsReorderable(false) ->setIsReorderable(false)
->setAliases(array('space', 'policy.space')) ->setAliases(array('space', 'policy.space'))
->setTransactionType($type_space) ->setTransactionType($type_space)
->setDescription(pht('Select a space for the object.'))
->setConduitDescription(
pht('Shift the object between spaces.'))
->setConduitTypeDescription(pht('New space PHID.'))
->setValue($object->getSpacePHID()); ->setValue($object->getSpacePHID());
$fields[] = $space_field; $fields[] = $space_field;

View file

@ -46,19 +46,27 @@ final class PhabricatorProjectsEditEngineExtension
->setKey('projectPHIDs') ->setKey('projectPHIDs')
->setLabel(pht('Projects')) ->setLabel(pht('Projects'))
->setEditTypeKey('projects') ->setEditTypeKey('projects')
->setDescription(pht('Add or remove associated projects.'))
->setAliases(array('project', 'projects')) ->setAliases(array('project', 'projects'))
->setIsCopyable(true) ->setIsCopyable(true)
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setEdgeTransactionDescriptions(
pht('Add projects.'),
pht('Remove projects.'),
pht('Set associated projects, overwriting current value.'))
->setCommentActionLabel(pht('Change Projects')) ->setCommentActionLabel(pht('Change Projects'))
->setDescription(pht('Select projects for the object.'))
->setTransactionType($edge_type) ->setTransactionType($edge_type)
->setMetadataValue('edge:type', $project_edge_type) ->setMetadataValue('edge:type', $project_edge_type)
->setValue($project_phids); ->setValue($project_phids);
$projects_field->setViewer($engine->getViewer());
$edit_add = $projects_field->getConduitEditType('projects.add')
->setConduitDescription(pht('Add projects.'));
$edit_set = $projects_field->getConduitEditType('projects.set')
->setConduitDescription(
pht('Set projects, overwriting current value.'));
$edit_rem = $projects_field->getConduitEditType('projects.remove')
->setConduitDescription(pht('Remove projects.'));
return array( return array(
$projects_field, $projects_field,
); );

View file

@ -41,18 +41,25 @@ final class PhabricatorSubscriptionsEditEngineExtension
->setKey('subscriberPHIDs') ->setKey('subscriberPHIDs')
->setLabel(pht('Subscribers')) ->setLabel(pht('Subscribers'))
->setEditTypeKey('subscribers') ->setEditTypeKey('subscribers')
->setDescription(pht('Manage subscribers.'))
->setAliases(array('subscriber', 'subscribers')) ->setAliases(array('subscriber', 'subscribers'))
->setIsCopyable(true) ->setIsCopyable(true)
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setEdgeTransactionDescriptions(
pht('Add subscribers.'),
pht('Remove subscribers.'),
pht('Set subscribers, overwriting current value.'))
->setCommentActionLabel(pht('Change Subscribers')) ->setCommentActionLabel(pht('Change Subscribers'))
->setTransactionType($subscribers_type) ->setTransactionType($subscribers_type)
->setValue($sub_phids); ->setValue($sub_phids);
$subscribers_field->setViewer($engine->getViewer());
$edit_add = $subscribers_field->getConduitEditType('subscribers.add')
->setConduitDescription(pht('Add subscribers.'));
$edit_set = $subscribers_field->getConduitEditType('subscribers.set')
->setConduitDescription(
pht('Set subscribers, overwriting current value.'));
$edit_rem = $subscribers_field->getConduitEditType('subscribers.remove')
->setConduitDescription(pht('Remove subscribers.'));
return array( return array(
$subscribers_field, $subscribers_field,
); );

View file

@ -64,6 +64,10 @@ abstract class PhabricatorEditEngine
abstract public function getEngineApplicationClass(); abstract public function getEngineApplicationClass();
abstract protected function buildCustomEditFields($object); abstract protected function buildCustomEditFields($object);
protected function didBuildCustomEditFields($object, array $fields) {
return;
}
public function getFieldsForConfig( public function getFieldsForConfig(
PhabricatorEditEngineConfiguration $config) { PhabricatorEditEngineConfiguration $config) {
@ -82,6 +86,15 @@ abstract class PhabricatorEditEngine
$fields = $this->buildCustomEditFields($object); $fields = $this->buildCustomEditFields($object);
foreach ($fields as $field) {
$field
->setViewer($viewer)
->setObject($object);
}
$fields = mpull($fields, null, 'getKey');
$this->didBuildCustomEditFields($object, $fields);
$extensions = PhabricatorEditEngineExtension::getAllEnabledExtensions(); $extensions = PhabricatorEditEngineExtension::getAllEnabledExtensions();
foreach ($extensions as $extension) { foreach ($extensions as $extension) {
$extension->setViewer($viewer); $extension->setViewer($viewer);
@ -96,19 +109,22 @@ abstract class PhabricatorEditEngine
assert_instances_of($extension_fields, 'PhabricatorEditField'); assert_instances_of($extension_fields, 'PhabricatorEditField');
foreach ($extension_fields as $field) { foreach ($extension_fields as $field) {
$fields[] = $field; $field
->setViewer($viewer)
->setObject($object);
}
$extension_fields = mpull($extension_fields, null, 'getKey');
$extension->didBuildCustomEditFields($this, $object, $extension_fields);
foreach ($extension_fields as $key => $field) {
$fields[$key] = $field;
} }
} }
$config = $this->getEditEngineConfiguration(); $config = $this->getEditEngineConfiguration();
$fields = $config->applyConfigurationToFields($this, $object, $fields); $fields = $config->applyConfigurationToFields($this, $object, $fields);
foreach ($fields as $field) {
$field
->setViewer($viewer)
->setObject($object);
}
return $fields; return $fields;
} }
@ -1595,6 +1611,11 @@ abstract class PhabricatorEditEngine
foreach ($xactions as $xaction) { foreach ($xactions as $xaction) {
$type = $types[$xaction['type']]; $type = $types[$xaction['type']];
// Let the parameter type interpret the value. This allows you to
// use usernames in list<user> fields, for example.
$parameter_type = $type->getConduitParameterType();
$xaction['value'] = $parameter_type->getValue($xaction, 'value');
$type_xactions = $type->generateTransactions( $type_xactions = $type->generateTransactions(
clone $template, clone $template,
$xaction); $xaction);

View file

@ -146,17 +146,16 @@ EOTEXT
); );
$key = pht('Key'); $key = pht('Key');
$summary = pht('Summary');
$description = pht('Description'); $description = pht('Description');
$head_type = pht('Type'); $head_type = pht('Type');
$table = array(); $table = array();
$table[] = "| {$key} | {$summary} |"; $table[] = "| {$key} | {$description} |";
$table[] = '|--------|----------------|'; $table[] = '|--------|----------------|';
foreach ($types as $type) { foreach ($types as $type) {
$edit_type = $type->getEditType(); $edit_type = $type->getEditType();
$edit_summary = $type->getSummary(); $edit_description = $type->getConduitDescription();
$table[] = "| `{$edit_type}` | {$edit_summary} |"; $table[] = "| `{$edit_type}` | {$edit_description} |";
} }
$out[] = implode("\n", $table); $out[] = implode("\n", $table);
@ -166,7 +165,7 @@ EOTEXT
$section[] = pht('Edit Type: %s', $type->getEditType()); $section[] = pht('Edit Type: %s', $type->getEditType());
$section[] = '---------'; $section[] = '---------';
$section[] = null; $section[] = null;
$section[] = $type->getDescription(); $section[] = $type->getConduitDescription();
$section[] = null; $section[] = null;
$section[] = pht( $section[] = pht(
'This edit generates transactions of type `%s` internally.', 'This edit generates transactions of type `%s` internally.',
@ -183,12 +182,8 @@ EOTEXT
'Use `%s` to select this edit type.', 'Use `%s` to select this edit type.',
$type->getEditType()); $type->getEditType());
$value_type = $type->getValueType(); $value_type = $type->getConduitType();
if (!strlen($value_type)) { $value_description = $type->getConduitTypeDescription();
$value_type = '?';
}
$value_description = $type->getValueDescription();
$table = array(); $table = array();
$table[] = "| {$key} | {$head_type} | {$description} |"; $table[] = "| {$key} | {$head_type} | {$description} |";

View file

@ -41,13 +41,15 @@ final class PhabricatorCommentEditEngineExtension
$comment_field = id(new PhabricatorCommentEditField()) $comment_field = id(new PhabricatorCommentEditField())
->setKey('comment') ->setKey('comment')
->setLabel(pht('Comments')) ->setLabel(pht('Comments'))
->setDescription(pht('Add comments.'))
->setAliases(array('comments')) ->setAliases(array('comments'))
->setIsHidden(true) ->setIsHidden(true)
->setIsReorderable(false) ->setIsReorderable(false)
->setIsDefaultable(false) ->setIsDefaultable(false)
->setIsLockable(false) ->setIsLockable(false)
->setTransactionType($comment_type) ->setTransactionType($comment_type)
->setConduitDescription(pht('Make comments.'))
->setConduitTypeDescription(
pht('Comment to add, formatted as remarkup.'))
->setValue(null); ->setValue(null);
return array( return array(

View file

@ -32,6 +32,13 @@ abstract class PhabricatorEditEngineExtension extends Phobject {
PhabricatorEditEngine $engine, PhabricatorEditEngine $engine,
PhabricatorApplicationTransactionInterface $object); PhabricatorApplicationTransactionInterface $object);
public function didBuildCustomEditFields(
PhabricatorEditEngine $engine,
PhabricatorApplicationTransactionInterface $object,
array $fields) {
return;
}
final public static function getAllExtensions() { final public static function getAllExtensions() {
return id(new PhutilClassMapQuery()) return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__) ->setAncestorClass(__CLASS__)

View file

@ -11,6 +11,10 @@ final class PhabricatorCommentEditField
return new PhabricatorCommentEditType(); return new PhabricatorCommentEditType();
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
public function shouldGenerateTransactionsFromSubmit() { public function shouldGenerateTransactionsFromSubmit() {
return false; return false;
} }

View file

@ -11,4 +11,8 @@ final class PhabricatorConduitEditField
return null; return null;
} }
protected function newConduitParameterType() {
return new ConduitWildParameterType();
}
} }

View file

@ -12,10 +12,13 @@ abstract class PhabricatorEditField extends Phobject {
private $object; private $object;
private $transactionType; private $transactionType;
private $metadata = array(); private $metadata = array();
private $description;
private $editTypeKey; private $editTypeKey;
private $isRequired; private $isRequired;
private $description;
private $conduitDescription;
private $conduitDocumentation; private $conduitDocumentation;
private $conduitTypeDescription;
private $commentActionLabel; private $commentActionLabel;
private $commentActionValue; private $commentActionValue;
@ -35,6 +38,8 @@ abstract class PhabricatorEditField extends Phobject {
private $isCopyable = false; private $isCopyable = false;
private $isConduitOnly = false; private $isConduitOnly = false;
private $conduitEditTypes;
public function setKey($key) { public function setKey($key) {
$this->key = $key; $this->key = $key;
return $this; return $this;
@ -80,15 +85,6 @@ abstract class PhabricatorEditField extends Phobject {
return $this->object; return $this->object;
} }
public function setDescription($description) {
$this->description = $description;
return $this;
}
public function getDescription() {
return $this->description;
}
public function setIsLocked($is_locked) { public function setIsLocked($is_locked) {
$this->isLocked = $is_locked; $this->isLocked = $is_locked;
return $this; return $this;
@ -125,6 +121,45 @@ abstract class PhabricatorEditField extends Phobject {
return $this->isConduitOnly; return $this->isConduitOnly;
} }
public function setDescription($description) {
$this->description = $description;
return $this;
}
public function getDescription() {
return $this->description;
}
public function setConduitDescription($conduit_description) {
$this->conduitDescription = $conduit_description;
return $this;
}
public function getConduitDescription() {
if ($this->conduitDescription === null) {
return $this->getDescription();
}
return $this->conduitDescription;
}
public function setConduitDocumentation($conduit_documentation) {
$this->conduitDocumentation = $conduit_documentation;
return $this;
}
public function getConduitDocumentation() {
return $this->conduitDocumentation;
}
public function setConduitTypeDescription($conduit_type_description) {
$this->conduitTypeDescription = $conduit_type_description;
return $this;
}
public function getConduitTypeDescription() {
return $this->conduitTypeDescription;
}
public function setIsEditDefaults($is_edit_defaults) { public function setIsEditDefaults($is_edit_defaults) {
$this->isEditDefaults = $is_edit_defaults; $this->isEditDefaults = $is_edit_defaults;
return $this; return $this;
@ -516,6 +551,20 @@ abstract class PhabricatorEditField extends Phobject {
return new AphrontStringHTTPParameterType(); return new AphrontStringHTTPParameterType();
} }
public function getConduitParameterType() {
$type = $this->newConduitParameterType();
if (!$type) {
return null;
}
$type->setViewer($this->getViewer());
return $type;
}
abstract protected function newConduitParameterType();
public function setEditTypeKey($edit_type_key) { public function setEditTypeKey($edit_type_key) {
$this->editTypeKey = $edit_type_key; $this->editTypeKey = $edit_type_key;
return $this; return $this;
@ -529,16 +578,13 @@ abstract class PhabricatorEditField extends Phobject {
} }
protected function newEditType() { protected function newEditType() {
// TODO: This could be a little cleaner. $parameter_type = $this->getConduitParameterType();
$http_type = $this->getHTTPParameterType(); if (!$parameter_type) {
if ($http_type) { return null;
$value_type = $http_type->getTypeName();
} else {
$value_type = 'wild';
} }
return id(new PhabricatorSimpleEditType()) return id(new PhabricatorSimpleEditType())
->setValueType($value_type); ->setConduitParameterType($parameter_type);
} }
protected function getEditType() { protected function getEditType() {
@ -549,19 +595,49 @@ abstract class PhabricatorEditField extends Phobject {
} }
$type_key = $this->getEditTypeKey(); $type_key = $this->getEditTypeKey();
$edit_type = $this->newEditType();
return $this->newEditType() if (!$edit_type) {
->setEditType($type_key) return null;
->setTransactionType($transaction_type)
->setDescription($this->getDescription())
->setMetadata($this->getMetadata())
->setConduitDocumentation($this->getConduitDocumentation());
} }
public function getConduitEditTypes() { return $edit_type
->setEditType($type_key)
->setTransactionType($transaction_type)
->setMetadata($this->getMetadata());
}
final public function getConduitEditTypes() {
if ($this->conduitEditTypes === null) {
$edit_types = $this->newConduitEditTypes();
$edit_types = mpull($edit_types, null, 'getEditType');
foreach ($edit_types as $edit_type) {
$edit_type->setEditField($this);
}
$this->conduitEditTypes = $edit_types;
}
return $this->conduitEditTypes;
}
final public function getConduitEditType($key) {
$edit_types = $this->getConduitEditTypes();
if (empty($edit_types[$key])) {
throw new Exception(
pht(
'This EditField does not provide a Conduit EditType with key "%s".',
$key));
}
return $edit_types[$key];
}
protected function newConduitEditTypes() {
$edit_type = $this->getEditType(); $edit_type = $this->getEditType();
if ($edit_type === null) { if (!$edit_type) {
return array(); return array();
} }
@ -679,13 +755,8 @@ abstract class PhabricatorEditField extends Phobject {
return $edit_type->generateTransactions($template, $spec); return $edit_type->generateTransactions($template, $spec);
} }
public function setConduitDocumentation($conduit_documentation) {
$this->conduitDocumentation = $conduit_documentation;
return $this;
}
public function getConduitDocumentation() {
return $this->conduitDocumentation;
}
} }

View file

@ -11,4 +11,8 @@ final class PhabricatorInstructionsEditField
return null; return null;
} }
protected function newConduitParameterType() {
return null;
}
} }

View file

@ -4,7 +4,6 @@ abstract class PhabricatorPHIDListEditField
extends PhabricatorEditField { extends PhabricatorEditField {
private $useEdgeTransactions; private $useEdgeTransactions;
private $transactionDescriptions = array();
private $isSingleValue; private $isSingleValue;
public function setUseEdgeTransactions($use_edge_transactions) { public function setUseEdgeTransactions($use_edge_transactions) {
@ -16,15 +15,6 @@ abstract class PhabricatorPHIDListEditField
return $this->useEdgeTransactions; return $this->useEdgeTransactions;
} }
public function setEdgeTransactionDescriptions($add, $rem, $set) {
$this->transactionDescriptions = array(
'+' => $add,
'-' => $rem,
'=' => $set,
);
return $this;
}
public function setSingleValue($value) { public function setSingleValue($value) {
if ($value === null) { if ($value === null) {
$value = array(); $value = array();
@ -44,6 +34,10 @@ abstract class PhabricatorPHIDListEditField
return new AphrontPHIDListHTTPParameterType(); return new AphrontPHIDListHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitPHIDListParameterType();
}
protected function getValueFromRequest(AphrontRequest $request, $key) { protected function getValueFromRequest(AphrontRequest $request, $key) {
$value = parent::getValueFromRequest($request, $key); $value = parent::getValueFromRequest($request, $key);
if ($this->getIsSingleValue()) { if ($this->getIsSingleValue()) {
@ -105,9 +99,9 @@ abstract class PhabricatorPHIDListEditField
return $type; return $type;
} }
public function getConduitEditTypes() { protected function newConduitEditTypes() {
if (!$this->getUseEdgeTransactions()) { if (!$this->getUseEdgeTransactions()) {
return parent::getConduitEditTypes(); return parent::newConduitEditTypes();
} }
$transaction_type = $this->getTransactionType(); $transaction_type = $this->getTransactionType();
@ -116,27 +110,26 @@ abstract class PhabricatorPHIDListEditField
} }
$type_key = $this->getEditTypeKey(); $type_key = $this->getEditTypeKey();
$strings = $this->transactionDescriptions;
$base = $this->getEditType(); $base = $this->getEditType();
$add = id(clone $base) $add = id(clone $base)
->setEditType($type_key.'.add') ->setEditType($type_key.'.add')
->setEdgeOperation('+') ->setEdgeOperation('+')
->setDescription(idx($strings, '+')) ->setConduitTypeDescription(pht('List of PHIDs to add.'))
->setValueDescription(pht('List of PHIDs to add.')); ->setConduitParameterType($this->getConduitParameterType());
$rem = id(clone $base) $rem = id(clone $base)
->setEditType($type_key.'.remove') ->setEditType($type_key.'.remove')
->setEdgeOperation('-') ->setEdgeOperation('-')
->setDescription(idx($strings, '-')) ->setConduitTypeDescription(pht('List of PHIDs to remove.'))
->setValueDescription(pht('List of PHIDs to remove.')); ->setConduitParameterType($this->getConduitParameterType());
$set = id(clone $base) $set = id(clone $base)
->setEditType($type_key.'.set') ->setEditType($type_key.'.set')
->setEdgeOperation('=') ->setEdgeOperation('=')
->setDescription(idx($strings, '=')) ->setConduitTypeDescription(pht('List of PHIDs to set.'))
->setValueDescription(pht('List of PHIDs to set.')); ->setConduitParameterType($this->getConduitParameterType());
return array( return array(
$add, $add,

View file

@ -55,4 +55,9 @@ final class PhabricatorPolicyEditField
return new AphrontPHIDHTTPParameterType(); return new AphrontPHIDHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -11,4 +11,8 @@ final class PhabricatorProjectsEditField
return new AphrontProjectListHTTPParameterType(); return new AphrontProjectListHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitProjectListParameterType();
}
} }

View file

@ -7,4 +7,8 @@ final class PhabricatorRemarkupEditField
return new PhabricatorRemarkupControl(); return new PhabricatorRemarkupControl();
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -31,4 +31,8 @@ final class PhabricatorSelectEditField
->setOptions($this->getOptions()); ->setOptions($this->getOptions());
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -13,4 +13,8 @@ final class PhabricatorSpaceEditField
return new AphrontPHIDHTTPParameterType(); return new AphrontPHIDHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitPHIDParameterType();
}
} }

View file

@ -13,4 +13,8 @@ final class PhabricatorSubscribersEditField
return new AphrontUserListHTTPParameterType(); return new AphrontUserListHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitUserListParameterType();
}
} }

View file

@ -39,4 +39,8 @@ final class PhabricatorTextAreaEditField
return $control; return $control;
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -7,4 +7,8 @@ final class PhabricatorTextEditField
return new AphrontFormTextControl(); return new AphrontFormTextControl();
} }
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -11,4 +11,8 @@ final class PhabricatorUsersEditField
return new AphrontUserListHTTPParameterType(); return new AphrontUserListHTTPParameterType();
} }
protected function newConduitParameterType() {
return new ConduitUserListParameterType();
}
} }

View file

@ -2,8 +2,8 @@
final class PhabricatorCommentEditType extends PhabricatorEditType { final class PhabricatorCommentEditType extends PhabricatorEditType {
public function getValueType() { protected function newConduitParameterType() {
return id(new AphrontStringHTTPParameterType())->getTypeName(); return new ConduitStringParameterType();
} }
public function generateTransactions( public function generateTransactions(
@ -19,8 +19,4 @@ final class PhabricatorCommentEditType extends PhabricatorEditType {
return array($xaction); return array($xaction);
} }
public function getValueDescription() {
return pht('Comment to add, formated as remarkup.');
}
} }

View file

@ -34,13 +34,4 @@ final class PhabricatorEdgeEditType
return array($xaction); return array($xaction);
} }
public function setValueDescription($value_description) {
$this->valueDescription = $value_description;
return $this;
}
public function getValueDescription() {
return $this->valueDescription;
}
} }

View file

@ -3,34 +3,16 @@
abstract class PhabricatorEditType extends Phobject { abstract class PhabricatorEditType extends Phobject {
private $editType; private $editType;
private $editField;
private $transactionType; private $transactionType;
private $label; private $label;
private $field; private $field;
private $description;
private $summary;
private $metadata = array(); private $metadata = array();
private $conduitDescription;
private $conduitDocumentation; private $conduitDocumentation;
private $conduitTypeDescription;
public function setDescription($description) { private $conduitParameterType;
$this->description = $description;
return $this;
}
public function getDescription() {
return $this->description;
}
public function setSummary($summary) {
$this->summary = $summary;
return $this;
}
public function getSummary() {
if ($this->summary === null) {
return $this->getDescription();
}
return $this->summary;
}
public function setLabel($label) { public function setLabel($label) {
$this->label = $label; $this->label = $label;
@ -59,15 +41,6 @@ abstract class PhabricatorEditType extends Phobject {
return $this->editType; return $this->editType;
} }
public function setConduitDocumentation($conduit_documentation) {
$this->conduitDocumentation = $conduit_documentation;
return $this;
}
public function getConduitDocumentation() {
return $this->conduitDocumentation;
}
public function setMetadata($metadata) { public function setMetadata($metadata) {
$this->metadata = $metadata; $this->metadata = $metadata;
return $this; return $this;
@ -90,9 +63,6 @@ abstract class PhabricatorEditType extends Phobject {
PhabricatorApplicationTransaction $template, PhabricatorApplicationTransaction $template,
array $spec); array $spec);
abstract public function getValueType();
abstract public function getValueDescription();
protected function newTransaction( protected function newTransaction(
PhabricatorApplicationTransaction $template) { PhabricatorApplicationTransaction $template) {
@ -106,4 +76,83 @@ abstract class PhabricatorEditType extends Phobject {
return $xaction; return $xaction;
} }
public function setEditField(PhabricatorEditField $edit_field) {
$this->editField = $edit_field;
return $this;
}
public function getEditField() {
return $this->editField;
}
/* -( Conduit )------------------------------------------------------------ */
protected function newConduitParameterType() {
if ($this->conduitParameterType) {
return clone $this->conduitParameterType;
}
return null;
}
public function setConduitParameterType(ConduitParameterType $type) {
$this->conduitParameterType = $type;
return $this;
}
public function getConduitParameterType() {
return $this->newConduitParameterType();
}
public function getConduitType() {
$parameter_type = $this->getConduitParameterType();
return $parameter_type->getTypeName();
}
public function setConduitTypeDescription($conduit_type_description) {
$this->conduitTypeDescription = $conduit_type_description;
return $this;
}
public function getConduitTypeDescription() {
if ($this->conduitTypeDescription === null) {
if ($this->getEditField()) {
return $this->getEditField()->getConduitTypeDescription();
}
}
return $this->conduitTypeDescription;
}
public function setConduitDescription($conduit_description) {
$this->conduitDescription = $conduit_description;
return $this;
}
public function getConduitDescription() {
if ($this->conduitDescription === null) {
if ($this->getEditField()) {
return $this->getEditField()->getConduitDescription();
}
}
return $this->conduitDescription;
}
public function setConduitDocumentation($conduit_documentation) {
$this->conduitDocumentation = $conduit_documentation;
return $this;
}
public function getConduitDocumentation() {
if ($this->conduitDocumentation === null) {
if ($this->getEditField()) {
return $this->getEditField()->getConduitDocumentation();
}
}
return $this->conduitDocumentation;
}
} }

View file

@ -42,4 +42,17 @@ abstract class PhabricatorPHIDListEditType
} }
} }
protected function newConduitParameterType() {
$default = parent::newConduitParameterType();
if ($default) {
return $default;
}
if ($this->getIsSingleValue()) {
return new ConduitPHIDParameterType();
} else {
return new ConduitPHIDListParameterType();
}
}
} }

View file

@ -2,20 +2,6 @@
final class PhabricatorSimpleEditType extends PhabricatorEditType { final class PhabricatorSimpleEditType extends PhabricatorEditType {
private $valueType;
private $valueDescription;
private $phuixControlType;
private $phuixControlSpecification = array();
public function setValueType($value_type) {
$this->valueType = $value_type;
return $this;
}
public function getValueType() {
return $this->valueType;
}
public function generateTransactions( public function generateTransactions(
PhabricatorApplicationTransaction $template, PhabricatorApplicationTransaction $template,
array $spec) { array $spec) {
@ -26,13 +12,4 @@ final class PhabricatorSimpleEditType extends PhabricatorEditType {
return array($edit); return array($edit);
} }
public function setValueDescription($value_description) {
$this->valueDescription = $value_description;
return $this;
}
public function getValueDescription() {
return $this->valueDescription;
}
} }

View file

@ -5,6 +5,7 @@ final class PhabricatorCustomFieldEditField
private $customField; private $customField;
private $httpParameterType; private $httpParameterType;
private $conduitParameterType;
public function setCustomField(PhabricatorCustomField $custom_field) { public function setCustomField(PhabricatorCustomField $custom_field) {
$this->customField = $custom_field; $this->customField = $custom_field;
@ -25,6 +26,16 @@ final class PhabricatorCustomFieldEditField
return $this->httpParameterType; return $this->httpParameterType;
} }
public function setCustomFieldConduitParameterType(
ConduitParameterType $type) {
$this->conduitParameterType = $type;
return $this;
}
public function getCustomFieldConduitParameterType() {
return $this->conduitParameterType;
}
protected function buildControl() { protected function buildControl() {
$field = $this->getCustomField(); $field = $this->getCustomField();
$clone = clone $field; $clone = clone $field;
@ -36,14 +47,15 @@ final class PhabricatorCustomFieldEditField
} }
protected function newEditType() { protected function newEditType() {
$type = id(new PhabricatorCustomFieldEditType()) $conduit_type = $this->newConduitParameterType();
->setCustomField($this->getCustomField()); if (!$conduit_type) {
return null;
$http_type = $this->getHTTPParameterType();
if ($http_type) {
$type->setValueType($http_type->getTypeName());
} }
$type = id(new PhabricatorCustomFieldEditType())
->setCustomField($this->getCustomField())
->setConduitParameterType($conduit_type);
return $type; return $type;
} }
@ -71,14 +83,14 @@ final class PhabricatorCustomFieldEditField
return $clone->getNewValueForApplicationTransactions(); return $clone->getNewValueForApplicationTransactions();
} }
public function getConduitEditTypes() { protected function newConduitEditTypes() {
$field = $this->getCustomField(); $field = $this->getCustomField();
if (!$field->shouldAppearInConduitTransactions()) { if (!$field->shouldAppearInConduitTransactions()) {
return array(); return array();
} }
return parent::getConduitEditTypes(); return parent::newConduitEditTypes();
} }
protected function newHTTPParameterType() { protected function newHTTPParameterType() {
@ -91,6 +103,16 @@ final class PhabricatorCustomFieldEditField
return null; return null;
} }
protected function newConduitParameterType() {
$type = $this->getCustomFieldConduitParameterType();
if ($type) {
return clone $type;
}
return null;
}
public function getAllReadValueFromRequestKeys() { public function getAllReadValueFromRequestKeys() {
$keys = array(); $keys = array();

View file

@ -4,7 +4,6 @@ final class PhabricatorCustomFieldEditType
extends PhabricatorEditType { extends PhabricatorEditType {
private $customField; private $customField;
private $valueType;
public function setCustomField(PhabricatorCustomField $custom_field) { public function setCustomField(PhabricatorCustomField $custom_field) {
$this->customField = $custom_field; $this->customField = $custom_field;
@ -15,25 +14,11 @@ final class PhabricatorCustomFieldEditType
return $this->customField; return $this->customField;
} }
public function setValueType($value_type) {
$this->valueType = $value_type;
return $this;
}
public function getValueType() {
return $this->valueType;
}
public function getMetadata() { public function getMetadata() {
$field = $this->getCustomField(); $field = $this->getCustomField();
return parent::getMetadata() + $field->getApplicationTransactionMetadata(); return parent::getMetadata() + $field->getApplicationTransactionMetadata();
} }
public function getValueDescription() {
$field = $this->getCustomField();
return $field->getFieldDescription();
}
public function generateTransactions( public function generateTransactions(
PhabricatorApplicationTransaction $template, PhabricatorApplicationTransaction $template,
array $spec) { array $spec) {

View file

@ -1106,6 +1106,11 @@ abstract class PhabricatorCustomField extends Phobject {
$field->setCustomFieldHTTPParameterType($http_type); $field->setCustomFieldHTTPParameterType($http_type);
} }
$conduit_type = $this->getConduitEditParameterType();
if ($conduit_type) {
$field->setCustomFieldConduitParameterType($conduit_type);
}
return $field; return $field;
} }
@ -1348,6 +1353,17 @@ abstract class PhabricatorCustomField extends Phobject {
return null; return null;
} }
public function getConduitEditParameterType() {
return $this->newConduitEditParameterType();
}
protected function newConduitEditParameterType() {
if ($this->proxy) {
return $this->proxy->newConduitEditParameterType();
}
return null;
}
/* -( Herald )------------------------------------------------------------- */ /* -( Herald )------------------------------------------------------------- */

View file

@ -136,4 +136,9 @@ final class PhabricatorStandardCustomFieldBool
protected function newConduitSearchParameterType() { protected function newConduitSearchParameterType() {
return new ConduitBoolParameterType(); return new ConduitBoolParameterType();
} }
protected function newConduitEditParameterType() {
return new ConduitBoolParameterType();
}
} }

View file

@ -202,4 +202,8 @@ final class PhabricatorStandardCustomFieldDate
return null; return null;
} }
protected function newConduitEditParameterType() {
return new ConduitEpochParameterType();
}
} }

View file

@ -120,4 +120,8 @@ final class PhabricatorStandardCustomFieldInt
return new ConduitIntParameterType(); return new ConduitIntParameterType();
} }
protected function newConduitEditParameterType() {
return new ConduitIntParameterType();
}
} }

View file

@ -87,4 +87,9 @@ final class PhabricatorStandardCustomFieldLink
protected function newConduitSearchParameterType() { protected function newConduitSearchParameterType() {
return new ConduitStringListParameterType(); return new ConduitStringListParameterType();
} }
protected function newConduitEditParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -143,4 +143,9 @@ final class PhabricatorStandardCustomFieldSelect
protected function newConduitSearchParameterType() { protected function newConduitSearchParameterType() {
return new ConduitStringListParameterType(); return new ConduitStringListParameterType();
} }
protected function newConduitEditParameterType() {
return new ConduitStringParameterType();
}
} }

View file

@ -19,4 +19,8 @@ final class PhabricatorStandardCustomFieldUsers
return new ConduitUserListParameterType(); return new ConduitUserListParameterType();
} }
protected function newConduitEditParameterType() {
return new ConduitUserListParameterType();
}
} }