Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13973794
D18874.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D18874.diff
View Options
diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php
--- a/src/applications/maniphest/editor/ManiphestEditEngine.php
+++ b/src/applications/maniphest/editor/ManiphestEditEngine.php
@@ -189,6 +189,7 @@
->setKey('owner')
->setAliases(array('ownerPHID', 'assign', 'assigned'))
->setLabel(pht('Assigned To'))
+ ->setBulkEditLabel(pht('Assign to'))
->setDescription(pht('User who is responsible for the task.'))
->setConduitDescription(pht('Reassign the task.'))
->setConduitTypeDescription(
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -2219,7 +2219,6 @@
}
foreach ($field_types as $field_type) {
- $field_type->setField($field);
$types[$field_type->getEditType()] = $field_type;
}
}
@@ -2523,7 +2522,6 @@
}
foreach ($field_types as $field_type) {
- $field_type->setField($field);
$types[$field_type->getEditType()] = $field_type;
}
}
diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEditField.php
@@ -681,50 +681,49 @@
}
protected function newEditType() {
- $parameter_type = $this->getConduitParameterType();
- if (!$parameter_type) {
- return null;
- }
-
- $edit_type = id(new PhabricatorSimpleEditType())
- ->setConduitParameterType($parameter_type);
-
- $bulk_type = $this->getBulkParameterType();
- if ($bulk_type) {
- $edit_type->setBulkParameterType($bulk_type);
- }
-
- return $edit_type;
+ return new PhabricatorSimpleEditType();
}
protected function getEditType() {
$transaction_type = $this->getTransactionType();
-
if ($transaction_type === null) {
return null;
}
- $type_key = $this->getEditTypeKey();
$edit_type = $this->newEditType();
if (!$edit_type) {
return null;
}
- return $edit_type
- ->setEditType($type_key)
+ $type_key = $this->getEditTypeKey();
+
+ $edit_type
+ ->setEditField($this)
->setTransactionType($transaction_type)
+ ->setEditType($type_key)
->setMetadata($this->getMetadata());
+
+ if (!$edit_type->getConduitParameterType()) {
+ $conduit_parameter = $this->getConduitParameterType();
+ if ($conduit_parameter) {
+ $edit_type->setConduitParameterType($conduit_parameter);
+ }
+ }
+
+ if (!$edit_type->getBulkParameterType()) {
+ $bulk_parameter = $this->getBulkParameterType();
+ if ($bulk_parameter) {
+ $edit_type->setBulkParameterType($bulk_parameter);
+ }
+ }
+
+ return $edit_type;
}
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;
}
@@ -758,11 +757,6 @@
if ($this->bulkEditTypes === null) {
$edit_types = $this->newBulkEditTypes();
$edit_types = mpull($edit_types, null, 'getEditType');
-
- foreach ($edit_types as $edit_type) {
- $edit_type->setEditField($this);
- }
-
$this->bulkEditTypes = $edit_types;
}
diff --git a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
--- a/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorPHIDListEditField.php
@@ -98,10 +98,8 @@
return new PhabricatorEdgeEditType();
}
- $type = new PhabricatorDatasourceEditType();
- $type->setIsSingleValue($this->getIsSingleValue());
- $type->setConduitParameterType($this->newConduitParameterType());
- return $type;
+ return id(new PhabricatorDatasourceEditType())
+ ->setIsSingleValue($this->getIsSingleValue());
}
protected function newBulkEditTypes() {
diff --git a/src/applications/transactions/editfield/PhabricatorTokenizerEditField.php b/src/applications/transactions/editfield/PhabricatorTokenizerEditField.php
--- a/src/applications/transactions/editfield/PhabricatorTokenizerEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorTokenizerEditField.php
@@ -56,4 +56,12 @@
return $action;
}
+ protected function newBulkParameterType() {
+ $datasource = $this->newDatasource()
+ ->setViewer($this->getViewer());
+
+ return id(new BulkTokenizerParameterType())
+ ->setDatasource($datasource);
+ }
+
}
diff --git a/src/applications/transactions/edittype/PhabricatorDatasourceEditType.php b/src/applications/transactions/edittype/PhabricatorDatasourceEditType.php
--- a/src/applications/transactions/edittype/PhabricatorDatasourceEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorDatasourceEditType.php
@@ -19,4 +19,20 @@
return '?';
}
+ public function newRawBulkTransaction(array $xaction) {
+ $value = idx($xaction, 'value');
+
+ if ($this->getIsSingleValue()) {
+ if ($value) {
+ $value = head($value);
+ } else {
+ $value = null;
+ }
+
+ $xaction['value'] = $value;
+ }
+
+ return $xaction;
+ }
+
}
diff --git a/src/applications/transactions/edittype/PhabricatorEdgeEditType.php b/src/applications/transactions/edittype/PhabricatorEdgeEditType.php
--- a/src/applications/transactions/edittype/PhabricatorEdgeEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorEdgeEditType.php
@@ -43,7 +43,6 @@
->setDatasource($this->getDatasource());
}
-
public function newRawBulkTransaction(array $xaction) {
$value = idx($xaction, 'value');
diff --git a/src/applications/transactions/edittype/PhabricatorEditType.php b/src/applications/transactions/edittype/PhabricatorEditType.php
--- a/src/applications/transactions/edittype/PhabricatorEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorEditType.php
@@ -6,7 +6,6 @@
private $editField;
private $transactionType;
private $label;
- private $field;
private $metadata = array();
private $conduitDescription;
@@ -36,16 +35,7 @@
return $this->bulkEditLabel;
}
- return $this->getField()->getBulkEditLabel();
- }
-
- public function setField(PhabricatorEditField $field) {
- $this->field = $field;
- return $this;
- }
-
- public function getField() {
- return $this->field;
+ return $this->getEditField()->getBulkEditLabel();
}
public function setEditType($edit_type) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 19, 2:43 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713339
Default Alt Text
D18874.diff (6 KB)
Attached To
Mode
D18874: Support "Assign To" in Maniphest bulk editor
Attached
Detach File
Event Timeline
Log In to Comment