Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13955134
D17088.id41080.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D17088.id41080.diff
View Options
diff --git a/src/applications/differential/customfield/DifferentialManiphestTasksField.php b/src/applications/differential/customfield/DifferentialManiphestTasksField.php
--- a/src/applications/differential/customfield/DifferentialManiphestTasksField.php
+++ b/src/applications/differential/customfield/DifferentialManiphestTasksField.php
@@ -7,10 +7,6 @@
return 'differential:maniphest-tasks';
}
- public function getFieldKeyForConduit() {
- return 'maniphestTaskPHIDs';
- }
-
public function canDisableField() {
return false;
}
@@ -41,25 +37,6 @@
DifferentialRevisionHasTaskEdgeType::EDGECONST);
}
- public function getApplicationTransactionType() {
- return PhabricatorTransactions::TYPE_EDGE;
- }
-
- public function getApplicationTransactionMetadata() {
- return array(
- 'edge:type' => DifferentialRevisionHasTaskEdgeType::EDGECONST,
- );
- }
-
- public function getNewValueForApplicationTransactions() {
- $edges = array();
- foreach ($this->getValue() as $phid) {
- $edges[$phid] = $phid;
- }
-
- return array('=' => $edges);
- }
-
public function getRequiredHandlePHIDsForPropertyView() {
return $this->getValue();
}
@@ -68,44 +45,4 @@
return $this->renderHandleList($handles);
}
- public function shouldAppearInCommitMessage() {
- return true;
- }
-
- public function shouldAllowEditInCommitMessage() {
- return true;
- }
-
- public function getCommitMessageLabels() {
- return array(
- 'Maniphest Task',
- 'Maniphest Tasks',
- );
- }
-
- public function parseValueFromCommitMessage($value) {
- return $this->parseObjectList(
- $value,
- array(
- ManiphestTaskPHIDType::TYPECONST,
- ));
- }
-
- public function getRequiredHandlePHIDsForCommitMessage() {
- return $this->getRequiredHandlePHIDsForPropertyView();
- }
-
- public function renderCommitMessageValue(array $handles) {
- return $this->renderObjectList($handles);
- }
-
- public function getProTips() {
- return array(
- pht(
- 'Write "%s" in your summary to automatically close the '.
- 'corresponding task when this change lands.',
- 'Fixes T123'),
- );
- }
-
}
diff --git a/src/applications/differential/customfield/DifferentialProjectReviewersField.php b/src/applications/differential/customfield/DifferentialProjectReviewersField.php
--- a/src/applications/differential/customfield/DifferentialProjectReviewersField.php
+++ b/src/applications/differential/customfield/DifferentialProjectReviewersField.php
@@ -57,13 +57,4 @@
return $reviewers;
}
- public function getProTips() {
- return array(
- pht(
- 'You can add a project as a subscriber or reviewer by writing '.
- '"%s" in the appropriate field.',
- '#projectname'),
- );
- }
-
}
diff --git a/src/applications/differential/editor/DifferentialRevisionEditEngine.php b/src/applications/differential/editor/DifferentialRevisionEditEngine.php
--- a/src/applications/differential/editor/DifferentialRevisionEditEngine.php
+++ b/src/applications/differential/editor/DifferentialRevisionEditEngine.php
@@ -192,6 +192,21 @@
->setConduitTypeDescription(pht('New repository.'))
->setSingleValue($object->getRepositoryPHID());
+ // This is a little flimsy, but allows "Maniphest Tasks: ..." to continue
+ // working properly in commit messages until we fully sort out T5873.
+ $fields[] = id(new PhabricatorHandlesEditField())
+ ->setKey('tasks')
+ ->setUseEdgeTransactions(true)
+ ->setIsConduitOnly(true)
+ ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
+ ->setMetadataValue(
+ 'edge:type',
+ DifferentialRevisionHasTaskEdgeType::EDGECONST)
+ ->setDescription(pht('Tasks associated with this revision.'))
+ ->setConduitDescription(pht('Change associated tasks.'))
+ ->setConduitTypeDescription(pht('List of tasks.'))
+ ->setValue(array());
+
return $fields;
}
diff --git a/src/applications/differential/field/DifferentialCommitMessageField.php b/src/applications/differential/field/DifferentialCommitMessageField.php
--- a/src/applications/differential/field/DifferentialCommitMessageField.php
+++ b/src/applications/differential/field/DifferentialCommitMessageField.php
@@ -182,7 +182,7 @@
protected function isCustomFieldEnabled($key) {
$field_list = PhabricatorCustomField::getObjectFields(
new DifferentialRevision(),
- DifferentialCustomField::ROLE_COMMITMESSAGE);
+ DifferentialCustomField::ROLE_DEFAULT);
$fields = $field_list->getFields();
return isset($fields[$key]);
diff --git a/src/applications/differential/field/DifferentialTasksCommitMessageField.php b/src/applications/differential/field/DifferentialTasksCommitMessageField.php
--- a/src/applications/differential/field/DifferentialTasksCommitMessageField.php
+++ b/src/applications/differential/field/DifferentialTasksCommitMessageField.php
@@ -55,7 +55,11 @@
}
public function getFieldTransactions($value) {
- // TODO: Implement this!
- return array();
+ return array(
+ array(
+ 'type' => 'tasks.set',
+ 'value' => $value,
+ ),
+ );
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 15 2024, 12:19 AM (5 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710561
Default Alt Text
D17088.id41080.diff (5 KB)
Attached To
Mode
D17088: Simplify "Tasks" field in Differential
Attached
Detach File
Event Timeline
Log In to Comment