Merge "Add file status tooltip and add declare modified status"
This commit is contained in:
commit
d3a779a8b4
@ -287,6 +287,7 @@ limitations under the License.
|
||||
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>
|
||||
|
@ -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) ?
|
||||
|
@ -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': {},
|
||||
|
Loading…
Reference in New Issue
Block a user