78 |
78 |
*/
|
79 |
79 |
@GetMapping("/projects/{id}")
|
80 |
80 |
public String getProjectById(@PathVariable Long id, Model model) {
|
|
81 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
81 |
82 |
model.addAttribute("project", projectService.getProjectById(id));
|
82 |
83 |
return "project";
|
83 |
84 |
}
|
... | ... | |
87 |
88 |
* @return list of AP
|
88 |
89 |
*/
|
89 |
90 |
@GetMapping("/anti-patterns")
|
90 |
|
public @ResponseBody List<AntiPattern> getAllAntiPatterns() {
|
|
91 |
public @ResponseBody List<AntiPattern> getAllAntiPatterns(Model model) {
|
|
92 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
91 |
93 |
return antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns());
|
92 |
94 |
}
|
93 |
95 |
|
... | ... | |
101 |
103 |
@GetMapping("/anti-patterns/{id}")
|
102 |
104 |
public String getAntiPatternById(@PathVariable Long id, Model model, HttpSession session) {
|
103 |
105 |
String currentConfigurationName = configurationGetFromSession(session);
|
|
106 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
104 |
107 |
model.addAttribute("antiPattern", antiPatternService.getAntiPatternById(id).getAntiPatternModel());
|
105 |
108 |
model.addAttribute("description", antiPatternService.getDescriptionFromCatalogue(id));
|
106 |
109 |
model.addAttribute("operationalizationText", antiPatternService.getOperationalizationText(antiPatternService.getAntiPatternById(id).getAntiPatternModel().getName()));
|
... | ... | |
164 |
167 |
}
|
165 |
168 |
antiPatternService.setConfigurationChanged(false);
|
166 |
169 |
|
|
170 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
167 |
171 |
model.addAttribute("queryResults", antiPatternService.getResults());
|
168 |
172 |
model.addAttribute("recalculationTime", DateTimeFormatter.ofPattern("HH:mm:ss").format(LocalTime.now()));
|
169 |
173 |
|
... | ... | |
176 |
180 |
* @return html file name for thymeleaf template
|
177 |
181 |
*/
|
178 |
182 |
@GetMapping("/about")
|
179 |
|
public String about() {return "about";}
|
|
183 |
public String about(Model model) {
|
|
184 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
|
185 |
return "about";
|
|
186 |
}
|
180 |
187 |
|
181 |
188 |
/**
|
182 |
189 |
* Method for getting all configuration from app and set it to the model class.
|
... | ... | |
186 |
193 |
*/
|
187 |
194 |
@GetMapping("/configuration")
|
188 |
195 |
public String configuration(Model model, HttpSession session) {
|
|
196 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
189 |
197 |
model.addAttribute("antiPatterns", antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns()));
|
190 |
198 |
|
191 |
199 |
String currentConfigurationName = configurationGetFromSession(session);
|
... | ... | |
381 |
389 |
* @return html file name for thymeleaf template
|
382 |
390 |
*/
|
383 |
391 |
@GetMapping("/login")
|
384 |
|
public String login(){
|
|
392 |
public String login(Model model){
|
|
393 |
model.addAttribute("query", new Query(projectService.getAllProjects(), antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns())));
|
385 |
394 |
return "login";
|
386 |
395 |
}
|
387 |
396 |
|
#27 Configuration menu item not shown if AP list is empty