Use 'Commit message' and 'Merge list' in comment-list
This brings the comment list (both in the messages at the bottom and in the reply modal dialog) into line with the file list, emails, and other places the file names are displayed. Change-Id: Id0ef2e3bafb63070d2284e4b70613ac92300d14d
This commit is contained in:
@@ -53,7 +53,9 @@ limitations under the License.
|
|||||||
</style>
|
</style>
|
||||||
<template is="dom-repeat" items="[[_computeFilesFromComments(comments)]]" as="file">
|
<template is="dom-repeat" items="[[_computeFilesFromComments(comments)]]" as="file">
|
||||||
<div class="file">
|
<div class="file">
|
||||||
<a href$="[[_computeFileDiffURL(file, changeNum, patchNum)]]">[[file]]</a>:
|
<a href$="[[_computeFileDiffURL(file, changeNum, patchNum)]]">
|
||||||
|
[[_computeFileDisplayName(file)]]
|
||||||
|
</a>:
|
||||||
</div>
|
</div>
|
||||||
<template is="dom-repeat"
|
<template is="dom-repeat"
|
||||||
items="[[_computeCommentsForFile(comments, file)]]" as="comment">
|
items="[[_computeCommentsForFile(comments, file)]]" as="comment">
|
||||||
|
@@ -14,6 +14,9 @@
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var COMMIT_MESSAGE_PATH = '/COMMIT_MSG';
|
||||||
|
var MERGE_LIST_PATH = '/MERGE_LIST';
|
||||||
|
|
||||||
Polymer({
|
Polymer({
|
||||||
is: 'gr-comment-list',
|
is: 'gr-comment-list',
|
||||||
|
|
||||||
@@ -39,6 +42,15 @@
|
|||||||
'/' + patchNum + '/' + file;
|
'/' + patchNum + '/' + file;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_computeFileDisplayName: function(path) {
|
||||||
|
if (path === COMMIT_MESSAGE_PATH) {
|
||||||
|
return 'Commit message';
|
||||||
|
} else if (path === MERGE_LIST_PATH) {
|
||||||
|
return 'Merge list';
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
},
|
||||||
|
|
||||||
_isOnParent: function(comment) {
|
_isOnParent: function(comment) {
|
||||||
return comment.side === 'PARENT';
|
return comment.side === 'PARENT';
|
||||||
},
|
},
|
||||||
|
@@ -65,6 +65,15 @@ limitations under the License.
|
|||||||
assert.equal(actual, expected);
|
assert.equal(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('_computeFileDisplayName', function() {
|
||||||
|
assert.equal(element._computeFileDisplayName('/COMMIT_MSG'),
|
||||||
|
'Commit message');
|
||||||
|
assert.equal(element._computeFileDisplayName('/MERGE_LIST'),
|
||||||
|
'Merge list');
|
||||||
|
assert.equal(element._computeFileDisplayName('/foo/bar/baz'),
|
||||||
|
'/foo/bar/baz');
|
||||||
|
});
|
||||||
|
|
||||||
test('_computeDiffLineURL', function() {
|
test('_computeDiffLineURL', function() {
|
||||||
var comment = {line: 123, side: 'REVISION', patch_set: 10};
|
var comment = {line: 123, side: 'REVISION', patch_set: 10};
|
||||||
var expected = '/c/<change>/<patch>/<file>#123';
|
var expected = '/c/<change>/<patch>/<file>#123';
|
||||||
|
Reference in New Issue
Block a user