From d0882d33e27f198632f5d5ae988fedd95c2945f6 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Wed, 14 Feb 2024 16:37:56 -0800 Subject: [PATCH 1/2] fix ehr tests that are enabling notifications --- LDK/resources/web/LDK/panel/NotificationAdminPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LDK/resources/web/LDK/panel/NotificationAdminPanel.js b/LDK/resources/web/LDK/panel/NotificationAdminPanel.js index ba674fae..0e139c85 100644 --- a/LDK/resources/web/LDK/panel/NotificationAdminPanel.js +++ b/LDK/resources/web/LDK/panel/NotificationAdminPanel.js @@ -198,7 +198,7 @@ Ext4.define('LDK.panel.NotificationAdminPanel', { helpPopup: 'This will be used as the reply email for all sent messages.', dataIndex: 'replyEmail', vtype: 'email', - value: results.replyEmail.address + value: results.replyEmail && results.replyEmail.address ? results.replyEmail.address : results.replyEmail ? results.replyEmail : '' },{ xtype: 'panel', border: false, From 5651559c3397894dd84c9ada281538b34257d3f8 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Fri, 16 Feb 2024 15:02:42 -0800 Subject: [PATCH 2/2] Explicitly convert Address to String --- LDK/resources/web/LDK/panel/NotificationAdminPanel.js | 2 +- LDK/src/org/labkey/ldk/LDKController.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LDK/resources/web/LDK/panel/NotificationAdminPanel.js b/LDK/resources/web/LDK/panel/NotificationAdminPanel.js index 0e139c85..8484180e 100644 --- a/LDK/resources/web/LDK/panel/NotificationAdminPanel.js +++ b/LDK/resources/web/LDK/panel/NotificationAdminPanel.js @@ -198,7 +198,7 @@ Ext4.define('LDK.panel.NotificationAdminPanel', { helpPopup: 'This will be used as the reply email for all sent messages.', dataIndex: 'replyEmail', vtype: 'email', - value: results.replyEmail && results.replyEmail.address ? results.replyEmail.address : results.replyEmail ? results.replyEmail : '' + value: results.replyEmail },{ xtype: 'panel', border: false, diff --git a/LDK/src/org/labkey/ldk/LDKController.java b/LDK/src/org/labkey/ldk/LDKController.java index 80c72e0a..fac82bb6 100644 --- a/LDK/src/org/labkey/ldk/LDKController.java +++ b/LDK/src/org/labkey/ldk/LDKController.java @@ -16,6 +16,7 @@ package org.labkey.ldk; +import jakarta.mail.Address; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -125,7 +126,8 @@ public ApiResponse execute(Object form, BindException errors) User u = NotificationServiceImpl.get().getUser(getContainer()); result.put("serviceEnabled", NotificationServiceImpl.get().isServiceEnabled()); result.put("notificationUser", u == null ? null : u.getEmail()); - result.put("replyEmail", NotificationServiceImpl.get().getReturnEmail(getContainer())); + Address replyEmail = NotificationServiceImpl.get().getReturnEmail(getContainer()); + result.put("replyEmail", replyEmail == null ? null : replyEmail.toString()); result.put("success", true); return new ApiSimpleResponse(result);