Skip to content

Commit

Permalink
Merge branch 'main' into DESENG-605-TenantCRUDMain
Browse files Browse the repository at this point in the history
  • Loading branch information
NatSquared authored May 23, 2024
2 parents f8b48c7 + 3acdbcd commit 0e008d7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- Reworked image upload component to match the design system
- Added new form components that align with the design system

- **Bugfix** Add try catch block around snowplow call [🎟️ DESENG-621](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-621)
- Added a try catch block to all snowplow calls

## May 22, 2024
- **Feature** Add languages side nav link [🎟️ DESENG-622](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-622)

## May 21, 2024
Expand Down
12 changes: 8 additions & 4 deletions met-web/src/components/engagement/view/EmailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ const EmailModal = ({ defaultPanel, open, handleClose }: EmailModalProps) => {
type: EmailVerificationType.Survey,
language: language.id,
});
window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/verify-email/jsonschema/1-0-0',
data: { survey_id: savedEngagement.surveys[0].id, engagement_id: savedEngagement.id },
});
try {
window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/verify-email/jsonschema/1-0-0',
data: { survey_id: savedEngagement.surveys[0].id, engagement_id: savedEngagement.id },
});
} catch (error) {
console.log('Email verification snowplow error:', error);
}
dispatch(
openNotification({
severity: 'success',
Expand Down
6 changes: 5 additions & 1 deletion met-web/src/components/engagement/view/EngagementView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export const EngagementView = () => {
if (!isPreview) {
setDefaultPanel('email');
setEmailModalOpen(true);
window.snowplow('trackPageView', 'Verify Email Modal');
try {
window.snowplow('trackPageView', 'Verify Email Modal');
} catch (error) {
console.log('Verify email modal snowplow error:', error);
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ const EmailListModal = ({ open, setOpen }: { open: boolean; setOpen: (open: bool
type: defaultType,
});

window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/verify-email/jsonschema/1-0-0',
data: { survey_id: savedEngagement.surveys[0].id, engagement_id: savedEngagement.id },
});
try {
window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/verify-email/jsonschema/1-0-0',
data: { survey_id: savedEngagement.surveys[0].id, engagement_id: savedEngagement.id },
});
} catch (error) {
console.log('Create subscription snowplow error:', error);
}
setOpen(false);
dispatch(
openNotificationModal({
Expand Down
12 changes: 8 additions & 4 deletions met-web/src/components/survey/submit/ActionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ export const ActionProvider = ({ children }: { children: JSX.Element }) => {
verification_token: token ? token : '',
});

window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/submit-survey/jsonschema/1-0-0',
data: { survey_id: savedSurvey.id, engagement_id: savedSurvey.engagement_id },
});
try {
window.snowplow('trackSelfDescribingEvent', {
schema: 'iglu:ca.bc.gov.met/submit-survey/jsonschema/1-0-0',
data: { survey_id: savedSurvey.id, engagement_id: savedSurvey.engagement_id },
});
} catch (error) {
console.log('Survey submit notification snowplow error:', error);
}
dispatch(
openNotification({
severity: 'success',
Expand Down
6 changes: 5 additions & 1 deletion met-web/src/routes/PageViewTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { useLocation } from 'react-router-dom';
const PageViewTracker = () => {
const location = useLocation();
useEffect(() => {
window.snowplow('trackPageView');
try {
window.snowplow('trackPageView');
} catch (error) {
console.log('Track page view snowplow error:', error);
}
}, [location]);

return null;
Expand Down

0 comments on commit 0e008d7

Please sign in to comment.