From 5a223241ee5e7f285abc4e39b33b00c49b27ea3c Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Mon, 23 Sep 2019 10:07:03 +0000 Subject: [PATCH] working on https://support.d4science.org/issues/17552 git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@181817 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../view/windows/DialogShareableLink.java | 36 ++++++-- .../view/windows/DialogShareableLink.ui.xml | 83 ++++++++++--------- 2 files changed, 74 insertions(+), 45 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.java index 3e653ff..236f075 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.java @@ -3,6 +3,7 @@ package org.gcube.portlets.user.workspace.client.view.windows; import org.gcube.portlets.user.workspace.client.AppControllerExplorer; import org.gcube.portlets.user.workspace.client.ConstantsExplorer; import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WsPortletInitOperation; +import org.gcube.portlets.user.workspace.client.event.CreateSharedFolderEvent; import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent; import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent; import org.gcube.portlets.user.workspace.client.model.FileModel; @@ -19,7 +20,6 @@ import com.github.gwtbootstrap.client.ui.ControlGroup; import com.github.gwtbootstrap.client.ui.Fieldset; import com.github.gwtbootstrap.client.ui.Modal; import com.github.gwtbootstrap.client.ui.ModalFooter; -import com.github.gwtbootstrap.client.ui.Row; import com.github.gwtbootstrap.client.ui.TextBox; import com.github.gwtbootstrap.client.ui.Well; import com.google.gwt.core.client.GWT; @@ -33,6 +33,7 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; /** @@ -88,17 +89,23 @@ public class DialogShareableLink extends Composite { SwitchButton switchButton; @UiField - Row fieldPrivateSharing; + VerticalPanel fieldPrivateSharing; @UiField SwitchButton switchButtonPrivate; @UiField - Row filedEnableDisableSharing; + VerticalPanel filedEnableDisableSharing; @UiField Label labelLinkSharing; + @UiField + Button buttonShareSettings; + + @UiField + Well wellPrivateLinkDescription; + // @UiField // HTMLPanel panelFieldsContainer; @@ -108,6 +115,10 @@ public class DialogShareableLink extends Composite { private boolean itemIsPublicStatus; + private final String privateShareToFileDescription = "By sharing the following Private Link " + + "to file with your coworkers, you will enact users (only the members belonging to the shared folder), " + + "after login, to access the file and the shared folder content"; + /** * The Interface DialogShareableLinkUiBinder. @@ -159,6 +170,15 @@ public class DialogShareableLink extends Composite { } }); + buttonShareSettings.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + AppControllerExplorer.getEventBus().fireEvent(new CreateSharedFolderEvent(fileItem, fileItem.getParentFileModel(),false)); + modalBox.hide(); + } + }); + modalBox.add(this); modalBox.add(modalFooter); modalBox.show(); @@ -227,8 +247,14 @@ public class DialogShareableLink extends Composite { }else { loadAndShowPublicLinkForItem(item, textPublicLink); } - }else { - //??? + } + + if(item.isShared()) { + wellPrivateLinkDescription.clear(); + wellPrivateLinkDescription.getElement().setInnerHTML(privateShareToFileDescription); + fieldSetPrivate.setVisible(true); + fieldPrivateSharing.setVisible(true); + loadAndShowPrivateLink(item, textPrivateLink); } } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.ui.xml b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.ui.xml index 9256aa0..33317d8 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.ui.xml +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogShareableLink.ui.xml @@ -16,9 +16,12 @@ margin-bottom: 20px; } - .padding-left-30 { - padding-left: 30px; - margin-top: 5px; + .padding-left-10 { + padding-left: 10px; + } + + .margin-left-5 { + margin-left: 5px; } .text-bold { @@ -29,18 +32,17 @@ pointer-events: none; cursor: default; opacity: .5; + padding-left: 10px; } - - - @@ -49,29 +51,30 @@ - - - Link Sharing with Coworkers - - + + Link Sharing with + Coworkers - - - - (Only the) Members belonging to the - share can view - - - + ui:field="switchButtonPrivate" addStyleNames="{style.not-active}" + visible="false"> + Share settings + + + (Only the) Members belonging to the + share + can view + + - + By sharing the following Private Link to folder with your @@ -94,20 +97,20 @@ - - - Link Sharing with Everyone - - - - - - - - - - + + Link Sharing with + Everyone + + + + + + +