From ef7c961f38625138841016da2651982f83fe6f24 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:16:52 +1100 Subject: [PATCH 01/12] Update strings.xml Add Traffic string resource --- WordPress/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 3e591eeda435..c39f29792f9a 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -1328,6 +1328,7 @@ Unknown Search Terms + Traffic Insights All-time posts, views, and visitors Today\'s Stats From 39cdbec5b804387e55c4c965af8632743989f9e9 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:17:39 +1100 Subject: [PATCH 02/12] Update StatsListViewModel.kt Add TRAFFIC to Stats Section --- .../android/ui/stats/refresh/lists/StatsListViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt index 2070d4e737b7..d6fd939a605d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt @@ -57,6 +57,7 @@ abstract class StatsListViewModel( private var isInitialized = false enum class StatsSection(@StringRes val titleRes: Int) { + TRAFFIC(R.string.stats_traffic), INSIGHTS(R.string.stats_insights), DAYS(R.string.stats_timeframe_days), WEEKS(R.string.stats_timeframe_weeks), From 13e998ef261789cc833fa3a475b1bc36ae340af3 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:19:27 +1100 Subject: [PATCH 03/12] Update StatsFragment.kt Add traffic tab, and exclude days, weeks, months, and years when feature flag is enabled --- .../android/ui/stats/refresh/StatsFragment.kt | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt index a30fba860869..0bd8572cf639 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt @@ -43,13 +43,17 @@ import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider.SiteUpdate import org.wordpress.android.ui.utils.UiHelpers import org.wordpress.android.util.JetpackBrandingUtils import org.wordpress.android.models.JetpackPoweredScreen +import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TRAFFIC import org.wordpress.android.util.WPSwipeToRefreshHelper +import org.wordpress.android.util.config.StatsTrafficTabFeatureConfig import org.wordpress.android.util.helpers.SwipeToRefreshHelper import org.wordpress.android.viewmodel.observeEvent import org.wordpress.android.widgets.WPSnackbar import javax.inject.Inject private val statsSections = listOf(INSIGHTS, DAYS, WEEKS, MONTHS, YEARS) +private val statsSectionsWithTrafficTab = listOf(TRAFFIC, INSIGHTS) +private var statsTrafficTabEnabled = false @AndroidEntryPoint class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializedListener { @@ -58,6 +62,10 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ @Inject lateinit var jetpackBrandingUtils: JetpackBrandingUtils + + @Inject + lateinit var statsTrafficTabFeatureConfig: StatsTrafficTabFeatureConfig + private val viewModel: StatsViewModel by activityViewModels() private lateinit var swipeToRefreshHelper: SwipeToRefreshHelper private lateinit var selectedTabListener: SelectedTabListener @@ -91,6 +99,8 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ } private fun StatsFragmentBinding.initializeViews() { + statsTrafficTabEnabled = statsTrafficTabFeatureConfig.isEnabled() + val adapter = StatsPagerAdapter(this@StatsFragment) statsPager.adapter = adapter statsPager.setPageTransformer( @@ -180,7 +190,11 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ viewModel.selectedSection.observe(viewLifecycleOwner) { selectedSection -> selectedSection?.let { - handleSelectedSection(selectedSection) + if (statsTrafficTabEnabled) { + handleSelectedSectionWithTrafficTab(selectedSection) + } else { + handleSelectedSection(selectedSection) + } } } @@ -209,6 +223,30 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ } } + @Suppress("MagicNumber") + private fun StatsFragmentBinding.handleSelectedSectionWithTrafficTab( + selectedSection: StatsSection + ) { + val position = when (selectedSection) { + TRAFFIC -> 0 + INSIGHTS -> 1 + DETAIL, + INSIGHT_DETAIL, + TOTAL_LIKES_DETAIL, + TOTAL_COMMENTS_DETAIL, + TOTAL_FOLLOWERS_DETAIL, + ANNUAL_STATS -> null + else -> null + } + position?.let { + if (statsPager.currentItem != position) { + tabLayout.removeOnTabSelectedListener(selectedTabListener) + statsPager.setCurrentItem(position, false) + tabLayout.addOnTabSelectedListener(selectedTabListener) + } + } + } + @Suppress("MagicNumber") private fun StatsFragmentBinding.handleSelectedSection( selectedSection: StatsSection @@ -225,6 +263,7 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ TOTAL_COMMENTS_DETAIL, TOTAL_FOLLOWERS_DETAIL, ANNUAL_STATS -> null + else -> null } position?.let { if (statsPager.currentItem != position) { @@ -295,18 +334,20 @@ class StatsFragment : Fragment(R.layout.stats_fragment), ScrollableViewInitializ } class StatsPagerAdapter(private val parent: Fragment) : FragmentStateAdapter(parent) { - override fun getItemCount(): Int = statsSections.size + private val statsTabs = if (statsTrafficTabEnabled) statsSectionsWithTrafficTab else statsSections + override fun getItemCount(): Int = statsTabs.size override fun createFragment(position: Int): Fragment { - return StatsListFragment.newInstance(statsSections[position]) + return StatsListFragment.newInstance(statsTabs[position]) } fun getTabTitle(position: Int): CharSequence { - return parent.context?.getString(statsSections[position].titleRes).orEmpty() + return parent.context?.getString(statsTabs[position].titleRes).orEmpty() } } private class SelectedTabListener(val viewModel: StatsViewModel) : OnTabSelectedListener { + private val statsTabs = if (statsTrafficTabEnabled) statsSectionsWithTrafficTab else statsSections override fun onTabReselected(tab: Tab?) { // Do nothing } @@ -316,6 +357,6 @@ private class SelectedTabListener(val viewModel: StatsViewModel) : OnTabSelected } override fun onTabSelected(tab: Tab) { - viewModel.onSectionSelected(statsSections[tab.position]) + viewModel.onSectionSelected(statsTabs[tab.position]) } } From 0f580c19085d402c0ec4c15616308832c546ec7b Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:19:58 +1100 Subject: [PATCH 04/12] Update StatsListFragment.kt Add Traffic stats section --- .../android/ui/stats/refresh/lists/StatsListFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt index 4d48b4e45eed..02720d5051aa 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt @@ -184,6 +184,7 @@ class StatsListFragment : ViewPagerFragment(R.layout.stats_list_fragment) { StatsSection.TOTAL_COMMENTS_DETAIL -> TotalCommentsDetailListViewModel::class.java StatsSection.TOTAL_FOLLOWERS_DETAIL -> TotalFollowersDetailListViewModel::class.java StatsSection.ANNUAL_STATS, + StatsSection.TRAFFIC -> DaysListViewModel::class.java // TODO: Replace with TrafficListViewModel StatsSection.INSIGHTS -> InsightsListViewModel::class.java StatsSection.DAYS -> DaysListViewModel::class.java StatsSection.WEEKS -> WeeksListViewModel::class.java From 4e3bd163cc1c33251716c45d51ba0a3115d6791c Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:20:13 +1100 Subject: [PATCH 05/12] Update SelectedSectionManager.kt Add traffic stats section --- .../android/ui/stats/refresh/utils/SelectedSectionManager.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt index dc8774cd62ef..30f0625934b8 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt @@ -48,6 +48,7 @@ fun StatsSection.toStatsGranularity(): StatsGranularity? { return when (this) { ANNUAL_STATS, DETAIL, TOTAL_LIKES_DETAIL, TOTAL_COMMENTS_DETAIL, TOTAL_FOLLOWERS_DETAIL, INSIGHTS -> null StatsSection.INSIGHT_DETAIL, + StatsSection.TRAFFIC -> DAYS // TODO: Replace with TRAFFIC when it's implemented StatsSection.DAYS -> DAYS StatsSection.WEEKS -> WEEKS StatsSection.MONTHS -> MONTHS From f7dcb6a820524f88f49ae0b64a639de7e2e6ec34 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:20:55 +1100 Subject: [PATCH 06/12] Update StatsDateSelector.kt Add traffic stats section mapping to Days for the time being --- .../android/ui/stats/refresh/utils/StatsDateSelector.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt index 1bf6aa2fc4ff..0246326a7c01 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt @@ -10,6 +10,7 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity.YEARS import org.wordpress.android.ui.stats.refresh.StatsViewModel.DateSelectorUiModel import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.INSIGHTS +import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TRAFFIC import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider.SelectedDate import org.wordpress.android.util.perform @@ -78,7 +79,7 @@ constructor( StatsSection.TOTAL_FOLLOWERS_DETAIL, StatsSection.INSIGHTS, StatsSection.INSIGHT_DETAIL, - StatsSection.DAYS -> DAYS + StatsSection.DAYS, TRAFFIC -> DAYS // TODO: Replace with TRAFFIC when it's implemented StatsSection.WEEKS -> WEEKS StatsSection.MONTHS -> MONTHS StatsSection.ANNUAL_STATS, From c94ad647111a91b3fa9b62f09295ddf20d78dba8 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:21:36 +1100 Subject: [PATCH 07/12] Update AnalyticsTrackerNosara.java Add traffic event --- .../org/wordpress/android/analytics/AnalyticsTrackerNosara.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index 7123b3c59e34..1ea594ddff90 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -1073,6 +1073,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "stats_accessed"; case STATS_ACCESS_ERROR: return "stats_access_error"; + case STATS_TRAFFIC_ACCESSED: + return "stats_traffic_accessed"; case STATS_INSIGHTS_ACCESSED: return "stats_insights_accessed"; case STATS_INSIGHTS_MANAGEMENT_HINT_DISMISSED: From a16044a66f93dd761d7ab8785325476abc44e7b6 Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:21:48 +1100 Subject: [PATCH 08/12] Update AnalyticsTracker.java add traffic event --- .../java/org/wordpress/android/analytics/AnalyticsTracker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index 2d901e7ad21d..a304f1f35a4e 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -82,6 +82,8 @@ public enum Stat { READER_SITE_SHARED, STATS_ACCESSED, STATS_ACCESS_ERROR, + + STATS_TRAFFIC_ACCESSED, STATS_INSIGHTS_ACCESSED, STATS_INSIGHTS_MANAGEMENT_HINT_DISMISSED, STATS_INSIGHTS_MANAGEMENT_HINT_CLICKED, From 86bfadb15dc8ec5fdd2d5f4ed40c5fdbc563ad9c Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:22:22 +1100 Subject: [PATCH 09/12] Update StatsAnalyticsUtils.kt Add traffic event, and map to days property for the time being --- .../android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt index f5534852b869..b4bae7a37efc 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt @@ -6,6 +6,7 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity import org.wordpress.android.fluxc.store.StatsStore.InsightType import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.INSIGHT_DETAIL +import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TRAFFIC import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureFragment.WidgetType import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureFragment.WidgetType.ALL_TIME_VIEWS import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureFragment.WidgetType.TODAY_VIEWS @@ -55,7 +56,7 @@ fun AnalyticsTrackerWrapper.trackViewsVisitorsChips(position: Int) { fun AnalyticsTrackerWrapper.trackWithSection(stat: Stat, section: StatsSection) { val property = when (section) { - StatsSection.DAYS -> DAYS_PROPERTY + StatsSection.DAYS, TRAFFIC -> DAYS_PROPERTY // TODO: Replace with TRAFFIC when it's implemented StatsSection.WEEKS -> WEEKS_PROPERTY StatsSection.MONTHS -> MONTHS_PROPERTY StatsSection.YEARS -> YEARS_PROPERTY From 7d995dbc4c2c7388b376b0e00562fd929ca0dffc Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:22:44 +1100 Subject: [PATCH 10/12] Update StatsViewModel.kt Add traffic to tracking --- .../org/wordpress/android/ui/stats/refresh/StatsViewModel.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt index 9217d1c7bb0e..2ede24a24638 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt @@ -18,6 +18,7 @@ import org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_PERIOD_DAYS_A import org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_PERIOD_MONTHS_ACCESSED import org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_PERIOD_WEEKS_ACCESSED import org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_PERIOD_YEARS_ACCESSED +import org.wordpress.android.analytics.AnalyticsTracker.Stat.STATS_TRAFFIC_ACCESSED import org.wordpress.android.fluxc.network.utils.StatsGranularity import org.wordpress.android.fluxc.store.DEFAULT_INSIGHTS import org.wordpress.android.fluxc.store.JETPACK_DEFAULT_INSIGHTS @@ -279,6 +280,7 @@ class StatsViewModel private fun trackSectionSelected(statsSection: StatsSection) { when (statsSection) { + StatsSection.TRAFFIC -> analyticsTracker.track(STATS_TRAFFIC_ACCESSED) StatsSection.INSIGHTS -> analyticsTracker.track(STATS_INSIGHTS_ACCESSED) StatsSection.DAYS -> analyticsTracker.trackGranular(STATS_PERIOD_DAYS_ACCESSED, StatsGranularity.DAYS) StatsSection.WEEKS -> analyticsTracker.trackGranular(STATS_PERIOD_WEEKS_ACCESSED, StatsGranularity.WEEKS) From 6ba45c19a1476bebf71787d0077a3e498b90342b Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 15 Jan 2024 16:34:18 +1100 Subject: [PATCH 11/12] Remove TODO in comment to satisfy detekt --- .../android/ui/stats/refresh/lists/StatsListFragment.kt | 2 +- .../android/ui/stats/refresh/utils/SelectedSectionManager.kt | 2 +- .../android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt | 2 +- .../android/ui/stats/refresh/utils/StatsDateSelector.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt index 02720d5051aa..fc1d01cef8d9 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListFragment.kt @@ -184,7 +184,7 @@ class StatsListFragment : ViewPagerFragment(R.layout.stats_list_fragment) { StatsSection.TOTAL_COMMENTS_DETAIL -> TotalCommentsDetailListViewModel::class.java StatsSection.TOTAL_FOLLOWERS_DETAIL -> TotalFollowersDetailListViewModel::class.java StatsSection.ANNUAL_STATS, - StatsSection.TRAFFIC -> DaysListViewModel::class.java // TODO: Replace with TrafficListViewModel + StatsSection.TRAFFIC -> DaysListViewModel::class.java // Replace with TrafficListViewModel StatsSection.INSIGHTS -> InsightsListViewModel::class.java StatsSection.DAYS -> DaysListViewModel::class.java StatsSection.WEEKS -> WeeksListViewModel::class.java diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt index 30f0625934b8..a3be1b5a3c3d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/SelectedSectionManager.kt @@ -48,7 +48,7 @@ fun StatsSection.toStatsGranularity(): StatsGranularity? { return when (this) { ANNUAL_STATS, DETAIL, TOTAL_LIKES_DETAIL, TOTAL_COMMENTS_DETAIL, TOTAL_FOLLOWERS_DETAIL, INSIGHTS -> null StatsSection.INSIGHT_DETAIL, - StatsSection.TRAFFIC -> DAYS // TODO: Replace with TRAFFIC when it's implemented + StatsSection.TRAFFIC -> DAYS // Replace with TRAFFIC when it's implemented StatsSection.DAYS -> DAYS StatsSection.WEEKS -> WEEKS StatsSection.MONTHS -> MONTHS diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt index b4bae7a37efc..95bb9b5e0f79 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsAnalyticsUtils.kt @@ -56,7 +56,7 @@ fun AnalyticsTrackerWrapper.trackViewsVisitorsChips(position: Int) { fun AnalyticsTrackerWrapper.trackWithSection(stat: Stat, section: StatsSection) { val property = when (section) { - StatsSection.DAYS, TRAFFIC -> DAYS_PROPERTY // TODO: Replace with TRAFFIC when it's implemented + StatsSection.DAYS, TRAFFIC -> DAYS_PROPERTY // Replace with TRAFFIC when it's implemented StatsSection.WEEKS -> WEEKS_PROPERTY StatsSection.MONTHS -> MONTHS_PROPERTY StatsSection.YEARS -> YEARS_PROPERTY diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt index 0246326a7c01..47227c520494 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsDateSelector.kt @@ -79,7 +79,7 @@ constructor( StatsSection.TOTAL_FOLLOWERS_DETAIL, StatsSection.INSIGHTS, StatsSection.INSIGHT_DETAIL, - StatsSection.DAYS, TRAFFIC -> DAYS // TODO: Replace with TRAFFIC when it's implemented + StatsSection.DAYS, TRAFFIC -> DAYS // Replace with TRAFFIC when it's implemented StatsSection.WEEKS -> WEEKS StatsSection.MONTHS -> MONTHS StatsSection.ANNUAL_STATS, From e373e2c0385a79c91c3f4519b178d6cd9040f458 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Tue, 16 Jan 2024 00:07:05 +0300 Subject: [PATCH 12/12] Remove a redundant line break from `AnalyticsTracker` --- .../java/org/wordpress/android/analytics/AnalyticsTracker.java | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index a304f1f35a4e..fbc2df7a413e 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -82,7 +82,6 @@ public enum Stat { READER_SITE_SHARED, STATS_ACCESSED, STATS_ACCESS_ERROR, - STATS_TRAFFIC_ACCESSED, STATS_INSIGHTS_ACCESSED, STATS_INSIGHTS_MANAGEMENT_HINT_DISMISSED,