Skip to content

Commit

Permalink
Fix naming mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
ylvion committed Apr 7, 2022
1 parent 3da9798 commit 186a24b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Order(2)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
public class LRSSettingFlowController implements DashboardStep {
private final DaveDashboardService daveAnalysisService;
private final DaveDashboardService daveDashboardService;
private final LrsService lrsService;

/**
Expand Down Expand Up @@ -89,10 +89,10 @@ public ModelAndView showEditLRS(@RequestParam(name = "flow") UUID dashboardId) {
@PostMapping(DaveDashboardMavController.BASE_URL + "/new/source")
public RedirectView selectLRS(@RequestParam(name = "flow") UUID dashboardId, @RequestParam(name = "lrs_id") UUID lrsId,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
LrsConnection lrsConnection = this.lrsService.getConnection(lrsId);
this.daveAnalysisService.setDashboardSource(dashboard, lrsConnection);
this.daveAnalysisService.checkDashboardConfiguration(dashboard);
this.daveDashboardService.setDashboardSource(dashboard, lrsConnection);
this.daveDashboardService.checkDashboardConfiguration(dashboard);
attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "./visualisations" : "../show");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Order(1)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
public class NameSettingFlowController implements DashboardStep {
private final DaveDashboardService daveAnalysisService;
private final DaveDashboardService daveDashboardService;

/**
* Get the Human readable name of this Step
Expand Down Expand Up @@ -61,7 +61,7 @@ public ModelAndView showSetTitle(@RequestParam(name = "flow") Optional<UUID> das
ModelAndView mav = new ModelAndView("bootstrap/dave/dashboard/identifier");
mav.addObject("dashboardIdentifier",
dashboardId
.map(this.daveAnalysisService::getDashboard)
.map(this.daveDashboardService::getDashboard)
.map(DaveDashboard::getName)
.orElse("")
);
Expand Down Expand Up @@ -93,10 +93,10 @@ public ModelAndView showEditTitle(@RequestParam(name = "flow") UUID dashboardId)
public RedirectView setTitleAndCreate(@RequestParam(name = "flow") Optional<UUID> dashboardId, String identifier,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = dashboardId
.map(this.daveAnalysisService::getDashboard)
.orElseGet(() -> this.daveAnalysisService.createEmptyDashboard(identifier));
this.daveAnalysisService.setDashboardName(dashboard, identifier);
this.daveAnalysisService.checkDashboardConfiguration(dashboard);
.map(this.daveDashboardService::getDashboard)
.orElseGet(() -> this.daveDashboardService.createEmptyDashboard(identifier));
this.daveDashboardService.setDashboardName(dashboard, identifier);
this.daveDashboardService.checkDashboardConfiguration(dashboard);
attributes.addAttribute("flow", dashboard.getId().toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "./new/source" : "./show");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Order(3)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
public class VisualisationsSettingFlowController implements DashboardStep {
private final DaveDashboardService daveAnalysisService;
private final DaveDashboardService daveDashboardService;

/**
* Get the Human readable name of this Step
Expand Down Expand Up @@ -62,16 +62,16 @@ public Pattern getPathRegex() {
*/
@GetMapping(DaveDashboardMavController.BASE_URL + "/new/visualisations")
public ModelAndView showSelectAnalysis(@RequestParam(name = "flow") UUID dashboardId, Optional<Boolean> cache) {
if (!cache.orElse(true)) this.daveAnalysisService.cleanCaches();
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
if (!cache.orElse(true)) this.daveDashboardService.cleanCaches();
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
LrsConnection lrsConnection = dashboard.getLrsConnection();
List<String> activities = this.daveAnalysisService.getActivitiesOfLrs(lrsConnection);
List<String> activities = this.daveDashboardService.getActivitiesOfLrs(lrsConnection);

ModelAndView mav = new ModelAndView("bootstrap/dave/dashboard/analysis");
mav.addObject("flow", dashboardId.toString());
mav.addObject("possibleActivities", activities);
mav.addObject("possibleAnalysis", this.daveAnalysisService.getAllAnalysis(true).toList());
mav.addObject("dashboardVisualisations", this.daveAnalysisService.getVisualisationsOfDashboard(dashboard));
mav.addObject("possibleAnalysis", this.daveDashboardService.getAllAnalysis(true).toList());
mav.addObject("dashboardVisualisations", this.daveDashboardService.getVisualisationsOfDashboard(dashboard));
mav.addObject("mode", DaveDashboardMavController.Mode.CREATING);
return mav;
}
Expand Down Expand Up @@ -103,9 +103,9 @@ public RedirectView addVisualisationToDashboard(@RequestParam(name = "flow") UUI
@RequestParam(name = "activity") String activityId,
@RequestParam(name = "analysis") String analysisName,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
UUID analysisIdentifier = this.daveAnalysisService.getAnalysisByName(analysisName).getId();
this.daveAnalysisService.addVisualisationToDashboard(dashboard, activityId, analysisIdentifier);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
UUID analysisIdentifier = this.daveDashboardService.getAnalysisByName(analysisName).getId();
this.daveDashboardService.addVisualisationToDashboard(dashboard, activityId, analysisIdentifier);

attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "../visualisations" : "../../edit/visualisations");
Expand All @@ -118,9 +118,9 @@ public RedirectView addVisualisationToDashboard(@RequestParam(name = "flow") UUI
*/
@PostMapping(DaveDashboardMavController.BASE_URL + "/new/visualisations")
public RedirectView selectVisualisations(@RequestParam(name = "flow") UUID dashboardId, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
this.daveAnalysisService.checkDashboardConfiguration(dashboard);
this.daveAnalysisService.finalizeDashboard(dashboard);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
this.daveDashboardService.checkDashboardConfiguration(dashboard);
this.daveDashboardService.finalizeDashboard(dashboard);
attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView("../show");
}
Expand All @@ -135,8 +135,8 @@ public RedirectView selectVisualisations(@RequestParam(name = "flow") UUID dashb
@PostMapping(DaveDashboardMavController.BASE_URL + "/new/visualisations/up")
public RedirectView moveVisualisationUp(@RequestParam(name = "flow") UUID dashboardId, @RequestParam(name = "position") Integer position,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
this.daveAnalysisService.shiftPositionOfVisualisationOfDashboard(dashboard, position, DaveDashboardService.Move.UP);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
this.daveDashboardService.shiftPositionOfVisualisationOfDashboard(dashboard, position, DaveDashboardService.Move.UP);

attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "../visualisations" : "../../edit/visualisations");
Expand All @@ -152,8 +152,8 @@ public RedirectView moveVisualisationUp(@RequestParam(name = "flow") UUID dashbo
@PostMapping(DaveDashboardMavController.BASE_URL + "/new/visualisations/down")
public RedirectView moveVisualisationDown(@RequestParam(name = "flow") UUID dashboardId, @RequestParam(name = "position") Integer position,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
this.daveAnalysisService.shiftPositionOfVisualisationOfDashboard(dashboard, position, DaveDashboardService.Move.DOWN);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
this.daveDashboardService.shiftPositionOfVisualisationOfDashboard(dashboard, position, DaveDashboardService.Move.DOWN);

attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "../visualisations" : "../../edit/visualisations");
Expand All @@ -169,8 +169,8 @@ public RedirectView moveVisualisationDown(@RequestParam(name = "flow") UUID dash
@PostMapping(DaveDashboardMavController.BASE_URL + "/new/visualisations/delete")
public RedirectView deleteVisualisation(@RequestParam(name = "flow") UUID dashboardId, @RequestParam(name = "position") Integer position,
DaveDashboardMavController.Mode mode, RedirectAttributes attributes) {
DaveDashboard dashboard = this.daveAnalysisService.getDashboard(dashboardId);
this.daveAnalysisService.deleteVisualisationFromDashboard(dashboard, position);
DaveDashboard dashboard = this.daveDashboardService.getDashboard(dashboardId);
this.daveDashboardService.deleteVisualisationFromDashboard(dashboard, position);

attributes.addAttribute("flow", dashboardId.toString());
return new RedirectView(DaveDashboardMavController.Mode.CREATING.equals(mode) ? "../visualisations" : "../../edit/visualisations");
Expand Down

0 comments on commit 186a24b

Please sign in to comment.