mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-17 10:11:10 +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())
|
->setObjectPHID($object->getPHID())
|
||||||
->setTransactions($xactions)
|
->setTransactions($xactions)
|
||||||
->setPager($pager)
|
->setPager($pager)
|
||||||
->setRenderData($render_data);
|
->setRenderData($render_data)
|
||||||
|
->setQuoteTargetID($this->getRequest()->getStr('quoteTargetID'))
|
||||||
|
->setQuoteRef($this->getRequest()->getStr('quoteRef'));
|
||||||
$object->willRenderTimeline($timeline, $this->getRequest());
|
$object->willRenderTimeline($timeline, $this->getRequest());
|
||||||
|
|
||||||
return $timeline;
|
return $timeline;
|
||||||
|
|
|
@ -198,6 +198,8 @@ class PhabricatorApplicationTransactionView extends AphrontView {
|
||||||
|
|
||||||
$view = new PHUITimelineView();
|
$view = new PHUITimelineView();
|
||||||
$view->setShouldTerminate($this->shouldTerminate);
|
$view->setShouldTerminate($this->shouldTerminate);
|
||||||
|
$view->setQuoteTargetID($this->getQuoteTargetID());
|
||||||
|
$view->setQuoteRef($this->getQuoteRef());
|
||||||
$events = $this->buildEvents($with_hiding);
|
$events = $this->buildEvents($with_hiding);
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
$view->addEvent($event);
|
$view->addEvent($event);
|
||||||
|
|
|
@ -8,6 +8,8 @@ final class PHUITimelineView extends AphrontView {
|
||||||
private $shouldAddSpacers = true;
|
private $shouldAddSpacers = true;
|
||||||
private $pager;
|
private $pager;
|
||||||
private $renderData = array();
|
private $renderData = array();
|
||||||
|
private $quoteTargetID;
|
||||||
|
private $quoteRef;
|
||||||
|
|
||||||
public function setID($id) {
|
public function setID($id) {
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
|
@ -43,6 +45,24 @@ final class PHUITimelineView extends AphrontView {
|
||||||
return $this;
|
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() {
|
public function render() {
|
||||||
if ($this->getPager()) {
|
if ($this->getPager()) {
|
||||||
if ($this->id === null) {
|
if ($this->id === null) {
|
||||||
|
@ -84,6 +104,9 @@ final class PHUITimelineView extends AphrontView {
|
||||||
|
|
||||||
$events = array();
|
$events = array();
|
||||||
if ($hide && $this->getPager()) {
|
if ($hide && $this->getPager()) {
|
||||||
|
$uri = $this->getPager()->getNextPageURI();
|
||||||
|
$uri->setQueryParam('quoteTargetID', $this->getQuoteTargetID());
|
||||||
|
$uri->setQueryParam('quoteRef', $this->getQuoteRef());
|
||||||
$events[] = javelin_tag(
|
$events[] = javelin_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
|
@ -96,7 +119,7 @@ final class PHUITimelineView extends AphrontView {
|
||||||
javelin_tag(
|
javelin_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => (string) $this->getPager()->getNextPageURI(),
|
'href' => (string) $uri,
|
||||||
'mustcapture' => true,
|
'mustcapture' => true,
|
||||||
'sigil' => 'show-older-link',
|
'sigil' => 'show-older-link',
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue