Highlight file list header on old patch sets
+ Additionally, provide a link to go to the latest patch set if an old change is shown. Change-Id: I25b8bb667473e4701fb1d06514450602eafd999a
This commit is contained in:
parent
462991f6d0
commit
791422a65a
@ -137,6 +137,12 @@ limitations under the License.
|
||||
border: 1px solid #ddd;
|
||||
margin: 1em var(--default-horizontal-margin);
|
||||
}
|
||||
.patchInfo--oldPatchSet .patchInfo-header {
|
||||
background-color: #fff9c4;
|
||||
}
|
||||
.patchInfo--oldPatchSet .latestPatchContainer {
|
||||
display: initial;
|
||||
}
|
||||
.patchInfo-header,
|
||||
gr-file-list {
|
||||
padding: .5em calc(var(--default-horizontal-margin) / 2);
|
||||
@ -147,6 +153,9 @@ limitations under the License.
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.latestPatchContainer {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (max-width: 50em) {
|
||||
.header {
|
||||
align-items: flex-start;
|
||||
@ -254,12 +263,12 @@ limitations under the License.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="patchInfo">
|
||||
<section class$="patchInfo [[_computePatchInfoClass(_patchRange.patchNum, _allPatchSets)]]">
|
||||
<div class="patchInfo-header">
|
||||
<div>
|
||||
<label class="patchSelectLabel" for="patchSetSelect">Patch set</label>
|
||||
<select id="patchSetSelect" on-change="_handlePatchChange">
|
||||
<template is="dom-repeat" items="{{_allPatchSets}}" as="patchNumber">
|
||||
<template is="dom-repeat" items="[[_allPatchSets]]" as="patchNumber">
|
||||
<option value$="[[patchNumber]]" selected$="[[_computePatchIndexIsSelected(index, _patchRange.patchNum)]]">
|
||||
<span>[[patchNumber]]</span>
|
||||
/
|
||||
@ -273,6 +282,10 @@ limitations under the License.
|
||||
class="download"
|
||||
on-tap="_handleDownloadTap">Download</gr-button>
|
||||
</span>
|
||||
<span class="latestPatchContainer">
|
||||
/
|
||||
<a href$="/c/[[_change._number]]">Go to latest patch set</a>
|
||||
</span>
|
||||
</div>
|
||||
<gr-commit-info
|
||||
change="[[_change]]"
|
||||
|
@ -390,6 +390,14 @@
|
||||
return allPatchSets[allPatchSets.length - 1];
|
||||
},
|
||||
|
||||
_computePatchInfoClass: function(patchNum, allPatchSets) {
|
||||
if (parseInt(patchNum, 10) ===
|
||||
this._computeLatestPatchNum(allPatchSets)) {
|
||||
return '';
|
||||
}
|
||||
return 'patchInfo--oldPatchSet';
|
||||
},
|
||||
|
||||
_computeAllPatchSets: function(change) {
|
||||
var patchNums = [];
|
||||
for (var rev in change.revisions) {
|
||||
|
@ -364,5 +364,14 @@ limitations under the License.
|
||||
assert(openSpy.lastCall.calledWithExactly(FocusTarget.CCS),
|
||||
'_openReplyDialog should have been passed CCS');
|
||||
});
|
||||
|
||||
test('class is applied to file list on old patch set', function() {
|
||||
var allPatcheSets = [1, 2, 4];
|
||||
assert.equal(element._computePatchInfoClass('1', allPatcheSets),
|
||||
'patchInfo--oldPatchSet');
|
||||
assert.equal(element._computePatchInfoClass('2', allPatcheSets),
|
||||
'patchInfo--oldPatchSet');
|
||||
assert.equal(element._computePatchInfoClass('4', allPatcheSets), '');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user