mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Transactions - make quotes work for older transactions
Summary: Fixes T6731. I don't really understand the intent behind the two view classes here, but to get this to work I need to pass yet more data to the lower-level class. Test Plan: Viewed a task with many comments. Clicked "show older". Quoted everything I could. Verified for each quote that it quoted correctly, inlcuding linking to the prior transaction. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6731 Differential Revision: https://secure.phabricator.com/D10973
This commit is contained in:
parent
f5301e8e94
commit
b718b429af
3 changed files with 29 additions and 2 deletions
|
@ -566,7 +566,9 @@ abstract class PhabricatorController extends AphrontController {
|
|||
->setObjectPHID($object->getPHID())
|
||||
->setTransactions($xactions)
|
||||
->setPager($pager)
|
||||
->setRenderData($render_data);
|
||||
->setRenderData($render_data)
|
||||
->setQuoteTargetID($this->getRequest()->getStr('quoteTargetID'))
|
||||
->setQuoteRef($this->getRequest()->getStr('quoteRef'));
|
||||
$object->willRenderTimeline($timeline, $this->getRequest());
|
||||
|
||||
return $timeline;
|
||||
|
|
|
@ -198,6 +198,8 @@ class PhabricatorApplicationTransactionView extends AphrontView {
|
|||
|
||||
$view = new PHUITimelineView();
|
||||
$view->setShouldTerminate($this->shouldTerminate);
|
||||
$view->setQuoteTargetID($this->getQuoteTargetID());
|
||||
$view->setQuoteRef($this->getQuoteRef());
|
||||
$events = $this->buildEvents($with_hiding);
|
||||
foreach ($events as $event) {
|
||||
$view->addEvent($event);
|
||||
|
|
|
@ -8,6 +8,8 @@ final class PHUITimelineView extends AphrontView {
|
|||
private $shouldAddSpacers = true;
|
||||
private $pager;
|
||||
private $renderData = array();
|
||||
private $quoteTargetID;
|
||||
private $quoteRef;
|
||||
|
||||
public function setID($id) {
|
||||
$this->id = $id;
|
||||
|
@ -43,6 +45,24 @@ final class PHUITimelineView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setQuoteTargetID($quote_target_id) {
|
||||
$this->quoteTargetID = $quote_target_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getQuoteTargetID() {
|
||||
return $this->quoteTargetID;
|
||||
}
|
||||
|
||||
public function setQuoteRef($quote_ref) {
|
||||
$this->quoteRef = $quote_ref;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getQuoteRef() {
|
||||
return $this->quoteRef;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
if ($this->getPager()) {
|
||||
if ($this->id === null) {
|
||||
|
@ -84,6 +104,9 @@ final class PHUITimelineView extends AphrontView {
|
|||
|
||||
$events = array();
|
||||
if ($hide && $this->getPager()) {
|
||||
$uri = $this->getPager()->getNextPageURI();
|
||||
$uri->setQueryParam('quoteTargetID', $this->getQuoteTargetID());
|
||||
$uri->setQueryParam('quoteRef', $this->getQuoteRef());
|
||||
$events[] = javelin_tag(
|
||||
'div',
|
||||
array(
|
||||
|
@ -96,7 +119,7 @@ final class PHUITimelineView extends AphrontView {
|
|||
javelin_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => (string) $this->getPager()->getNextPageURI(),
|
||||
'href' => (string) $uri,
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'show-older-link',
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue