Commit 3078b976 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

warning message due to lack of google conesent improved, additional...

warning message due to lack of google conesent improved, additional explanation is in user provded overlays table
parent 40711545
......@@ -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;
......@@ -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");
......
......@@ -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));
......
......@@ -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);
});
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment