Merge "Add file status tooltip and add declare modified status"
diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html
index a710b0b..fa984c9 100644
--- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html
+++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html
@@ -287,6 +287,7 @@
data-path$="[[file.__path]]" tabindex="-1">
<div class$="[[_computeClass('status', file.__path)]]"
tabindex="0"
+ title$="[[_computeFileStatusLabel(file.status)]]"
aria-label$="[[_computeFileStatusLabel(file.status)]]">
[[_computeFileStatus(file.status)]]
</div>
diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js
index 95615ea..f54e058 100644
--- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js
+++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js
@@ -35,6 +35,7 @@
A: 'Added',
C: 'Copied',
D: 'Deleted',
+ M: 'Modified',
R: 'Renamed',
W: 'Rewritten',
U: 'Unchanged',
@@ -894,6 +895,12 @@
rev.description.substring(0, PATCH_DESC_MAX_LENGTH) : '';
},
+ /**
+ * Get a descriptive label for use in the status indicator's tooltip and
+ * ARIA label.
+ * @param {string} status
+ * @return {string}
+ */
_computeFileStatusLabel(status) {
const statusCode = this._computeFileStatus(status);
return FileStatus.hasOwnProperty(statusCode) ?
diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html
index 8e32ea3..88b5f66 100644
--- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html
+++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html
@@ -797,6 +797,11 @@
assert.isTrue(tapSpy.lastCall.args[0].defaultPrevented);
});
+ test('_computeFileStatusLabel', () => {
+ assert.equal(element._computeFileStatusLabel('A'), 'Added');
+ assert.equal(element._computeFileStatusLabel('M'), 'Modified');
+ });
+
test('_handleFileListTap', () => {
element._filesByPath = {
'/COMMIT_MSG': {},