From 1d4ce20cd26a84a74fcde9ecea690164a9bd8850 Mon Sep 17 00:00:00 2001 From: Rafa Audibert Date: Wed, 27 Nov 2024 17:53:12 +0000 Subject: [PATCH 1/2] Hide timezones behind FF We're seeing incosistent values in production, let's hide it behind a FF for now --- frontend/src/lib/constants.tsx | 1 + .../web-analytics/webAnalyticsLogic.tsx | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx index 9c41f441e73f4..dd33bcf30edb4 100644 --- a/frontend/src/lib/constants.tsx +++ b/frontend/src/lib/constants.tsx @@ -233,6 +233,7 @@ export const FEATURE_FLAGS = { EXPERIMENTS_MIGRATION_DISABLE_UI: 'experiments-migration-disable-ui', // owner: @jurajmajerik #team-experiments CUSTOM_CSS_THEMES: 'custom-css-themes', // owner: @daibhin WEB_ANALYTICS_WARN_CUSTOM_EVENT_NO_SESSION: 'web-analytics-warn-custom-event-no-session', // owner: @robbie-c #team-web-analytics + WEB_ANALYTICS_TIMEZONE_TAB: 'web-analytics-timezone-tab', // owner: @rafaeelaudibert #team-web-analytics } as const export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS] diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx index ce12ec43126c4..a748f20d8c48e 100644 --- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx +++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx @@ -995,13 +995,6 @@ export const webAnalyticsLogic = kea([ 'Cities', WebStatsBreakdown.City ), - createTableTab( - TileId.GEOGRAPHY, - GeographyTab.TIMEZONES, - 'Timezones', - 'Timezones', - WebStatsBreakdown.Timezone - ), createTableTab( TileId.GEOGRAPHY, GeographyTab.LANGUAGES, @@ -1009,6 +1002,19 @@ export const webAnalyticsLogic = kea([ 'Languages', WebStatsBreakdown.Language ), + + // :BUG:, see #26475, hidden behind FF while we fix it + ...[ + featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_TIMEZONE_TAB] + ? createTableTab( + TileId.GEOGRAPHY, + GeographyTab.TIMEZONES, + 'Timezones', + 'Timezones', + WebStatsBreakdown.Timezone + ) + : null, + ].filter((x) => x !== null), ], } : null, From a4c395616257ebc6e6ce76a8e7dd83a273377516 Mon Sep 17 00:00:00 2001 From: Rafa Audibert Date: Wed, 27 Nov 2024 18:03:55 +0000 Subject: [PATCH 2/2] Assert TabsTileTab up above to prevent tricky TS hack This is simpler than what we had before --- .../web-analytics/webAnalyticsLogic.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx index a748f20d8c48e..60cf855e1a98f 100644 --- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx +++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx @@ -973,7 +973,7 @@ export const webAnalyticsLogic = kea([ }, insightProps: createInsightProps(TileId.GEOGRAPHY, GeographyTab.MAP), canOpenInsight: true, - }, + } as TabsTileTab, createTableTab( TileId.GEOGRAPHY, GeographyTab.COUNTRIES, @@ -1004,18 +1004,16 @@ export const webAnalyticsLogic = kea([ ), // :BUG:, see #26475, hidden behind FF while we fix it - ...[ - featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_TIMEZONE_TAB] - ? createTableTab( - TileId.GEOGRAPHY, - GeographyTab.TIMEZONES, - 'Timezones', - 'Timezones', - WebStatsBreakdown.Timezone - ) - : null, - ].filter((x) => x !== null), - ], + featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_TIMEZONE_TAB] + ? createTableTab( + TileId.GEOGRAPHY, + GeographyTab.TIMEZONES, + 'Timezones', + 'Timezones', + WebStatsBreakdown.Timezone + ) + : null, + ].filter(isNotNil), } : null, {