Don't filter drafts on patch_set in file list

When using
/changes/<change num>/revisions/<revision id>/drafts
`patch_set` is not set on the results since it is implicit.

Change-Id: I91dc18bba1063fb3e6c1ce63cc5aed081cbb31e9
This commit is contained in:
Andrew Bonventre 2015-12-21 11:38:08 -05:00 committed by Dave Borowitz
parent 4c8549e12f
commit 4837ccb9fa

View File

@ -73,7 +73,7 @@ limitations under the License.
href$="[[_computeDiffURL(changeNum, patchNum, file.__path)]]">[[file.__path]]</a>
</td>
<td>
<span class="drafts">[[_computeDraftsString(_drafts, patchNum, file.__path)]]</span>
<span class="drafts">[[_computeDraftsString(_drafts, file.__path)]]</span>
<span class="comments">[[_computeCommentsString(comments, patchNum, file.__path)]]</span>
</td>
<td>
@ -128,11 +128,8 @@ limitations under the License.
return Changes.baseURL(changeNum, patchNum) + '/drafts';
},
_computeDraftsString: function(drafts, patchNum, path) {
var patchDrafts = (drafts[path] || []).filter(function(d) {
return d.patch_set == patchNum;
});
var num = patchDrafts.length;
_computeDraftsString: function(drafts, path) {
var num = (drafts[path] || []).length;
if (num == 0) { return ''; }
if (num == 1) { return '1 draft'; }
if (num > 1) { return num + ' drafts'; };