Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Modify constructor to take in a list of owners (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewalvintran authored and rvema committed Feb 21, 2019
1 parent c330712 commit 3c2af4d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/capitalone/dashboard/model/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ public class Dashboard extends BaseModel {
Dashboard() {
}

public Dashboard(String template, String title, Application application, Owner owner, DashboardType type, String configurationItemBusServName, String configurationItemBusAppName, List<String> activeWidgets, boolean scoreEnabled, ScoreDisplayType scoreDisplay) {
this(false, template, title, application, owner, type,configurationItemBusServName, configurationItemBusAppName,activeWidgets, scoreEnabled, scoreDisplay);
public Dashboard(String template, String title, Application application, List<Owner> owners, DashboardType type, String configurationItemBusServName, String configurationItemBusAppName, List<String> activeWidgets, boolean scoreEnabled, ScoreDisplayType scoreDisplay) {
this(false, template, title, application, owners, type,configurationItemBusServName, configurationItemBusAppName,activeWidgets, scoreEnabled, scoreDisplay);
}

public Dashboard(boolean remoteCreated, String template, String title, Application application, Owner owner, DashboardType type, String configurationItemBusServName, String configurationItemBusAppName,List<String> activeWidgets, boolean scoreEnabled, ScoreDisplayType scoreDisplay) {
public Dashboard(boolean remoteCreated, String template, String title, Application application, List<Owner> owners, DashboardType type, String configurationItemBusServName, String configurationItemBusAppName,List<String> activeWidgets, boolean scoreEnabled, ScoreDisplayType scoreDisplay) {
this.template = template;
this.title = title;
this.configurationItemBusServName = configurationItemBusServName;
this.configurationItemBusAppName = configurationItemBusAppName;
this.application = application;
this.type = type;
this.owners.add(owner);
this.owners = owners;
this.activeWidgets = activeWidgets;
this.scoreEnabled = scoreEnabled;
this.scoreDisplay = scoreDisplay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ private Dashboard createDashboard(boolean hasBuildCollector) {
}

Application application = new Application("app", component); List<String> activeWidgets = new ArrayList<>();
Dashboard dashboard = new Dashboard("template", "title", application, new Owner("owner", AuthType.STANDARD), DashboardType.Team , "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard dashboard = new Dashboard("template", "title", application, owners, DashboardType.Team , "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);
dashboard.setId(ObjectId.get());
return dashboard;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ private Dashboard createDashboard(boolean hasBuildCollector) {

Application application = new Application("app", component);
List<String> activeWidgets = new ArrayList<>();
Dashboard dashboard = new Dashboard("template", "title", application, new Owner("owner", AuthType.STANDARD), DashboardType.Team , "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard dashboard = new Dashboard("template", "title", application, owners, DashboardType.Team , "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);
dashboard.setId(ObjectId.get());
return dashboard;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ private Dashboard createDashboard(boolean hasBuildCollector) {

Application application = new Application("app", component);
List<String> activeWidgets = new ArrayList<>();
Dashboard dashboard = new Dashboard("template", "title", application, new Owner("owner", AuthType.STANDARD), DashboardType.Team , "ASVTEST", "BAPTEST", activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard dashboard = new Dashboard("template", "title", application, owners, DashboardType.Team , "ASVTEST", "BAPTEST", activeWidgets, false, ScoreDisplayType.HEADER);
dashboard.setId(ObjectId.get());
return dashboard;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ private Dashboard makeTeamDashboard(String template, String title, String appNam
app.addComponent(new Component(compName));
}
List<String> activeWidgets = new ArrayList<>();
Dashboard dashboard = new Dashboard(template, title, app, new Owner(owner, AuthType.STANDARD), DashboardType.Team,configItemAppName, configItemComponentName, activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard dashboard = new Dashboard(template, title, app, owners, DashboardType.Team,configItemAppName, configItemComponentName, activeWidgets, false, ScoreDisplayType.HEADER);
return dashboard;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public void createTeamDashboardTest() {
Application application = new Application("Jay's App", component);

List<String> activeWidgets = new ArrayList<>();
Dashboard dashboard = new Dashboard("Topo", "Jays's Dashboard", application, new Owner("amit", AuthType.STANDARD), DashboardType.Team, configItemApp.getConfigurationItem(), configItemComp.getConfigurationItem(), activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard dashboard = new Dashboard("Topo", "Jays's Dashboard", application, owners, DashboardType.Team, configItemApp.getConfigurationItem(), configItemComp.getConfigurationItem(), activeWidgets, false, ScoreDisplayType.HEADER);

Widget build = new Widget();
build.setName("build");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ private Dashboard setupDashboard() {
ObjectId configItemAppId = new ObjectId();
ObjectId configItemComponetId = new ObjectId();
List<String> activeWidgets = new ArrayList<>();
Dashboard rt = new Dashboard("Capone", "hygieia", new Application("hygieia", new Component()), new Owner("owner", AuthType.STANDARD), DashboardType.Team, "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);
List<Owner> owners = new ArrayList<Owner>();
owners.add(new Owner("owner", AuthType.STANDARD));
Dashboard rt = new Dashboard("Capone", "hygieia", new Application("hygieia", new Component()), owners, DashboardType.Team, "ASVTEST", "BAPTEST",activeWidgets, false, ScoreDisplayType.HEADER);

Widget pipelineWidget = new Widget();
pipelineWidget.setName("pipeline");
Expand Down

3 comments on commit 3c2af4d

@mrmather
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit might break Hygiaia (API) build. I just started looking at it (and Hygieia overall) about 2 hours ago

@rvema
Copy link
Contributor

@rvema rvema commented on 3c2af4d Feb 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrmather the supporting change in Hygieia project is being merged and will support this change

@rvema
Copy link
Contributor

@rvema rvema commented on 3c2af4d Feb 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The supporting changes in Hygieia project are merged as well. Please refresh your workspace

Please sign in to comment.