make cloud onboarding survey disableable via runtime feature flag (#7407)

## Summary

The survey is causing some friction. It incurs about 5-10% dropoff.
Although that number is actually somewhat slow, the information has
mostly served its purpose for now. We can toggle it freely once this PR
is merged.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7407-make-cloud-onboarding-survey-disableable-via-runtime-feature-flag-2c76d73d365081648195f322cb0d7a64)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2025-12-12 13:44:53 -08:00
committed by GitHub
parent 7d326cbc14
commit b5ab45673a
5 changed files with 40 additions and 6 deletions

View File

@@ -225,6 +225,7 @@ import { computed, onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import {
getSurveyCompletedStatus,
submitSurvey
@@ -234,14 +235,20 @@ import { useTelemetry } from '@/platform/telemetry'
const { t } = useI18n()
const router = useRouter()
const { flags } = useFeatureFlags()
const onboardingSurveyEnabled = computed(() => flags.onboardingSurveyEnabled)
// Check if survey is already completed on mount
onMounted(async () => {
if (!onboardingSurveyEnabled.value) {
await router.replace({ name: 'cloud-user-check' })
return
}
try {
const surveyCompleted = await getSurveyCompletedStatus()
if (surveyCompleted) {
// User already completed survey, redirect to waitlist
await router.replace({ name: 'cloud-waitlist' })
// User already completed survey, return to onboarding flow
await router.replace({ name: 'cloud-user-check' })
} else {
// Track survey opened event
if (isCloud) {
@@ -342,6 +349,10 @@ const goTo = (step: number, activate: (val: string | number) => void) => {
// Submit
const onSubmitSurvey = async () => {
try {
if (!onboardingSurveyEnabled.value) {
await router.replace({ name: 'cloud-user-check' })
return
}
isSubmitting.value = true
// prepare payload with consistent structure
const payload = {

View File

@@ -30,6 +30,7 @@ import { computed, nextTick, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import {
getSurveyCompletedStatus,
getUserCloudStatus
@@ -40,6 +41,10 @@ import CloudSurveyViewSkeleton from './skeletons/CloudSurveyViewSkeleton.vue'
const router = useRouter()
const { wrapWithErrorHandlingAsync } = useErrorHandling()
const { flags } = useFeatureFlags()
const onboardingSurveyEnabled = computed(
() => flags.onboardingSurveyEnabled ?? true
)
const skeletonType = ref<'login' | 'survey' | 'waitlist' | 'loading'>('loading')
@@ -51,6 +56,11 @@ const {
wrapWithErrorHandlingAsync(async () => {
await nextTick()
if (!onboardingSurveyEnabled.value) {
await router.replace({ path: '/' })
return
}
const [cloudUserStats, surveyStatus] = await Promise.all([
getUserCloudStatus(),
getSurveyCompletedStatus()
@@ -63,7 +73,7 @@ const {
return
}
// Survey is required for all users
// Survey is required for all users when feature flag is enabled
if (!surveyStatus) {
skeletonType.value = 'survey'
await router.replace({ name: 'cloud-survey' })