Use placeholder in change list size col
Specifically. uses the placeholder for unknown sizes in the change list.
Bug: Issue 8467
Change-Id: I6d1ae5c3f5eaa18906832a380313ed577ff87262
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.html b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.html
index d0286be..626cb68 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.html
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.html
@@ -210,7 +210,12 @@
<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">
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.js b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.js
index 5d7121a..9675f9a 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.js
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.js
@@ -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';
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html
index 4b001c3..4ac7b8e 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html
@@ -226,7 +226,7 @@
assert.equal(element._computeChangeSize({
insertions: 'foo',
deletions: 'bar',
- }), '🤷');
+ }), null);
assert.equal(element._computeChangeSize({
insertions: 1,
deletions: 1,