Use placeholder in change list size col

Specifically. uses the placeholder for unknown sizes in the change list.

Bug: Issue 8467
Change-Id: I6d1ae5c3f5eaa18906832a380313ed577ff87262
This commit is contained in:
Kasper Nilsson
2018-03-07 16:29:27 -08:00
parent 5367f14a9e
commit ffc011ce16
3 changed files with 12 additions and 3 deletions

View File

@@ -210,7 +210,12 @@ limitations under the License.
<gr-tooltip-content
has-tooltip
title="[[_computeSizeTooltip(change)]]">
<span>[[_computeChangeSize(change)]]</span>
<template is="dom-if" if="[[_changeSize]]">
<span>[[_changeSize]]</span>
</template>
<template is="dom-if" if="[[!_changeSize]]">
<span class="placeholder">--</span>
</template>
</gr-tooltip-content>
</td>
<template is="dom-repeat" items="[[labelNames]]" as="labelName">

View File

@@ -45,6 +45,10 @@
value: false,
},
showNumber: Boolean,
_changeSize: {
type: String,
computed: '_computeChangeSize(change)',
},
},
behaviors: [
@@ -153,7 +157,7 @@
_computeChangeSize(change) {
const delta = change.insertions + change.deletions;
if (isNaN(delta) || delta === 0) {
return '🤷'; // Unknown
return null; // Unknown
}
if (delta < CHANGE_SIZE.XS) {
return 'XS';

View File

@@ -226,7 +226,7 @@ limitations under the License.
assert.equal(element._computeChangeSize({
insertions: 'foo',
deletions: 'bar',
}), '🤷');
}), null);
assert.equal(element._computeChangeSize({
insertions: 1,
deletions: 1,