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:
@@ -39,7 +39,6 @@ limitations under the License.
|
||||
.editing .editBtn,
|
||||
.canEdit .revisionNoEditing,
|
||||
.editing .revisionWithEditing,
|
||||
.repositoryBrowser:not(.show),
|
||||
.revisionEdit {
|
||||
display: none;
|
||||
}
|
||||
@@ -72,7 +71,7 @@ limitations under the License.
|
||||
<tr class="headerRow">
|
||||
<th class="name topHeader">Name</th>
|
||||
<th class="description topHeader">Revision</th>
|
||||
<th class$="repositoryBrowser topHeader [[computeBrowserClass(detailType)]]">
|
||||
<th class="repositoryBrowser topHeader">
|
||||
Repository Browser</th>
|
||||
<th class="delete topHeader"></th>
|
||||
</tr>
|
||||
@@ -113,7 +112,7 @@ limitations under the License.
|
||||
</gr-button>
|
||||
</span>
|
||||
</td>
|
||||
<td class$="repositoryBrowser [[computeBrowserClass(detailType)]]">
|
||||
<td class="repositoryBrowser">
|
||||
<template is="dom-repeat"
|
||||
items="[[_computeWeblink(item)]]" as="link">
|
||||
<a href$="[[link.url]]"
|
||||
|
@@ -139,13 +139,6 @@
|
||||
return webLinks.length ? webLinks : null;
|
||||
},
|
||||
|
||||
computeBrowserClass(detailType) {
|
||||
if (detailType === DETAIL_TYPES.BRANCHES) {
|
||||
return 'show';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
||||
_stripRefs(item, detailType) {
|
||||
if (detailType === DETAIL_TYPES.BRANCHES) {
|
||||
return item.replace('refs/heads/', '');
|
||||
|
@@ -50,6 +50,12 @@ limitations under the License.
|
||||
return {
|
||||
ref: `refs/tags/test${++counter}`,
|
||||
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); });
|
||||
});
|
||||
|
||||
test('test for test branch in the list', done => {
|
||||
test('test for branch in the list', done => {
|
||||
flush(() => {
|
||||
assert.equal(element._items[2].ref, 'refs/heads/test2');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('test for test web links in the branches list', done => {
|
||||
test('test for web links in the branches list', done => {
|
||||
flush(() => {
|
||||
assert.equal(element._items[2].web_links[0].url,
|
||||
'https://git.example.org/branch/test;refs/heads/test2');
|
||||
@@ -332,13 +338,21 @@ limitations under the License.
|
||||
element._paramsChanged(params).then(() => { flush(done); });
|
||||
});
|
||||
|
||||
test('test for test tag in the list', done => {
|
||||
test('test for tag in the list', done => {
|
||||
flush(() => {
|
||||
assert.equal(element._items[1].ref, 'refs/tags/test2');
|
||||
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 => {
|
||||
flush(() => {
|
||||
assert.equal(element._stripRefs(element._items[1].ref,
|
||||
|
Reference in New Issue
Block a user