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:
@@ -109,6 +109,10 @@ public final class Project {
|
||||
|
||||
protected InheritedBoolean useContentMerge;
|
||||
|
||||
protected String defaultDashboardId;
|
||||
|
||||
protected String localDefaultDashboardId;
|
||||
|
||||
protected Project() {
|
||||
}
|
||||
|
||||
@@ -186,6 +190,22 @@ public final class Project {
|
||||
state = newState;
|
||||
}
|
||||
|
||||
public String getDefaultDashboard() {
|
||||
return defaultDashboardId;
|
||||
}
|
||||
|
||||
public void setDefaultDashboard(final String defaultDashboardId) {
|
||||
this.defaultDashboardId = defaultDashboardId;
|
||||
}
|
||||
|
||||
public String getLocalDefaultDashboard() {
|
||||
return localDefaultDashboardId;
|
||||
}
|
||||
|
||||
public void setLocalDefaultDashboard(final String localDefaultDashboardId) {
|
||||
this.localDefaultDashboardId = localDefaultDashboardId;
|
||||
}
|
||||
|
||||
public void copySettingsFrom(final Project update) {
|
||||
description = update.description;
|
||||
useContributorAgreements = update.useContributorAgreements;
|
||||
|
||||
Reference in New Issue
Block a user