-
Notifications
You must be signed in to change notification settings - Fork 0
Updates in details of DF #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package br.ufrn.dct.apf.controller; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import javax.validation.Valid; | ||
|
||
import br.ufrn.dct.apf.dto.DataFunctionDTO; | ||
import br.ufrn.dct.apf.model.DataFunction; | ||
import br.ufrn.dct.apf.model.Project; | ||
import br.ufrn.dct.apf.model.User; | ||
import br.ufrn.dct.apf.model.UserStory; | ||
import br.ufrn.dct.apf.service.DataFunctionService; | ||
import br.ufrn.dct.apf.service.ProjectService; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
@@ -16,12 +16,11 @@ | |
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
import br.ufrn.dct.apf.dto.DataFunctionDTO; | ||
import br.ufrn.dct.apf.model.Project; | ||
import br.ufrn.dct.apf.model.User; | ||
import br.ufrn.dct.apf.model.UserStory; | ||
import br.ufrn.dct.apf.service.DataFunctionService; | ||
import br.ufrn.dct.apf.service.ProjectService; | ||
|
||
import javax.validation.Valid; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
@Controller | ||
public class DataFunctionController extends AbstractController { | ||
|
@@ -78,15 +77,21 @@ public ModelAndView add(DataFunctionDTO df) { | |
return mv; | ||
} | ||
|
||
// @GetMapping("/df/list") | ||
// public ModelAndView list() { | ||
// @GetMapping("/df/list/{projectId}") | ||
// public ModelAndView list(@PathVariable("projectId") Long projectId) throws BusinessRuleException { | ||
// ModelAndView mv = new ModelAndView("df/list"); | ||
// | ||
// User current = getCurrentUser(); | ||
// User currentUser = getCurrentUser(); | ||
// Project project = projectService.findOne(projectId); | ||
// | ||
// if (!project.isMemberOfProject(currentUser)) { | ||
// throw MEMBER_NOT_EXISTS; | ||
// } | ||
// | ||
// List<Project> projects = projectService.findByUserId(current.getId()); | ||
// List<DataFunction> dfs = dataFunctionService.findByProject(projectId); | ||
// | ||
// mv.addObject("projects", projects); | ||
// mv.addObject("project", project); | ||
// mv.addObject("dfs", dfs); | ||
// | ||
// return mv; | ||
// } | ||
|
@@ -126,17 +131,4 @@ public ModelAndView details(@PathVariable("dataFunctionId") Long id) { | |
|
||
return mv; | ||
} | ||
|
||
// Consultar se precisa ser por projeto ou time a busca | ||
@GetMapping("/df/list") | ||
public ModelAndView list() { | ||
ModelAndView mv = new ModelAndView("df/list"); | ||
|
||
List<DataFunction> dfs = dataFunctionService.findAll(); | ||
|
||
mv.addObject("dfs", dfs); | ||
|
||
return mv; | ||
} | ||
|
||
Comment on lines
-129
to
-141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joaoeudes7 não tem mais o listar de DataFunction? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Veja a resposta no outro comentário |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package br.ufrn.dct.apf.repository; | ||
|
||
import br.ufrn.dct.apf.model.DataFunction; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import br.ufrn.dct.apf.model.DataFunction; | ||
import java.util.List; | ||
|
||
@Repository("dataFunctionRepository") | ||
public interface DataFunctionRepository extends JpaRepository<DataFunction, Long> { | ||
|
||
List<DataFunction> findByProject(Long projectId); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ | |
</td> | ||
<td> | ||
<div class="btn-group pull-right"> | ||
<a class="btn btn-sm btn-primary" th:href="@{/df/details/{id}(id=${dataFunction.id})}">Detalhes</a> | ||
<a class="btn btn-sm btn-primary" th:href="@{/df/edit/{id}(id=${dataFunction.id})}">Editar</a> | ||
<a class="delete btn btn-sm btn-danger" th:href="@{/df/delete/{id}(id=${dataFunction.id})}">Excluir</a> | ||
</div> | ||
|
@@ -121,8 +122,7 @@ | |
<td> | ||
<div class="btn-group pull-right"> | ||
<a class="btn btn-sm btn-primary" th:href="@{/us/edit/{id}(id=${userstory.id})}">Editar</a> | ||
<a class="delete btn btn-sm btn-danger" | ||
th:href="@{/us/delete/{id}(id=${userstory.id})}">Excluir</a> | ||
<a class="delete btn btn-sm btn-danger" th:href="@{/us/delete/{id}(id=${userstory.id})}">Excluir</a> | ||
</div> | ||
</td> | ||
</tr> | ||
|
@@ -179,5 +179,10 @@ | |
<div th:include="fragments/footer :: footer-authenticated" align="center"></div> | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
function viewDetailsDf(id) { | ||
window.location = `details/${id}`; | ||
} | ||
</script> | ||
Comment on lines
+182
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O que acha de invés de adicionar um botão na linha da tabela, fazer a mudança de rota por meio do clique na linha? Utilizando JS |
||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaoeudes7 muito código comentado. Ainda está em construção?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para saber se posso remover, como os DFs vão ser puxadas a partir da view do projeto, não vejo mais necessidade dessa view de list, até por isso descartei o que eu havia feito, veja os detalhes da tarefas e #31