Skip to content

Commit

Permalink
Use special text for periodic updates, and try more ways of finding t…
Browse files Browse the repository at this point in the history
…he analysis ID for linking
  • Loading branch information
ianmcorvidae committed Oct 1, 2024
1 parent 2ab6899 commit 5ea2957
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"email": "Email",
"environment": "<b>E</b>nvironment",
"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",
Expand Down
9 changes: 7 additions & 2 deletions src/components/notifications/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 (
<ExternalLink href={`/vice/${encodeURIComponent(accessUrl)}`}>
{t("interactiveAnalysisUrl", { message })}
Expand All @@ -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 (
Expand Down

0 comments on commit 5ea2957

Please sign in to comment.