Commit 8491b9b4 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1330-add-instance-name-to-request-an-account-email-s-title' into 'master'

Resolve "add instance name to 'request an account' email's title"

Closes #1330

See merge request !1225
parents 2f9fcc02 1d1830d4
Pipeline #31156 failed with stage
in 19 minutes and 42 seconds
minerva (15.1.0) unstable; urgency=medium
minerva (15.1.0~beta.0) unstable; urgency=medium
* Small improvement: annotations are exported in SBGN extension that can be
opened by newt (#1296)
* Small improvement: plugin API allows to add/remove data overlays (#1153)
......@@ -29,6 +29,8 @@ minerva (15.1.0) unstable; urgency=medium
to SBGN-ML PD (#1320)
* Small improvement: SBGN notes are imported properly (#1319)
* Small improvement: SBGN notes are exported properly (#1319)
* Small improvement: possibility to customize request account email title
(#1330)
* Bug fix: export to image from selected polygon contained all elements
inside rectangle bounded by the polygon coordinates (#1096)
* Bug fix: continuous refreshing list of project when uploading/removing
......@@ -38,7 +40,7 @@ minerva (15.1.0) unstable; urgency=medium
* Bug fix: when content of element popover is too wide the scrollbar is
visible (#1269)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 18 Jun 2020 16:00:00 +0200
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 13 Jul 2020 16:00:00 +0200
minerva (15.0.2) stable; urgency=medium
* Bug fix: annotations using identifiers.org urls sometimes required http and
......
......@@ -17,6 +17,7 @@ var ConfigurationType = {
OVERLAY_OPACITY: "OVERLAY_OPACITY",
REQUEST_ACCOUNT_EMAIL: "REQUEST_ACCOUNT_EMAIL",
REQUEST_ACCOUNT_DEFAULT_CONTENT: "REQUEST_ACCOUNT_DEFAULT_CONTENT",
REQUEST_ACCOUNT_DEFAULT_TITLE: "REQUEST_ACCOUNT_DEFAULT_TITLE",
RIGHT_LOGO_IMG: "RIGHT_LOGO_IMG",
RIGHT_LOGO_LINK: "RIGHT_LOGO_LINK",
RIGHT_LOGO_TEXT: "RIGHT_LOGO_TEXT",
......
......@@ -465,17 +465,13 @@ ProjectInfoPanel.prototype.showUserProfilePage = function (user) {
*/
ProjectInfoPanel.prototype.init = function () {
var self = this;
var email, content;
return self.getServerConnector().getConfigurationParam(ConfigurationType.REQUEST_ACCOUNT_EMAIL).then(function (result) {
email = result;
return self.getServerConnector().getConfigurationParam(ConfigurationType.REQUEST_ACCOUNT_DEFAULT_CONTENT);
}).then(function (result) {
content = encodeURIComponent(result);
var url = 'mailto:' + email + '?subject=MINERVA account request&body=' + content;
var link = $("[name=requestAccount]", self.getElement());
link.attr("href", url);
return self.getServerConnector().getLoggedUser()
}).then(function (user) {
var email = self.getConfiguration().getOption(ConfigurationType.REQUEST_ACCOUNT_EMAIL).getValue();
var content = encodeURIComponent(self.getConfiguration().getOption(ConfigurationType.REQUEST_ACCOUNT_DEFAULT_CONTENT).getValue());
var title = self.getConfiguration().getOption(ConfigurationType.REQUEST_ACCOUNT_DEFAULT_TITLE).getValue();
var url = 'mailto:' + email + '?subject=' + title + '&body=' + content;
var link = $("[name=requestAccount]", self.getElement());
link.attr("href", url);
return self.getServerConnector().getLoggedUser().then(function (user) {
console.log(user.isConnectedToLdap());
if (!user.isConnectedToLdap()) {
var logoutButton = self.getControlElement(PanelControlElementType.USER_TAB_LOGOUT_BUTTON);
......
......@@ -764,7 +764,7 @@ function createLoginDiv(configuration) {
title: "Reset password",
width: 320,
height: 120,
modal:true,
modal: true,
close: function () {
$(content).dialog("destroy");
dataTable.destroy();
......@@ -867,13 +867,16 @@ function createLoginDiv(configuration) {
});
});
$('#register_button', result).click(function () {
var email, content;
var email, content, title;
return ServerConnector.getConfigurationParam(ConfigurationType.REQUEST_ACCOUNT_EMAIL).then(function (result) {
email = result;
return ServerConnector.getConfigurationParam(ConfigurationType.REQUEST_ACCOUNT_DEFAULT_TITLE);
}).then(function (result) {
title = result;
return ServerConnector.getConfigurationParam(ConfigurationType.REQUEST_ACCOUNT_DEFAULT_CONTENT);
}).then(function (result) {
content = encodeURIComponent(result);
document.location.href = 'mailto:' + email + '?subject=MINERVA account request&body=' + content;
document.location.href = 'mailto:' + email + '?subject=' + title + '&body=' + content;
});
});
......
......@@ -361,6 +361,10 @@ public enum ConfigurationElementType {
MINERVA_ROOT("Minerva root url", "", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.SERVER_CONFIGURATION),
REQUEST_ACCOUNT_DEFAULT_TITLE("Email title used for requesting an account",
"MINERVA account request",
ConfigurationElementEditType.STRING, false, ConfigurationElementTypeGroup.EMAIL_NOTIFICATION),
;
/**
......
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