use of com.epam.ta.reportportal.entity.dashboard.Dashboard in project service-api by reportportal.
the class DemoDashboardsService method createDemoDashboard.
private Dashboard createDemoDashboard(List<Widget> widgets, ReportPortalUser user, Project project, String name) {
Dashboard dashboard = new Dashboard();
dashboard.setName(name);
dashboard.setProject(project);
dashboard.setCreationDate(LocalDateTime.now());
dashboard.setOwner(user.getUsername());
dashboard.setShared(SHARED);
dashboardRepository.save(dashboard);
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(0), 0, 0, 6, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(1), 6, 0, 6, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(2), 0, 5, 7, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(3), 7, 5, 5, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(4), 0, 10, 5, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(5), 5, 10, 7, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(6), 0, 15, 6, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(7), 6, 15, 6, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(8), 0, 20, 12, 4));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(9), 0, 24, 7, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(10), 7, 24, 5, 5));
dashboard.addWidget(createDashboardWidget(user.getUsername(), dashboard, widgets.get(11), 0, 29, 12, 4));
aclHandler.initAcl(dashboard, user.getUsername(), project.getId(), SHARED);
return dashboard;
}
Aggregations