Allow defining a default dashboard for projects
It is now possible to define a default dashboard for a project in the project.config file in the refs/meta/config branch. Example: [dashboard] default = refs/meta/dashboards/main:default When it will be possible to inherit dashboards from parent projects, it will be important to differentiate between a default dashboard that is be used for this project and the dashboard that will be inherited by the child projects as default dashboard. This is why we allow overwriting the default dashboard by explicitly setting a local default dashboard, which will only be used by this project. Example: [dashboard] default = refs/meta/dashboards/main:default local-default = refs/meta/dashboards/main:local Via the /dashboards/ REST endpoint it is now possible to either retrieve all dashboards of the project or only the default dashboard of the project. Change-Id: I119408968bc86c3fd112c186638d3176235ca28e Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -23,6 +23,7 @@ public class DashboardInfo extends JavaScriptObject {
|
||||
public final native String projectName() /*-{ return this.project_name; }-*/;
|
||||
public final native String description() /*-{ return this.description; }-*/;
|
||||
public final native String parameters() /*-{ return this.parameters; }-*/;
|
||||
public final native boolean isDefault() /*-{ return this.isDefault ? true : false; }-*/;
|
||||
|
||||
protected DashboardInfo() {
|
||||
}
|
||||
|
@@ -28,6 +28,13 @@ public class DashboardMap extends NativeMap<DashboardInfo> {
|
||||
.send(NativeMap.copyKeysIntoChildren(callback));
|
||||
}
|
||||
|
||||
public static void projectDefault(Project.NameKey project, boolean mine,
|
||||
AsyncCallback<DashboardMap> callback) {
|
||||
new RestApi("/dashboards/project/" + URL.encode(project.get()).replaceAll("[?]", "%3F"))
|
||||
.addParameterTrue("default")
|
||||
.send(NativeMap.copyKeysIntoChildren(callback));
|
||||
}
|
||||
|
||||
protected DashboardMap() {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user