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

chore: Add tracking to Alert list actions #14813

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ActionType } from "@artsy/cohesion"
import { Box, Clickable, Flex, Spacer, Sup, Text } from "@artsy/palette"
import { createFragmentContainer, graphql } from "react-relay"
import { SavedSearchAlertListItem_item$data } from "__generated__/SavedSearchAlertListItem_item.graphql"
import { EditAlertEntity } from "Apps/Settings/Routes/SavedSearchAlerts/types"
import { createFragmentContainer, graphql } from "react-relay"
import { useTracking } from "react-tracking"
import { useJump } from "Utils/Hooks/useJump"

export type SavedSearchAlertListItemVariant = "active" | "inactive"
Expand All @@ -19,9 +21,10 @@ export const SavedSearchAlertListItem: React.FC<SavedSearchAlertListItemProps> =
onEditAlertClick,
onViewArtworksClick,
}) => {
const matchingArtworksCount = item.artworksConnection?.counts?.total

const { jumpTo } = useJump()
const { trackEvent } = useTracking()

const matchingArtworksCount = item.artworksConnection?.counts?.total

return (
<Box
Expand Down Expand Up @@ -82,14 +85,16 @@ export const SavedSearchAlertListItem: React.FC<SavedSearchAlertListItemProps> =
<Clickable
textDecoration="underline"
onClick={() => {
{
onEditAlertClick({
id: item.internalID,
name: item.settings?.name ?? undefined,
artistIds: item.artistIDs as string[],
})
jumpTo("Alerts")
}
trackEvent({
action_type: ActionType.clickedEditAlert,
alert_id: item.internalID,
})
onEditAlertClick({
id: item.internalID,
name: item.settings?.name ?? undefined,
artistIds: item.artistIDs as string[],
})
jumpTo("Alerts")
}}
>
Edit
Expand All @@ -105,6 +110,10 @@ export const SavedSearchAlertListItem: React.FC<SavedSearchAlertListItemProps> =
>
<Clickable
onClick={() => {
trackEvent({
action_type: ActionType.clickedViewArtworks,
alert_id: item.internalID,
})
onViewArtworksClick({
id: item.internalID,
name: item.settings?.name ?? undefined,
Expand Down