diff --git a/.classpath b/.classpath
index 47f9d23..f205eb9 100644
--- a/.classpath
+++ b/.classpath
@@ -1,12 +1,12 @@
-
+
-
+
@@ -41,5 +41,5 @@
-
+
diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
index b5e46b5..90a8f8f 100644
--- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs
+++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
@@ -1,4 +1,4 @@
eclipse.preferences.version=1
-lastWarOutDir=/Users/massi/Documents/workspace/news-feed/target/news-feed-2.8.0-SNAPSHOT
+lastWarOutDir=/Users/massi/Documents/workspace/news-feed/target/news-feed-2.8.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index ecd5910..cbff659 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -8,9 +8,6 @@
uses
-
- uses
-
uses
diff --git a/distro/changelog.xml b/distro/changelog.xml
index 1c63ffc..5c4ba9b 100644
--- a/distro/changelog.xml
+++ b/distro/changelog.xml
@@ -1,23 +1,32 @@
-
- Bug #16724, Social networking: "See more" seems to reload a post with part of the old look and feel
- Bug #16673, News Feed: comments with links between parenthesis not recognised
+
+ Fixed Bug #17181, post editing leads to losing both formatting and mentions
-
- Feature #16205: News Feed avoid refresh page when user is commenting
+
+ Fixed Bug #16724, Social networking: "See more" seems to reload a
+ post with part of the old look and feel
+ Fixed Bug #16673, News Feed: comments with links between parenthesis
+ not recognised
+
+
+ Feature #16205: News Feed avoid refresh page when user is
+ commenting
Minor CSS fix for anchors links font size
- Bug fix #16225 mentions and replies http links not working in some email notifications
+ Bug fix #16225 mentions and replies http links not working in
+ some email notifications
Feature #16452, Revise posts look and feel
-
+
Removed previous jquery js load script and useless deprecated
- pagebus
+ pagebus
+
-
+
Ported to GWT 2.8.2
Fix for Incident #11187 citing a people (with '@') in comments
is not working anymore
@@ -29,13 +38,15 @@
Feature #10192 allow to sort feeds per recent comments
Bug #7841 lack of blank space to separate the query term when
- hashtag is used
+ hashtag is used
+
Support for ticket #11139
Enhanced efficiency when retrieving mentioned users or groups
- in comments
+ in comments
+
-
+
fixes for Incident #10262: Cannot see who liked posts on VREs
of Parthenos
@@ -44,8 +55,8 @@
Ported to GWT 2.8.1
-
+
fixes for changes to the underneath
common-notification-library
@@ -57,15 +68,15 @@
try to engage the user to post something.
-
+
removed asl session
Increased general performance and bugfixes
fetching of users list to mention in comments loaded on demand
-
+
Support to show feeds related to user's statistics added
Fixed time for comments/posts: the year is present only if the
@@ -73,34 +84,34 @@
was made before the current one
-
+
Updated for Liferay 6.2.5
-
+
Full-text search supported
-
+
Multi-attachment supported
Image preview available
-
+
Fix for Bug #246, editing changes comment "metadata" namely
data
-
+
Integrated workspace explorer widget and replace light tree
Fix for Bug #195, Post dates lack the year
-
+
Revised the way we shorten posts' text when this is very long,
better heuristic used
diff --git a/pom.xml b/pom.xml
index 5394221..423d493 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.portlets.user
news-feed
war
- 2.8.0-SNAPSHOT
+ 2.8.1-SNAPSHOT
gCube News Feed Portlet
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java
index 3a8d3cd..b15c458 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java
@@ -49,7 +49,7 @@ public interface NewsService extends RemoteService {
HashSet mentionedUsers, String feedOwnerId,
boolean isAppFeed);
- OperationResult editComment(Comment toEdit);
+ OperationResult editComment(String text, Comment toEdit, HashSet mentionedUsers);
ArrayList getAllLikesByPost(String postid);
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsServiceAsync.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsServiceAsync.java
index 6acd5a8..2c8174a 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsServiceAsync.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsServiceAsync.java
@@ -48,7 +48,7 @@ public interface NewsServiceAsync {
void deletePost(String feedid, AsyncCallback callback);
- void editComment(Comment toEdit, AsyncCallback callback);
+ void editComment(String text, Comment toEdit, HashSet mentionedUsers, AsyncCallback callback);
void getOnlyLikedPosts(AsyncCallback> callback);
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/event/EditCommentEvent.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/event/EditCommentEvent.java
index 98b394d..843caa2 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/event/EditCommentEvent.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/event/EditCommentEvent.java
@@ -1,7 +1,10 @@
package org.gcube.portlets.user.newsfeed.client.event;
+import java.util.HashSet;
+
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portlets.user.newsfeed.client.ui.TweetTemplate;
+import org.gcube.portlets.user.newsfeed.shared.MentionedDTO;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.HTMLPanel;
@@ -13,7 +16,9 @@ public class EditCommentEvent extends GwtEvent {
private TweetTemplate owner;
private Comment edited;
+ private String text;
private HTMLPanel commentPanel;
+ private HashSet mentionedUsers;
public TweetTemplate getOwner() {
return owner;
@@ -25,12 +30,21 @@ public class EditCommentEvent extends GwtEvent {
public HTMLPanel getCommentPanel() {
return commentPanel;
}
- public EditCommentEvent(TweetTemplate owner, Comment editedComment, HTMLPanel commentPanel) {
+ public EditCommentEvent(TweetTemplate owner, String text, Comment editedComment, HTMLPanel commentPanel, HashSet mentionedUsers) {
this.owner = owner;
+ this.text = text;
this.edited = editedComment;
this.commentPanel = commentPanel;
+ this.mentionedUsers = mentionedUsers;
}
+ public HashSet getMentionedUsers() {
+ return mentionedUsers;
+ }
+ public String getText() {
+ return text;
+ }
+
@Override
public Type getAssociatedType() {
return TYPE;
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java
index 977f2a4..05836ac 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java
@@ -203,7 +203,7 @@ public class NewsFeedPanel extends Composite {
eventBus.addHandler(EditCommentEvent.TYPE, new EditCommentEventHandler() {
@Override
public void onEditComment(EditCommentEvent event) {
- doEditComment(event.getOwner(), event.getCommentInstance(), event.getCommentPanel());
+ doEditComment(event.getOwner(), event.getText(), event.getCommentInstance(), event.getCommentPanel(), event.getMentionedUsers());
}
});
@@ -1361,15 +1361,6 @@ public class NewsFeedPanel extends Composite {
owner.setCommentingDisabled(false);
owner.updateCommentsNumberCount();
owner.showAddCommentForm(false);
-
- // if(owner.isUser()){
- // // alert the User statistics portlet to increment the number of comments got
- // try {
- // NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsIncrement, "", Defaults.STRING_JSONIZER);
- // } catch (PageBusAdapterException e) {
- // GWT.log(e.toString());
- // }
- // }
}
}
else {
@@ -1379,8 +1370,8 @@ public class NewsFeedPanel extends Composite {
});
}
- private void doEditComment(final TweetTemplate owner, Comment edited, final HTMLPanel commentPanel) {
- newsService.editComment(edited, new AsyncCallback() {
+ private void doEditComment(final TweetTemplate owner, String text, Comment edited, final HTMLPanel commentPanel, HashSet mentionedUsers) {
+ newsService.editComment(text, edited, mentionedUsers, new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Could not edit this comment: " + caught.getMessage());
@@ -1390,7 +1381,7 @@ public class NewsFeedPanel extends Composite {
public void onSuccess(OperationResult result) {
if (result != null) {
if (!result.isSuccess()) {
- //CheckSession.showLogoutDialog();
+ Window.alert("Could not deliver this comment. Please try again in a short while.");
}
else {
Comment comment = (Comment) result.getComment();
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java
index a1bc3e4..53845a7 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java
@@ -83,16 +83,17 @@ public class AddCommentTemplate extends Composite {
isEditing = true;
this.toEdit = toEdit;
- String commentText = new HTML(toEdit.getText()).getText();
- //replace the < & and >
- commentText = commentText.replaceAll("<","<").replaceAll(">",">");
- commentText = commentText.replaceAll("&","&");
-
+ String commentText = toEdit.getText().replaceAll("
", "\n");
+ commentText = commentText.replaceAll(" ", " ");
+ commentText = new HTML(commentText).getText();
+
owner = caller;
commentTextArea.setContext(owner.getVREContext());
avatarImage.setPixelSize(30, 30);
avatarImage.setUrl(caller.getMyUserInfo().getAvatarId());
commentTextArea.setText(commentText);
+
+
mainPanel.removeStyleName("comment-hidden");
mainPanel.setStyleName("single-comment");
commentTextArea.addStyleName("comment-dark-color");
@@ -106,10 +107,10 @@ public class AddCommentTemplate extends Composite {
}
};
handlerRegistration = Window.addWindowClosingHandler(closingHandler);
-
+
}
-
-
+
+
/** Used by AddCommentTemplate to instantiate SuperPosedTextArea */
@UiFactory SuperPosedTextArea build() {
@@ -151,7 +152,7 @@ public class AddCommentTemplate extends Composite {
}
if (isEditing) {
toEdit.setText(escapeHtml(commentTextArea.getText()));
- eventBus.fireEvent(new EditCommentEvent(owner, toEdit, commentPanel));
+ eventBus.fireEvent(new EditCommentEvent(owner, escapeHtml(commentTextArea.getText()), toEdit, commentPanel, commentTextArea.getMentionedUsers()));
}
else { //it is ok to add this comment
eventBus.fireEvent(new AddCommentEvent(owner, escapeHtml(commentTextArea.getText()), commentTextArea.getMentionedUsers()));
@@ -159,6 +160,7 @@ public class AddCommentTemplate extends Composite {
this.getWidget().setVisible(false);
owner.setCommentingDisabled(false);
handlerRegistration.removeHandler();
+
GWT.log(" handlerRegistration.removeHandler();");
}
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml
index 695e24f..f93cd49 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml
@@ -14,7 +14,7 @@
- |