Skip to content

Commit d8d69ff

Browse files
authored
Add properties to data retention banner custom event (#9063)
* add properties to retention banner custom event * update snapshots
1 parent 820bdbc commit d8d69ff

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

frontend/src/app/commonComponents/DataRetentionLimitsBanner.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { getAppInsights } from "../TelemetryService";
22

33
import Alert from "./Alert";
4-
54
import "./DataRetentionLimitsBanner.scss";
5+
import { DATA_RETENTION_LIMITS_INFO_LINK } from "./DataRetentionModal";
66

77
interface Props {
88
dataRetained: string;
@@ -13,7 +13,13 @@ export const DataRetentionLimitsBanner = ({ dataRetained }: Props) => {
1313

1414
const handleSupportClick = () => {
1515
if (appInsights) {
16-
appInsights.trackEvent({ name: "Data Retention Limits" });
16+
appInsights.trackEvent({
17+
name: "Data Retention Limits",
18+
properties: {
19+
source: `${dataRetained} data retention limits banner`,
20+
link: DATA_RETENTION_LIMITS_INFO_LINK,
21+
},
22+
});
1723
}
1824
};
1925

@@ -36,9 +42,7 @@ export const DataRetentionLimitsBanner = ({ dataRetained }: Props) => {
3642
className={"data-retention-limits-link"}
3743
target="_blank"
3844
rel="noopener noreferrer"
39-
href={
40-
"https://simplereport.gov/using-simplereport/data-retention-limits/"
41-
}
45+
href={DATA_RETENTION_LIMITS_INFO_LINK}
4246
onClick={handleSupportClick}
4347
>
4448
{"Learn how to prepare for data retention limits."}

frontend/src/app/commonComponents/DataRetentionModal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ declare global {
1414
}
1515

1616
const DATA_RETENTION_MODAL_DISMISSED_KEY = "dataRetentionModalDismissed";
17-
const SUPPORT_LINK =
17+
export const DATA_RETENTION_LIMITS_INFO_LINK =
1818
"https://www.simplereport.gov/using-simplereport/data-retention-limits/";
1919

2020
interface DataRetentionModalProps {
@@ -43,10 +43,14 @@ const DataRetentionModal = ({ isOpen, onClose }: DataRetentionModalProps) => {
4343
properties: {
4444
action: "learn_more_clicked",
4545
modalType: "data_retention",
46-
supportLink: SUPPORT_LINK,
46+
supportLink: DATA_RETENTION_LIMITS_INFO_LINK,
4747
},
4848
});
49-
window.open(SUPPORT_LINK, "_blank", "noopener,noreferrer");
49+
window.open(
50+
DATA_RETENTION_LIMITS_INFO_LINK,
51+
"_blank",
52+
"noopener,noreferrer"
53+
);
5054
};
5155

5256
const handleCheckboxChange = (event: React.ChangeEvent<HTMLInputElement>) => {

frontend/src/app/testResults/__snapshots__/ResultsNavWrapper.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exports[`ResultsNav displays the results sub nav when user has the permission 1`
3131
This change may impact how your facility uses SimpleReport.
3232
<a
3333
class="data-retention-limits-link"
34-
href="https://simplereport.gov/using-simplereport/data-retention-limits/"
34+
href="https://www.simplereport.gov/using-simplereport/data-retention-limits/"
3535
rel="noopener noreferrer"
3636
target="_blank"
3737
>
@@ -116,7 +116,7 @@ exports[`ResultsNav doesnt display the results sub nav when user doesnt have the
116116
This change may impact how your facility uses SimpleReport.
117117
<a
118118
class="data-retention-limits-link"
119-
href="https://simplereport.gov/using-simplereport/data-retention-limits/"
119+
href="https://www.simplereport.gov/using-simplereport/data-retention-limits/"
120120
rel="noopener noreferrer"
121121
target="_blank"
122122
>

0 commit comments

Comments
 (0)