1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

Allow "Change Subtype" to be selected from the comment action stack

Summary:
Ref T13222. See PHI683. Currently, you can "Change subtype..." via Conduit and the bulk editor, but not via the comment action stack or edit forms.

In PHI683 an install is doing this often enough that they'd like it to become a first-class action. I've generally been cautious about pushing this action to become a first-class action (there are some inevitable rough edges and I don't want to add too much complexity if there isn't a use case for it) but since we have evidence that users would find it useful and nothing has exploded yet, I'm comfortable taking another step forward.

Currently, `EditEngine` has this sort of weird `setIsConduitOnly()` method. This actually means more like "this doesn't show up on forms". Make it better align with that. In particular, a "conduit only" field can already show up in the bulk editor, which is goofy. Change this to `setIsFormField()` and convert/simplify existing callsites.

Test Plan:
There are a lot of ways to reach EditEngine so this probably isn't entirely exhaustive, but I think I got pretty much anything which is likely to break:

- Searched for `setIsConduitOnly()` and `getIsConduitOnly()`, converted all callsites to `setIsFormField()`.
- Searched for `setIsLockable()`, `setIsReorderable()` and `setIsDefaultable()` and aligned these calls to intent where applicable.
- Created an Almanac binding.
- Edited an Almanac binding.
- Created an Almanac service.
- Edited an Almanac service.
- Edited a binding property.
- Deleted a binding property.
- Created and edited a badge.
- Awarded and revoked a badge.
- Created and edited an event.
- Made an event recurring.
- Created and edited a Conpherence thread.
- Edited and updated the diff for a revision.
- Created and edited a repository.
- Created and disabled repository URIs.
- Created and edited a blueprint.
- Created and edited tasks.
- Created a paste, edited/archived a paste.
- Created/edited/archived a package.
- Created/edited a project.
- Made comments.
- Moved tasks on workboards via comment action stack.
- Changed task subtype via comment action stack.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13222

Differential Revision: https://secure.phabricator.com/D19842
This commit is contained in:
epriestley 2018-11-26 15:44:48 -08:00
parent 1d0b99e1f8
commit 2f11001f6e
29 changed files with 85 additions and 68 deletions

View file

@ -136,7 +136,7 @@ final class AlmanacBindingEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('service') ->setKey('service')
->setLabel(pht('Service')) ->setLabel(pht('Service'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
AlmanacBindingServiceTransaction::TRANSACTIONTYPE) AlmanacBindingServiceTransaction::TRANSACTIONTYPE)
->setDescription(pht('Service to create a binding for.')) ->setDescription(pht('Service to create a binding for.'))
@ -146,7 +146,7 @@ final class AlmanacBindingEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('interface') ->setKey('interface')
->setLabel(pht('Interface')) ->setLabel(pht('Interface'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
AlmanacBindingInterfaceTransaction::TRANSACTIONTYPE) AlmanacBindingInterfaceTransaction::TRANSACTIONTYPE)
->setDescription(pht('Interface to bind the service to.')) ->setDescription(pht('Interface to bind the service to.'))
@ -156,7 +156,7 @@ final class AlmanacBindingEditEngine
id(new PhabricatorBoolEditField()) id(new PhabricatorBoolEditField())
->setKey('disabled') ->setKey('disabled')
->setLabel(pht('Disabled')) ->setLabel(pht('Disabled'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
AlmanacBindingDisableTransaction::TRANSACTIONTYPE) AlmanacBindingDisableTransaction::TRANSACTIONTYPE)
->setDescription(pht('Disable or enable the binding.')) ->setDescription(pht('Disable or enable the binding.'))

View file

@ -150,7 +150,7 @@ final class AlmanacInterfaceEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('device') ->setKey('device')
->setLabel(pht('Device')) ->setLabel(pht('Device'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
AlmanacInterfaceDeviceTransaction::TRANSACTIONTYPE) AlmanacInterfaceDeviceTransaction::TRANSACTIONTYPE)
->setDescription(pht('When creating an interface, set the device.')) ->setDescription(pht('When creating an interface, set the device.'))

