From af2e6d0d4ae69b8bc529db24db7e76333d2366b1 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 6 Nov 2015 16:04:27 +0000 Subject: [PATCH] 1280: Workspace GUI: quote and available feature improvements Task-Url: https://support.d4science.org/issues/1280 Added button hide, updated css git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@120225 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/workspace/client/AppController.java | 4 +++- .../client/view/WorkspaceFeaturesView.java | 20 ++++++++++++++++++- .../client/view/WorkspaceFeaturesView.ui.xml | 3 ++- src/main/webapp/workspaceportlet.css | 3 ++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java index 0813148..2e683a7 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java @@ -1325,7 +1325,9 @@ public class AppController implements SubscriberInterface { private void initPortlet(final HasWidgets rootPanel, final boolean instanceWithGrouping, boolean isSearchForItemId, final String searchParameter, final String itemIdParameter, final String operationParameter){ - final boolean displayFeatures = readCookieWorkspaceAvailableFeatures(); + boolean displayFeatures = readCookieWorkspaceAvailableFeatures(); + + GWT.log("Display features? "+displayFeatures); if(displayFeatures) rootPanel.add(workspaceFeatures); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.java index 079640e..56a5b45 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.java @@ -8,6 +8,7 @@ import org.gcube.portlets.user.workspace.client.ConstantsPortlet; import org.gcube.portlets.user.workspace.client.resources.Resources; import com.github.gwtbootstrap.client.ui.Alert; +import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.CheckBox; import com.github.gwtbootstrap.client.ui.Label; import com.github.gwtbootstrap.client.ui.Popover; @@ -18,6 +19,8 @@ import com.github.gwtbootstrap.client.ui.event.ClosedEvent; import com.github.gwtbootstrap.client.ui.event.ClosedHandler; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.VerticalAlign; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; @@ -79,6 +82,9 @@ public class WorkspaceFeaturesView extends Composite { @UiField CheckBox ck_features_show_again; + + @UiField + Button btn_hide_ws_feautures_panel; private static WorkspaceFeaturesUiBinder uiBinder = GWT.create(WorkspaceFeaturesUiBinder.class); @@ -121,7 +127,7 @@ public class WorkspaceFeaturesView extends Composite { ck_features_show_again.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE); ck_features_show_again.getElement().getFirstChildElement().setId("check_features_donotshowagain"); - + ck_features_show_again.addStyleName("margin-right-10"); shf.addStyleName("margin-right-10"); upl.addStyleName("margin-right-10"); plk.addStyleName("margin-right-10"); @@ -140,6 +146,18 @@ public class WorkspaceFeaturesView extends Composite { } }); + + btn_hide_ws_feautures_panel.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + Boolean isChecked = ck_features_show_again.getValue(); + Boolean showAgain = !isChecked; + GWT.log("Close alert_ws_features, show again? "+showAgain.toString().toLowerCase()); + AppController.setCookie(ConstantsPortlet.GCUBE_COOKIE_WORKSPACE_AVAILABLE_FEATURES, showAgain.toString().toLowerCase(), ConstantsPortlet.COOKIE_EXPIRE_DAYS); + WorkspaceFeaturesView.this.alert_ws_features.close(); + } + }); } /** diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.ui.xml b/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.ui.xml index 4908846..dd319fa 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeaturesView.ui.xml @@ -2,7 +2,7 @@ - + @@ -21,6 +21,7 @@ + diff --git a/src/main/webapp/workspaceportlet.css b/src/main/webapp/workspaceportlet.css index 8f03204..9948d2b 100644 --- a/src/main/webapp/workspaceportlet.css +++ b/src/main/webapp/workspaceportlet.css @@ -407,7 +407,8 @@ margin-left: auto; margin-right: auto; margin-top: auto; - width: 95% + width: 95%; +/* height: 27px !important; */ } .alert_ws_features .close{