Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14054046
D18866.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D18866.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -223,6 +223,7 @@
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php',
'BulkParameterType' => 'applications/transactions/bulk/type/BulkParameterType.php',
+ 'BulkSelectParameterType' => 'applications/transactions/bulk/type/BulkSelectParameterType.php',
'BulkStringParameterType' => 'applications/transactions/bulk/type/BulkStringParameterType.php',
'CalendarTimeUtil' => 'applications/calendar/util/CalendarTimeUtil.php',
'CalendarTimeUtilTestCase' => 'applications/calendar/__tests__/CalendarTimeUtilTestCase.php',
@@ -5244,6 +5245,7 @@
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
'BulkParameterType' => 'Phobject',
+ 'BulkSelectParameterType' => 'BulkParameterType',
'BulkStringParameterType' => 'BulkParameterType',
'CalendarTimeUtil' => 'Phobject',
'CalendarTimeUtilTestCase' => 'PhabricatorTestCase',
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
@@ -201,6 +201,7 @@
id(new PhabricatorSelectEditField())
->setKey('status')
->setLabel(pht('Status'))
+ ->setBulkEditLabel(pht('Set status to'))
->setDescription(pht('Status of the task.'))
->setConduitDescription(pht('Change the task status.'))
->setConduitTypeDescription(pht('New task status constant.'))
@@ -213,6 +214,7 @@
id(new PhabricatorSelectEditField())
->setKey('priority')
->setLabel(pht('Priority'))
+ ->setBulkEditLabel(pht('Set priority to'))
->setDescription(pht('Priority of the task.'))
->setConduitDescription(pht('Change the priority of the task.'))
->setConduitTypeDescription(pht('New task priority constant.'))
diff --git a/src/applications/transactions/bulk/type/BulkParameterType.php b/src/applications/transactions/bulk/type/BulkParameterType.php
--- a/src/applications/transactions/bulk/type/BulkParameterType.php
+++ b/src/applications/transactions/bulk/type/BulkParameterType.php
@@ -3,6 +3,7 @@
abstract class BulkParameterType extends Phobject {
private $viewer;
+ private $field;
final public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
@@ -13,6 +14,15 @@
return $this->viewer;
}
+ final public function setField(PhabricatorEditField $field) {
+ $this->field = $field;
+ return $this;
+ }
+
+ final public function getField() {
+ return $this->field;
+ }
+
abstract public function getPHUIXControlType();
public function getPHUIXControlSpecification() {
diff --git a/src/applications/transactions/bulk/type/BulkSelectParameterType.php b/src/applications/transactions/bulk/type/BulkSelectParameterType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/bulk/type/BulkSelectParameterType.php
@@ -0,0 +1,22 @@
+<?php
+
+final class BulkSelectParameterType
+ extends BulkParameterType {
+
+ public function getOptions() {
+ return $this->getField()->getOptions();
+ }
+
+ public function getPHUIXControlType() {
+ return 'select';
+ }
+
+ public function getPHUIXControlSpecification() {
+ return array(
+ 'options' => $this->getOptions(),
+ 'order' => array_keys($this->getOptions()),
+ 'value' => null,
+ );
+ }
+
+}
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
@@ -643,7 +643,9 @@
return null;
}
- $type->setViewer($this->getViewer());
+ $type
+ ->setField($this)
+ ->setViewer($this->getViewer());
return $type;
}
diff --git a/src/applications/transactions/editfield/PhabricatorSelectEditField.php b/src/applications/transactions/editfield/PhabricatorSelectEditField.php
--- a/src/applications/transactions/editfield/PhabricatorSelectEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorSelectEditField.php
@@ -54,6 +54,10 @@
return new ConduitStringParameterType();
}
+ protected function newBulkParameterType() {
+ return new BulkSelectParameterType();
+ }
+
private function getCanonicalValue($value) {
$options = $this->getOptions();
if (!isset($options[$value])) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:55 PM (9 h, 45 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728106
Default Alt Text
D18866.diff (4 KB)
Attached To
Mode
D18866: Support "select" types in bulk editor (status, priority)
Attached
Detach File
Event Timeline
Log In to Comment