PolyGerrit: Support repository browser urls in the tag list

Since change[1] repository browser urls have been supported.

Lets add the support for tags list.

[1] https://gerrit-review.googlesource.com/#/c/112233/

Change-Id: Ieffc6428cf7206e101fbe3cfeba7d262078e83c5
This commit is contained in:
Paladox none
2017-07-06 14:25:14 +00:00
parent 36d668a68d
commit f9747f90a1
3 changed files with 19 additions and 13 deletions

View File

@@ -39,7 +39,6 @@ limitations under the License.
.editing .editBtn, .editing .editBtn,
.canEdit .revisionNoEditing, .canEdit .revisionNoEditing,
.editing .revisionWithEditing, .editing .revisionWithEditing,
.repositoryBrowser:not(.show),
.revisionEdit { .revisionEdit {
display: none; display: none;
} }
@@ -72,7 +71,7 @@ limitations under the License.
<tr class="headerRow"> <tr class="headerRow">
<th class="name topHeader">Name</th> <th class="name topHeader">Name</th>
<th class="description topHeader">Revision</th> <th class="description topHeader">Revision</th>
<th class$="repositoryBrowser topHeader [[computeBrowserClass(detailType)]]"> <th class="repositoryBrowser topHeader">
Repository Browser</th> Repository Browser</th>
<th class="delete topHeader"></th> <th class="delete topHeader"></th>
</tr> </tr>
@@ -113,7 +112,7 @@ limitations under the License.
</gr-button> </gr-button>
</span> </span>
</td> </td>
<td class$="repositoryBrowser [[computeBrowserClass(detailType)]]"> <td class="repositoryBrowser">
<template is="dom-repeat" <template is="dom-repeat"
items="[[_computeWeblink(item)]]" as="link"> items="[[_computeWeblink(item)]]" as="link">
<a href$="[[link.url]]" <a href$="[[link.url]]"

View File

@@ -139,13 +139,6 @@
return webLinks.length ? webLinks : null; return webLinks.length ? webLinks : null;
}, },
computeBrowserClass(detailType) {
if (detailType === DETAIL_TYPES.BRANCHES) {
return 'show';
}
return '';
},
_stripRefs(item, detailType) { _stripRefs(item, detailType) {
if (detailType === DETAIL_TYPES.BRANCHES) { if (detailType === DETAIL_TYPES.BRANCHES) {
return item.replace('refs/heads/', ''); return item.replace('refs/heads/', '');

View File

@@ -50,6 +50,12 @@ limitations under the License.
return { return {
ref: `refs/tags/test${++counter}`, ref: `refs/tags/test${++counter}`,
revision: '9c9d08a438e55e52f33b608415e6dddd9b18550d', revision: '9c9d08a438e55e52f33b608415e6dddd9b18550d',
web_links: [
{
name: 'diffusion',
url: `https://git.example.org/tag/test;refs/tags/test${counter}`,
},
],
}; };
}; };
@@ -90,14 +96,14 @@ limitations under the License.
element._paramsChanged(params).then(() => { flush(done); }); element._paramsChanged(params).then(() => { flush(done); });
}); });
test('test for test branch in the list', done => { test('test for branch in the list', done => {
flush(() => { flush(() => {
assert.equal(element._items[2].ref, 'refs/heads/test2'); assert.equal(element._items[2].ref, 'refs/heads/test2');
done(); done();
}); });
}); });
test('test for test web links in the branches list', done => { test('test for web links in the branches list', done => {
flush(() => { flush(() => {
assert.equal(element._items[2].web_links[0].url, assert.equal(element._items[2].web_links[0].url,
'https://git.example.org/branch/test;refs/heads/test2'); 'https://git.example.org/branch/test;refs/heads/test2');
@@ -332,13 +338,21 @@ limitations under the License.
element._paramsChanged(params).then(() => { flush(done); }); element._paramsChanged(params).then(() => { flush(done); });
}); });
test('test for test tag in the list', done => { test('test for tag in the list', done => {
flush(() => { flush(() => {
assert.equal(element._items[1].ref, 'refs/tags/test2'); assert.equal(element._items[1].ref, 'refs/tags/test2');
done(); done();
}); });
}); });
test('test for web links in the tags list', done => {
flush(() => {
assert.equal(element._items[1].web_links[0].url,
'https://git.example.org/tag/test;refs/tags/test2');
done();
});
});
test('test for refs/tags/ being striped from ref', done => { test('test for refs/tags/ being striped from ref', done => {
flush(() => { flush(() => {
assert.equal(element._stripRefs(element._items[1].ref, assert.equal(element._stripRefs(element._items[1].ref,