Display message when no changes are available
Message is kept unspecific since it can be shown because of search query with no matches or dashboard group with no items. Change-Id: I02020aa51651e6a2c1c8a72908ce2fc5bd77bd73
This commit is contained in:
@@ -49,6 +49,9 @@ limitations under the License.
|
|||||||
<template is="dom-if" if="[[_groupTitle(groupIndex)]]">
|
<template is="dom-if" if="[[_groupTitle(groupIndex)]]">
|
||||||
<div class="groupHeader">[[_groupTitle(groupIndex)]]</div>
|
<div class="groupHeader">[[_groupTitle(groupIndex)]]</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template is="dom-if" if="[[!changeGroup.length]]">
|
||||||
|
<div class="noChanges">No changes</div>
|
||||||
|
</template>
|
||||||
<template is="dom-repeat" items="[[changeGroup]]" as="change">
|
<template is="dom-repeat" items="[[changeGroup]]" as="change">
|
||||||
<gr-change-list-item
|
<gr-change-list-item
|
||||||
selected$="[[_computeItemSelected(index, groupIndex, selectedIndex)]]"
|
selected$="[[_computeItemSelected(index, groupIndex, selectedIndex)]]"
|
||||||
|
@@ -29,6 +29,10 @@ limitations under the License.
|
|||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.noChanges {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding: .3em .5em;
|
||||||
|
}
|
||||||
.keyboard,
|
.keyboard,
|
||||||
.star {
|
.star {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@@ -136,6 +136,26 @@ limitations under the License.
|
|||||||
assert.isFalse(elementItems[2].hasAttribute('unreviewed'));
|
assert.isFalse(elementItems[2].hasAttribute('unreviewed'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('no changes', function() {
|
||||||
|
element.changes = [];
|
||||||
|
flushAsynchronousOperations();
|
||||||
|
var listItems = Polymer.dom(element.root).querySelectorAll(
|
||||||
|
'gr-change-list-item');
|
||||||
|
assert.equal(listItems.length, 0);
|
||||||
|
var noChangesMsg = Polymer.dom(element.root).querySelector('.noChanges');
|
||||||
|
assert.ok(noChangesMsg);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('empty groups', function() {
|
||||||
|
element.groups = [[], []];
|
||||||
|
flushAsynchronousOperations();
|
||||||
|
var listItems = Polymer.dom(element.root).querySelectorAll(
|
||||||
|
'gr-change-list-item');
|
||||||
|
assert.equal(listItems.length, 0);
|
||||||
|
var noChangesMsg = Polymer.dom(element.root).querySelectorAll(
|
||||||
|
'.noChanges');
|
||||||
|
assert.equal(noChangesMsg.length, 2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
suite('gr-change-list groups', function() {
|
suite('gr-change-list groups', function() {
|
||||||
|
Reference in New Issue
Block a user