Remove duplicated/empty notes stuff

This commit is contained in:
KennyTV 2020-08-05 17:31:04 +02:00
parent ae16ef8b71
commit ae74dda88e
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 10 additions and 16 deletions

View File

@ -338,15 +338,22 @@ public class ProjectsController extends HangarController {
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("projects.show", author, slug));
}
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
@Secured("ROLE_USER")
@RequestMapping("/{author}/{slug}/notes")
public Object showNotes(@PathVariable Object author, @PathVariable Object slug) {
return null; // TODO implement showNotes request controller
public ModelAndView showNotes(@PathVariable String author, @PathVariable String slug) {
ModelAndView mv = new ModelAndView("projects/admin/notes");
ProjectData projectData = projectService.getProjectData(author, slug);
mv.addObject("project", projectData.getProject());
//TODO get real notes
mv.addObject("notes", List.of(new Note().message("## 10/10\n* has everything\n* but also nothing").user("kneny")));
return fillModel(mv);
}
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
@Secured("ROLE_USER")
@RequestMapping("/{author}/{slug}/notes/addmessage")
public Object addMessage(@PathVariable Object author, @PathVariable Object slug) {
public ModelAndView addMessage(@PathVariable String author, @PathVariable String slug) {
return null; // TODO implement addMessage request controller
}
@ -399,18 +406,6 @@ public class ProjectsController extends HangarController {
}
}
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
@Secured("ROLE_USER")
@GetMapping("/{author}/{slug}/notes")
public ModelAndView showNotes(@PathVariable String author, @PathVariable String slug) {
ModelAndView mv = new ModelAndView("projects/admin/notes");
ProjectData projectData = projectService.getProjectData(author, slug);
mv.addObject("project", projectData.getProject());
//TODO get and save real notes
mv.addObject("notes", List.of(new Note().message("## 10/10\n* has everything\n* but also nothing").user("kneny")));
return fillModel(mv);
}
private ModelAndView showUserGrid(String author, String slug, Integer page, String title, TriFunction<Long, Integer, Integer, Collection<UsersTable>> getUsers) {
ProjectData projectData = projectService.getProjectData(author, slug);
ScopedProjectData scopedProjectData = projectService.getScopedProjectData(projectData.getProject().getId());

View File

@ -63,7 +63,6 @@ public class RouteHelper {
register("projects.showNotes", "/{author}/{slug}/notes", of("author", "slug"), of());
register("projects.setVisible", "/{author}/{slug}/visible/{visibility}", of("author", "slug", "visibility"), of());
register("projects.removeMember", "/{author}/{slug}/manage/members/remove", of("author", "slug"), of());
register("projects.showNotes", "/{author}/{slug}/notes", of("author", "slug"), of());
register("versions.restore", "/{author}/{slug}/versions/{version}/restore", of("author", "slug", "version"), of());
register("versions.downloadRecommendedJar", "/{author}/{slug}/versions/recommended/jar", of("author", "slug"), of("token"));