Added warning message on broken link

This commit is contained in:
Francesco Mangiacrapa 2023-02-03 14:19:33 +01:00
parent 1a6c9b074d
commit ff3a7461df
6 changed files with 37 additions and 9 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -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
*******************************/