ported to liferay 6.2
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@126439 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2be571f652
commit
c3d2f0d456
|
@ -1,4 +1,7 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-user.join-vre.3.0.0" date="2016-03-28">
|
||||
<Change>Ported to Liferay 6.2</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.join-vre.2.0.0"
|
||||
date="2015-10-22">
|
||||
<Change>Refactored to support virtual groups and related descriptions
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ResponsivePanel extends Composite {
|
|||
public static final String loading = GWT.getModuleBaseURL() + "../images/vre-loader.gif";
|
||||
|
||||
private VerticalPanel mainPanel = new VerticalPanel();
|
||||
|
||||
private ArrayList<VreThumbnail> myThumbnails = new ArrayList<VreThumbnail>();
|
||||
public ResponsivePanel() {
|
||||
GWT.log("ResponsivePanel()");
|
||||
joinService.getVREs(new AsyncCallback<LinkedHashMap<VRECategory, ArrayList<VRE>>>() {
|
||||
|
@ -64,6 +64,7 @@ public class ResponsivePanel extends Composite {
|
|||
Thumbnails toReturn = new Thumbnails();
|
||||
for (VRE vre : vres) {
|
||||
VreThumbnail thumb = new VreThumbnail(vre);
|
||||
myThumbnails.add(thumb);
|
||||
toReturn.add(thumb);
|
||||
}
|
||||
return toReturn;
|
||||
|
@ -76,7 +77,7 @@ public class ResponsivePanel extends Composite {
|
|||
|
||||
public void requestMembership(VRE vre) {
|
||||
if (vre.isUponRequest()) {
|
||||
RequestMembershipDialog modal = new RequestMembershipDialog(vre);
|
||||
RequestMembershipDialog modal = new RequestMembershipDialog(this, vre);
|
||||
modal.show();
|
||||
} else {
|
||||
AccessVREDialog modal = new AccessVREDialog(vre);
|
||||
|
@ -88,6 +89,14 @@ public class ResponsivePanel extends Composite {
|
|||
AccessViaInviteDialog modal = new AccessViaInviteDialog(vre, inviteId);
|
||||
modal.show();
|
||||
}
|
||||
|
||||
public void setPending(VRE toSet) {
|
||||
for (VreThumbnail thumb : myThumbnails) {
|
||||
if (thumb.getMyVre().getinfraScope().compareTo(toSet.getinfraScope()) == 0) {
|
||||
thumb.setPending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.portlets.user.joinvre.client.ui;
|
|||
|
||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinServiceAsync;
|
||||
import org.gcube.portlets.user.joinvre.client.responsive.ResponsivePanel;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
|
@ -31,11 +32,13 @@ public class RequestMembershipDialog extends Composite {
|
|||
@UiField Button confirmRequest;
|
||||
@UiField TextArea optionalText;
|
||||
@UiField HelpBlock helpBlock;
|
||||
VRE myVRE = null;
|
||||
private VRE myVRE = null;
|
||||
private ResponsivePanel responsivePanel;
|
||||
|
||||
public RequestMembershipDialog(VRE myVRE) {
|
||||
public RequestMembershipDialog(ResponsivePanel responsivePanel, VRE myVRE) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
this.myVRE = myVRE;
|
||||
this.responsivePanel = responsivePanel;
|
||||
optionalText.setWidth("95%");
|
||||
optionalText.setPlaceholder("You can add an optional comment here");
|
||||
}
|
||||
|
@ -59,6 +62,8 @@ public class RequestMembershipDialog extends Composite {
|
|||
optionalText.removeFromParent();
|
||||
m.setTitle("Thank you, your request has been sent successfully");
|
||||
helpBlock.setText("You will receive an email as soon as your request will be processed.");
|
||||
responsivePanel.setPending(myVRE);
|
||||
confirmRequest.setEnabled(false);
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -82,8 +82,6 @@ public class VreThumbnail extends Composite {
|
|||
@Override
|
||||
public void onSuccess(String currentGroupName) {
|
||||
Location.assign("/group/" +currentGroupName +"/explore?"+JoinVRE.GET_OID_PARAMETER+"="+myVre.getId());
|
||||
//RequestMembershipDialog modal = new RequestMembershipDialog(currentGroupName);
|
||||
//modal.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -97,4 +95,14 @@ public class VreThumbnail extends Composite {
|
|||
modal.show();
|
||||
}
|
||||
|
||||
public void setPending() {
|
||||
joinButton.setText("Waiting approval");
|
||||
joinButton.setType(ButtonType.WARNING);
|
||||
joinButton.setEnabled(false);
|
||||
}
|
||||
|
||||
public VRE getMyVre() {
|
||||
return myVre;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue