mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-11 16:16:14 +01:00
24926f9453
Summary: Ref T11114. This probably still has some bugs, but survives basic sanity checks. Continue pulling commit message logic out of CustomField so we can reduce the amount of responsibility/bloat in the classtree and send more code through EditEngine. Test Plan: - Called `differential.getcommitmessage` via API console for various revisions/parameters (edit and create mode, with and without fields, with and without revisions). - Used `--create`, `--edit` and `--update` modes of `arc diff` from the CLI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17066
43 lines
930 B
PHP
43 lines
930 B
PHP
<?php
|
|
|
|
final class DifferentialJIRAIssuesCommitMessageField
|
|
extends DifferentialCommitMessageCustomField {
|
|
|
|
const FIELDKEY = 'jira.issues';
|
|
|
|
public function getFieldName() {
|
|
return pht('JIRA Issues');
|
|
}
|
|
|
|
public function getFieldAliases() {
|
|
return array(
|
|
'JIRA',
|
|
'JIRA Issue',
|
|
);
|
|
}
|
|
|
|
public function getCustomFieldKey() {
|
|
return 'phabricator:jira-issues';
|
|
}
|
|
|
|
public function parseFieldValue($value) {
|
|
return preg_split('/[\s,]+/', $value, $limit = -1, PREG_SPLIT_NO_EMPTY);
|
|
}
|
|
|
|
protected function readFieldValueFromCustomFieldStorage($value) {
|
|
return $this->readJSONFieldValueFromCustomFieldStorage($value, array());
|
|
}
|
|
|
|
public function readFieldValueFromConduit($value) {
|
|
return $this->readStringListFieldValueFromConduit($value);
|
|
}
|
|
|
|
public function renderFieldValue($value) {
|
|
if (!$value) {
|
|
return null;
|
|
}
|
|
|
|
return implode(', ', $value);
|
|
}
|
|
|
|
}
|