chore: clean up activation of team properties (#29460)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
@@ -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 }) => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||