Commit e005e594 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'terms-of-use-issue' into 'master'

Terms of use issue

See merge request piotr.gawron/minerva!314
parents 2cbd7e88 ec16869f
...@@ -87,14 +87,28 @@ Configuration.prototype.getGitHash = function () { ...@@ -87,14 +87,28 @@ Configuration.prototype.getGitHash = function () {
return this._gitHash; return this._gitHash;
}; };
/**
*
* @param {string} type
* @param {ConfigurationOption} value
*/
Configuration.prototype.setOption = function (type, value) { Configuration.prototype.setOption = function (type, value) {
this._options[type] = value; this._options[type] = value;
}; };
/**
*
* @param {string} type
* @returns {ConfigurationOption}
*/
Configuration.prototype.getOption = function (type) { Configuration.prototype.getOption = function (type) {
return this._options[type]; return this._options[type];
}; };
/**
*
* @returns {Array}
*/
Configuration.prototype.getOptions = function () { Configuration.prototype.getOptions = function () {
var self = this; var self = this;
var result = []; var result = [];
......
...@@ -1727,6 +1727,13 @@ ServerConnector.addComment = function (params) { ...@@ -1727,6 +1727,13 @@ ServerConnector.addComment = function (params) {
}); });
}; };
/**
*
* @param {DataOverlay} params.overlay
* @param {string|number} params.fileId
* @param {string} [params.projectId]
* @returns {PromiseLike<DataOverlay>}
*/
ServerConnector.addOverlay = function (params) { ServerConnector.addOverlay = function (params) {
var overlay = params.overlay; var overlay = params.overlay;
if (!(overlay instanceof DataOverlay)) { if (!(overlay instanceof DataOverlay)) {
...@@ -1739,6 +1746,7 @@ ServerConnector.addOverlay = function (params) { ...@@ -1739,6 +1746,7 @@ ServerConnector.addOverlay = function (params) {
description: overlay.getDescription(), description: overlay.getDescription(),
content: overlay.getContent(), content: overlay.getContent(),
filename: overlay.getFilename(), filename: overlay.getFilename(),
googleLicenseConsent: overlay.isGoogleLicenseConsent(),
fileId: params.fileId fileId: params.fileId
}; };
return self.getProjectId(params.projectId).then(function (result) { return self.getProjectId(params.projectId).then(function (result) {
...@@ -1788,7 +1796,7 @@ ServerConnector.updateOverlay = function (overlay) { ...@@ -1788,7 +1796,7 @@ ServerConnector.updateOverlay = function (overlay) {
creator: overlay.getCreator(), creator: overlay.getCreator(),
publicOverlay: overlay.getPublicOverlay(), publicOverlay: overlay.getPublicOverlay(),
defaultOverlay: overlay.isDefaultOverlay(), defaultOverlay: overlay.isDefaultOverlay(),
googleLicenseConsent : overlay.isGoogleLicenseConsent() googleLicenseConsent: overlay.isGoogleLicenseConsent()
} }
}; };
return self.sendPatchRequest(self.updateOverlayUrl(queryParams), filterParams); return self.sendPatchRequest(self.updateOverlayUrl(queryParams), filterParams);
......
...@@ -165,8 +165,10 @@ AddOverlayDialog.prototype.addOverlay = function () { ...@@ -165,8 +165,10 @@ AddOverlayDialog.prototype.addOverlay = function () {
var overlay = new DataOverlay({ var overlay = new DataOverlay({
name: nameInput.value, name: nameInput.value,
description: descriptionInput.value, description: descriptionInput.value,
filename: filename filename: filename,
googleLicenseConsent: consent
}); });
if (filename === undefined || filename === "") { if (filename === undefined || filename === "") {
filename = "unknown.txt"; filename = "unknown.txt";
} }
...@@ -178,8 +180,7 @@ AddOverlayDialog.prototype.addOverlay = function () { ...@@ -178,8 +180,7 @@ AddOverlayDialog.prototype.addOverlay = function () {
return ServerConnector.addOverlay({ return ServerConnector.addOverlay({
fileId: file.id, fileId: file.id,
overlay: overlay, overlay: overlay,
projectId: self.getProject().getProjectId(), projectId: self.getProject().getProjectId()
googleLicenseConsent: consent
}); });
}).then(function (result) { }).then(function (result) {
overlay = result; overlay = result;
......
...@@ -411,7 +411,7 @@ function create(params) { ...@@ -411,7 +411,7 @@ function create(params) {
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.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. ")
} }
if (user.getLogin() !== "anonymous" && !user.isTermsOfUseConsent()) { if (user.getLogin() !== "anonymous" && !user.isTermsOfUseConsent()) {
requestConsent(user, params.getConfiguration().getOption(ConfigurationType.TERMS_OF_USE)); requestConsent(user, params.getConfiguration().getOption(ConfigurationType.TERMS_OF_USE).getValue());
} }
var result = { var result = {
destroy: function () { destroy: function () {
......
Supports Markdown
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