Skip to content
Snippets Groups Projects
Commit d9654bd5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '280-account-request-prefilled-text' into 'master'

Resolve "Account request - prefilled text"

Closes #280

See merge request piotr.gawron/minerva!194
parents 4c7f34c3 a2c94d68
No related branches found
No related tags found
1 merge request!194Resolve "Account request - prefilled text"
Pipeline #
......@@ -13,6 +13,7 @@ var logger = require('../../logger');
// noinspection JSUnusedLocalSymbols
var Promise = require("bluebird");
var xss = require("xss");
function ConfigurationAdminPanel(params) {
AbstractAdminPanel.call(this, params);
......@@ -119,6 +120,8 @@ ConfigurationAdminPanel.prototype.optionToTableRow = function (option) {
option.getValueType() === "PASSWORD" ||
option.getValueType() === "URL") {
editOption = "<input name='edit-" + option.getType() + "' value='" + value + "'/>";
} else if (option.getValueType() === "TEXT") {
editOption = "<textarea name='edit-" + option.getType() + "'>" + xss(value) + "</textarea>";
} else if (option.getValueType() === "COLOR") {
editOption = "<div>" +
"<input class='minerva-color-input' name='edit-" + option.getType() + "' data='" + option.getType() + "' value='" + value + "'/>" +
......
......@@ -18,10 +18,15 @@ public enum ConfigurationElementEditType {
*/
INTEGER,
/**
* String value.
*/
STRING,
/**
* String value.
*/
STRING,
/**
* Multiple line text value.
*/
TEXT,
/**
* Color value (for color picker).
......
......@@ -144,7 +144,16 @@ public enum ConfigurationElementType {
* Opacity of data overlay objects in the frontend.
*/
OVERLAY_OPACITY("Opacity used when drwaing data overlays (value between 0.0-1.0)", "0.8",
ConfigurationElementEditType.DOUBLE, false),;
ConfigurationElementEditType.DOUBLE, false),
/**
* Default content of the email when requesting for an account in the system.
*/
REQUEST_ACCOUNT_DEFAULT_CONTENT("Email content used for requesting an account",
"Dear Disease map team,\nI would like to request an account in the system.\nKind regards", ConfigurationElementEditType.TEXT,
false),
;
/**
* Default value of the configuration parameter (it will be used only when value
......
......@@ -72,6 +72,18 @@
}
});
}
function requestAccount() {
var email, content;
return minerva.ServerConnector.getConfigurationParam("REQUEST_ACCOUNT_EMAIL").then(function(result){
email = result;
return minerva.ServerConnector.getConfigurationParam("REQUEST_ACCOUNT_DEFAULT_CONTENT");
}).then(function(result){
content = encodeURIComponent(result);
url = 'mailto:'+email+'?subject=MINERVA account request&body='+content;
window.location.href=url;
})
return false;
}
//]]>
</script>
......@@ -108,7 +120,7 @@
<br/>
<a href="javascript:;" id="register_button"
onClick="window.location.href='mailto:#{userMB.requestAccountEmail}?subject=MINERVA account request'; return false;"
onClick="requestAccount(); return false"
class="adminLink"><i class="fa fa-chevron-right"></i> REQUEST AN ACCOUNT</a>
</h:form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment