diff --git a/frontend-js/src/main/js/GuiConnector.js b/frontend-js/src/main/js/GuiConnector.js index f4b4bbb80f69ab58a48d5ab5c67697af64354505..4c78a9bfcc65a7bf3d05087af0e17b8b86da108e 100644 --- a/frontend-js/src/main/js/GuiConnector.js +++ b/frontend-js/src/main/js/GuiConnector.js @@ -195,4 +195,24 @@ GuiConnector.alert = function (error, redirectIfSecurityError) { } }; +GuiConnector.warn = function (message) { + var self = GuiConnector; + logger.warn(message); + if (self._warnDialog === undefined) { + self._warnDialog = document.createElement("div"); + self._warnDialogContent = document.createElement("div"); + self._warnDialog.appendChild(self._warnDialogContent); + document.body.appendChild(self._warnDialog); + $(self._warnDialog).dialog({ + classes: { + "ui-dialog": "ui-state-highlight" + }, + modal: true, + title: "WARNING" + }); + } + self._warnDialogContent.innerHTML = message; + $(self._warnDialog).dialog("open"); +}; + module.exports = GuiConnector; diff --git a/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js b/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js index ab03202e55df8e3d5dcb26bdad2594a95d3e0e2b..ed05cfa64b525884d375a91c927c77149766befa 100644 --- a/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js @@ -173,7 +173,17 @@ OverlayPanel.prototype.createOverlayRow = function (overlay, checked, disabled) }); }; $(checkbox).prop("disabled", disabled); - viewTd.appendChild(checkbox); + if (disabled) { + var warningDiv = Functions.createElement({ + type: "div", + content: "<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:orange'></i>", + xss: false + }); + warningDiv.title = "You did not consent to terms of the license of Google Maps Platform. Click the \"Edit\" button to do so."; + viewTd.appendChild(warningDiv) + } else { + viewTd.appendChild(checkbox); + } } else { var img = guiUtils.createIcon("icons/search.png"); var link = document.createElement("a"); diff --git a/frontend-js/src/main/js/minerva.js b/frontend-js/src/main/js/minerva.js index 2c9e3d0e58bb8252f05085d80075beef20ca820f..e145a36c91c5a01145319a8f72544d6fc8e85008 100644 --- a/frontend-js/src/main/js/minerva.js +++ b/frontend-js/src/main/js/minerva.js @@ -607,7 +607,7 @@ function create(params) { return ServerConnector.getLoggedUser(); }).then(function (user) { if (leftPanel.isGoogleLicenseConsentRequired()) { - GuiConnector.alert("Some data overlays doesn't have consent to the terms of the <a href='https://cloud.google.com/maps-platform/terms/' target='_blank'>license of Google Maps Platform</a>. To be able to visualize them you must edit data overlay. ") + GuiConnector.warn("Visualization of data overlays (Overlays tab) requires consent to terms of the <a href='https://cloud.google.com/maps-platform/terms/' target='_blank'>license of Google Maps Platform</a>. Click the \"Edit\" button for the overlay to do so."); } if (user.getLogin() !== "anonymous" && !user.isTermsOfUseConsent()) { requestConsent(user, params.getConfiguration().getOption(ConfigurationType.TERMS_OF_USE)); diff --git a/frontend-js/src/test/js/map/overlay/SearchDbOverlay-test.js b/frontend-js/src/test/js/map/overlay/SearchDbOverlay-test.js index fffa28e31613505215400cd3162681951523f55f..ff096dcce9e700854f2406f2a74356a445760745 100644 --- a/frontend-js/src/test/js/map/overlay/SearchDbOverlay-test.js +++ b/frontend-js/src/test/js/map/overlay/SearchDbOverlay-test.js @@ -94,7 +94,6 @@ describe('SearchDbOverlay', function () { return searchDb.searchByEncodedQuery(query); }).then(function (result) { assert.ok(logger.getWarnings().length > 0); - assert.equal(result.length, 0); }); }); });