mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
Pholio inline comments appear after comment
Summary: Pholio inline comments now appear after comments. Adding inline comment shows up properly on comments. Test Plan: {F33723} Reviewers: epriestley, johann.fridriksson Reviewed By: johann.fridriksson CC: aran, Korvin Maniphest Tasks: T2446 Differential Revision: https://secure.phabricator.com/D5103
This commit is contained in:
parent
04aa59abc6
commit
1f00f2728b
3 changed files with 26 additions and 3 deletions
|
@ -56,9 +56,9 @@ final class PholioMockCommentController extends PholioController {
|
||||||
mpull($mock->getImages(), 'getID'));
|
mpull($mock->getImages(), 'getID'));
|
||||||
|
|
||||||
foreach ($inlineComments as $inlineComment) {
|
foreach ($inlineComments as $inlineComment) {
|
||||||
$xactions[] = id(new PholioTransaction())
|
$xactions[] = id(new PholioTransaction())
|
||||||
->setTransactionType(PholioTransactionType::TYPE_INLINE)
|
->setTransactionType(PholioTransactionType::TYPE_INLINE)
|
||||||
->attachComment($inlineComment);
|
->attachComment($inlineComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
$editor = id(new PholioMockEditor())
|
$editor = id(new PholioMockEditor())
|
||||||
|
|
|
@ -140,4 +140,22 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function sortTransactions(array $xactions) {
|
||||||
|
$head = array();
|
||||||
|
$tail = array();
|
||||||
|
|
||||||
|
// Move inline comments to the end, so the comments preceed them.
|
||||||
|
foreach ($xactions as $xaction) {
|
||||||
|
$type = $xaction->getTransactionType();
|
||||||
|
if ($type == PholioTransactionType::TYPE_INLINE) {
|
||||||
|
$tail[] = $xaction;
|
||||||
|
} else {
|
||||||
|
$head[] = $xaction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values(array_merge($head, $tail));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,11 @@ final class PholioTransaction extends PhabricatorApplicationTransaction {
|
||||||
'The old description was: %s',
|
'The old description was: %s',
|
||||||
$this->renderHandleLink($author_phid),
|
$this->renderHandleLink($author_phid),
|
||||||
$old);
|
$old);
|
||||||
|
break;
|
||||||
|
case PholioTransactionType::TYPE_INLINE:
|
||||||
|
return pht(
|
||||||
|
'%s added an inline comment.',
|
||||||
|
$this->renderHandleLink($author_phid));
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::getTitle();
|
return parent::getTitle();
|
||||||
|
|
Loading…
Reference in a new issue