Francesco Mangiacrapa 2019-09-23 10:07:03 +00:00
parent 1f78d4fafd
commit 5a223241ee
2 changed files with 74 additions and 45 deletions

View File

@ -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.AppControllerExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer; import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WsPortletInitOperation; 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.RefreshFolderEvent;
import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent; import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.workspace.client.model.FileModel; 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.Fieldset;
import com.github.gwtbootstrap.client.ui.Modal; import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.ModalFooter; 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.TextBox;
import com.github.gwtbootstrap.client.ui.Well; import com.github.gwtbootstrap.client.ui.Well;
import com.google.gwt.core.client.GWT; 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.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
/** /**
@ -88,17 +89,23 @@ public class DialogShareableLink extends Composite {
SwitchButton switchButton; SwitchButton switchButton;
@UiField @UiField
Row fieldPrivateSharing; VerticalPanel fieldPrivateSharing;
@UiField @UiField
SwitchButton switchButtonPrivate; SwitchButton switchButtonPrivate;
@UiField @UiField
Row filedEnableDisableSharing; VerticalPanel filedEnableDisableSharing;
@UiField @UiField
Label labelLinkSharing; Label labelLinkSharing;
@UiField
Button buttonShareSettings;
@UiField
Well wellPrivateLinkDescription;
// @UiField // @UiField
// HTMLPanel panelFieldsContainer; // HTMLPanel panelFieldsContainer;
@ -108,6 +115,10 @@ public class DialogShareableLink extends Composite {
private boolean itemIsPublicStatus; 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. * 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(this);
modalBox.add(modalFooter); modalBox.add(modalFooter);
modalBox.show(); modalBox.show();
@ -227,8 +247,14 @@ public class DialogShareableLink extends Composite {
}else { }else {
loadAndShowPublicLinkForItem(item, textPublicLink); loadAndShowPublicLinkForItem(item, textPublicLink);
} }
}else { }
//???
if(item.isShared()) {
wellPrivateLinkDescription.clear();
wellPrivateLinkDescription.getElement().setInnerHTML(privateShareToFileDescription);
fieldSetPrivate.setVisible(true);
fieldPrivateSharing.setVisible(true);
loadAndShowPrivateLink(item, textPrivateLink);
} }
} }

View File

@ -16,9 +16,12 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
.padding-left-30 { .padding-left-10 {
padding-left: 30px; padding-left: 10px;
margin-top: 5px; }
.margin-left-5 {
margin-left: 5px;
} }
.text-bold { .text-bold {
@ -29,18 +32,17 @@
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;
opacity: .5; opacity: .5;
padding-left: 10px;
} }
<!-- .font-size-14 {
@external .form-horizontal .input-large; font-size: 14px;
--> }
<!--
.form-horizontal .input-large {--><!-- .to-top-alignment {
width: 95%; vertical-align: top;
--> padding-top: 0px !important;
<!--
} }
-->
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<b:Form type="HORIZONTAL"> <b:Form type="HORIZONTAL">
@ -49,29 +51,30 @@
<b:Icon type="ROTATE_RIGHT" spin="true" /> <b:Icon type="ROTATE_RIGHT" spin="true" />
</b:Alert> </b:Alert>
<b:Row ui:field="fieldPrivateSharing" <g:VerticalPanel ui:field="fieldPrivateSharing"
addStyleNames="{style.margin-bottom-20}"> addStyleNames="{style.margin-bottom-20}">
<b:Column size="2"> <g:HorizontalPanel>
<b:Label type="INFO">Link Sharing with Coworkers</b:Label> <b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with
</b:Column> Coworkers</b:Label>
<b:Column size="2">
<citem:SwitchButton <citem:SwitchButton
ui:field="switchButtonPrivate" addStyleNames="{style.not-active}"></citem:SwitchButton> ui:field="switchButtonPrivate" addStyleNames="{style.not-active}"
</b:Column> visible="false"></citem:SwitchButton>
<b:Row> <b:Button addStyleNames="{style.padding-left-10} {style.to-top-alignment}" type="LINK" ui:field="buttonShareSettings">Share settings</b:Button>
<b:Column size="4" addStyleNames="{style.padding-left-30}"> </g:HorizontalPanel>
<g:Label ui:field="labelLinkPrivateSharing">(Only the) Members belonging to the <g:VerticalPanel
share can view</g:Label> addStyleNames="{style.margin-left-5}">
</b:Column> <g:Label ui:field="labelLinkPrivateSharing">(Only the) Members belonging to the
</b:Row> share
</b:Row> can view</g:Label>
</g:VerticalPanel>
</g:VerticalPanel>
<b:Fieldset ui:field="fieldSetPrivate"> <b:Fieldset ui:field="fieldSetPrivate">
<g:HTMLPanel> <g:HTMLPanel>
<!-- <b:Legend>sharing....</b:Legend> --> <!-- <b:Legend>sharing....</b:Legend> -->
<b:ControlGroup ui:field="cgPrivateLink"> <b:ControlGroup ui:field="cgPrivateLink">
<b:Well> <b:Well ui:field="wellPrivateLinkDescription">
By sharing the following Private Link By sharing the following Private Link
to folder with to folder with
your your
@ -94,20 +97,20 @@
</g:HTMLPanel> </g:HTMLPanel>
</b:Fieldset> </b:Fieldset>
<b:Row ui:field="filedEnableDisableSharing" <g:VerticalPanel ui:field="filedEnableDisableSharing"
addStyleNames="{style.margin-bottom-20}"> addStyleNames="{style.margin-bottom-20}">
<b:Column size="2"> <g:HorizontalPanel>
<b:Label type="INFO">Link Sharing with Everyone</b:Label> <b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with
</b:Column> Everyone</b:Label>
<b:Column size="2"> <citem:SwitchButton ui:field="switchButton"
<citem:SwitchButton ui:field="switchButton"></citem:SwitchButton> addStyleNames="{style.padding-left-10}"></citem:SwitchButton>
</b:Column> </g:HorizontalPanel>
<b:Row> <g:VerticalPanel
<b:Column size="4" addStyleNames="{style.padding-left-30}"> addStyleNames="{style.margin-left-5}">
<g:Label ui:field="labelLinkSharing"></g:Label> <g:Label ui:field="labelLinkSharing"></g:Label>
</b:Column> </g:VerticalPanel>
</b:Row> </g:VerticalPanel>
</b:Row>
<b:Fieldset ui:field="fieldSetPublic"> <b:Fieldset ui:field="fieldSetPublic">
<b:ControlGroup ui:field="cgPublicLink"> <b:ControlGroup ui:field="cgPublicLink">