Improve delete message.
Add unit test.
This commit is contained in:
@@ -46,8 +46,6 @@ public interface MindmapService {
|
||||
|
||||
void removeCollaboration(@NotNull Mindmap mindmap, @NotNull Collaboration collaboration) throws CollaborationException;
|
||||
|
||||
void addTags(@NotNull Mindmap mindmap, String tags);
|
||||
|
||||
void removeMindmap(@NotNull final Mindmap mindmap, @NotNull final User user) throws WiseMappingException;
|
||||
|
||||
List<Mindmap> search(MindMapCriteria criteria);
|
||||
|
||||
@@ -231,28 +231,6 @@ public class MindmapServiceImpl
|
||||
return collaborator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTags(@NotNull Mindmap mindmap, String tags) {
|
||||
mindmap.setTags(tags);
|
||||
mindmapManager.updateMindmap(mindmap, false);
|
||||
if (tags != null && tags.length() > 0) {
|
||||
final String tag[] = tags.split(TAG_SEPARATOR);
|
||||
final User user = mindmap.getCreator();
|
||||
// Add new Tags to User
|
||||
boolean updateUser = false;
|
||||
for (String userTag : tag) {
|
||||
if (!user.getTags().contains(userTag)) {
|
||||
user.getTags().add(userTag);
|
||||
updateUser = true;
|
||||
}
|
||||
}
|
||||
if (updateUser) {
|
||||
//update user
|
||||
userService.updateUser(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MindMapHistory> findMindmapHistory(int mindmapId) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface UserService {
|
||||
|
||||
public void resetPassword(@NotNull String email) throws InvalidUserEmailException, InvalidAuthSchemaException;
|
||||
|
||||
public void deleteUser(@NotNull User user);
|
||||
public void removeUser(@NotNull User user);
|
||||
|
||||
public void auditLogin(@NotNull User user);
|
||||
|
||||
|
||||
@@ -102,8 +102,10 @@ public class UserServiceImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUser(@NotNull User user) {
|
||||
userManager.deleteUser(user);
|
||||
public void removeUser(@NotNull User user) {
|
||||
// Force object reload before removing....
|
||||
final User userBy = userManager.getUserBy(user.getEmail());
|
||||
userManager.removeUser(userBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user