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 a710b0b1e0..fa984c9887 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 @@ limitations under the License. data-path$="[[file.__path]]" tabindex="-1">
[[_computeFileStatus(file.status)]]
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 95615ea800..f54e0583a8 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 8e32ea3ddf..88b5f66e3f 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 @@ limitations under the License. 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': {},