Bug fix #18420 NewsFeed - see more link makes tags disappear

Bug fix #18292 Leave page check on comments and posts popup not removed
This commit is contained in:
Massimiliano Assante 2020-02-27 17:08:22 +01:00
parent a28975719a
commit 996cf392bd
3 changed files with 7 additions and 15 deletions

View File

@ -39,11 +39,10 @@
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<version>3.6.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -191,7 +190,7 @@
<dependency>
<groupId>org.gcube.socialnetworking</groupId>
<artifactId>social-util-library</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<version>[1.7.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -48,6 +48,7 @@ public class SingleComment extends Composite {
@UiField HTML editImage;
@UiField HTML seeMore;
@SuppressWarnings("deprecation")
public SingleComment(Comment toShow, TweetTemplate owner, boolean isUsers) {
initWidget(uiBinder.createAndBindUi(this));
sinkEvents(Event.ONPASTE);
@ -78,13 +79,8 @@ public class SingleComment extends Composite {
}
String commentToShow = toShow.getText();
//replace the < & and >
// commentToShow = commentToShow.replaceAll("&lt;","<").replaceAll("&gt;",">");
commentToShow = commentToShow.replaceAll("&amp;","&");
if (commentToShow.length() > MAX_SHOWTEXT_LENGTH) {
final int TEXT_TO_SHOW_LENGHT = (commentToShow.length() < 700) ? (commentToShow.length() - (commentToShow.length() / 3)) : 700;
commentToShow = commentToShow.substring(0, TEXT_TO_SHOW_LENGHT) + "...";
@ -132,7 +128,6 @@ public class SingleComment extends Composite {
void onSeeMoreClick(ClickEvent e) {
String commentToShow = myComment.getText();
//replace the < & and >
commentToShow = commentToShow.replaceAll("&lt;","<").replaceAll("&gt;",">");
commentToShow = commentToShow.replaceAll("&amp;","&");
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + NewsFeedPanel.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;

View File

@ -77,7 +77,7 @@ public class TweetTemplate extends Composite {
private HTML showAllComments = new HTML();
private boolean isAppPost = false;
private HTML submitCommentPreloader = new HTML("<div class=\"more-comment\"><img style=\"padding-right:15px;\"src=\""+ loading +"\" /></div>");
private TweetTemplate myInstance;
// Carousel from the image-previewer widget
private Carousel carousel;
@ -133,6 +133,7 @@ public class TweetTemplate extends Composite {
* @param displaySingle tells if you're displaying a single fedd or not
* @param eventBus
*/
@SuppressWarnings("deprecation")
public TweetTemplate(boolean displaySingle, boolean showTimelineSource, UserInfo myUserInfo, EnhancedFeed myPost, HandlerManager eventBus) {
initWidget(uiBinder.createAndBindUi(this));
commentsNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
@ -142,7 +143,6 @@ public class TweetTemplate extends Composite {
likesNo.getElement().getStyle().setPaddingLeft(2, Unit.PX);
commentsNo.getElement().getStyle().setPaddingLeft(2, Unit.PX);
myInstance = this;
this.myUserInfo = myUserInfo;
this.vreSourceInMetadata.setVisible(false);
this.separator.setVisible(false);
@ -191,7 +191,7 @@ public class TweetTemplate extends Composite {
linkPreviewer.onFileNameClickOpenCarousel(carousel);
// remove next and prev buttons of the carousel since we have only an image
carousel.hideArrows();
carousel.showArrows(false);
}
@ -278,7 +278,7 @@ public class TweetTemplate extends Composite {
// hide arrows if there is no more than 1 image
if(imagesAvailableInCarousel <= 1)
carousel.hideArrows();
carousel.showArrows(false);
}
@ -463,8 +463,6 @@ public class TweetTemplate extends Composite {
@UiHandler("seeMore")
void onSeeMoreClick(ClickEvent e) {
String postText = myPost.getFeed().getDescription();
//replace the < & and >
postText = postText.replaceAll("&lt;","<").replaceAll("&gt;",">");
postText = postText.replaceAll("&amp;","&");
contentArea.setHTML(postText);