Display draft reviews in revision lists
Summary: We have /differential/filter/drafts/ but nobody knows about it. This diff displays the draft only if there is no flag to not waste space. Test Plan: /differential/filter/revisions/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, alanh Differential Revision: https://secure.phabricator.com/D3324
This commit is contained in:
@@ -23,6 +23,7 @@ final class DifferentialRevisionListView extends AphrontView {
|
||||
|
||||
private $revisions;
|
||||
private $flags = array();
|
||||
private $drafts = array();
|
||||
private $handles;
|
||||
private $user;
|
||||
private $fields;
|
||||
@@ -84,6 +85,11 @@ final class DifferentialRevisionListView extends AphrontView {
|
||||
->withObjectPHIDs(mpull($this->revisions, 'getPHID'))
|
||||
->execute();
|
||||
|
||||
$this->drafts = id(new DifferentialRevisionQuery())
|
||||
->withIDs(mpull($this->revisions, 'getID'))
|
||||
->withDraftRepliesByAuthors(array($user->getPHID()))
|
||||
->execute();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -135,7 +141,23 @@ final class DifferentialRevisionListView extends AphrontView {
|
||||
'class' => 'phabricator-flag-icon '.$class,
|
||||
),
|
||||
'');
|
||||
|
||||
} else if (array_key_exists($revision->getID(), $this->drafts)) {
|
||||
$src = '/rsrc/image/icon/fatcow/page_white_edit.png';
|
||||
$flag =
|
||||
'<a href="/D'.$revision->getID().'#comment-preview">'.
|
||||
phutil_render_tag(
|
||||
'img',
|
||||
array(
|
||||
'src' => celerity_get_resource_uri($src),
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
'alt' => 'Draft',
|
||||
'title' => 'Draft Comment',
|
||||
)).
|
||||
'</a>';
|
||||
}
|
||||
|
||||
$row = array($flag);
|
||||
|
||||
$modified = $revision->getDateModified();
|
||||
|
||||
BIN
webroot/rsrc/image/icon/fatcow/page_white_edit.png
Normal file
BIN
webroot/rsrc/image/icon/fatcow/page_white_edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 719 B |
Reference in New Issue
Block a user