Page MenuHomePhabricator

D14667.diff
No OneTemporary

D14667.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -427,7 +427,7 @@
'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43',
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
- 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'dd5cae21',
+ 'rsrc/js/application/transactions/behavior-comment-actions.js' => '2ada1547',
'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96',
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => 'b23b49e6',
@@ -506,7 +506,7 @@
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca',
- 'rsrc/js/phuix/PHUIXFormControl.js' => 'f9fba5ee',
+ 'rsrc/js/phuix/PHUIXFormControl.js' => '7e1dc09e',
'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b',
),
'symbols' => array(
@@ -571,7 +571,7 @@
'javelin-behavior-audit-preview' => 'd835b03a',
'javelin-behavior-bulk-job-reload' => 'edf8a145',
'javelin-behavior-choose-control' => '6153c708',
- 'javelin-behavior-comment-actions' => 'dd5cae21',
+ 'javelin-behavior-comment-actions' => '2ada1547',
'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
'javelin-behavior-conpherence-menu' => '1d45c74d',
@@ -831,7 +831,7 @@
'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => '8cf6d262',
'phuix-dropdown-menu' => 'bd4c8dca',
- 'phuix-form-control-view' => 'f9fba5ee',
+ 'phuix-form-control-view' => '7e1dc09e',
'phuix-icon-view' => 'bff6884b',
'policy-css' => '957ea14c',
'policy-edit-css' => '815c66f7',
@@ -1027,6 +1027,14 @@
'javelin-install',
'javelin-util',
),
+ '2ada1547' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-dom',
+ 'phuix-form-control-view',
+ 'phuix-icon-view',
+ ),
'2b8de964' => array(
'javelin-install',
'javelin-util',
@@ -1422,6 +1430,10 @@
'phuix-action-view',
'javelin-workflow',
),
+ '7e1dc09e' => array(
+ 'javelin-install',
+ 'javelin-dom',
+ ),
'7e41274a' => array(
'javelin-install',
),
@@ -1867,14 +1879,6 @@
'javelin-dom',
'phabricator-busy',
),
- 'dd5cae21' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-dom',
- 'phuix-form-control-view',
- 'phuix-icon-view',
- ),
'de2e896f' => array(
'javelin-behavior',
'javelin-dom',
@@ -2032,10 +2036,6 @@
'javelin-util',
'phabricator-busy',
),
- 'f9fba5ee' => array(
- 'javelin-install',
- 'javelin-dom',
- ),
'fa0f4fc2' => array(
'javelin-behavior',
'javelin-dom',
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
@@ -62,12 +62,18 @@
// TODO: Restore these or toss them:
// - Default owner to viewer.
- // - Don't show "change status" for closed tasks.
// - Don't show "change owner" for closed tasks.
- // - Don't let users change a task status to "Duplicate".
// - When closing an unassigned task, assign the closing user.
// - Make sure implicit CCs on actions are working reasonably.
+ if ($object->isClosed()) {
+ $priority_label = null;
+ $default_status = ManiphestTaskStatus::getDefaultStatus();
+ } else {
+ $priority_label = pht('Change Priority');
+ $default_status = ManiphestTaskStatus::getDefaultClosedStatus();
+ }
+
return array(
id(new PhabricatorTextEditField())
->setKey('title')
@@ -82,7 +88,9 @@
->setDescription(pht('Status of the task.'))
->setTransactionType(ManiphestTransaction::TYPE_STATUS)
->setValue($object->getStatus())
- ->setOptions($status_map),
+ ->setOptions($status_map)
+ ->setCommentActionLabel(pht('Change Status'))
+ ->setCommentActionDefaultValue($default_status),
id(new PhabricatorUsersEditField())
->setKey('owner')
->setAliases(array('ownerPHID', 'assign', 'assigned'))
@@ -96,7 +104,8 @@
->setDescription(pht('Priority of the task.'))
->setTransactionType(ManiphestTransaction::TYPE_PRIORITY)
->setValue($object->getPriority())
- ->setOptions($priority_map),
+ ->setOptions($priority_map)
+ ->setCommentActionLabel($priority_label),
id(new PhabricatorRemarkupEditField())
->setKey('description')
->setLabel(pht('Description'))
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
@@ -15,6 +15,7 @@
private $description;
private $editTypeKey;
private $isRequired;
+ private $commentActionLabel;
private $isLocked;
private $isHidden;
@@ -172,6 +173,16 @@
return $this->controlError;
}
+ public function setCommentActionLabel($label) {
+ $this->commentActionLabel = $label;
+ return $this;
+ }
+
+ public function getCommentActionLabel() {
+ return $this->commentActionLabel;
+ }
+
+
protected function newControl() {
throw new PhutilMethodNotImplementedException();
}
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
@@ -4,6 +4,7 @@
extends PhabricatorEditField {
private $options;
+ private $commentActionDefaultValue;
public function setOptions(array $options) {
$this->options = $options;
@@ -17,6 +18,15 @@
return $this->options;
}
+ public function setCommentActionDefaultValue($default) {
+ $this->commentActionDefaultValue = $default;
+ return $this;
+ }
+
+ public function getCommentActionDefaultValue() {
+ return $this->commentActionDefaultValue;
+ }
+
protected function newControl() {
return id(new AphrontFormSelectControl())
->setOptions($this->getOptions());
@@ -26,4 +36,27 @@
return new AphrontSelectHTTPParameterType();
}
+ public function getCommentEditTypes() {
+ $label = $this->getCommentActionLabel();
+ if ($label === null) {
+ return array();
+ }
+
+ $default_value = $this->getCommentActionDefaultValue();
+ if ($default_value === null) {
+ $default_value = $this->getValue();
+ }
+
+ $edit = $this->getEditType()
+ ->setLabel($label)
+ ->setPHUIXControlType('select')
+ ->setPHUIXControlSpecification(
+ array(
+ 'options' => $this->getOptions(),
+ 'value' => $default_value,
+ ));
+
+ return array($edit);
+ }
+
}
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
@@ -3,19 +3,8 @@
abstract class PhabricatorTokenizerEditField
extends PhabricatorPHIDListEditField {
- private $commentActionLabel;
-
abstract protected function newDatasource();
- public function setCommentActionLabel($label) {
- $this->commentActionLabel = $label;
- return $this;
- }
-
- public function getCommentActionLabel() {
- return $this->commentActionLabel;
- }
-
protected function newControl() {
$control = id(new AphrontFormTokenizerControl())
->setDatasource($this->newDatasource());
diff --git a/src/applications/transactions/edittype/PhabricatorSimpleEditType.php b/src/applications/transactions/edittype/PhabricatorSimpleEditType.php
--- a/src/applications/transactions/edittype/PhabricatorSimpleEditType.php
+++ b/src/applications/transactions/edittype/PhabricatorSimpleEditType.php
@@ -4,6 +4,8 @@
private $valueType;
private $valueDescription;
+ private $phuixControlType;
+ private $phuixControlSpecification = array();
public function setValueType($value_type) {
$this->valueType = $value_type;
@@ -33,4 +35,22 @@
return $this->valueDescription;
}
+ public function setPHUIXControlType($type) {
+ $this->phuixControlType = $type;
+ return $this;
+ }
+
+ public function getPHUIXControlType() {
+ return $this->phuixControlType;
+ }
+
+ public function setPHUIXControlSpecification(array $spec) {
+ $this->phuixControlSpecification = $spec;
+ return $this;
+ }
+
+ public function getPHUIXControlSpecification() {
+ return $this->phuixControlSpecification;
+ }
+
}
diff --git a/webroot/rsrc/js/application/transactions/behavior-comment-actions.js b/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
--- a/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
+++ b/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
@@ -62,7 +62,7 @@
var control = new JX.PHUIXFormControl()
.setLabel(action.label)
.setError(remove)
- .setControl('tokenizer', action.spec);
+ .setControl(action.type, action.spec);
var node = control.getNode();
rows[action.key] = control;
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
@@ -32,6 +32,9 @@
case 'tokenizer':
input = this._newTokenizer(spec);
break;
+ case 'select':
+ input = this._newSelect(spec);
+ break;
default:
// TODO: Default or better error?
JX.$E('Bad Input Type');
@@ -126,6 +129,20 @@
}
}
};
+ },
+
+ _newSelect: function(spec) {
+ var node = JX.Prefab.renderSelect(spec.options, spec.value);
+
+ return {
+ node: node,
+ get: function() {
+ return node.value;
+ },
+ set: function(value) {
+ node.value = value;
+ }
+ };
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 14, 8:37 PM (3 w, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7670127
Default Alt Text
D14667.diff (10 KB)

Event Timeline