The improve profile button has been changed in order to show a hint message on how the user can improve the profile.
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@128747 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fcd0bba533
commit
18e13c3194
5
pom.xml
5
pom.xml
|
@ -161,6 +161,11 @@
|
||||||
<artifactId>callout-tour</artifactId>
|
<artifactId>callout-tour</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common.portal</groupId>
|
||||||
|
<artifactId>portal-manager</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -16,8 +16,10 @@ import org.gcube.portlets.widgets.widgettour.client.extendedclasses.GCubeTour;
|
||||||
|
|
||||||
import com.ait.toolkit.hopscotch.client.Placement;
|
import com.ait.toolkit.hopscotch.client.Placement;
|
||||||
import com.ait.toolkit.hopscotch.client.TourStep;
|
import com.ait.toolkit.hopscotch.client.TourStep;
|
||||||
|
import com.github.gwtbootstrap.client.ui.AlertBlock;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.CheckBox;
|
import com.github.gwtbootstrap.client.ui.CheckBox;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
@ -73,9 +75,18 @@ public class StatisticsPanel extends Composite {
|
||||||
private final static String PROFILE_STRENGTH_LABEL = "Profile Strength";
|
private final static String PROFILE_STRENGTH_LABEL = "Profile Strength";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* profile url
|
* improve profile hints
|
||||||
*/
|
*/
|
||||||
private final static String profileAccount = "/group/data-e-infrastructure-gateway/profile";
|
public static String IMPROVE_PROFILE_HINT_MESSAGE_ROOT = "You can improve your profile strength by: <ul>"
|
||||||
|
+ "<li> adding a job title, your current position or your professional summary;"
|
||||||
|
+ "<li> adding your contact information (facebook, linkedin, skype, google mail and so on).</ul>";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* improve profile hints
|
||||||
|
*/
|
||||||
|
public static final String IMPROVE_PROFILE_HINT_MESSAGE_PROFILE = "You can improve your profile strength by: <ul>"
|
||||||
|
+ "<li> adding a job title, your current position or your professional summary;"
|
||||||
|
+ "<li> adding your contact information (facebook, linkedin, skype, google mail and so on).</ul>";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* profile button label
|
* profile button label
|
||||||
|
@ -249,6 +260,10 @@ public class StatisticsPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save page landing
|
||||||
|
if(information.getCurrentPageLanding() != null)
|
||||||
|
IMPROVE_PROFILE_HINT_MESSAGE_ROOT += "<a href='" + information.getCurrentPageLanding() + "/profile" + "'><b>Go to your profile</b></a>";
|
||||||
|
|
||||||
// user image
|
// user image
|
||||||
Images image = GWT.create(Images.class);
|
Images image = GWT.create(Images.class);
|
||||||
Image userImage = new Image(image.avatarLoader());
|
Image userImage = new Image(image.avatarLoader());
|
||||||
|
@ -388,8 +403,13 @@ public class StatisticsPanel extends Composite {
|
||||||
// in case too low information within the user profile
|
// in case too low information within the user profile
|
||||||
if(profileStrengthInt < profileImproveThreshold && information.isOwner()){
|
if(profileStrengthInt < profileImproveThreshold && information.isOwner()){
|
||||||
|
|
||||||
|
// Show an alert block in which underline how he can improve the profile
|
||||||
|
final AlertBlock improveProfileHint = new AlertBlock();
|
||||||
|
improveProfileHint.setType(AlertType.INFO);
|
||||||
|
improveProfileHint.addStyleName("improve-profile-hint-message");
|
||||||
|
|
||||||
final Button improveProfileButton = new Button(IMPROVE_BUTTON_LABEL);
|
final Button improveProfileButton = new Button(IMPROVE_BUTTON_LABEL);
|
||||||
improveProfileButton.setType(ButtonType.WARNING);
|
improveProfileButton.setType(ButtonType.INFO);
|
||||||
improveProfileButton.setTitle("Improve your profile.");
|
improveProfileButton.setTitle("Improve your profile.");
|
||||||
|
|
||||||
improveProfileButton.addClickHandler(new ClickHandler() {
|
improveProfileButton.addClickHandler(new ClickHandler() {
|
||||||
|
@ -397,8 +417,12 @@ public class StatisticsPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent arg0) {
|
public void onClick(ClickEvent arg0) {
|
||||||
|
|
||||||
// redirect
|
// set text according current url
|
||||||
Window.Location.assign(profileAccount);
|
if(isProfilePage)
|
||||||
|
improveProfileHint.setHTML(IMPROVE_PROFILE_HINT_MESSAGE_PROFILE);
|
||||||
|
else
|
||||||
|
improveProfileHint.setHTML(IMPROVE_PROFILE_HINT_MESSAGE_ROOT);
|
||||||
|
mainPanel.add(improveProfileHint);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.application.framework.core.session.SessionManager;
|
import org.gcube.application.framework.core.session.SessionManager;
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||||
|
import org.gcube.common.portal.PortalContext;
|
||||||
import org.gcube.portal.custom.communitymanager.SiteManagerUtil;
|
import org.gcube.portal.custom.communitymanager.SiteManagerUtil;
|
||||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||||
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
||||||
|
@ -308,8 +309,13 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
actualVre = temp[temp.length - 1];
|
actualVre = temp[temp.length - 1];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// page landing
|
||||||
|
String pageLanding = PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest());
|
||||||
|
|
||||||
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, isOwner, isProfileShowable);
|
UserInformation bean = new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, isOwner, isProfileShowable);
|
||||||
|
bean.setCurrentPageLanding(pageLanding);
|
||||||
|
return bean;
|
||||||
}
|
}
|
||||||
else return new UserInformation(true, null, userName, vreID, true, true);
|
else return new UserInformation(true, null, userName, vreID, true, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ public class UserInformation implements Serializable {
|
||||||
// If the visiting user is the owner of the page, there is no proble
|
// If the visiting user is the owner of the page, there is no proble
|
||||||
// if the visiting user is not the owner and the real owner doesn't want
|
// if the visiting user is not the owner and the real owner doesn't want
|
||||||
// to show the portlet to the other users, we need to hide the statistics.
|
// to show the portlet to the other users, we need to hide the statistics.
|
||||||
|
|
||||||
|
private String currentPageLanding;
|
||||||
|
|
||||||
public UserInformation(){
|
public UserInformation(){
|
||||||
super();
|
super();
|
||||||
|
@ -41,7 +43,14 @@ public class UserInformation implements Serializable {
|
||||||
this.isOwner = isOwner;
|
this.isOwner = isOwner;
|
||||||
this.isProfileShowable = isProfileShowable;
|
this.isProfileShowable = isProfileShowable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCurrentPageLanding() {
|
||||||
|
return currentPageLanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentPageLanding(String currentPageLanding) {
|
||||||
|
this.currentPageLanding = currentPageLanding;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isRoot() {
|
public boolean isRoot() {
|
||||||
return isRoot;
|
return isRoot;
|
||||||
|
@ -100,6 +109,7 @@ public class UserInformation implements Serializable {
|
||||||
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
|
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
|
||||||
+ ", aslSessionUsername=" + aslSessionUsername + ", actualVre="
|
+ ", aslSessionUsername=" + aslSessionUsername + ", actualVre="
|
||||||
+ actualVre + ", isOwner=" + isOwner + ", isProfileShowable="
|
+ actualVre + ", isOwner=" + isOwner + ", isProfileShowable="
|
||||||
+ isProfileShowable + "]";
|
+ isProfileShowable + ", currentPageLanding="
|
||||||
|
+ currentPageLanding + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,9 @@
|
||||||
|
|
||||||
.privacy-checkbox-statistics-style {
|
.privacy-checkbox-statistics-style {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.improve-profile-hint-message {
|
||||||
|
margin-top: 15px !important;
|
||||||
|
padding: 25px !important;
|
||||||
}
|
}
|
Loading…
Reference in New Issue