-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve downgrade flow in onboarding (#22436)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Zach Waterfield <[email protected]>
- Loading branch information
1 parent
0ff2c22
commit cbf16e8
Showing
10 changed files
with
68 additions
and
24 deletions.
There are no files selected for viewing
Binary file modified
BIN
+78.1 KB
(330%)
frontend/__snapshots__/scenes-app-dashboards--insight-legend--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13.7 KB
(92%)
frontend/__snapshots__/scenes-app-sidepanels--side-panel-docs--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-12.8 KB
(92%)
frontend/__snapshots__/scenes-app-sidepanels--side-panel-docs--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,10 +142,14 @@ export const AllProductsPlanComparison = ({ | |
} | ||
const { billing, redirectPath, timeRemainingInSeconds, timeTotalInSeconds } = useValues(billingLogic) | ||
const { ref: planComparisonRef } = useResizeObserver() | ||
const { reportBillingUpgradeClicked } = useActions(eventUsageLogic) | ||
const { reportBillingUpgradeClicked, reportBillingDowngradeClicked } = useActions(eventUsageLogic) | ||
const currentPlanIndex = plans.findIndex((plan) => plan.current_plan) | ||
const { surveyID, comparisonModalHighlightedFeatureKey } = useValues(billingProductLogic({ product })) | ||
const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) | ||
const { surveyID, comparisonModalHighlightedFeatureKey, billingProductLoading } = useValues( | ||
billingProductLogic({ product }) | ||
) | ||
const { reportSurveyShown, setSurveyResponse, setBillingProductLoading } = useActions( | ||
billingProductLogic({ product }) | ||
) | ||
const { featureFlags } = useValues(featureFlagLogic) | ||
|
||
const nonInclusionProducts = billing?.products.filter((p) => !p.inclusion_only) || [] | ||
|
@@ -164,6 +168,8 @@ export const AllProductsPlanComparison = ({ | |
to={ | ||
plan.contact_support | ||
? 'mailto:[email protected]?subject=Enterprise%20plan%20request' | ||
: i < currentPlanIndex | ||
? undefined // Downgrade action handled in onClick | ||
: getUpgradeProductLink({ | ||
product, | ||
redirectPath, | ||
|
@@ -190,14 +196,17 @@ export const AllProductsPlanComparison = ({ | |
} | ||
onClick={() => { | ||
if (!plan.current_plan) { | ||
// TODO: add current plan key and new plan key | ||
reportBillingUpgradeClicked(product.type) | ||
} | ||
if (plan.included_if == 'has_subscription' && !plan.current_plan && i < currentPlanIndex) { | ||
setSurveyResponse(product.type, '$survey_response_1') | ||
reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) | ||
setBillingProductLoading(product.type) | ||
if (i < currentPlanIndex) { | ||
setSurveyResponse(product.type, '$survey_response_1') | ||
reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) | ||
reportBillingDowngradeClicked(product.type) | ||
} else { | ||
reportBillingUpgradeClicked(product.type) | ||
} | ||
} | ||
}} | ||
loading={billingProductLoading === product.type && !plan.current_plan && !plan.contact_support} | ||
data-attr={`upgrade-${plan.name}`} | ||
> | ||
{plan.current_plan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,10 +121,14 @@ export const PlanComparison = ({ | |
const fullyFeaturedPlan = plans[plans.length - 1] | ||
const { billing, redirectPath, timeRemainingInSeconds, timeTotalInSeconds } = useValues(billingLogic) | ||
const { width, ref: planComparisonRef } = useResizeObserver() | ||
const { reportBillingUpgradeClicked } = useActions(eventUsageLogic) | ||
const { reportBillingUpgradeClicked, reportBillingDowngradeClicked } = useActions(eventUsageLogic) | ||
const currentPlanIndex = plans.findIndex((plan) => plan.current_plan) | ||
const { surveyID, comparisonModalHighlightedFeatureKey } = useValues(billingProductLogic({ product })) | ||
const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) | ||
const { surveyID, comparisonModalHighlightedFeatureKey, billingProductLoading } = useValues( | ||
billingProductLogic({ product }) | ||
) | ||
const { reportSurveyShown, setSurveyResponse, setBillingProductLoading } = useActions( | ||
billingProductLogic({ product }) | ||
) | ||
const { featureFlags } = useValues(featureFlagLogic) | ||
|
||
const ctaAction = billing?.subscription_level === 'custom' ? 'Subscribe' : 'Upgrade' | ||
|
@@ -135,6 +139,8 @@ export const PlanComparison = ({ | |
to={ | ||
plan.contact_support | ||
? 'mailto:[email protected]?subject=Enterprise%20plan%20request' | ||
: i < currentPlanIndex | ||
? undefined // Downgrade action handled in onClick | ||
: getUpgradeProductLink({ | ||
product, | ||
redirectPath, | ||
|
@@ -161,14 +167,17 @@ export const PlanComparison = ({ | |
} | ||
onClick={() => { | ||
if (!plan.current_plan) { | ||
// TODO: add current plan key and new plan key | ||
reportBillingUpgradeClicked(product.type) | ||
} | ||
if (plan.included_if == 'has_subscription' && !plan.current_plan && i < currentPlanIndex) { | ||
setSurveyResponse(product.type, '$survey_response_1') | ||
reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) | ||
setBillingProductLoading(product.type) | ||
if (i < currentPlanIndex) { | ||
setSurveyResponse(product.type, '$survey_response_1') | ||
reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) | ||
reportBillingDowngradeClicked(product.type) | ||
} else { | ||
reportBillingUpgradeClicked(product.type) | ||
} | ||
} | ||
}} | ||
loading={billingProductLoading === product.type && !plan.current_plan && !plan.contact_support} | ||
data-attr={`upgrade-${plan.name}`} | ||
> | ||
{plan.current_plan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters