mirror of
https://github.com/mattermost/focalboard.git
synced 2025-02-01 19:14:35 +02:00
Merge pull request #3668 from mattermost/MM-45761
[MM-45761] - Telemetry: Track how many users end up in purchase/pricing modal/notify admin
This commit is contained in:
commit
82007d81e4
@ -8,7 +8,7 @@ const PostTypeCloudUpgradeNudge = (props: {post: Post}): JSX.Element => {
|
||||
const ctaHandler = (e: React.MouseEvent) => {
|
||||
e.preventDefault()
|
||||
const windowAny = (window as any)
|
||||
windowAny?.openPricingModal()()
|
||||
windowAny?.openPricingModal()({trackingLocation: 'boards > click_view_upgrade_options_nudge'})
|
||||
}
|
||||
|
||||
// custom post type doesn't support styling via CSS stylesheet.
|
||||
|
@ -166,7 +166,7 @@ const CardDetail = (props: Props): JSX.Element|null => {
|
||||
role='button'
|
||||
onClick={() => {
|
||||
props.onClose();
|
||||
(window as any).openPricingModal()()
|
||||
(window as any).openPricingModal()({trackingLocation: 'boards > learn_more_about_our_plans_click'})
|
||||
}}
|
||||
>
|
||||
<FormattedMessage
|
||||
@ -179,7 +179,7 @@ const CardDetail = (props: Props): JSX.Element|null => {
|
||||
className='CardDetail__limited-button'
|
||||
onClick={() => {
|
||||
props.onClose();
|
||||
(window as any).openPricingModal()()
|
||||
(window as any).openPricingModal()({trackingLocation: 'boards > upgrade_click'})
|
||||
}}
|
||||
emphasis='primary'
|
||||
size='large'
|
||||
|
@ -119,7 +119,7 @@ const CardLimitNotification = (props: Props) => {
|
||||
}, [me?.id])
|
||||
|
||||
const onClick = useCallback(() => {
|
||||
(window as any).openPricingModal()()
|
||||
(window as any).openPricingModal()({trackingLocation: 'boards > card_limit_notification_upgrade_to_a_paid_plan_click'})
|
||||
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.LimitCardLimitLinkOpen, {})
|
||||
}, [])
|
||||
|
||||
|
@ -80,7 +80,7 @@ export const ViewLimitModal = (props: Props): JSX.Element => {
|
||||
telemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewLimitCTAPerformed, {board: board.id})
|
||||
|
||||
if (isAdmin) {
|
||||
(window as any)?.openPricingModal()()
|
||||
(window as any)?.openPricingModal()({trackingLocation: 'boards > view_limit_dialog'})
|
||||
} else {
|
||||
await octoClient.notifyAdminUpgrade()
|
||||
props.showNotifyAdminSuccess()
|
||||
|
6
webapp/src/types/index.d.ts
vendored
6
webapp/src/types/index.d.ts
vendored
@ -1,5 +1,9 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
type TelemetryProps = {
|
||||
trackingLocation: string;
|
||||
}
|
||||
export interface IAppWindow extends Window {
|
||||
baseURL?: string
|
||||
frontendBaseURL?: string
|
||||
@ -8,7 +12,7 @@ export interface IAppWindow extends Window {
|
||||
msCrypto: Crypto
|
||||
openInNewBrowser?: ((href: string) => void) | null
|
||||
webkit?: {messageHandlers: {nativeApp?: {postMessage: <T>(message: T) => void}}}
|
||||
openPricingModal?: () => () => void
|
||||
openPricingModal?: () => (telemetry: TelemetryProps) => void
|
||||
}
|
||||
|
||||
// SuiteWindow documents all custom properties
|
||||
|
Loading…
x
Reference in New Issue
Block a user