Bug fix for too long vre names.

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@122443 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-01-22 09:56:03 +00:00
parent cff58c2c1a
commit 1cff3c981d
4 changed files with 12 additions and 8 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/user-statistics-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry kind="src" output="target/user-statistics-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
jarsExcludedFromWebInfLib= jarsExcludedFromWebInfLib=
lastWarOutDir=/home/costantino/workspace/user-statistics-portlet/target/user-statistics-portlet-0.0.1-SNAPSHOT lastWarOutDir=/home/costantino/workspace/user-statistics/target/user-statistics-1.0.0-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -125,9 +125,13 @@ public class StatisticsPanel extends Composite {
if(!isRoot){ if(!isRoot){
// add the border to the panel and the VRE name // add the border to the panel and the VRE name (check for VRE name lenght)
mainPanel.addStyleName("user-stats-frame-border"); mainPanel.addStyleName("user-stats-frame-border");
final HTML name = new HTML(DISPLAY_NAME + " in " + information.getActualVre()); String nameToShow = DISPLAY_NAME + " in " + information.getActualVre();
nameToShow = nameToShow.length() > 30 ?
nameToShow.substring(0, 27) + "..." : information.getActualVre();
final HTML name = new HTML(nameToShow);
name.setTitle(DISPLAY_NAME + " in " + information.getActualVre());
name.setStyleName("user-stats-title"); name.setStyleName("user-stats-title");
mainPanel.add(name); mainPanel.add(name);
@ -145,7 +149,7 @@ public class StatisticsPanel extends Composite {
// set the style for the user image // set the style for the user image
userImage.setStyleName("user-image"); userImage.setStyleName("user-image");
// set the right margin according isRoot variable value // set the right margin according isRoot variable value
if(isRoot) if(isRoot)
userImage.addStyleName("user-image-margin-right-root"); userImage.addStyleName("user-image-margin-right-root");
@ -336,7 +340,7 @@ public class StatisticsPanel extends Composite {
feeds.clearPanelValues(); feeds.clearPanelValues();
Label numberOfFeedsLabel = new Label(formattedNumbers(postsBean.getFeedsNumber())); Label numberOfFeedsLabel = new Label(formattedNumbers(postsBean.getFeedsNumber()));
if(isRoot) if(isRoot)
numberOfFeedsLabel.setTitle("Your posts during the last year (" + postsBean.getFeedsNumber() + ")."); numberOfFeedsLabel.setTitle("Your posts during the last year (" + postsBean.getFeedsNumber() + ").");
else else
numberOfFeedsLabel.setTitle("Your posts during the last year in this VRE (" + postsBean.getFeedsNumber() + ")."); numberOfFeedsLabel.setTitle("Your posts during the last year in this VRE (" + postsBean.getFeedsNumber() + ").");
numberOfFeedsLabel.setStyleName("statistic-value"); numberOfFeedsLabel.setStyleName("statistic-value");

View File

@ -120,7 +120,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
*/ */
public String getDevelopmentUser() { public String getDevelopmentUser() {
String user = userid; String user = userid;
// user = "massimiliano.assante"; user = "massimiliano.assante";
return user; return user;
} }
@ -257,7 +257,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, accountURL); return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, accountURL);
} }
else return new UserInformation(true, null, userName, null, null); else return new UserInformation(false, null, userName, vreID, null);
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")