From ff3a7461dfdf7cf090cd17675cc45620369256fe Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 3 Feb 2023 14:19:33 +0100 Subject: [PATCH] Added warning message on broken link --- .../client/GeoportalDataViewer.java | 21 +++++++++++++++--- .../client/gis/OpenLayerMap.java | 2 +- .../client/resources/GNAImages.java | 5 ++++- ...geoporta_error.png => geoportal_error.png} | Bin .../client/resources/warning_error.png | Bin 0 -> 2777 bytes src/main/webapp/GeoportalDataViewer.css | 18 +++++++++++---- 6 files changed, 37 insertions(+), 9 deletions(-) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/{geoporta_error.png => geoportal_error.png} (100%) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/warning_error.png diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java index 1ce4008..528de4d 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java @@ -64,6 +64,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; +import com.github.gwtbootstrap.client.ui.Modal; import com.github.gwtbootstrap.client.ui.Popover; import com.github.gwtbootstrap.client.ui.constants.Placement; import com.google.gwt.core.client.EntryPoint; @@ -362,7 +363,7 @@ public class GeoportalDataViewer implements EntryPoint { if (!ucdIds.contains(collId)) { GWT.log("!! Collection " + collId + " is not available"); - Window.alert("Collection " + collId + " is not found."); + Window.alert("Collection " + collId + " not found."); } else { GCubeCollection toOpen = theConfig.getAvailableCollections().get(collId); @@ -449,9 +450,22 @@ public class GeoportalDataViewer implements EntryPoint { @Override public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); + // Window.alert(caught.getMessage()); mainPanel.hidePanelDetails(); + Modal errorModal = new Modal(true, true); + errorModal.setCloseVisible(true); + errorModal.setTitle("Oops..."); + Image geoportalError = new Image(GNAImages.ICONS.warningError()); + FlowPanel errorPanelMsg = new FlowPanel(); + errorPanelMsg.getElement().addClassName("general_warning"); + errorPanelMsg.add(geoportalError); + errorPanelMsg.add(new HTML("D4S GeoPortal")); + HTML erroMessage = new HTML( + "Oops something went wrong, either the project does not exist or it has not been published yet"); + errorPanelMsg.add(erroMessage); + errorModal.add(errorPanelMsg); + errorModal.show(); } @Override @@ -779,8 +793,9 @@ public class GeoportalDataViewer implements EntryPoint { //console.log("jsonObj: "+jsonObj); return jsonObj; }-*/; + // /** -// * Handler popu closer. +// * Handler popup closer. // * // * @param divId the div id // * @param overlayId the overlay id diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java index ca3623a..9d7d153 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java @@ -642,7 +642,7 @@ public abstract class OpenLayerMap { Style style = new Style(); StrokeOptions strokeOptions = new StrokeOptions(); - strokeOptions.setColor(new Color(255, 255, 51, 0.8)); + strokeOptions.setColor(new Color(255, 69, 0, 0.8)); strokeOptions.setWidth(5); Stroke stroke = new Stroke(strokeOptions); stroke.setWidth(2); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/GNAImages.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/GNAImages.java index cabeb3f..511c501 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/GNAImages.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/GNAImages.java @@ -59,7 +59,10 @@ public interface GNAImages extends ClientBundle { @Source("spinner_clock.gif") ImageResource spinnerClock(); - @Source("geoporta_error.png") + @Source("geoportal_error.png") ImageResource geoportaServiceError(); + + @Source("warning_error.png") + ImageResource warningError(); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/geoporta_error.png b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/geoportal_error.png similarity index 100% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/geoporta_error.png rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/geoportal_error.png diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/warning_error.png b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/warning_error.png new file mode 100644 index 0000000000000000000000000000000000000000..801a01be3f0bcc88f9d503e3b3706b0e0a85f44e GIT binary patch literal 2777 zcmV;~3MTc5P)PSHcEExmHGqwPapay<1jsjm!QjVC{$~}!Y0R5}q z4NL;d3cl?Eun+iFk}_*XGe2mw0puAi;1KW-(5fKfC%|1zHi9Z&N)YH@{z2gDRR5gg zz$02#BWbJw0C%GXzb-q09RhN^q>)oVp0OGD3$R>B0ia59A2|cOFQjvVU_5}{@1Mlq!3UK%G8t0h zNHB^5A4BcI`_4@$U4tNqDIm{Sj&l81xYng0uLJK-QqH+nq#vPpfO`pN@BywurKWk0 z_Z}e6xCA%`tZ}VNNlu}{!vDHfWHAO@D^P&_$PfMu@NeLMs3ej#sL*ni;4{{ubpMi| zOmV#S0C~o>s4ZWq6z?Ob%%K-LH*EA_&MMT_@&l+voW%5a4)|b_a#TQ;5xg}39ZLNU zRnA?P^Qd3r!%52d0?)k-codnF#utH)_U)Fsqp0|DK7#K3Ov7s${BE(x3C~y8US!Vut7l1tH5_^ zbo}@ss&hzP)}ua?cX+o3$TNmer+pGD@-#{LX-$1@27WD|%M9?|B;}-lEHS+D0D3ik z0GYu*13W7r=l7^^u`a9dFn!D`13)EKd{#)--%&xbc&l( zoEkt!D>rEu3(5o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4bMkhU z%<`_kpu9?V7R>+)AG7v){ZgUbudo-Ly$ct5{kg8c=TX1(6Q~5AKLKy(g?=Owi9{li fNF)-8L?ZtOlUW;}PvV$_00000NkvXXu0mjf@FNUS literal 0 HcmV?d00001 diff --git a/src/main/webapp/GeoportalDataViewer.css b/src/main/webapp/GeoportalDataViewer.css index b0aa313..fb31c9b 100644 --- a/src/main/webapp/GeoportalDataViewer.css +++ b/src/main/webapp/GeoportalDataViewer.css @@ -720,11 +720,11 @@ Table Of Contents (TOC) text-align: center; font-size: 20px; margin: 0; - position: absolute; - top: 50%; + position: absolute; + top: 50%; width: 100%; - -ms-transform: translateY(-50%); - transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } .general_error div { @@ -732,6 +732,16 @@ Table Of Contents (TOC) } +.general_warning { + text-align: center; + font-size: 20px; +} + +.general_warning div { + padding: 20px; +} + + /****************************** RESPONSIVE *******************************/