Show "File n of N" in diff views

This allows the reviewer to see how many files are still left to
review and how many are already done.

Change-Id: Id89eb7c85a557708d5de7bf1447747661eb1e3a1
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-12-03 12:04:41 +01:00
parent 4d046a248b
commit c77cac8f88
6 changed files with 29 additions and 2 deletions

View File

@@ -74,6 +74,8 @@ public class Header extends Composite {
@UiField CheckBox reviewed;
@UiField Element project;
@UiField Element filePath;
@UiField Element fileNumber;
@UiField Element fileCount;
@UiField Element noDiff;
@UiField FlowPanel linkPanel;
@@ -143,6 +145,9 @@ public class Header extends Composite {
public void onSuccess(NativeMap<FileInfo> result) {
JsArray<FileInfo> files = result.values();
FileInfo.sortFileInfoByPath(files);
fileNumber.setInnerText(
Integer.toString(Natives.asList(files).indexOf(result.get(path)) + 1));
fileCount.setInnerText(Integer.toString(files.length()));
int index = 0; // TODO: Maybe use patchIndex.
for (int i = 0; i < files.length(); i++) {
if (path.equals(files.get(i).path())) {