Page MenuHomePhabricator

D18867.diff
No OneTemporary

D18867.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -142,7 +142,7 @@
'rsrc/css/phui/phui-basic-nav-view.css' => '98c11ab3',
'rsrc/css/phui/phui-big-info-view.css' => 'acc3492c',
'rsrc/css/phui/phui-box.css' => '4bd6cdb9',
- 'rsrc/css/phui/phui-bulk-editor.css' => '1fe728a8',
+ 'rsrc/css/phui/phui-bulk-editor.css' => '9a81e5d5',
'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
'rsrc/css/phui/phui-cms.css' => '504b4b23',
'rsrc/css/phui/phui-comment-form.css' => 'ac68149f',
@@ -532,7 +532,7 @@
'rsrc/js/phuix/PHUIXButtonView.js' => '8a91e1ac',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => '04b2ae03',
'rsrc/js/phuix/PHUIXExample.js' => '68af71ca',
- 'rsrc/js/phuix/PHUIXFormControl.js' => '68bb05aa',
+ 'rsrc/js/phuix/PHUIXFormControl.js' => '1dd0870c',
'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b',
),
'symbols' => array(
@@ -822,7 +822,7 @@
'phui-basic-nav-view-css' => '98c11ab3',
'phui-big-info-view-css' => 'acc3492c',
'phui-box-css' => '4bd6cdb9',
- 'phui-bulk-editor-css' => '1fe728a8',
+ 'phui-bulk-editor-css' => '9a81e5d5',
'phui-button-bar-css' => 'f1ff5494',
'phui-button-css' => '1863cc6e',
'phui-button-simple-css' => '8e1baf68',
@@ -884,7 +884,7 @@
'phuix-autocomplete' => 'e0731603',
'phuix-button-view' => '8a91e1ac',
'phuix-dropdown-menu' => '04b2ae03',
- 'phuix-form-control-view' => '68bb05aa',
+ 'phuix-form-control-view' => '1dd0870c',
'phuix-icon-view' => 'bff6884b',
'policy-css' => '957ea14c',
'policy-edit-css' => '815c66f7',
@@ -1029,6 +1029,10 @@
'javelin-request',
'javelin-uri',
),
+ '1dd0870c' => array(
+ 'javelin-install',
+ 'javelin-dom',
+ ),
'1e911d0f' => array(
'javelin-stratcom',
'javelin-request',
@@ -1445,10 +1449,6 @@
'javelin-dom',
'phuix-button-view',
),
- '68bb05aa' => array(
- 'javelin-install',
- 'javelin-dom',
- ),
'69adf288' => array(
'javelin-install',
),
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',
+ 'BulkRemarkupParameterType' => 'applications/transactions/bulk/type/BulkRemarkupParameterType.php',
'BulkSelectParameterType' => 'applications/transactions/bulk/type/BulkSelectParameterType.php',
'BulkStringParameterType' => 'applications/transactions/bulk/type/BulkStringParameterType.php',
'CalendarTimeUtil' => 'applications/calendar/util/CalendarTimeUtil.php',
@@ -5245,6 +5246,7 @@
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
'BulkParameterType' => 'Phobject',
+ 'BulkRemarkupParameterType' => 'BulkParameterType',
'BulkSelectParameterType' => 'BulkParameterType',
'BulkStringParameterType' => 'BulkParameterType',
'CalendarTimeUtil' => 'Phobject',
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
@@ -245,6 +245,7 @@
$fields[] = id(new PhabricatorRemarkupEditField())
->setKey('description')
->setLabel(pht('Description'))
+ ->setBulkEditLabel(pht('Set description to'))
->setDescription(pht('Task description.'))
->setConduitDescription(pht('Update the task description.'))
->setConduitTypeDescription(pht('New task description.'))
diff --git a/src/applications/transactions/bulk/PhabricatorEditEngineBulkJobType.php b/src/applications/transactions/bulk/PhabricatorEditEngineBulkJobType.php
--- a/src/applications/transactions/bulk/PhabricatorEditEngineBulkJobType.php
+++ b/src/applications/transactions/bulk/PhabricatorEditEngineBulkJobType.php
@@ -70,8 +70,17 @@
foreach ($raw_xactions as $raw_xaction) {
$xaction = $object->getApplicationTransactionTemplate()
- ->setTransactionType($raw_xaction['type'])
- ->setNewValue($raw_xaction['value']);
+ ->setTransactionType($raw_xaction['type']);
+
+ if (isset($raw_xaction['value'])) {
+ $xaction->setNewValue($raw_xaction['value']);
+ }
+
+ if (isset($raw_xaction['comment'])) {
+ $comment = $xaction->getApplicationTransactionCommentObject()
+ ->setContent($raw_xaction['comment']);
+ $xaction->attachComment($comment);
+ }
$xactions[] = $xaction;
}
diff --git a/src/applications/transactions/bulk/type/BulkRemarkupParameterType.php b/src/applications/transactions/bulk/type/BulkRemarkupParameterType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/bulk/type/BulkRemarkupParameterType.php
@@ -0,0 +1,10 @@
+<?php
+
+final class BulkRemarkupParameterType
+ extends BulkParameterType {
+
+ public function getPHUIXControlType() {
+ return 'remarkup';
+ }
+
+}
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
@@ -2450,7 +2450,7 @@
$map[] = array(
'label' => $bulk_label,
- 'xaction' => $type->getTransactionType(),
+ 'xaction' => $key,
'control' => array(
'type' => $bulk_type->getPHUIXControlType(),
'spec' => (object)$bulk_type->getPHUIXControlSpecification(),
@@ -2463,6 +2463,50 @@
final public function newRawBulkTransactions(array $xactions) {
+ $config = $this->loadDefaultConfiguration();
+ if (!$config) {
+ throw new Exception(
+ pht('No default edit engine configuration for bulk edit.'));
+ }
+
+ $object = $this->newEditableObject();
+ $fields = $this->buildEditFields($object);
+
+ $edit_types = $this->getBulkEditTypesFromFields($fields);
+
+ foreach ($xactions as $key => $xaction) {
+ PhutilTypeSpec::checkMap(
+ $xaction,
+ array(
+ 'type' => 'string',
+ 'value' => 'optional wild',
+ 'comment' => 'optional string',
+ ));
+
+ $type = $xaction['type'];
+ if (!isset($edit_types[$type])) {
+ throw new Exception(
+ pht(
+ 'Unsupported bulk edit type "%s".',
+ $type));
+ }
+
+ $edit_type = $edit_types[$type];
+
+ // Replace the edit type with the underlying transaction type. Usually
+ // these are 1:1 and the transaction type just has more internal noise,
+ // but it's possible that this isn't the case.
+ $xaction['type'] = $edit_type->getTransactionType();
+
+ $xaction = $edit_type->newRawBulkTransaction($xaction);
+ if ($xaction === null) {
+ unset($xactions[$key]);
+ continue;
+ }
+
+ $xactions[$key] = $xaction;
+ }
+
return $xactions;
}
diff --git a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
--- a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
@@ -11,4 +11,8 @@
return new ConduitStringParameterType();
}
+ protected function newBulkParameterType() {
+ return new BulkRemarkupParameterType();
+ }
+
}
diff --git a/src/applications/transactions/edittype/PhabricatorCommentEditType.php b/src/applications/transactions/edittype/PhabricatorCommentEditType.php
--- a/src/applications/transactions/edittype/PhabricatorCommentEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorCommentEditType.php
@@ -6,6 +6,21 @@
return new ConduitStringParameterType();
}
+ protected function newBulkParameterType() {
+ return new BulkRemarkupParameterType();
+ }
+
+ public function newRawBulkTransaction(array $xaction) {
+ if (!strlen($xaction['value'])) {
+ return null;
+ }
+
+ $xaction['comment'] = $xaction['value'];
+ unset($xaction['value']);
+
+ return $xaction;
+ }
+
public function generateTransactions(
PhabricatorApplicationTransaction $template,
array $spec) {
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
@@ -125,6 +125,11 @@
}
+ public function newRawBulkTransaction(array $xaction) {
+ return $xaction;
+ }
+
+
/* -( Conduit )------------------------------------------------------------ */
diff --git a/src/applications/transactions/engineextension/PhabricatorCommentEditEngineExtension.php b/src/applications/transactions/engineextension/PhabricatorCommentEditEngineExtension.php
--- a/src/applications/transactions/engineextension/PhabricatorCommentEditEngineExtension.php
+++ b/src/applications/transactions/engineextension/PhabricatorCommentEditEngineExtension.php
@@ -46,6 +46,7 @@
$comment_field = id(new PhabricatorCommentEditField())
->setKey(self::EDITKEY)
->setLabel(pht('Comments'))
+ ->setBulkEditLabel(pht('Add comment'))
->setAliases(array('comments'))
->setIsHidden(true)
->setIsReorderable(false)
diff --git a/webroot/rsrc/css/phui/phui-bulk-editor.css b/webroot/rsrc/css/phui/phui-bulk-editor.css
--- a/webroot/rsrc/css/phui/phui-bulk-editor.css
+++ b/webroot/rsrc/css/phui/phui-bulk-editor.css
@@ -20,3 +20,8 @@
.bulk-edit-input input {
width: 100%;
}
+
+.bulk-edit-input textarea {
+ width: 100%;
+ height: 8em;
+}
diff --git a/webroot/rsrc/js/phuix/PHUIXFormControl.js b/webroot/rsrc/js/phuix/PHUIXFormControl.js
--- a/webroot/rsrc/js/phuix/PHUIXFormControl.js
+++ b/webroot/rsrc/js/phuix/PHUIXFormControl.js
@@ -57,6 +57,9 @@
case 'text':
input = this._newText(spec);
break;
+ case 'remarkup':
+ input = this._newRemarkup(spec);
+ break;
default:
// TODO: Default or better error?
JX.$E('Bad Input Type');
@@ -312,6 +315,28 @@
};
},
+ _newRemarkup: function(spec) {
+ var attrs = {};
+
+ // We could imagine a world where this renders a full remarkup control
+ // with all the hint buttons and client behaviors, but today much of that
+ // behavior is defined server-side and thus this isn't a world we
+ // currently live in.
+
+ var node = JX.$N('textarea', attrs);
+ node.value = spec.value || '';
+
+ return {
+ node: node,
+ get: function() {
+ return node.value;
+ },
+ set: function(value) {
+ node.value = value;
+ }
+ };
+ },
+
_newOptgroups: function(spec) {
var value = spec.value || null;

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 13, 9:28 PM (3 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730002
Default Alt Text
D18867.diff (11 KB)

Event Timeline