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 () {
return this._gitHash;
};
/**
*
* @param {string} type
* @param {ConfigurationOption} value
*/
Configuration.prototype.setOption = function (type, value) {
this._options[type] = value;
};
/**
*
* @param {string} type
* @returns {ConfigurationOption}
*/
Configuration.prototype.getOption = function (type) {
return this._options[type];
};
/**
*
* @returns {Array}
*/
Configuration.prototype.getOptions = function () {
var self = this;
var result = [];
......
......@@ -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) {
var overlay = params.overlay;
if (!(overlay instanceof DataOverlay)) {
......@@ -1739,6 +1746,7 @@ ServerConnector.addOverlay = function (params) {
description: overlay.getDescription(),
content: overlay.getContent(),
filename: overlay.getFilename(),
googleLicenseConsent: overlay.isGoogleLicenseConsent(),
fileId: params.fileId
};
return self.getProjectId(params.projectId).then(function (result) {
......@@ -1788,7 +1796,7 @@ ServerConnector.updateOverlay = function (overlay) {
creator: overlay.getCreator(),
publicOverlay: overlay.getPublicOverlay(),
defaultOverlay: overlay.isDefaultOverlay(),
googleLicenseConsent : overlay.isGoogleLicenseConsent()
googleLicenseConsent: overlay.isGoogleLicenseConsent()
}
};
return self.sendPatchRequest(self.updateOverlayUrl(queryParams), filterParams);
......
......@@ -165,8 +165,10 @@ AddOverlayDialog.prototype.addOverlay = function () {
var overlay = new DataOverlay({
name: nameInput.value,
description: descriptionInput.value,
filename: filename
filename: filename,
googleLicenseConsent: consent
});
if (filename === undefined || filename === "") {
filename = "unknown.txt";
}
......@@ -178,8 +180,7 @@ AddOverlayDialog.prototype.addOverlay = function () {
return ServerConnector.addOverlay({
fileId: file.id,
overlay: overlay,
projectId: self.getProject().getProjectId(),
googleLicenseConsent: consent
projectId: self.getProject().getProjectId()
});
}).then(function (result) {
overlay = result;
......
......@@ -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. ")
}
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 = {
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