diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b5e25..da49ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,21 +4,26 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v6.31.0] [r4.25.0] - 2020-07-08 + +#### Fixes + +[Task #19544] update the unsharing messages in the accounting history ## [v6.30.1] [r4.24.0] - 2020-06-25 -**Fixes** +#### Fixes [Task #19544] update the unsharing messages in the accounting history ## [v6.30.0] [r4.23.0] - 2020-05-18 -**New Features** +#### New Features [#19058] Restore operation: the user has to select the destination folder -**Fixes** +#### Fixes [#19232] Fixed upload of file names that use special characters @@ -27,7 +32,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [v6.29.0] [r4.21.0] - 2020-03-27 -**New Features** +#### New Features [#18150] Get Shareable Link as Long URL also @@ -35,7 +40,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm [#18174] Workspace Search facility, business logic applied on workspace side -**Fixes** +#### Fixes [#18577] Fixing Shareable link informative text for public file diff --git a/pom.xml b/pom.xml index 9851010..30222f5 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.gcube.portlets.user workspace-tree-widget - 6.30.1 + 6.31.0-SNAPSHOT gCube Workspace Tree Widget gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index 2a6bd5b..d408867 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -119,6 +119,7 @@ import org.gcube.portlets.user.workspace.client.view.windows.DialogAddFolderAndS import org.gcube.portlets.user.workspace.client.view.windows.DialogAddFolderAndSmart.AddType; import org.gcube.portlets.user.workspace.client.view.windows.DialogAddUrl; import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo; +import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfoBootstrap; import org.gcube.portlets.user.workspace.client.view.windows.DialogGetLink; import org.gcube.portlets.user.workspace.client.view.windows.DialogGetLink.Link_Type; import org.gcube.portlets.user.workspace.client.view.windows.DialogShareLink; @@ -171,10 +172,14 @@ import com.extjs.gxt.ui.client.event.MessageBoxEvent; import com.extjs.gxt.ui.client.widget.Dialog; import com.extjs.gxt.ui.client.widget.Info; import com.extjs.gxt.ui.client.widget.MessageBox; +import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Modal; +import com.github.gwtbootstrap.client.ui.ModalFooter; import com.github.gwtbootstrap.client.ui.event.HideEvent; import com.github.gwtbootstrap.client.ui.event.HideHandler; import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.http.client.RequestBuilder; @@ -690,8 +695,32 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onGetInfo(GetInfoEvent getInfoEvent) { - new DialogGetInfo(getInfoEvent.getSourceFile()); - //new DialogInfoboot(getInfoEvent.getSourceFile()); + //new DialogGetInfo(getInfoEvent.getSourceFile()); + + FileModel fileItem = getInfoEvent.getSourceFile(); + + if(fileItem!=null) { + final Modal modal = new Modal(true); + modal.setCloseVisible(true); + modal.setTitle(fileItem.getName() + " - Details"); + modal.setMaxHeigth("800px"); + + ModalFooter modalFooter = new ModalFooter(); + final Button buttClose = new Button("Close"); + modalFooter.add(buttClose); + + buttClose.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + modal.hide(); + } + }); + + DialogGetInfoBootstrap dlg = new DialogGetInfoBootstrap(fileItem); + modal.add(dlg); + modal.show(); + } } }); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java new file mode 100644 index 0000000..7d09790 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java @@ -0,0 +1,173 @@ +package org.gcube.portlets.user.workspace.client.view.windows; + +import java.util.List; + +import org.gcube.portlets.user.workspace.client.AppControllerExplorer; +import org.gcube.portlets.user.workspace.client.model.FileModel; + +import com.extjs.gxt.ui.client.widget.form.TextField; +import com.github.gwtbootstrap.client.ui.ControlGroup; +import com.github.gwtbootstrap.client.ui.TextArea; +import com.github.gwtbootstrap.client.ui.TextBox; +import com.google.gwt.core.client.GWT; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.Widget; + +public class DialogGetInfoBootstrap extends Composite { + + private static DialogGetInfoBootstrapUiBinder uiBinder = GWT.create(DialogGetInfoBootstrapUiBinder.class); + + interface DialogGetInfoBootstrapUiBinder extends UiBinder { + } + + public DialogGetInfoBootstrap() { + initWidget(uiBinder.createAndBindUi(this)); + } + + public static final String UNKNOWN = "unknown"; + + @UiField + TextBox txtName; + + @UiField + TextBox txtId; + + @UiField + TextBox txtLocation; + + @UiField + ControlGroup cgTxtIsPublic; + + @UiField + TextBox txtIsPublic; + + @UiField + TextArea txtAreaDescription; + + /* + * TextField txtType = new TextField(); private + * TextField txtCategory = new TextField(); private + * TextField txtOwner = new TextField(); private + * TextField txtLastMofication = new TextField(); private + * TextField txtCreated = new TextField(); private + * TextField txtSize = new TextField(); private + * TextField txtLocation = new TextField(); private + * TextField txtIsPublic = new TextField(); private + * TextField txtThreddsSynched = new TextField(); private + * TextField txtShared = new TextField(); // private TextArea + * textAreaSharedWith = new TextArea(); private Html htmlUsersWidget = new + * Html(); private Html htmlPropertiesWidget = new Html(); private final + * NumberFormat number = ConstantsExplorer.numberFormatterKB; // private + * TextField txtGcubeItemProperties; private HorizontalPanel + * hpGcubeProperties; private DialogEditProperties editProperties = null; + */ + + public DialogGetInfoBootstrap(final FileModel fileModel) { + initWidget(uiBinder.createAndBindUi(this)); + + // Setting name + textFieldSetValue(txtName, fileModel.getName()); + textFieldSetValue(txtId, fileModel.getIdentifier()); + + if (fileModel.isRoot()) + txtLocation.setValue("/"); + else + loadLocation(fileModel.getIdentifier()); + + if (fileModel.isDirectory()) { + cgTxtIsPublic.setVisible(true); + txtIsPublic.setValue(fileModel.isPublic() + ""); + + /* + * if (fileModel.getSynchedThreddsStatus() != null) { txtThreddsSynched = new + * TextField(); txtThreddsSynched.setFieldLabel("Thredds Sync"); + * txtThreddsSynched.setReadOnly(true); + * txtThreddsSynched.setValue(fileModel.getSynchedThreddsStatus() + ""); + * add(txtThreddsSynched); + * + * } + */ + + } + + if (fileModel.isDirectory()) { + txtAreaDescription.setValue(fileModel.getDescription()); + // add(txtAreaDescription); + } else + loadDescription(fileModel.getIdentifier()); + + } + + private void textFieldSetValue(TextBox field, String value) { + + if (value == null || value.isEmpty()) + field.setValue(UNKNOWN); + else + field.setValue(value); + } + + private void loadLocation(String itemId) { + + txtLocation.setEnabled(false); + AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false, + new AsyncCallback>() { + + @Override + public void onFailure(Throwable caught) { + GWT.log("failure get list parents by item identifier " + caught); + txtLocation.setValue(UNKNOWN); + txtLocation.setEnabled(false); + } + + @Override + public void onSuccess(List result) { + + String location = ""; + if (result != null) { + for (FileModel fileModel : result) { + if (fileModel != null) + location += "/" + fileModel.getName(); + } + } + if (location.isEmpty()) + location = "/"; + + txtLocation.setValue(location); + txtLocation.setEnabled(true); + } + }); + + } + + /** + * @param identifier + */ + private void loadDescription(String identifier) { + txtAreaDescription.setEnabled(false); + + AppControllerExplorer.rpcWorkspaceService.getItemDescriptionById(identifier, new AsyncCallback() { + + @Override + public void onFailure(Throwable arg0) { + txtAreaDescription.setEnabled(false); + + } + + @Override + public void onSuccess(String result) { + if (result != null) + txtAreaDescription.setValue(result); + else + txtAreaDescription.setValue(""); + + txtAreaDescription.setEnabled(true); + + } + }); + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml new file mode 100644 index 0000000..e533d56 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml @@ -0,0 +1,95 @@ + + + + .back-color-info { + background-color: #fafaff !important; + } + + .margin-bottom-20 { + margin-bottom: 20px; + } + + .padding-left-10 { + padding-left: 10px; + } + + .margin-left-5 { + margin-left: 5px; + } + + .text-bold { + font-weight: bold; + } + + .not-active { + pointer-events: none; + cursor: default; + opacity: .5; + padding-left: 10px; + } + + .font-size-14 { + font-size: 14px; + } + + .to-top-alignment { + vertical-align: top; + padding-top: 0px !important; + } + + .no-border { + border: 0px; + } + + + + + + + + + Name + + + + + + + Id + + + + + + + Location + + + + + + + Public Folder + + + + + + + Description + + + + + + + + + + \ No newline at end of file