Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use special text for periodic updates, and try more ways of finding the analysis ID for linking #594

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading