Merge "Link "Recently closed" header to full query"
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
},
|
||||
{
|
||||
name: 'Recently closed',
|
||||
query: 'is:closed (owner:self OR reviewer:self OR assignee:self) ' +
|
||||
'-age:4w limit:10',
|
||||
query: 'is:closed (owner:self OR reviewer:self OR assignee:self)',
|
||||
suffixForDashboard: '-age:4w limit:10',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -99,9 +99,17 @@
|
||||
_getChanges() {
|
||||
return this.$.restAPI.getChanges(
|
||||
null,
|
||||
this.sectionMetadata.map(section => section.query),
|
||||
this.sectionMetadata.map(
|
||||
section => this._dashboardQueryForSection(section)),
|
||||
null,
|
||||
this.options);
|
||||
},
|
||||
|
||||
_dashboardQueryForSection(section) {
|
||||
if (section.suffixForDashboard) {
|
||||
return section.query + ' ' + section.suffixForDashboard;
|
||||
}
|
||||
return section.query;
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -55,5 +55,14 @@ limitations under the License.
|
||||
element.params = {view: 'gr-dashboard-view'};
|
||||
assert.equal(getChangesStub.callCount, 2);
|
||||
});
|
||||
|
||||
test('_dashboardQueryForSection', () => {
|
||||
const query = 'query';
|
||||
const suffixForDashboard = 'suffix';
|
||||
assert.equal(element._dashboardQueryForSection({query}), 'query');
|
||||
assert.equal(
|
||||
element._dashboardQueryForSection({query, suffixForDashboard}),
|
||||
'query suffix');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user