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 $revisions;
|
||||||
private $flags = array();
|
private $flags = array();
|
||||||
|
private $drafts = array();
|
||||||
private $handles;
|
private $handles;
|
||||||
private $user;
|
private $user;
|
||||||
private $fields;
|
private $fields;
|
||||||
@@ -84,6 +85,11 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||||||
->withObjectPHIDs(mpull($this->revisions, 'getPHID'))
|
->withObjectPHIDs(mpull($this->revisions, 'getPHID'))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
$this->drafts = id(new DifferentialRevisionQuery())
|
||||||
|
->withIDs(mpull($this->revisions, 'getID'))
|
||||||
|
->withDraftRepliesByAuthors(array($user->getPHID()))
|
||||||
|
->execute();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +141,23 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||||||
'class' => 'phabricator-flag-icon '.$class,
|
'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);
|
$row = array($flag);
|
||||||
|
|
||||||
$modified = $revision->getDateModified();
|
$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