February 2019
Intermediate to advanced
442 pages
11h 46m
English
The view task screen will open the task in view mode, meaning it will show the details of the task. It also allows you to add a comment and shows the list of comments added to the selected task. The controller method for viewing the task will populate the task and comment data, and redirects the user to view the task screen. The method looks as follows:
@GetMapping("/viewTask")fun viewTask(@RequestParam(name = "taskId",required = true) taskId:Int,model:Model):String{ val selectedTask:Task? = taskRepository?.findById(taskId)?.get() val user:User? = userRepository?. findById(selectedTask?.getAssignedTo() ?: 0)?.get() val taskDto= TaskDTO(selectedTask?.getId(),selectedTask?.getTitle(), selectedTask?.getDetail(),selectedTask?.getAssignedTo() ...