ref 17169: Selection of users in the Sharing panel

https://support.d4science.org/issues/17169

Updated support to VREs discovery

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181380 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-07-31 16:39:22 +00:00
parent e0f0e913ce
commit 234bb80439
1 changed files with 26 additions and 12 deletions

View File

@ -74,7 +74,7 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
//
public static final String LOADING = "Loading";
public static final String LOADINGSTYLE = "x-mask-loading";
private static final int HEIGHT_ALREADY_SHARED_PANEL = 80;
private static final int WIDTH_ALREADY_SHARED_PANEL = 597;
private static final int HEIGHT_VRE_PANEL = 40;
@ -142,16 +142,31 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
if (targetContact != null && targetContact.size() > 0) {
if (owner != null) {
alreadyShared = owner.getName() + ", ";
if (targetContact.contains(owner)) {
targetContact.remove(owner);
}
if (targetContact.size() > 0) {
alreadyShared = owner.getName() + ", ";
for (int i = 0; i < targetContact.size(); i++) {
if ((i + 1) == targetContact.size()) {
alreadyShared += targetContact.get(i).getName();
} else {
alreadyShared += targetContact.get(i).getName() + ", ";
}
}
} else {
alreadyShared = owner.getName();
}
} else {
for (int i = 0; i < targetContact.size(); i++) {
if ((i + 1) == targetContact.size()) {
alreadyShared += targetContact.get(i).getName();
} else {
alreadyShared += targetContact.get(i).getName() + ", ";
}
}
}
for (int i = 0; i < targetContact.size() - 1; i++)
alreadyShared += targetContact.get(i).getName() + ", ";
alreadyShared += targetContact.get(targetContact.size() - 1).getName();
} else {
if (owner != null) {
alreadyShared = owner.getName();
@ -159,7 +174,7 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
}
textAreaAlreadyShared.setValue(alreadyShared);
GWT.log("PanelMultiDragWorkspaceContact TextArea Set");
}
@ -197,7 +212,7 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
vreListStore.commitChanges();
} else {
GWT.log("No VREs found from server");
vresList=new ArrayList<>();
vresList = new ArrayList<>();
MessageBox.alert("Attention", "No VREs found " + ConstantsSharing.TRY_AGAIN, null);
}
@ -211,7 +226,7 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
private void create() {
GWT.log("PanelMultiDragWorkspaceContact Create Start");
// Already Shared
GWT.log("PanelMultiDragWorkspaceContact Already Shared Panel");
alreadySharedPanel = new ContentPanel();
@ -244,7 +259,7 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
//
GWT.log("PanelMultiDragWorkspaceContact Create VREPanel");
// VRE
final ContentPanel vrePanel = new ContentPanel();
vrePanel.setId("vre-panel-share-admin" + Random.nextInt());
@ -265,7 +280,6 @@ public class PanelMultiDragWorkspaceContact extends ContentPanel {
vreListCombo.setTypeAhead(true);
vreListCombo.setTriggerAction(TriggerAction.ALL);
vreListCombo.addSelectionChangedListener(new SelectionChangedListener<UserVRE>() {
@Override