View file

@ -136,7 +136,7 @@ final class AlmanacServiceEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('type') ->setKey('type')
->setLabel(pht('Type')) ->setLabel(pht('Type'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
AlmanacServiceTypeTransaction::TRANSACTIONTYPE) AlmanacServiceTypeTransaction::TRANSACTIONTYPE)
->setDescription(pht('When creating a service, set the type.')) ->setDescription(pht('When creating a service, set the type.'))

View file

@ -30,14 +30,14 @@ final class AlmanacPropertiesEditEngineExtension
->setConduitDescription( ->setConduitDescription(
pht('Pass a map of values to set one or more properties.')) pht('Pass a map of values to set one or more properties.'))
->setConduitTypeDescription(pht('Map of property names to values.')) ->setConduitTypeDescription(pht('Map of property names to values.'))
->setIsConduitOnly(true), ->setIsFormField(false),
id(new AlmanacDeletePropertyEditField()) id(new AlmanacDeletePropertyEditField())
->setKey('property.delete') ->setKey('property.delete')
->setTransactionType($object->getAlmanacPropertyDeleteTransactionType()) ->setTransactionType($object->getAlmanacPropertyDeleteTransactionType())
->setConduitDescription( ->setConduitDescription(
pht('Pass a list of property names to delete properties.')) pht('Pass a list of property names to delete properties.'))
->setConduitTypeDescription(pht('List of property names.')) ->setConduitTypeDescription(pht('List of property names.'))
->setIsConduitOnly(true), ->setIsFormField(false),
); );
} }

View file

@ -126,7 +126,7 @@ final class PhabricatorBadgesEditEngine
->setValue($object->getDescription()), ->setValue($object->getDescription()),
id(new PhabricatorUsersEditField()) id(new PhabricatorUsersEditField())
->setKey('award') ->setKey('award')
->setIsConduitOnly(true) ->setIsFormField(false)
->setDescription(pht('New badge award recipients.')) ->setDescription(pht('New badge award recipients.'))
->setConduitTypeDescription(pht('New badge award recipients.')) ->setConduitTypeDescription(pht('New badge award recipients.'))
->setTransactionType( ->setTransactionType(
@ -134,7 +134,7 @@ final class PhabricatorBadgesEditEngine
->setLabel(pht('Award Recipients')), ->setLabel(pht('Award Recipients')),
id(new PhabricatorUsersEditField()) id(new PhabricatorUsersEditField())
->setKey('revoke') ->setKey('revoke')
->setIsConduitOnly(true) ->setIsFormField(false)
->setDescription(pht('Revoke badge award recipients.')) ->setDescription(pht('Revoke badge award recipients.'))
->setConduitTypeDescription(pht('Revoke badge award recipients.')) ->setConduitTypeDescription(pht('Revoke badge award recipients.'))
->setTransactionType( ->setTransactionType(

View file

@ -148,7 +148,7 @@ final class PhabricatorCalendarEventEditEngine
->setDescription(pht('Cancel the event.')) ->setDescription(pht('Cancel the event.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarEventCancelTransaction::TRANSACTIONTYPE) PhabricatorCalendarEventCancelTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Cancel or restore the event.')) ->setConduitDescription(pht('Cancel or restore the event.'))
->setConduitTypeDescription(pht('True to cancel the event.')) ->setConduitTypeDescription(pht('True to cancel the event.'))
->setValue($object->getIsCancelled()), ->setValue($object->getIsCancelled()),
@ -161,7 +161,7 @@ final class PhabricatorCalendarEventEditEngine
->setDescription(pht('Host of the event.')) ->setDescription(pht('Host of the event.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarEventHostTransaction::TRANSACTIONTYPE) PhabricatorCalendarEventHostTransaction::TRANSACTIONTYPE)
->setIsConduitOnly($this->getIsCreate()) ->setIsFormField(!$this->getIsCreate())
->setConduitDescription(pht('Change the host of the event.')) ->setConduitDescription(pht('Change the host of the event.'))
->setConduitTypeDescription(pht('New event host.')) ->setConduitTypeDescription(pht('New event host.'))
->setSingleValue($object->getHostPHID()), ->setSingleValue($object->getHostPHID()),

View file

@ -99,7 +99,7 @@ final class PhabricatorCalendarExportEditEngine
->setDescription(pht('Disable the export.')) ->setDescription(pht('Disable the export.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarExportDisableTransaction::TRANSACTIONTYPE) PhabricatorCalendarExportDisableTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Disable or restore the export.')) ->setConduitDescription(pht('Disable or restore the export.'))
->setConduitTypeDescription(pht('True to cancel the export.')) ->setConduitTypeDescription(pht('True to cancel the export.'))
->setValue($object->getIsDisabled()), ->setValue($object->getIsDisabled()),

View file

@ -101,7 +101,7 @@ final class PhabricatorCalendarImportEditEngine
->setDescription(pht('Disable the import.')) ->setDescription(pht('Disable the import.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE) PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Disable or restore the import.')) ->setConduitDescription(pht('Disable or restore the import.'))
->setConduitTypeDescription(pht('True to cancel the import.')) ->setConduitTypeDescription(pht('True to cancel the import.'))
->setValue($object->getIsDisabled()), ->setValue($object->getIsDisabled()),
@ -111,7 +111,7 @@ final class PhabricatorCalendarImportEditEngine
->setDescription(pht('Delete all events from this source.')) ->setDescription(pht('Delete all events from this source.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE) PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Disable or restore the import.')) ->setConduitDescription(pht('Disable or restore the import.'))
->setConduitTypeDescription(pht('True to delete imported events.')) ->setConduitTypeDescription(pht('True to delete imported events.'))
->setValue(false), ->setValue(false),
@ -121,7 +121,7 @@ final class PhabricatorCalendarImportEditEngine
->setDescription(pht('Reload events imported from this source.')) ->setDescription(pht('Reload events imported from this source.'))
->setTransactionType( ->setTransactionType(
PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE) PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Disable or restore the import.')) ->setConduitDescription(pht('Disable or restore the import.'))
->setConduitTypeDescription(pht('True to reload the import.')) ->setConduitTypeDescription(pht('True to reload the import.'))
->setValue(false), ->setValue(false),

View file

@ -76,8 +76,8 @@ final class ConpherenceEditEngine
$initial_phids = $participant_phids; $initial_phids = $participant_phids;
} }
// Only show participants on create or conduit, not edit // Only show participants on create or conduit, not edit.
$conduit_only = !$this->getIsCreate(); $show_participants = (bool)$this->getIsCreate();
return array( return array(
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
@ -103,7 +103,7 @@ final class ConpherenceEditEngine
->setKey('participants') ->setKey('participants')
->setValue($participant_phids) ->setValue($participant_phids)
->setInitialValue($initial_phids) ->setInitialValue($initial_phids)
->setIsConduitOnly($conduit_only) ->setIsFormField($show_participants)
->setAliases(array('users', 'members', 'participants', 'userPHID')) ->setAliases(array('users', 'members', 'participants', 'userPHID'))
->setDescription(pht('Room participants.')) ->setDescription(pht('Room participants.'))
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)

View file

@ -138,7 +138,7 @@ final class DifferentialRevisionEditEngine
DifferentialRevisionUpdateTransaction::TRANSACTIONTYPE) DifferentialRevisionUpdateTransaction::TRANSACTIONTYPE)
->setHandleParameterType(new AphrontPHIDListHTTPParameterType()) ->setHandleParameterType(new AphrontPHIDListHTTPParameterType())
->setSingleValue($diff_phid) ->setSingleValue($diff_phid)
->setIsConduitOnly(!$diff) ->setIsFormField((bool)$diff)
->setIsReorderable(false) ->setIsReorderable(false)
->setIsDefaultable(false) ->setIsDefaultable(false)
->setIsInvisible(true) ->setIsInvisible(true)
@ -225,7 +225,7 @@ final class DifferentialRevisionEditEngine
$fields[] = id(new PhabricatorHandlesEditField()) $fields[] = id(new PhabricatorHandlesEditField())
->setKey('tasks') ->setKey('tasks')
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue( ->setMetadataValue(
'edge:type', 'edge:type',
@ -245,7 +245,7 @@ final class DifferentialRevisionEditEngine
$fields[] = id(new PhabricatorBoolEditField()) $fields[] = id(new PhabricatorBoolEditField())
->setKey('draft') ->setKey('draft')
->setLabel(pht('Hold as Draft')) ->setLabel(pht('Hold as Draft'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions( ->setOptions(
pht('Autosubmit Once Builds Finish'), pht('Autosubmit Once Builds Finish'),
pht('Hold as Draft')) pht('Hold as Draft'))

View file

@ -244,7 +244,7 @@ final class DiffusionRepositoryEditEngine
->setKey('vcs') ->setKey('vcs')
->setLabel(pht('Version Control System')) ->setLabel(pht('Version Control System'))
->setTransactionType(PhabricatorRepositoryTransaction::TYPE_VCS) ->setTransactionType(PhabricatorRepositoryTransaction::TYPE_VCS)
->setIsConduitOnly(true) ->setIsFormField(false)
->setIsCopyable(true) ->setIsCopyable(true)
->setOptions(PhabricatorRepositoryType::getAllRepositoryTypes()) ->setOptions(PhabricatorRepositoryType::getAllRepositoryTypes())
->setDescription(pht('Underlying repository version control system.')) ->setDescription(pht('Underlying repository version control system.'))
@ -300,7 +300,7 @@ final class DiffusionRepositoryEditEngine
->setKey('allowDangerousChanges') ->setKey('allowDangerousChanges')
->setLabel(pht('Allow Dangerous Changes')) ->setLabel(pht('Allow Dangerous Changes'))
->setIsCopyable(true) ->setIsCopyable(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions( ->setOptions(
pht('Prevent Dangerous Changes'), pht('Prevent Dangerous Changes'),
pht('Allow Dangerous Changes')) pht('Allow Dangerous Changes'))
@ -313,7 +313,7 @@ final class DiffusionRepositoryEditEngine
->setKey('allowEnormousChanges') ->setKey('allowEnormousChanges')
->setLabel(pht('Allow Enormous Changes')) ->setLabel(pht('Allow Enormous Changes'))
->setIsCopyable(true) ->setIsCopyable(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions( ->setOptions(
pht('Prevent Enormous Changes'), pht('Prevent Enormous Changes'),
pht('Allow Enormous Changes')) pht('Allow Enormous Changes'))
@ -326,7 +326,7 @@ final class DiffusionRepositoryEditEngine
->setKey('status') ->setKey('status')
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setTransactionType(PhabricatorRepositoryTransaction::TYPE_ACTIVATE) ->setTransactionType(PhabricatorRepositoryTransaction::TYPE_ACTIVATE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions(PhabricatorRepository::getStatusNameMap()) ->setOptions(PhabricatorRepository::getStatusNameMap())
->setDescription(pht('Active or inactive status.')) ->setDescription(pht('Active or inactive status.'))
->setConduitDescription(pht('Active or deactivate the repository.')) ->setConduitDescription(pht('Active or deactivate the repository.'))

View file

@ -150,7 +150,7 @@ final class DiffusionURIEditEngine
->setAliases(array('repositoryPHID')) ->setAliases(array('repositoryPHID'))
->setLabel(pht('Repository')) ->setLabel(pht('Repository'))
->setIsRequired(true) ->setIsRequired(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
PhabricatorRepositoryURITransaction::TYPE_REPOSITORY) PhabricatorRepositoryURITransaction::TYPE_REPOSITORY)
->setDescription(pht('The repository this URI is associated with.')) ->setDescription(pht('The repository this URI is associated with.'))
@ -195,7 +195,7 @@ final class DiffusionURIEditEngine
->setKey('credential') ->setKey('credential')
->setAliases(array('credentialPHID')) ->setAliases(array('credentialPHID'))
->setLabel(pht('Credential')) ->setLabel(pht('Credential'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
PhabricatorRepositoryURITransaction::TYPE_CREDENTIAL) PhabricatorRepositoryURITransaction::TYPE_CREDENTIAL)
->setDescription( ->setDescription(
@ -206,7 +206,7 @@ final class DiffusionURIEditEngine
id(new PhabricatorBoolEditField()) id(new PhabricatorBoolEditField())
->setKey('disable') ->setKey('disable')
->setLabel(pht('Disabled')) ->setLabel(pht('Disabled'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType(PhabricatorRepositoryURITransaction::TYPE_DISABLE) ->setTransactionType(PhabricatorRepositoryURITransaction::TYPE_DISABLE)
->setDescription(pht('Active status of the URI.')) ->setDescription(pht('Active status of the URI.'))
->setConduitDescription(pht('Disable or activate the URI.')) ->setConduitDescription(pht('Disable or activate the URI.'))

View file

@ -153,7 +153,7 @@ final class DrydockBlueprintEditEngine
id(new PhabricatorTextEditField()) id(new PhabricatorTextEditField())
->setKey('type') ->setKey('type')
->setLabel(pht('Type')) ->setLabel(pht('Type'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
DrydockBlueprintTypeTransaction::TRANSACTIONTYPE) DrydockBlueprintTypeTransaction::TRANSACTIONTYPE)
->setDescription(pht('When creating a blueprint, set the type.')) ->setDescription(pht('When creating a blueprint, set the type.'))

View file

@ -169,9 +169,7 @@ EODOCS
->setConduitDocumentation($column_documentation) ->setConduitDocumentation($column_documentation)
->setAliases(array('columnPHID', 'columns', 'columnPHIDs')) ->setAliases(array('columnPHID', 'columns', 'columnPHIDs'))
->setTransactionType(PhabricatorTransactions::TYPE_COLUMNS) ->setTransactionType(PhabricatorTransactions::TYPE_COLUMNS)
->setIsReorderable(false) ->setIsFormField(false)
->setIsDefaultable(false)
->setIsLockable(false)
->setCommentActionLabel(pht('Move on Workboard')) ->setCommentActionLabel(pht('Move on Workboard'))
->setCommentActionOrder(2000) ->setCommentActionOrder(2000)
->setColumnMap($column_map), ->setColumnMap($column_map),
@ -291,7 +289,7 @@ EODOCS
->setConduitDescription(pht('Change the parents of this task.')) ->setConduitDescription(pht('Change the parents of this task.'))
->setConduitTypeDescription(pht('List of parent task PHIDs.')) ->setConduitTypeDescription(pht('List of parent task PHIDs.'))
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $parent_type) ->setMetadataValue('edge:type', $parent_type)
->setValue($parent_phids); ->setValue($parent_phids);
@ -303,7 +301,7 @@ EODOCS
->setConduitDescription(pht('Change the subtasks of this task.')) ->setConduitDescription(pht('Change the subtasks of this task.'))
->setConduitTypeDescription(pht('List of subtask PHIDs.')) ->setConduitTypeDescription(pht('List of subtask PHIDs.'))
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $subtask_type) ->setMetadataValue('edge:type', $subtask_type)
->setValue($parent_phids); ->setValue($parent_phids);

View file

@ -159,7 +159,7 @@ EOTEXT
->setDescription(pht('Archive or enable the package.')) ->setDescription(pht('Archive or enable the package.'))
->setTransactionType( ->setTransactionType(
PhabricatorOwnersPackageStatusTransaction::TRANSACTIONTYPE) PhabricatorOwnersPackageStatusTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setValue($object->getStatus()) ->setValue($object->getStatus())
->setOptions($object->getStatusNameMap()), ->setOptions($object->getStatusNameMap()),
id(new PhabricatorCheckboxesEditField()) id(new PhabricatorCheckboxesEditField())
@ -176,7 +176,7 @@ EOTEXT
id(new PhabricatorConduitEditField()) id(new PhabricatorConduitEditField())
->setKey('paths.set') ->setKey('paths.set')
->setLabel(pht('Paths')) ->setLabel(pht('Paths'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setTransactionType( ->setTransactionType(
PhabricatorOwnersPackagePathsTransaction::TRANSACTIONTYPE) PhabricatorOwnersPackagePathsTransaction::TRANSACTIONTYPE)
->setConduitDescription( ->setConduitDescription(

View file

@ -104,7 +104,7 @@ final class PhabricatorPasteEditEngine
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setTransactionType( ->setTransactionType(
PhabricatorPasteStatusTransaction::TRANSACTIONTYPE) PhabricatorPasteStatusTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions(PhabricatorPaste::getStatusNameMap()) ->setOptions(PhabricatorPaste::getStatusNameMap())
->setDescription(pht('Active or archived status.')) ->setDescription(pht('Active or archived status.'))
->setConduitDescription(pht('Active or archive the paste.')) ->setConduitDescription(pht('Active or archive the paste.'))

View file

@ -71,7 +71,7 @@ final class PhabricatorUserEditEngine
->setLabel(pht('Disabled')) ->setLabel(pht('Disabled'))
->setDescription(pht('Disable the user.')) ->setDescription(pht('Disable the user.'))
->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE) ->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setConduitDescription(pht('Disable or enable the user.')) ->setConduitDescription(pht('Disable or enable the user.'))
->setConduitTypeDescription(pht('True to disable the user.')) ->setConduitTypeDescription(pht('True to disable the user.'))
->setValue($object->getIsDisabled()), ->setValue($object->getIsDisabled()),

View file

@ -126,7 +126,7 @@ final class PhameBlogEditEngine
->setKey('status') ->setKey('status')
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setTransactionType(PhameBlogStatusTransaction::TRANSACTIONTYPE) ->setTransactionType(PhameBlogStatusTransaction::TRANSACTIONTYPE)
->setIsConduitOnly(true) ->setIsFormField(false)
->setOptions(PhameBlog::getStatusNameMap()) ->setOptions(PhameBlog::getStatusNameMap())
->setDescription(pht('Active or archived status.')) ->setDescription(pht('Active or archived status.'))
->setConduitDescription(pht('Active or archive the blog.')) ->setConduitDescription(pht('Active or archive the blog.'))

View file

@ -287,13 +287,13 @@ final class PhabricatorProjectEditEngine
// Show this on the web UI when creating a project, but not when editing // Show this on the web UI when creating a project, but not when editing
// one. It is always available via Conduit. // one. It is always available via Conduit.
$conduit_only = !$this->getIsCreate(); $show_field = (bool)$this->getIsCreate();
$members_field = id(new PhabricatorUsersEditField()) $members_field = id(new PhabricatorUsersEditField())
->setKey('members') ->setKey('members')
->setAliases(array('memberPHIDs')) ->setAliases(array('memberPHIDs'))
->setLabel(pht('Initial Members')) ->setLabel(pht('Initial Members'))
->setIsConduitOnly($conduit_only) ->setIsFormField($show_field)
->setUseEdgeTransactions(true) ->setUseEdgeTransactions(true)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue( ->setMetadataValue(

View file

@ -30,6 +30,11 @@ final class PhabricatorEditEngineConfigurationDefaultsController
$fields = $engine->getFieldsForConfig($config); $fields = $engine->getFieldsForConfig($config);
foreach ($fields as $key => $field) { foreach ($fields as $key => $field) {
if (!$field->getIsFormField()) {
unset($fields[$key]);
continue;
}
if (!$field->getIsDefaultable()) { if (!$field->getIsDefaultable()) {
unset($fields[$key]); unset($fields[$key]);
continue; continue;

View file

@ -79,6 +79,10 @@ EOTEXT
); );
foreach ($fields as $field) { foreach ($fields as $field) {
if (!$field->getIsFormField()) {
continue;
}
if (!$field->getIsLockable()) { if (!$field->getIsLockable()) {
continue; continue;
} }

View file

@ -62,6 +62,10 @@ final class PhabricatorEditEngineConfigurationReorderController
$key_order = array(); $key_order = array();
foreach ($fields as $field) { foreach ($fields as $field) {
if (!$field->getIsFormField()) {
continue;
}
if (!$field->getIsReorderable()) { if (!$field->getIsReorderable()) {
continue; continue;
} }

View file

@ -1289,6 +1289,10 @@ abstract class PhabricatorEditEngine
} }
foreach ($fields as $field) { foreach ($fields as $field) {
if (!$field->getIsFormField()) {
continue;
}
$field->appendToForm($form); $field->appendToForm($form);
} }

View file

@ -44,7 +44,7 @@ abstract class PhabricatorEditField extends Phobject {
private $isDefaultable = true; private $isDefaultable = true;
private $isLockable = true; private $isLockable = true;
private $isCopyable = false; private $isCopyable = false;
private $isConduitOnly = false; private $isFormField = true;
private $conduitEditTypes; private $conduitEditTypes;
private $bulkEditTypes; private $bulkEditTypes;
@ -139,13 +139,13 @@ abstract class PhabricatorEditField extends Phobject {
return $this->isReorderable; return $this->isReorderable;
} }
public function setIsConduitOnly($is_conduit_only) { public function setIsFormField($is_form_field) {
$this->isConduitOnly = $is_conduit_only; $this->isFormField = $is_form_field;
return $this; return $this;
} }
public function getIsConduitOnly() { public function getIsFormField() {
return $this->isConduitOnly; return $this->isFormField;
} }
public function setDescription($description) { public function setDescription($description) {
@ -336,7 +336,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
protected function buildControl() { protected function buildControl() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return null; return null;
} }
@ -637,7 +637,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
final public function getHTTPParameterType() { final public function getHTTPParameterType() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return null; return null;
} }
@ -840,7 +840,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
public function shouldGenerateTransactionsFromSubmit() { public function shouldGenerateTransactionsFromSubmit() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return false; return false;
} }
@ -853,7 +853,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
public function shouldReadValueFromRequest() { public function shouldReadValueFromRequest() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return false; return false;
} }
@ -869,7 +869,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
public function shouldReadValueFromSubmit() { public function shouldReadValueFromSubmit() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return false; return false;
} }
@ -885,7 +885,7 @@ abstract class PhabricatorEditField extends Phobject {
} }
public function shouldGenerateTransactionsFromComment() { public function shouldGenerateTransactionsFromComment() {
if ($this->getIsConduitOnly()) { if (!$this->getCommentActionLabel()) {
return false; return false;
} }

View file

@ -57,10 +57,7 @@ final class PhabricatorCommentEditEngineExtension
->setBulkEditLabel(pht('Add comment')) ->setBulkEditLabel(pht('Add comment'))
->setBulkEditGroupKey('comments') ->setBulkEditGroupKey('comments')
->setAliases(array('comments')) ->setAliases(array('comments'))
->setIsHidden(true) ->setIsFormField(false)
->setIsReorderable(false)
->setIsDefaultable(false)
->setIsLockable(false)
->setCanApplyWithoutEditCapability($is_interact) ->setCanApplyWithoutEditCapability($is_interact)
->setTransactionType($comment_type) ->setTransactionType($comment_type)
->setConduitDescription(pht('Make comments.')) ->setConduitDescription(pht('Make comments.'))

View file

@ -36,20 +36,20 @@ final class PhabricatorSubtypeEditEngineExtension
$subtype_field = id(new PhabricatorSelectEditField()) $subtype_field = id(new PhabricatorSelectEditField())
->setKey(self::EDITKEY) ->setKey(self::EDITKEY)
->setLabel(pht('Subtype')) ->setLabel(pht('Subtype'))
->setIsConduitOnly(true) ->setIsFormField(false)
->setIsHidden(true)
->setIsReorderable(false)
->setIsDefaultable(false)
->setIsLockable(false)
->setTransactionType($subtype_type) ->setTransactionType($subtype_type)
->setConduitDescription(pht('Change the object subtype.')) ->setConduitDescription(pht('Change the object subtype.'))
->setConduitTypeDescription(pht('New object subtype key.')) ->setConduitTypeDescription(pht('New object subtype key.'))
->setValue($object->getEditEngineSubtype()) ->setValue($object->getEditEngineSubtype())
->setOptions($options); ->setOptions($options);
// If subtypes are configured, enable changing them from the bulk editor. // If subtypes are configured, enable changing them from the bulk editor
// and comment action stack.
if (count($map) > 1) { if (count($map) > 1) {
$subtype_field->setBulkEditLabel(pht('Change subtype to')); $subtype_field
->setBulkEditLabel(pht('Change subtype to'))
->setCommentActionLabel(pht('Change Subtype'))
->setCommentActionOrder(3000);
} }
return array( return array(

View file

@ -139,9 +139,14 @@ final class PhabricatorEditEngineConfiguration
$values = $this->getProperty('defaults', array()); $values = $this->getProperty('defaults', array());
foreach ($fields as $key => $field) { foreach ($fields as $key => $field) {
if (!$field->getIsFormField()) {
continue;
}
if (!$field->getIsDefaultable()) { if (!$field->getIsDefaultable()) {
continue; continue;
} }
if ($is_new) { if ($is_new) {
if (array_key_exists($key, $values)) { if (array_key_exists($key, $values)) {
$field->readDefaultValueFromConfiguration($values[$key]); $field->readDefaultValueFromConfiguration($values[$key]);

View file

@ -59,7 +59,7 @@ final class PhabricatorCustomFieldEditField
} }
protected function buildControl() { protected function buildControl() {
if ($this->getIsConduitOnly()) { if (!$this->getIsFormField()) {
return null; return null;
} }

View file

@ -1145,10 +1145,10 @@ abstract class PhabricatorCustomField extends Phobject {
return $this->proxy->newStandardEditField(); return $this->proxy->newStandardEditField();
} }
if (!$this->shouldAppearInEditView()) { if ($this->shouldAppearInEditView()) {
$conduit_only = true; $form_field = true;
} else { } else {
$conduit_only = false; $form_field = false;
} }
$bulk_label = $this->getBulkEditLabel(); $bulk_label = $this->getBulkEditLabel();
@ -1160,7 +1160,7 @@ abstract class PhabricatorCustomField extends Phobject {
->setBulkEditLabel($bulk_label) ->setBulkEditLabel($bulk_label)
->setDescription($this->getFieldDescription()) ->setDescription($this->getFieldDescription())
->setTransactionType($this->getApplicationTransactionType()) ->setTransactionType($this->getApplicationTransactionType())
->setIsConduitOnly($conduit_only) ->setIsFormField($form_field)
->setValue($this->getNewValueForApplicationTransactions()); ->setValue($this->getNewValueForApplicationTransactions());
} }