chore: clean up activation of team properties (#29460)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Joshua Snyder
2025-03-05 14:35:01 +00:00
committed by GitHub
parent 13e581792c
commit 46344a52b6
12 changed files with 24 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -378,19 +378,30 @@ export const activationLogic = kea<activationLogicType>([
}
},
onTeamLoad: ({ team }) => {
if (
team?.session_recording_opt_in &&
values.savedOnboardingTasks[ActivationTask.SetupSessionRecordings] !== ActivationTaskStatus.COMPLETED
) {
actions.markTaskAsCompleted(ActivationTask.SetupSessionRecordings)
}
const teamPropertiesToCheck: { property: keyof TeamType; task: ActivationTask }[] = [
{
property: 'session_recording_opt_in',
task: ActivationTask.SetupSessionRecordings,
},
{
property: 'ingested_event',
task: ActivationTask.IngestFirstEvent,
},
{
property: 'autocapture_web_vitals_opt_in',
task: ActivationTask.SetUpWebVitals,
},
{
property: 'app_urls',
task: ActivationTask.AddAuthorizedDomain,
},
]
if (
team?.ingested_event &&
values.savedOnboardingTasks[ActivationTask.IngestFirstEvent] !== ActivationTaskStatus.COMPLETED
) {
actions.markTaskAsCompleted(ActivationTask.IngestFirstEvent)
}
teamPropertiesToCheck.forEach(({ property, task }) => {
if (team?.[property]) {
actions.markTaskAsCompleted(task)
}
})
},
})),
afterMount(({ actions, values }) => {

View File

@@ -15,7 +15,7 @@ import {
type ProductIntentProperties,
} from 'lib/utils/product-intents'
import { activationLogic, ActivationTask } from '~/layout/navigation-3000/sidepanel/panels/activation/activationLogic'
import { activationLogic } from '~/layout/navigation-3000/sidepanel/panels/activation/activationLogic'
import { CorrelationConfigType, ProductKey, ProjectType, TeamPublicType, TeamType } from '~/types'
import { organizationLogic } from './organizationLogic'
@@ -247,14 +247,6 @@ export const teamLogic = kea<teamLogicType>([
if (currentTeam && !payload?.onboarding_tasks) {
activationLogic.findMounted()?.actions?.onTeamLoad(currentTeam)
}
if (payload?.autocapture_web_vitals_opt_in) {
activationLogic.findMounted()?.actions?.markTaskAsCompleted(ActivationTask.SetUpWebVitals)
}
if (payload?.app_urls && payload?.app_urls.length > 0) {
activationLogic.findMounted()?.actions?.markTaskAsCompleted(ActivationTask.AddAuthorizedDomain)
}
},
createTeamSuccess: ({ currentTeam }) => {
if (currentTeam) {