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.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);
}
}

View File

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