Skip to content

Commit

Permalink
Feat: Added invite event (#3631)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikehrn authored Dec 4, 2024
1 parent ce3941c commit 20c36d4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/frontend-2/components/workspace/wizard/Wizard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<div class="py-3 md:py-6">
<CommonLoadingIcon v-if="loading" class="my-10 justify-self-center" />
<CommonLoadingIcon
v-if="loading || !isClientReady"
class="my-10 justify-self-center"
/>
<template v-else>
<CommonAlert
v-if="showPaymentError"
Expand Down Expand Up @@ -67,6 +70,7 @@ const { loading: queryLoading, onResult } = useQuery(
)
const showPaymentError = ref(false)
const isClientReady = ref(false)
const loading = computed(
() => wizardIsLoading.value || (props.workspaceId ? queryLoading.value : false)
Expand All @@ -81,9 +85,7 @@ onResult((result) => {
setState({
...state,
id: props.workspaceId ?? (route.query.workspaceId as string),
plan: null, // Force re-select plan
billingInterval: null // Force re-select billing interval
id: props.workspaceId ?? (route.query.workspaceId as string)
})
// If the users comes back from Stripe, we need to go to the last relevant step and show an error
Expand All @@ -99,10 +101,12 @@ onResult((result) => {
cancelCheckoutSession(route.query.session_id as string, props.workspaceId)
}
mixpanel.track('Workspace Creation Checkout Session Started')
mixpanel.track('Workspace Creation Checkout Session Canceled')
}
} else {
mixpanel.track('Workspace Creation Started')
}
})
onMounted(() => {
isClientReady.value = true
})
</script>
12 changes: 12 additions & 0 deletions packages/frontend-2/lib/workspaces/composables/wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ export const useWorkspacesWizard = () => {
}))

await inviteToWorkspace({ workspaceId, inputs, hideNotifications: true })

mixpanel.track('Invite Action', {
type: 'workspace invite',
name: 'send',
multiple: inputs.length !== 1,
count: inputs.length,
hasProject: true,
to: 'email',
source: 'wizard',
// eslint-disable-next-line camelcase
workspace_id: workspaceId
})
}

const result = await updateWorkspaceCreationState({
Expand Down

0 comments on commit 20c36d4

Please sign in to comment.