Skip to content

Commit

Permalink
Merge pull request #594 from ianmcorvidae/analysis-details-link
Browse files Browse the repository at this point in the history
Use special text for periodic updates, and try more ways of finding the analysis ID for linking
  • Loading branch information
ianmcorvidae authored Oct 2, 2024
2 parents 2ab6899 + 5ea2957 commit 972c0f4
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 972c0f4

Please sign in to comment.