Skip to content

Commit

Permalink
Merge branch 'main' into feat/update-navigation-infra
Browse files Browse the repository at this point in the history
  • Loading branch information
MounirDhahri committed Nov 7, 2024
2 parents 26601ad + 61c9649 commit 961d64f
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"braces": "in the resolutions - needed to resolve a security dependency issue - need to remove this when the issue is resolved and packages are updated"
},
"dependencies": {
"@artsy/cohesion": "4.214.0",
"@artsy/cohesion": "4.215.0",
"@artsy/palette-mobile": "13.2.44",
"@artsy/to-title-case": "1.1.0",
"@braze/react-native-sdk": "11.0.0",
Expand Down
13 changes: 7 additions & 6 deletions src/app/Components/Tasks/Task.tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ describe("Task Component", () => {
expect(mockClearTask).toHaveBeenCalled()
expect(mockDissmissTask).toHaveBeenCalled()
expect(mockTrackEvent).toHaveBeenCalledWith({
action: "tappedClearNotification",
action: "tappedClearTask",
context_module: "actNow",
context_screen_owner_type: "home",
destination_path: "www.test.com",
notification_category: "send_wire",
notification_id: "one",
task_id: "one",
task_type: "send_wire",
})
})

Expand All @@ -68,12 +68,13 @@ describe("Task Component", () => {
expect(mockAcknowledgeTask).toHaveBeenCalled()
expect(mockClearTask).toHaveBeenCalled()
expect(mockTrackEvent).toHaveBeenCalledWith({
action: "tappedNotification",
action: "tappedTaskGroup",
context_module: "actNow",
context_screen_owner_type: "home",
destination_path: "www.test.com",
notification_category: "send_wire",
notification_id: "one",
task_id: "one",
task_type: "send_wire",
type: "thumbnail",
})
})
})
Expand Down
6 changes: 3 additions & 3 deletions src/app/Components/Tasks/Task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface TaskProps {
}
export const Task = forwardRef<SwipeableMethods, TaskProps>(
({ disableSwipeable, onClearTask, onPress, ...restProps }, ref) => {
const { tappedNotification, tappedClearNotification } = useHomeViewTracking()
const { tappedTaskGroup, tappedClearTask } = useHomeViewTracking()
const { submitMutation: dismissTask } = useDismissTask()
const { submitMutation: acknowledgeTask } = useAcknowledgeTask()
const fontScale = PixelRatio.getFontScale()
Expand All @@ -35,15 +35,15 @@ export const Task = forwardRef<SwipeableMethods, TaskProps>(
}

acknowledgeTask({ variables: { taskID: task.internalID } })
tappedNotification(ContextModule.actNow, task.actionLink, task.internalID, task.taskType)
tappedTaskGroup(ContextModule.actNow, task.actionLink, task.internalID, task.taskType)
onClearTask()

navigate(task.actionLink)
}

const handleClearTask = async () => {
dismissTask({ variables: { taskID: task.internalID } })
tappedClearNotification(ContextModule.actNow, task.actionLink, task.internalID, task.taskType)
tappedClearTask(ContextModule.actNow, task.actionLink, task.internalID, task.taskType)
onClearTask()
}

Expand Down
7 changes: 4 additions & 3 deletions src/app/Scenes/HomeView/Sections/HomeViewSectionTasks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ContextModule } from "@artsy/cohesion"
import { Flex, FlexProps, Skeleton, SkeletonBox, SkeletonText, Spacer } from "@artsy/palette-mobile"
import { useIsFocused } from "@react-navigation/native"
import { HomeViewSectionTasksQuery } from "__generated__/HomeViewSectionTasksQuery.graphql"
import { HomeViewSectionTasks_section$key } from "__generated__/HomeViewSectionTasks_section.graphql"
import { SectionTitle } from "app/Components/SectionTitle"
Expand Down Expand Up @@ -28,9 +29,9 @@ export const HomeViewSectionTasks: React.FC<HomeViewSectionTasksProps> = ({
}) => {
const swipeableRef = useRef<SwipeableMethods>(null)
const [displayTask, setDisplayTask] = useState(true)
const [isReady, setIsReady] = useState(false)
const section = useFragment(tasksFragment, sectionProp)
const tasks = extractNodes(section.tasksConnection)
const isFocused = useIsFocused()

const { isDismissed } = GlobalStore.useAppState((state) => state.progressiveOnboarding)
const { dismiss } = GlobalStore.actions.progressiveOnboarding
Expand All @@ -40,7 +41,7 @@ export const HomeViewSectionTasks: React.FC<HomeViewSectionTasksProps> = ({

// adding the find-saved-artwork onboarding key to prevent overlap
const shouldStartOnboardingAnimation =
isReady &&
isFocused &&
!isDismissed("act-now-tasks").status &&
!!isDismissed("find-saved-artwork").status &&
!!swipeableRef.current &&
Expand Down Expand Up @@ -84,7 +85,7 @@ export const HomeViewSectionTasks: React.FC<HomeViewSectionTasksProps> = ({
<SectionTitle title={section.component?.title} />
</Flex>

<Flex mr={2} onLayout={() => setIsReady(true)}>
<Flex mr={2}>
<Task ref={swipeableRef} task={task} onClearTask={handleClearTask} />
</Flex>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ describe("HomeViewSectionTasks", () => {
expect(mockTrackEvent.mock.calls[0]).toMatchInlineSnapshot(`
[
{
"action": "tappedNotification",
"action": "tappedTaskGroup",
"context_module": "actNow",
"context_screen_owner_type": "home",
"destination_path": "/test-link",
"notification_category": "send_wire",
"notification_id": "one",
"task_id": "one",
"task_type": "send_wire",
"type": "thumbnail",
},
]
`)
Expand All @@ -97,12 +98,12 @@ describe("HomeViewSectionTasks", () => {
expect(mockTrackEvent.mock.calls[0]).toMatchInlineSnapshot(`
[
{
"action": "tappedClearNotification",
"action": "tappedClearTask",
"context_module": "actNow",
"context_screen_owner_type": "home",
"destination_path": "/test-link",
"notification_category": "send_wire",
"notification_id": "one",
"task_id": "one",
"task_type": "send_wire",
},
]
`)
Expand Down
33 changes: 17 additions & 16 deletions src/app/Scenes/HomeView/hooks/useHomeViewTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
TappedAuctionResultGroup,
TappedCardGroup,
TappedChangePaymentMethod,
TappedClearNotification,
TappedClearTask,
TappedCollectionGroup,
TappedFairGroup,
TappedHeroUnitGroup,
TappedNotification,
TappedNotificationsBell,
TappedShowGroup,
TappedShowMore,
TappedTaskGroup,
TappedViewingRoomGroup,
} from "@artsy/cohesion"
import { PaymentFailureBanner_Fragment$data } from "__generated__/PaymentFailureBanner_Fragment.graphql"
Expand Down Expand Up @@ -305,19 +305,19 @@ export const useHomeViewTracking = () => {
trackEvent(payload)
},

tappedClearNotification: (
tappedClearTask: (
contextModule: ContextModule,
destinationPath: string,
notificationID: string,
notificationCategory: string
taskID: string,
taskType: string
) => {
const payload: TappedClearNotification = {
action: ActionType.tappedClearNotification,
const payload: TappedClearTask = {
action: ActionType.tappedClearTask,
context_module: contextModule,
context_screen_owner_type: OwnerType.home,
destination_path: destinationPath,
notification_id: notificationID,
notification_category: notificationCategory,
task_id: taskID,
task_type: taskType,
}

trackEvent(payload)
Expand Down Expand Up @@ -408,19 +408,20 @@ export const useHomeViewTracking = () => {
trackEvent(payload)
},

tappedNotification: (
tappedTaskGroup: (
contextModule: ContextModule,
destinationPath: string,
notificationID: string,
notificationCategory: string
taskID: string,
taskType: string
) => {
const payload: TappedNotification = {
action: ActionType.tappedNotification,
const payload: TappedTaskGroup = {
action: ActionType.tappedTaskGroup,
context_module: contextModule,
context_screen_owner_type: OwnerType.home,
destination_path: destinationPath,
notification_id: notificationID,
notification_category: notificationCategory,
task_id: taskID,
task_type: taskType,
type: "thumbnail",
}

trackEvent(payload)
Expand Down
4 changes: 3 additions & 1 deletion src/app/Scenes/Onboarding/Auth2/components/AuthScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export const AuthScreen: React.FC<AuthScreenProps> = ({ children, name }) => {

return (
<>
<Flex display={isVisible ? "flex" : "none"}>{children}</Flex>
<Flex display={isVisible ? "flex" : "none"} zIndex={isVisible ? 1 : 0}>
{children}
</Flex>
</>
)
}
2 changes: 1 addition & 1 deletion src/app/system/errorReporting/setupSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function setupSentry(props: SetupSentryProps = { debug: false }) {
autoSessionTracking: true,
enableWatchdogTerminationTracking: false,
attachStacktrace: true,
tracesSampleRate: props.debug ? 1.0 : 0.1,
tracesSampleRate: props.debug ? 1.0 : 0.05,
debug: props.debug,
integrations: [
Sentry.reactNativeTracingIntegration({
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@artsy/cohesion@4.214.0":
version "4.214.0"
resolved "https://registry.yarnpkg.com/@artsy/cohesion/-/cohesion-4.214.0.tgz#e01d0e189427c94ad9aeade88fb959507a3122da"
integrity sha512-OGbvPxhCC7DuJ+aNR3yw5vXvsHE4jy1fbZs4cWL4KnChjk8vo7xMxqLQFmc8FXckmSFG2O5mdWnrhF8QEgIFPw==
"@artsy/cohesion@4.215.0":
version "4.215.0"
resolved "https://registry.yarnpkg.com/@artsy/cohesion/-/cohesion-4.215.0.tgz#751aa7b6d0c5665d8e538dafcaf9cf6be864c956"
integrity sha512-gb+TMl59R3IPPKucTbsjhFlOom/y8GF4XkEE3Tfe8tA9Agt2FPZCJXIjYELIGiyRn9EKMQUjBeLF1G927ToSzQ==
dependencies:
core-js "3"

Expand Down

0 comments on commit 961d64f

Please sign in to comment.