Merge "Replace ${project} in a foreach query (for project dashboards)" into stable-2.16
This commit is contained in:
@@ -117,9 +117,8 @@
|
||||
const suffix = response.foreach ? ' ' + response.foreach : '';
|
||||
return {
|
||||
name: section.name,
|
||||
query:
|
||||
section.query.replace(
|
||||
PROJECT_PLACEHOLDER_PATTERN, project) + suffix,
|
||||
query: (section.query + suffix).replace(
|
||||
PROJECT_PLACEHOLDER_PATTERN, project),
|
||||
};
|
||||
}),
|
||||
};
|
||||
|
@@ -223,7 +223,6 @@ limitations under the License.
|
||||
test('dashboard with foreach', () => {
|
||||
sandbox.stub(element.$.restAPI, 'getDashboard', () => Promise.resolve({
|
||||
title: 'title',
|
||||
// Note: ${project} should not be resolved in foreach!
|
||||
foreach: 'foreach for ${project}',
|
||||
sections: [
|
||||
{name: 'section 1', query: 'query 1'},
|
||||
@@ -236,10 +235,10 @@ limitations under the License.
|
||||
{
|
||||
title: 'title',
|
||||
sections: [
|
||||
{name: 'section 1', query: 'query 1 foreach for ${project}'},
|
||||
{name: 'section 1', query: 'query 1 foreach for project'},
|
||||
{
|
||||
name: 'section 2',
|
||||
query: 'project query 2 foreach for ${project}',
|
||||
query: 'project query 2 foreach for project',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
Reference in New Issue
Block a user