mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
e9f4a84a89
Summary: Ref T7447. Implements per-viewer comment hiding. Once a comment is obsolete or uninteresting, you can hide it completely. This is sticky per-user. My hope is that this will strike a better balance between concerns than some of the other approaches (conservative porting, summarization, hide-all). Specifically, this adds a new action here: {F435621} Clicking it completely collapses the comment into a small icon on the previous line, and saves the comment state as hidden for you: {F435626} You can click the icon to reveal all hidden comments below the line. Test Plan: - Hid comments. - Showed comments. - Created, edited, deleted and submitted comments. - Used Diffusion comments (hiding is not implemented there yet, but I'd plan to bring it there eventually if it works out in Differential). Reviewers: btrahan, chad Reviewed By: btrahan Subscribers: jparise, yelirekim, epriestley Maniphest Tasks: T7447 Differential Revision: https://secure.phabricator.com/D13009
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class DifferentialInlineCommentPreviewController
|
|
extends PhabricatorInlineCommentPreviewController {
|
|
|
|
protected function loadInlineComments() {
|
|
$viewer = $this->getViewer();
|
|
|
|
$revision = id(new DifferentialRevisionQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($this->getRevisionID()))
|
|
->executeOne();
|
|
if (!$revision) {
|
|
return array();
|
|
}
|
|
|
|
return id(new DifferentialInlineCommentQuery())
|
|
->setViewer($this->getViewer())
|
|
->withDrafts(true)
|
|
->withAuthorPHIDs(array($viewer->getPHID()))
|
|
->withRevisionPHIDs(array($revision->getPHID()))
|
|
->needHidden(true)
|
|
->execute();
|
|
}
|
|
|
|
protected function loadObjectOwnerPHID() {
|
|
$viewer = $this->getViewer();
|
|
|
|
$revision = id(new DifferentialRevisionQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($this->getRevisionID()))
|
|
->executeOne();
|
|
if (!$revision) {
|
|
return null;
|
|
}
|
|
|
|
return $revision->getAuthorPHID();
|
|
}
|
|
|
|
|
|
private function getRevisionID() {
|
|
return $this->getRequest()->getURIData('id');
|
|
}
|
|
}
|