From 5ea295722cc5c98164012e65d05295ef6473d75e Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Tue, 1 Oct 2024 14:42:26 -0700 Subject: [PATCH] Use special text for periodic updates, and try more ways of finding the analysis ID for linking --- public/static/locales/en/common.json | 1 + src/components/notifications/Message.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/static/locales/en/common.json b/public/static/locales/en/common.json index ee21d62ed..14c8289c8 100644 --- a/public/static/locales/en/common.json +++ b/public/static/locales/en/common.json @@ -37,6 +37,7 @@ "email": "Email", "environment": "Environment", "errorMarkAsSeen": "Unable to mark notifications as read.", + "extendOrTerminateUrl": "{{message}} You can terminate or extend the time limit here.", "filter": "Filter", "formatTermFreeTextOption": "Use \"{{inputValue}}\"", "help": "Help", diff --git a/src/components/notifications/Message.js b/src/components/notifications/Message.js index e7ba6294b..6ec7b5412 100644 --- a/src/components/notifications/Message.js +++ b/src/components/notifications/Message.js @@ -54,6 +54,8 @@ function AnalysisLink(props) { const isShare = action === "share"; const isComplete = isTerminated(analysis); const isJobStatusChange = action === "job_status_change"; + const isPeriodicUpdate = + notification?.email_template === "analysis_periodic_notification"; let message = getDisplayMessage(notification); @@ -67,9 +69,9 @@ function AnalysisLink(props) { const analysisId = isShare && analysis?.analyses?.length > 0 ? analysis.analyses[0].analysis_id - : isJobStatusChange && analysis?.id; + : isJobStatusChange && (analysis?.id || analysis?.analysisid); - if (accessUrl) { + if (accessUrl && !isPeriodicUpdate) { return ( {t("interactiveAnalysisUrl", { message })} @@ -84,6 +86,9 @@ function AnalysisLink(props) { message = t("accessAnalysisOutput", { message }); } else if (analysisId) { [href, as] = getAnalysisDetailsLinkRefs(analysisId); + if (isPeriodicUpdate) { + message = t("extendOrTerminateUrl", { message }); + } } return (