mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Break all old differential comment anchors
Test Plan: Display revision, verify text, click on links. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Maniphest Tasks: T845 Differential Revision: https://secure.phabricator.com/D1591
This commit is contained in:
parent
4caa684724
commit
3e3f73235c
4 changed files with 16 additions and 9 deletions
|
@ -25,7 +25,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
private $inlines;
|
private $inlines;
|
||||||
private $changesets;
|
private $changesets;
|
||||||
private $target;
|
private $target;
|
||||||
private $commentNumber;
|
private $anchorName;
|
||||||
private $user;
|
private $user;
|
||||||
private $versusDiffID;
|
private $versusDiffID;
|
||||||
|
|
||||||
|
@ -70,8 +70,8 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCommentNumber($comment_number) {
|
public function setAnchorName($anchor_name) {
|
||||||
$this->commentNumber = $comment_number;
|
$this->anchorName = $anchor_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,10 +111,9 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
$info[] = $date;
|
$info[] = $date;
|
||||||
|
|
||||||
$comment_anchor = null;
|
$comment_anchor = null;
|
||||||
$num = $this->commentNumber;
|
$anchor_name = $this->anchorName;
|
||||||
if ($num && !$this->preview) {
|
if ($anchor_name != '' && !$this->preview) {
|
||||||
Javelin::initBehavior('phabricator-watch-anchor');
|
Javelin::initBehavior('phabricator-watch-anchor');
|
||||||
$anchor_name = 'comment-'.$num;
|
|
||||||
$info[] = phutil_render_tag(
|
$info[] = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
@ -122,7 +121,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
'id' => $anchor_name,
|
'id' => $anchor_name,
|
||||||
'href' => '#'.$anchor_name,
|
'href' => '#'.$anchor_name,
|
||||||
),
|
),
|
||||||
'Comment D'.$comment->getRevisionID().'#'.$num);
|
'D'.$comment->getRevisionID().'#'.$anchor_name);
|
||||||
$comment_anchor = 'anchor-'.$anchor_name;
|
$comment_anchor = 'anchor-'.$anchor_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,14 @@ final class DifferentialRevisionCommentListView extends AphrontView {
|
||||||
$view->setChangesets($this->changesets);
|
$view->setChangesets($this->changesets);
|
||||||
$view->setTargetDiff($this->target);
|
$view->setTargetDiff($this->target);
|
||||||
$view->setVersusDiffID($this->versusDiffID);
|
$view->setVersusDiffID($this->versusDiffID);
|
||||||
$view->setCommentNumber($num++);
|
if ($comment->getAction() == DifferentialAction::ACTION_SUMMARIZE) {
|
||||||
|
$view->setAnchorName('summary');
|
||||||
|
} elseif ($comment->getAction() == DifferentialAction::ACTION_TESTPLAN) {
|
||||||
|
$view->setAnchorName('test-plan');
|
||||||
|
} else {
|
||||||
|
$view->setAnchorName('comment-'.$num);
|
||||||
|
$num++;
|
||||||
|
}
|
||||||
|
|
||||||
$html[] = $view->render();
|
$html[] = $view->render();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/revisioncomment');
|
phutil_require_module('phabricator', 'applications/differential/view/revisioncomment');
|
||||||
phutil_require_module('phabricator', 'applications/markup/engine');
|
phutil_require_module('phabricator', 'applications/markup/engine');
|
||||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||||
|
|
|
@ -233,7 +233,7 @@ class ManiphestTransactionDetailView extends ManiphestView {
|
||||||
'id' => $anchor_name,
|
'id' => $anchor_name,
|
||||||
'href' => '#'.$anchor_name,
|
'href' => '#'.$anchor_name,
|
||||||
),
|
),
|
||||||
'Comment T'.$any_transaction->getTaskID().'#'.$num);
|
'T'.$any_transaction->getTaskID().'#'.$anchor_name);
|
||||||
$comment_anchor = 'anchor-'.$anchor_name;
|
$comment_anchor = 'anchor-'.$anchor_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue