Skip to content

Commit 82f4597

Browse files
committed
work in progress
1 parent 23d4baf commit 82f4597

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/main/java/org/woehlke/simpleworklist/project/ProjectControllerServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public String addNewProjectToProjectIdPersist(
8181
} else {
8282
Project thisProject = projectService.findByProjectId(projectId);
8383
project = thisProject.addOtherProjectToChildren(project);
84+
project.setContext(context);
8485
project = projectService.add(project);
8586
thisProject = projectService.update(thisProject);
8687
log.info("project: "+ project.toString());
@@ -129,6 +130,7 @@ public String addNewProjectToProjectRootPersist(
129130
Model model
130131
) {
131132
log.info("addNewProjectToRootPersist");
133+
project.setContext(context);
132134
project = projectService.add(project);
133135
userSession.setLastProjectId(project.getId());
134136
model.addAttribute("userSession", userSession);

src/main/java/org/woehlke/simpleworklist/project/ProjectServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ public Project findByProjectId(@Min(1L) long projectId) {
8181
public Project add(@NotNull Project entity) {
8282
log.info("saveAndFlush");
8383
entity.setUuid(UUID.randomUUID().toString());
84+
/*
8485
if(entity.getContext()!=null){
8586
if(entity.getContext().getUuid() == null){
8687
entity.getContext().setUuid(UUID.randomUUID().toString());
8788
}
8889
}
90+
*/
8991
return projectRepository.saveAndFlush(entity);
9092
}
9193

src/main/java/org/woehlke/simpleworklist/task/TaskProjektServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.woehlke.simpleworklist.user.session.UserSessionBean;
1111

1212
import javax.validation.constraints.NotNull;
13+
import java.util.UUID;
1314

1415
@Slf4j
1516
@Service
@@ -32,13 +33,13 @@ public String transformTaskIntoProjectGet(
3233
Project thisProject = new Project();
3334
thisProject.setName(task.getTitle());
3435
thisProject.setDescription(task.getText());
35-
thisProject.setUuid(task.getUuid());
3636
thisProject.setContext(task.getContext());
3737
if (task.getProject() != null) {
3838
long projectId = task.getProject().getId();
3939
Project parentProject = projectService.findByProjectId(projectId);
4040
thisProject.setParent(parentProject);
4141
}
42+
thisProject.setContext(task.getContext());
4243
thisProject = projectService.add(thisProject);
4344
task.setProject(null);
4445
task.moveToTrash();

0 commit comments

Comments
 (0)