Skip to content

Commit 40dcf29

Browse files
committed
## 2.3.34
* fixed #317 switch Context is broken * fixed #326 add Context to Breadcrumb * Issue #327 AbstractController: rename rootCategories to rootProjects (line 77) * Issue #328 AbstractController: rename allCategories to allProjects (line 66) * Issue #329 AbstractController: remove side effects from getContext (line 145, 159)
1 parent 2afe17a commit 40dcf29

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

etc/TODO.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@
6161
* fixed #325 add version for optimistic locking to org.woehlke.simpleworklist.domain.task.Task
6262

6363
## 2.3.34
64-
* Issue #317 switch Context is broken
64+
* fixed #317 switch Context is broken
6565
* fixed #326 add Context to Breadcrumb
66+
* Issue #327 AbstractController: rename rootCategories to rootProjects (line 77)
67+
* Issue #328 AbstractController: rename allCategories to allProjects (line 66)
68+
* Issue #329 AbstractController: remove side effects from getContext (line 145, 159)
6669

6770
## 2.3.35
6871
* Issue #234 Taskstate: Task Edit Form -> change Project via DropDown

src/main/java/org/woehlke/simpleworklist/common/domain/AbstractController.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.woehlke.simpleworklist.user.services.UserAccountAccessService;
2424
import org.woehlke.simpleworklist.user.services.UserAccountLoginSuccessService;
2525

26+
import javax.validation.constraints.NotNull;
2627
import java.util.ArrayList;
2728
import java.util.List;
2829
import java.util.Locale;
@@ -76,9 +77,7 @@ public final List<Project> getAllCategories(
7677
//TODO: rename rootCategories to rootProjects
7778
@ModelAttribute("rootCategories")
7879
public final List<Project> getRootCategories(
79-
@ModelAttribute("userSession") UserSessionBean userSession,
80-
BindingResult result, //TODO: remove
81-
Model model //TODO: remove
80+
@ModelAttribute("userSession") UserSessionBean userSession
8281
) {
8382
Context context = this.getContext(userSession);
8483
return projectService.findRootProjectsByContext(context);
@@ -143,6 +142,20 @@ protected UserAccount getUser() {
143142
return this.userAccountLoginSuccessService.retrieveCurrentUser();
144143
}
145144

145+
protected Context getContext(@NotNull final UserSessionBean userSession){
146+
UserAccount thisUser = this.getUser();
147+
//if(userSession == null){
148+
// userSession = new UserSessionBean();
149+
//}
150+
long defaultContextId = thisUser.getDefaultContext().getId();
151+
//userSession.setLastContextId(defaultContextId);
152+
Context context = contextService.findByIdAndUserAccount(userSession.getLastContextId(), thisUser);
153+
//userSession.setLastContextId(context.getId());
154+
//userSession.setUserAccountid(thisUser.getId());
155+
return context;
156+
}
157+
158+
/*
146159
protected Context getContext(UserSessionBean userSession){
147160
UserAccount thisUser = this.getUser();
148161
if(userSession == null){
@@ -155,5 +168,6 @@ protected Context getContext(UserSessionBean userSession){
155168
userSession.setUserAccountid(thisUser.getId());
156169
return context;
157170
}
171+
*/
158172

159173
}

0 commit comments

Comments
 (0)