Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14356610
D14666.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14666.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
@@ -58,17 +58,9 @@
unset($status_map[$dup_status]);
}
- $owner_phid = $object->getOwnerPHID();
- if ($owner_phid) {
- $owner_value = array($owner_phid);
- } else {
- $owner_value = array();
- }
-
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
// TODO: Restore these or toss them:
- // - Require a single owner.
// - Default owner to viewer.
// - Don't show "change status" for closed tasks.
// - Don't show "change owner" for closed tasks.
@@ -92,12 +84,12 @@
->setValue($object->getStatus())
->setOptions($status_map),
id(new PhabricatorUsersEditField())
- ->setKey('assigned')
- ->setAliases(array('assign', 'assignee'))
+ ->setKey('owner')
+ ->setAliases(array('ownerPHID', 'assign', 'assigned'))
->setLabel(pht('Assigned To'))
->setDescription(pht('User who is responsible for the task.'))
->setTransactionType(ManiphestTransaction::TYPE_OWNER)
- ->setValue($owner_value),
+ ->setSingleValue($object->getOwnerPHID()),
id(new PhabricatorSelectEditField())
->setKey('priority')
->setLabel(pht('Priority'))
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
@@ -5,6 +5,7 @@
private $useEdgeTransactions;
private $transactionDescriptions = array();
+ private $isSingleValue;
public function setUseEdgeTransactions($use_edge_transactions) {
$this->useEdgeTransactions = $use_edge_transactions;
@@ -24,6 +25,21 @@
return $this;
}
+ public function setSingleValue($value) {
+ if ($value === null) {
+ $value = array();
+ } else {
+ $value = array($value);
+ }
+
+ $this->isSingleValue = true;
+ return $this->setValue($value);
+ }
+
+ public function getIsSingleValue() {
+ return $this->isSingleValue;
+ }
+
protected function newHTTPParameterType() {
return new AphrontPHIDListHTTPParameterType();
}
@@ -31,6 +47,14 @@
public function getValueForTransaction() {
$new = parent::getValueForTransaction();
+ if ($this->getIsSingleValue()) {
+ if ($new) {
+ return head($new);
+ } else {
+ return null;
+ }
+ }
+
if (!$this->getUseEdgeTransactions()) {
return $new;
}
@@ -68,7 +92,13 @@
return new PhabricatorEdgeEditType();
}
- return parent::newEditType();
+ $type = parent::newEditType();
+
+ if ($this->getIsSingleValue()) {
+ $type->setValueType('phid');
+ }
+
+ return $type;
}
public function getConduitEditTypes() {
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
@@ -25,6 +25,10 @@
$control->setOriginalValue($initial_value);
}
+ if ($this->getIsSingleValue()) {
+ $control->setLimit(1);
+ }
+
return $control;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 10:43 PM (17 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908908
Default Alt Text
D14666.diff (3 KB)
Attached To
Mode
D14666: Limit number of EditEngine tokenizer tokens in "Owner" field UI to 1
Attached
Detach File
Event Timeline
Log In to Comment