Support 'foreach' in a project dashboard config

Change-Id: I8ede9ec3d4c0efa16a88bad55cc59b2b039f0cdc
This commit is contained in:
Martin Fick
2012-11-19 21:58:20 -07:00
parent 4accc9e658
commit cb8fe2f51b
3 changed files with 20 additions and 0 deletions

View File

@@ -144,9 +144,13 @@ class DashboardsCollection implements
info.title = config.getString("dashboard", null, "title");
info.description = config.getString("dashboard", null, "description");
info.isDefault = setDefault ? (info.id.equals(defaultOf(project)) ? true : null) : null;
info.foreach = config.getString("dashboard", null, "foreach");
UrlEncoded u = new UrlEncoded("/dashboard/");
u.put("title", Objects.firstNonNull(info.title, info.path));
if (info.foreach != null) {
u.put("foreach", replace(project.getName(), info.foreach));
}
for (String name : config.getSubsections("section")) {
Section s = new Section();
s.name = name;
@@ -181,6 +185,7 @@ class DashboardsCollection implements
String ref;
String path;
String description;
String foreach;
String url;
@SerializedName("default")