-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor(Controllers): Pass in domain instead of Long to methods #65
refactor(Controllers): Pass in domain instead of Long to methods #65
Conversation
- Added ProjectRepository and WorkgroupRepository Closes #64
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.
Get notification when the student opens the VLE doesn't work anymore. I think this is because the logic was changed in NotificationController.getNotifications().
Before when it was working there is an "else if".
if (toWorkgroupId != null) {
Workgroup workgroup = workgroupService.retrieveById(new Long(toWorkgroupId));
if (isStudentAndNotAllowedToSaveNotification(user, run, workgroup)) {
return new ArrayList<Notification>();
}
} else if (!user.isAdmin() && !runService.hasRunPermission(run, user, BasePermission.READ)) {
return new ArrayList<Notification>();
}
return vleService.getNotifications(id, runId, periodId,
toWorkgroupId, groupId, nodeId, componentId);
The changed code that doesn't return the notifications has the "else if" changed to "if".
if (toWorkgroup != null) {
if (isStudentAndNotAllowedToSaveNotification(user, run, toWorkgroup)) {
return new ArrayList<Notification>();
}
}
if (!user.isAdmin() && !runService.hasRunPermission(run, user, BasePermission.READ)) {
return new ArrayList<Notification>();
}
return vleService.getNotifications(id, run, periodId, toWorkgroup, groupId, nodeId,
componentId);
Copying a project in the Authoring Tool shows a popup error but the project still gets copied. This popup error does not happen on develop or PROD. I couldn't figure out why the popup error is happening.
All the other endpoints I tested seemed to work.
- Reverted NotificationController logic change and copyProject prototype.
- Updated unit tests
I reverted the logic changes in NotificationController.getNotifications() and also the changes in AuthorAPIController.copyProject. I think this problem may be fixed by refactoring the the call to |
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.
Looks good.
- The user object retrieved in the controller by DomainClassConverter is now a HibernateProxy object due to PR #65, so I updated the User's equal object to check for it.
- The user object retrieved in the controller by DomainClassConverter is now a HibernateProxy object due to PR #65, so I updated the User's equal object to check for it.
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
Test
Closes #64