Repository: wordpress-mobile/WordPress-Android (language: kotlin)

Issue:
Dashboard Personalization: Refactor Recent Activity Card
Refactor the recent activity card

```[tasklist]
### Tasks
- [ ] Remove activity log remote feature flag
- [ ] Create ActivityLogViewModelSlice
- [ ] Move tracking to ViewModelSlice
- [ ] Update unit tests
```



Discussion hints:
nan

Pull request: Implements: Viewmodel slice for ActivityLogCard
Closes #19022

## Description
Implements the viewmodel slice for Activity log card

## To test:
- Go to app 
- Login with a site having activity log 
- Go to me → Debug settings 
- Verify that `dashboard_activity_log` flag doesn’t exist 
- Click on an `ActivityCardItem`
- Verify that the event is triggered 
- ✅  🔵 Tracked: my_site_dashboard_card_item_tapped, Properties: {"type":"activity_log","subtype":"activity_log"}
- Navigate Back 
- Click on more menu 
- ✅  Verify that the event is triggered
-  🔵 Tracked: my_site_dashboard_contextual_menu_accessed, Properties: {"card":"activity_log"}
- Click on all activity
- ✅  Verify  🔵 Tracked: my_site_dashboard_card_menu_item_tapped, Properties: {"card":"activity_log","item":"all_activity"}
- Navigate back 
- Click on more menu 
- Click on Hide this 
- Verify event triggered 🔵 Tracked: my_site_dashboard_card_menu_item_tapped, Properties: {"card":"activity_log","item":"hide_this"}

## Regression Notes
1. Potential unintended areas of impact
- Activity log card does not work as expected
- Tracking on Activity log card is incorrect

2. What I did to test those areas of impact (or what existing automated tests I relied on)
Manual tests and Unit tests

3. What automated tests I added (or what prevented me from doing so)
Unit tests

PR submission checklist:
- [x] I have completed the Regression Notes.
- [x] I have considered adding accessibility improvements for my changes.
- [x] I have considered if this change warrants user-facing release notes and have added them to `RELEASE-NOTES.txt` if necessary.

UI Changes testing checklist:
- [x] Portrait and landscape orientations.
- [x] Light and dark modes.
- [x] Fonts: Larger, smaller and bold text.
- [x] High contrast.
- [x] Talkback.
- [x] Languages with large words or with letters/accents not frequently used in English.
- [x] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
- [x] Large and small screen sizes. (Tablet and smaller phones)
- [x] Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)


Test command: ./gradlew :WordPress:testWordpressVanillaDebugUnitTest --tests "org.wordpress.android.ui.mysite.cards.dashboard.activity.ActivityLogCardViewModelSliceTest" --tests "org.wordpress.android.ui.mysite.cards.dashboard.activity.DashboardActivityLogCardFeatureUtilsTest" --tests "org.wordpress.android.ui.mysite.MySiteViewModelTest" --tests "org.wordpress.android.ui.mysite.cards.dashboard.CardsTrackerTest"

Fix patch:
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
index db53819515e6..1e56a4912799 100644
--- a/WordPress/build.gradle
+++ b/WordPress/build.gradle
@@ -146,7 +146,6 @@ android {
         buildConfigField "boolean", "JETPACK_INSTALL_FULL_PLUGIN", "false"
         buildConfigField "boolean", "ENABLE_BLAZE_FEATURE", "false"
         buildConfigField "boolean", "WP_INDIVIDUAL_PLUGIN_OVERLAY", "false"
-        buildConfigField "boolean", "DASHBOARD_CARD_ACTIVITY_LOG", "false"
         buildConfigField "boolean", "DASHBOARD_CARD_DOMAIN", "false"
         buildConfigField "boolean", "DASHBOARD_CARD_FREE_TO_PAID_PLANS", "false"
         buildConfigField "boolean", "SITE_EDITOR_MVP", "false"
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt
index ceaa1d2519d4..139b2e74aa3e 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteViewModel.kt
@@ -58,8 +58,6 @@ import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.SingleActionCard
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.JetpackBadge
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.SiteInfoHeaderCard
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.Type
-import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams
-import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams.ActivityCardItemClickParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.BloggingPromptCardBuilderParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.DashboardCardDomainBuilderParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.DashboardCardPlansBuilderParams
@@ -84,6 +82,7 @@ import org.wordpress.android.ui.mysite.SiteDialogModel.ChangeSiteIconDialogModel
 import org.wordpress.android.ui.mysite.cards.CardsBuilder
 import org.wordpress.android.ui.mysite.cards.DomainRegistrationCardShownTracker
 import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker
+import org.wordpress.android.ui.mysite.cards.dashboard.activity.ActivityLogCardViewModelSlice
 import org.wordpress.android.ui.mysite.cards.dashboard.bloggingprompts.BloggingPromptsCardAnalyticsTracker
 import org.wordpress.android.ui.mysite.cards.dashboard.domain.DashboardCardDomainUtils
 import org.wordpress.android.ui.mysite.cards.dashboard.domaintransfer.DomainTransferCardViewModel
@@ -208,7 +207,8 @@ class MySiteViewModel @Inject constructor(
     private val domainTransferCardViewModel: DomainTransferCardViewModel,
     private val pagesCardViewModelSlice: PagesCardViewModelSlice,
     private val todaysStatsViewModelSlice: TodaysStatsViewModelSlice,
-    private val postsCardViewModelSlice: PostsCardViewModelSlice
+    private val postsCardViewModelSlice: PostsCardViewModelSlice,
+    private val activityLogCardViewModelSlice: ActivityLogCardViewModelSlice
 ) : ScopedViewModel(mainDispatcher) {
     private var isDefaultTabSet: Boolean = false
     private val _onSnackbarMessage = MutableLiveData<Event<SnackbarMessageHolder>>()
@@ -297,7 +297,8 @@ class MySiteViewModel @Inject constructor(
         pagesCardViewModelSlice.onNavigation,
         domainTransferCardViewModel.onNavigation,
         todaysStatsViewModelSlice.onNavigation,
-        postsCardViewModelSlice.onNavigation
+        postsCardViewModelSlice.onNavigation,
+        activityLogCardViewModelSlice.onNavigation
     )
     val onMediaUpload = _onMediaUpload as LiveData<Event<MediaModel>>
     val onUploadedItem = siteIconUploadHandler.onUploadedItem
@@ -316,7 +317,8 @@ class MySiteViewModel @Inject constructor(
             blazeCardViewModelSlice.refresh,
             pagesCardViewModelSlice.refresh,
             todaysStatsViewModelSlice.refresh,
-            postsCardViewModelSlice.refresh
+            postsCardViewModelSlice.refresh,
+            activityLogCardViewModelSlice.refresh
         )
     val domainTransferCardRefresh = domainTransferCardViewModel.refresh
 
@@ -577,7 +579,7 @@ class MySiteViewModel @Inject constructor(
                 showErrorCard = cardsUpdate?.showErrorCard == true,
                 onErrorRetryClick = this::onDashboardErrorRetry,
                 todaysStatsCardBuilderParams = todaysStatsViewModelSlice.getTodaysStatsBuilderParams(
-                        cardsUpdate?.cards?.firstOrNull { it is TodaysStatsCardModel } as? TodaysStatsCardModel
+                    cardsUpdate?.cards?.firstOrNull { it is TodaysStatsCardModel } as? TodaysStatsCardModel
                 ),
                 postCardBuilderParams = postsCardViewModelSlice.getPostsCardBuilderParams(
                     cardsUpdate?.cards?.firstOrNull { it is PostsCardModel } as? PostsCardModel
@@ -618,14 +620,8 @@ class MySiteViewModel @Inject constructor(
                 pagesCardBuilderParams = pagesCardViewModelSlice.getPagesCardBuilderParams(
                     cardsUpdate?.cards?.firstOrNull { it is PagesCardModel } as? PagesCardModel,
                 ),
-                activityCardBuilderParams = ActivityCardBuilderParams(
-                    activityCardModel = cardsUpdate?.cards?.firstOrNull {
-                        it is ActivityCardModel
-                    } as? ActivityCardModel,
-                    onActivityItemClick = this::onActivityCardItemClick,
-                    onMoreMenuClick = this::onActivityCardMoreMenuClick,
-                    onAllActivityMenuItemClick = this::onActivityCardAllActivityItemClick,
-                    onHideMenuItemClick = this::onActivityCardHideMenuItemClick
+                activityCardBuilderParams = activityLogCardViewModelSlice.getActivityLogCardBuilderParams(
+                    cardsUpdate?.cards?.firstOrNull { it is ActivityCardModel } as? ActivityCardModel
                 ),
             ),
             QuickLinkRibbonBuilderParams(
@@ -691,32 +687,6 @@ class MySiteViewModel @Inject constructor(
         )
     }
 
-    private fun onActivityCardItemClick(activityCardItemClickParams: ActivityCardItemClickParams) {
-        cardsTracker.trackActivityCardItemClicked()
-        _onNavigation.value =
-            Event(
-                SiteNavigationAction.OpenActivityLogDetail(
-                    requireNotNull(selectedSiteRepository.getSelectedSite()),
-                    activityCardItemClickParams.activityId,
-                    activityCardItemClickParams.isRewindable
-                )
-            )
-    }
-    private fun onActivityCardHideMenuItemClick() {
-        cardsTracker.trackActivityCardMenuItemClicked(CardsTracker.MenuItemType.HIDE_THIS)
-        appPrefsWrapper.setShouldHideActivityDashboardCard(
-            requireNotNull(selectedSiteRepository.getSelectedSite()).siteId,true)
-        refresh()
-    }
-
-    private fun onActivityCardAllActivityItemClick() {
-        cardsTracker.trackActivityCardMenuItemClicked(CardsTracker.MenuItemType.ALL_ACTIVITY)
-        _onNavigation.value =
-            Event(SiteNavigationAction.OpenActivityLog(requireNotNull(selectedSiteRepository.getSelectedSite())))
-    }
-
-    private fun onActivityCardMoreMenuClick() = cardsTracker.trackActivityLogMoreMenuClicked()
-
     private fun buildJetpackBadgeIfEnabled(): JetpackBadge? {
         val screen = JetpackPoweredScreen.WithStaticText.HOME
         return JetpackBadge(
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTracker.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTracker.kt
index 753353d435da..69c2df9cc719 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTracker.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTracker.kt
@@ -65,30 +65,11 @@ class CardsTracker @Inject constructor(
         NO_CAMPAIGNS("no_campaigns"),
         CAMPAIGNS("campaigns")
     }
-    enum class MenuItemType(val label: String) {
-        ALL_ACTIVITY("all_activity"),
-        HIDE_THIS("hide_this")
-    }
+
     fun trackQuickStartCardItemClicked(quickStartTaskType: QuickStartTaskType) {
         trackCardItemClicked(Type.QUICK_START.label, quickStartTaskType.toSubtypeValue().label)
     }
 
-    fun trackActivityCardItemClicked() {
-        trackCardItemClicked(Type.ACTIVITY.label, ActivityLogSubtype.ACTIVITY_LOG.label)
-    }
-
-    fun trackActivityCardFooterClicked() {
-        trackCardFooterLinkClicked(Type.ACTIVITY.label, ActivityLogSubtype.ACTIVITY_LOG.label)
-    }
-
-    fun trackActivityCardMenuItemClicked(menuItemType: MenuItemType) {
-        trackCardMoreMenuItemClicked(Type.ACTIVITY.label, menuItemType.label)
-    }
-
-    fun trackActivityLogMoreMenuClicked() {
-        trackCardMoreMenuClicked(Type.ACTIVITY.label)
-    }
-
     fun trackCardFooterLinkClicked(type: String, subtype: String) {
         analyticsTrackerWrapper.track(
             Stat.MY_SITE_DASHBOARD_CARD_FOOTER_ACTION_TAPPED,
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt
new file mode 100644
index 000000000000..a6f8226b8c3c
--- /dev/null
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt
@@ -0,0 +1,79 @@
+package org.wordpress.android.ui.mysite.cards.dashboard.activity
+
+import androidx.lifecycle.MutableLiveData
+import org.wordpress.android.fluxc.model.dashboard.CardModel
+import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams
+import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams.ActivityCardItemClickParams
+import org.wordpress.android.ui.mysite.SelectedSiteRepository
+import org.wordpress.android.ui.mysite.SiteNavigationAction
+import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker
+import org.wordpress.android.ui.prefs.AppPrefsWrapper
+import org.wordpress.android.viewmodel.Event
+import javax.inject.Inject
+import javax.inject.Singleton
+
+@Singleton
+class ActivityLogCardViewModelSlice @Inject constructor(
+    private val cardsTracker: CardsTracker,
+    private val selectedSiteRepository: SelectedSiteRepository,
+    private val appPrefsWrapper: AppPrefsWrapper
+) {
+    private val _onNavigation = MutableLiveData<Event<SiteNavigationAction>>()
+    val onNavigation = _onNavigation
+
+    private val _refresh = MutableLiveData<Event<Boolean>>()
+    val refresh = _refresh
+
+    fun getActivityLogCardBuilderParams(activityCardModel: CardModel.ActivityCardModel?) =
+        ActivityCardBuilderParams(
+            activityCardModel = activityCardModel,
+            onActivityItemClick = this::onActivityCardItemClick,
+            onMoreMenuClick = this::onActivityCardMoreMenuClick,
+            onAllActivityMenuItemClick = this::onActivityCardAllActivityItemClick,
+            onHideMenuItemClick = this::onActivityCardHideMenuItemClick
+        )
+
+    private fun onActivityCardItemClick(activityCardItemClickParams: ActivityCardItemClickParams) {
+        cardsTracker.trackCardItemClicked(
+            CardsTracker.Type.ACTIVITY.label,
+            CardsTracker.ActivityLogSubtype.ACTIVITY_LOG.label
+        )
+        _onNavigation.value =
+            Event(
+                SiteNavigationAction.OpenActivityLogDetail(
+                    requireNotNull(selectedSiteRepository.getSelectedSite()),
+                    activityCardItemClickParams.activityId,
+                    activityCardItemClickParams.isRewindable
+                )
+            )
+    }
+
+    private fun onActivityCardHideMenuItemClick() {
+        cardsTracker.trackCardMoreMenuItemClicked(
+            CardsTracker.Type.ACTIVITY.label,
+            MenuItemType.HIDE_THIS.label
+        )
+        appPrefsWrapper.setShouldHideActivityDashboardCard(
+            requireNotNull(selectedSiteRepository.getSelectedSite()).siteId, true
+        )
+        _refresh.postValue(Event(true))
+    }
+
+    private fun onActivityCardAllActivityItemClick() {
+        cardsTracker.trackCardMoreMenuItemClicked(
+            CardsTracker.Type.ACTIVITY.label,
+            MenuItemType.ALL_ACTIVITY.label
+        )
+        _onNavigation.value =
+            Event(SiteNavigationAction.OpenActivityLog(requireNotNull(selectedSiteRepository.getSelectedSite())))
+    }
+
+    private fun onActivityCardMoreMenuClick() = cardsTracker.trackCardMoreMenuClicked(CardsTracker.Type.ACTIVITY.label)
+
+    enum class MenuItemType(val label: String) {
+        ALL_ACTIVITY("all_activity"),
+        HIDE_THIS("hide_this")
+    }
+}
+
+
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtils.kt
index edb5c583c14c..7bc10ec693e0 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtils.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtils.kt
@@ -3,16 +3,14 @@ package org.wordpress.android.ui.mysite.cards.dashboard.activity
 import org.wordpress.android.fluxc.model.SiteModel
 import org.wordpress.android.ui.prefs.AppPrefsWrapper
 import org.wordpress.android.util.SiteUtilsWrapper
-import org.wordpress.android.util.config.DashboardCardActivityLogConfig
 import javax.inject.Inject
 
 class DashboardActivityLogCardFeatureUtils @Inject constructor(
-    private val dashboardCardActivityLogConfig: DashboardCardActivityLogConfig,
     private val siteUtilsWrapper: SiteUtilsWrapper,
     private val appPrefsWrapper: AppPrefsWrapper
 ) {
     fun shouldRequestActivityCard(selectedSite: SiteModel): Boolean {
-        if (!dashboardCardActivityLogConfig.isEnabled() || isActivityCardHiddenByUser(selectedSite.siteId)) return false
+        if (isActivityCardHiddenByUser(selectedSite.siteId)) return false
         val isWpComOrJetpack = siteUtilsWrapper.isAccessedViaWPComRest(selectedSite) ||
                 selectedSite.isJetpackConnected
         return selectedSite.hasCapabilityManageOptions
diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/DashboardCardActvitiyLogConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/DashboardCardActvitiyLogConfig.kt
deleted file mode 100644
index 1c22bc7be68f..000000000000
--- a/WordPress/src/main/java/org/wordpress/android/util/config/DashboardCardActvitiyLogConfig.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.wordpress.android.util.config
-
-import org.wordpress.android.BuildConfig
-import org.wordpress.android.annotation.Feature
-import javax.inject.Inject
-
-const val DASHBOARD_CARD_ACTIVITY_LOG_REMOTE_FIELD = "dashboard_card_activity_log"
-
-@Feature(DASHBOARD_CARD_ACTIVITY_LOG_REMOTE_FIELD, false)
-class DashboardCardActivityLogConfig @Inject constructor(
-    appConfig: AppConfig
-) : FeatureConfig(
-    appConfig,
-    BuildConfig.DASHBOARD_CARD_ACTIVITY_LOG,
-    DASHBOARD_CARD_ACTIVITY_LOG_REMOTE_FIELD
-)


Test patch:
diff --git a/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt
index 3aa003be9c75..7eacc476e1b0 100644
--- a/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt
+++ b/WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt
@@ -72,7 +72,6 @@ import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.SingleActionCard
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.JetpackBadge
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.SiteInfoHeaderCard
 import org.wordpress.android.ui.mysite.MySiteCardAndItem.SiteInfoHeaderCard.IconState
-import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams.ActivityCardItemClickParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.DashboardCardsBuilderParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.DomainRegistrationCardBuilderParams
 import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.InfoItemBuilderParams
@@ -100,6 +99,7 @@ import org.wordpress.android.ui.mysite.SiteDialogModel.ChangeSiteIconDialogModel
 import org.wordpress.android.ui.mysite.cards.CardsBuilder
 import org.wordpress.android.ui.mysite.cards.DomainRegistrationCardShownTracker
 import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker
+import org.wordpress.android.ui.mysite.cards.dashboard.activity.ActivityLogCardViewModelSlice
 import org.wordpress.android.ui.mysite.cards.dashboard.bloggingprompts.BloggingPromptAttribution
 import org.wordpress.android.ui.mysite.cards.dashboard.bloggingprompts.BloggingPromptsCardAnalyticsTracker
 import org.wordpress.android.ui.mysite.cards.dashboard.domain.DashboardCardDomainUtils
@@ -326,6 +326,9 @@ class MySiteViewModelTest : BaseUnitTest() {
     @Mock
     lateinit var postsCardViewModelSlice: PostsCardViewModelSlice
 
+    @Mock
+    lateinit var activityLogCardViewModelSlice: ActivityLogCardViewModelSlice
+
     private lateinit var viewModel: MySiteViewModel
     private lateinit var uiModels: MutableList<UiModel>
     private lateinit var snackbars: MutableList<SnackbarMessageHolder>
@@ -349,8 +352,6 @@ class MySiteViewModelTest : BaseUnitTest() {
     private val emailAddress = "test@email.com"
     private val localHomepageId = 1
     private val bloggingPromptId = 123
-    private val activityId = "activityId"
-    private val isRewindable = false
     private lateinit var site: SiteModel
     private lateinit var siteInfoHeader: SiteInfoHeaderCard
     private lateinit var homepage: PageModel
@@ -383,10 +384,6 @@ class MySiteViewModelTest : BaseUnitTest() {
     private var onBloggingPromptViewMoreClicked: (() -> Unit)? = null
     private var onBloggingPromptViewAnswersClicked: ((promptId: Int) -> Unit)? = null
     private var onBloggingPromptRemoveClicked: (() -> Unit)? = null
-    private var onActivityCardAllActivityMenuItemClick: (() -> Unit)? = null
-    private var onActivityCardHideMenuItemClick: (() -> Unit)? = null
-    private var onActivityCardMoreMenuClick: (() -> Unit)? = null
-    private var onActivityItemClick: ((params: ActivityCardItemClickParams) -> Unit)? = null
     private val quickStartCategory: QuickStartCategory
         get() = QuickStartCategory(
             taskType = QuickStartTaskType.CUSTOMIZE,
@@ -495,6 +492,7 @@ class MySiteViewModelTest : BaseUnitTest() {
         whenever(pagesCardViewModelSlice.getPagesCardBuilderParams(anyOrNull())).thenReturn(mock())
         whenever(todaysStatsViewModelSlice.getTodaysStatsBuilderParams(anyOrNull())).thenReturn(mock())
         whenever(postsCardViewModelSlice.getPostsCardBuilderParams(anyOrNull())).thenReturn(mock())
+        whenever(activityLogCardViewModelSlice.getActivityLogCardBuilderParams(anyOrNull())).thenReturn(mock())
 
         viewModel = MySiteViewModel(
             networkUtilsWrapper,
@@ -553,7 +551,8 @@ class MySiteViewModelTest : BaseUnitTest() {
             domainTransferCardViewModel,
             pagesCardViewModelSlice,
             todaysStatsViewModelSlice,
-            postsCardViewModelSlice
+            postsCardViewModelSlice,
+            activityLogCardViewModelSlice
         )
         uiModels = mutableListOf()
         snackbars = mutableListOf()
@@ -1853,61 +1852,6 @@ class MySiteViewModelTest : BaseUnitTest() {
             )
     }
 
-    /* DASHBOARD */
-    @Test
-    fun `when dashboard cards are shown, then card shown event is tracked`() = test {
-        initSelectedSite()
-
-        verify(cardsTracker, atLeastOnce()).trackShown(any())
-    }
-
-    /* DASHBOARD ACTIVITY CARD */
-    @Test
-    fun `given activity card, when all activity menu item is clicked, then trigger navigate to activity log list`() =
-        test {
-            initSelectedSite()
-
-            requireNotNull(onActivityCardAllActivityMenuItemClick).invoke()
-
-            assertThat(navigationActions).containsOnly(SiteNavigationAction.OpenActivityLog(site))
-        }
-
-    @Test
-    fun `given activity card, when activity item is clicked, then navigate to activity detail`() =
-        test {
-            initSelectedSite()
-
-            requireNotNull(onActivityItemClick).invoke(ActivityCardItemClickParams(activityId, isRewindable))
-
-            assertThat(navigationActions).containsOnly(
-                SiteNavigationAction.OpenActivityLogDetail(
-                    site,
-                    activityId,
-                    isRewindable
-                )
-            )
-        }
-
-    @Test
-    fun `given activity card, when activity item is clicked, then event is tracked`() =
-        test {
-            initSelectedSite()
-
-            requireNotNull(onActivityItemClick).invoke(ActivityCardItemClickParams(activityId, isRewindable))
-
-            verify(cardsTracker).trackActivityCardItemClicked()
-        }
-
-    @Test
-    fun `given activity card, when hide this menu item is clicked, then the sources are refreshed`() =
-        test {
-            initSelectedSite()
-
-            requireNotNull(onActivityCardHideMenuItemClick).invoke()
-
-            verify(mySiteSourceManager).refresh()
-        }
-
     /* DASHBOARD ERROR SNACKBAR */
 
     @Test
@@ -3208,7 +3152,6 @@ class MySiteViewModelTest : BaseUnitTest() {
                 } else {
                 //    add(initPostCard(mockInvocation))
                     if (bloggingPromptsFeatureConfig.isEnabled()) add(initBloggingPromptCard(mockInvocation))
-                    add(initActivityCard(mockInvocation))
                 }
             }
         )
@@ -3287,36 +3230,6 @@ class MySiteViewModelTest : BaseUnitTest() {
         return items
     }
 
-    private fun initActivityCard(mockInvocation: InvocationOnMock): DashboardCard.ActivityCard.ActivityCardWithItems {
-        val params = (mockInvocation.arguments.filterIsInstance<DashboardCardsBuilderParams>()).first()
-        onActivityItemClick = params.activityCardBuilderParams.onActivityItemClick
-        onActivityCardMoreMenuClick = params.activityCardBuilderParams.onMoreMenuClick
-        onActivityCardAllActivityMenuItemClick = params.activityCardBuilderParams.onAllActivityMenuItemClick
-        onActivityCardHideMenuItemClick = params.activityCardBuilderParams.onHideMenuItemClick
-        return DashboardCard.ActivityCard.ActivityCardWithItems(
-            title = UiStringRes(0),
-            onAllActivityMenuItemClick = ListItemInteraction.create {
-                (onActivityCardAllActivityMenuItemClick as () -> Unit).invoke()
-            },
-            onHideMenuItemClick = ListItemInteraction.create {
-                (onActivityCardHideMenuItemClick as () -> Unit).invoke()
-            },
-            onMoreMenuClick = ListItemInteraction.create {
-                (onActivityCardMoreMenuClick as () -> Unit).invoke()
-            },
-            activityItems = listOf(
-                DashboardCard.ActivityCard.ActivityCardWithItems.ActivityItem(
-                    label = UiStringRes(0),
-                    subLabel = "",
-                    displayDate = "",
-                    icon = 0,
-                    iconBackgroundColor = 0,
-                    onClick = mock()
-                )
-            ),
-        )
-    }
-
     fun ViewModel.invokeOnCleared() {
         val viewModelStore = ViewModelStore()
         val viewModelProvider = ViewModelProvider(viewModelStore, object : ViewModelProvider.Factory {
diff --git a/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTrackerTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTrackerTest.kt
index cd7987188d0e..951b45fe44a5 100644
--- a/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTrackerTest.kt
+++ b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsTrackerTest.kt
@@ -8,8 +8,6 @@ import org.mockito.junit.MockitoJUnitRunner
 import org.mockito.kotlin.verify
 import org.wordpress.android.analytics.AnalyticsTracker.Stat
 import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTaskType
-import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker.ActivityLogSubtype
-import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker.MenuItemType
 import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker.QuickStartSubtype
 import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker.Type
 import org.wordpress.android.ui.quickstart.QuickStartTracker
@@ -17,8 +15,6 @@ import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
 
 private const val TYPE = "type"
 private const val SUBTYPE = "subtype"
-private const val ITEM = "item"
-private const val CARD = "card"
 
 @RunWith(MockitoJUnitRunner::class)
 class CardsTrackerTest {
@@ -30,6 +26,7 @@ class CardsTrackerTest {
 
     @Mock
     lateinit var quickStartTracker: QuickStartTracker
+
     private lateinit var cardsTracker: CardsTracker
 
     @Before
@@ -53,61 +50,6 @@ class CardsTrackerTest {
         verifyQuickStartCardItemClickedTracked(QuickStartSubtype.CUSTOMIZE.label)
     }
 
-    @Test
-    fun `when activity log item is clicked, then activity card item event is tracked`() {
-        cardsTracker.trackActivityCardItemClicked()
-
-        verifyCardItemClickedTracked(Type.ACTIVITY, ActivityLogSubtype.ACTIVITY_LOG.label)
-    }
-
-    @Test
-    fun `when activity card footer link is clicked, then footer link clicked is tracked`() {
-        cardsTracker.trackActivityCardFooterClicked()
-
-        verifyFooterLinkClickedTracked(Type.ACTIVITY, ActivityLogSubtype.ACTIVITY_LOG.label)
-    }
-
-    @Test
-    fun `when activity card hide this menu item is clicked, then hide this event is tracked`() {
-        cardsTracker.trackActivityCardMenuItemClicked(MenuItemType.HIDE_THIS)
-
-        verifyCardMenuItemClickedTracked(Type.ACTIVITY, MenuItemType.HIDE_THIS.label)
-    }
-
-    @Test
-    fun `when activity card all activity menu item is clicked, then all activity this event is tracked`() {
-        cardsTracker.trackActivityCardMenuItemClicked(MenuItemType.ALL_ACTIVITY)
-
-        verifyCardMenuItemClickedTracked(Type.ACTIVITY, MenuItemType.ALL_ACTIVITY.label)
-    }
-
-    @Test
-    fun `when activity card more menu is clicked, then activity more menu event is tracked`() {
-        cardsTracker.trackActivityLogMoreMenuClicked()
-
-        verifyCardMoreMenuClickTracked(Type.ACTIVITY)
-    }
-
-    private fun verifyFooterLinkClickedTracked(
-        typeValue: Type,
-        subtypeValue: String
-    ) {
-        verify(analyticsTracker).track(
-            Stat.MY_SITE_DASHBOARD_CARD_FOOTER_ACTION_TAPPED,
-            mapOf(TYPE to typeValue.label, SUBTYPE to subtypeValue)
-        )
-    }
-
-    private fun verifyCardItemClickedTracked(
-        typeValue: Type,
-        subtypeValue: String
-    ) {
-        verify(analyticsTracker).track(
-            Stat.MY_SITE_DASHBOARD_CARD_ITEM_TAPPED,
-            mapOf(TYPE to typeValue.label, SUBTYPE to subtypeValue)
-        )
-    }
-
     private fun verifyQuickStartCardItemClickedTracked(
         subtypeValue: String
     ) {
@@ -116,22 +58,4 @@ class CardsTrackerTest {
             mapOf(TYPE to Type.QUICK_START.label, SUBTYPE to subtypeValue)
         )
     }
-
-    private fun verifyCardMenuItemClickedTracked(
-        typeValue: Type,
-        menuItem: String
-    ) {
-        verify(analyticsTracker).track(
-            Stat.MY_SITE_DASHBOARD_CARD_MENU_ITEM_TAPPED,
-            mapOf(CARD to typeValue.label, ITEM to menuItem)
-        )
-    }
-    private fun verifyCardMoreMenuClickTracked(
-        typeValue: Type
-    ) {
-        verify(analyticsTracker).track(
-            Stat.MY_SITE_DASHBOARD_CONTEXTUAL_MENU_ACCESSED,
-            mapOf(CARD to typeValue.label)
-        )
-    }
 }
diff --git a/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSliceTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSliceTest.kt
new file mode 100644
index 000000000000..8eac4c8128d6
--- /dev/null
+++ b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSliceTest.kt
@@ -0,0 +1,124 @@
+package org.wordpress.android.ui.mysite.cards.dashboard.activity
+
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import org.assertj.core.api.Assertions
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnitRunner
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+import org.wordpress.android.BaseUnitTest
+import org.wordpress.android.fluxc.model.SiteModel
+import org.wordpress.android.ui.mysite.MySiteCardAndItemBuilderParams.ActivityCardBuilderParams.ActivityCardItemClickParams
+import org.wordpress.android.ui.mysite.SelectedSiteRepository
+import org.wordpress.android.ui.mysite.SiteNavigationAction
+import org.wordpress.android.ui.mysite.cards.dashboard.CardsTracker
+import org.wordpress.android.ui.prefs.AppPrefsWrapper
+
+@ExperimentalCoroutinesApi
+@RunWith(MockitoJUnitRunner::class)
+class ActivityLogCardViewModelSliceTest : BaseUnitTest() {
+    @Mock
+    lateinit var cardsTracker: CardsTracker
+
+    @Mock
+    lateinit var selectedSiteRepository: SelectedSiteRepository
+
+    @Mock
+    lateinit var appPrefsWrapper: AppPrefsWrapper
+
+    private lateinit var activityLogCardViewModelSlice: ActivityLogCardViewModelSlice
+
+    private lateinit var navigationActions: MutableList<SiteNavigationAction>
+
+    private lateinit var refreshEvents: MutableList<Boolean>
+
+    private val site = mock<SiteModel>()
+
+    private val activityId = "activityId"
+    private val isRewindable = false
+
+    @Before
+    fun setUp() {
+        activityLogCardViewModelSlice = ActivityLogCardViewModelSlice(
+            cardsTracker,
+            selectedSiteRepository,
+            appPrefsWrapper
+        )
+        navigationActions = mutableListOf()
+        activityLogCardViewModelSlice.onNavigation.observeForever { event ->
+            event?.getContentIfNotHandled()?.let {
+                navigationActions.add(it)
+            }
+        }
+        refreshEvents = mutableListOf()
+        activityLogCardViewModelSlice.refresh.observeForever { event ->
+            event?.getContentIfNotHandled()?.let {
+                refreshEvents.add(it)
+            }
+        }
+        whenever(selectedSiteRepository.getSelectedSite()).thenReturn(site)
+    }
+
+    @Test
+    fun `given activity log card, when card item is clicked, then stats page is opened`() =
+        test {
+            val params = activityLogCardViewModelSlice.getActivityLogCardBuilderParams(mock())
+            val cardItemClickParams = ActivityCardItemClickParams(activityId, isRewindable)
+
+            params.onActivityItemClick(cardItemClickParams)
+
+            Assertions.assertThat(navigationActions).containsOnly(
+                SiteNavigationAction.OpenActivityLogDetail(
+                    site,
+                    activityId,
+                    isRewindable
+                )
+            )
+        }
+
+    @Test
+    fun `given activity log card, when card more menu is clicked, then event is tracked`() =
+        test {
+            val params = activityLogCardViewModelSlice.getActivityLogCardBuilderParams(mock())
+
+            params.onMoreMenuClick()
+
+            verify(cardsTracker).trackCardMoreMenuClicked(CardsTracker.Type.ACTIVITY.label)
+        }
+
+    @Test
+    fun `given activity log card, when all activity menu item is clicked, all activity page is opened`() =
+        test {
+            val params = activityLogCardViewModelSlice.getActivityLogCardBuilderParams(mock())
+
+            params.onAllActivityMenuItemClick()
+
+            Assertions.assertThat(navigationActions).containsOnly(
+                SiteNavigationAction.OpenActivityLog(site)
+            )
+            verify(cardsTracker).trackCardMoreMenuItemClicked(
+                CardsTracker.Type.ACTIVITY.label,
+                ActivityLogCardViewModelSlice.MenuItemType.ALL_ACTIVITY.label
+            )
+        }
+
+    @Test
+    fun `given activity log card, when hide menu item is clicked, all activity page is opened`() =
+        test {
+            val params = activityLogCardViewModelSlice.getActivityLogCardBuilderParams(mock())
+
+            params.onHideMenuItemClick()
+
+            Assertions.assertThat(refreshEvents).containsOnly(true)
+            verify(cardsTracker).trackCardMoreMenuItemClicked(
+                CardsTracker.Type.ACTIVITY.label,
+                ActivityLogCardViewModelSlice.MenuItemType.HIDE_THIS.label
+            )
+            verify(appPrefsWrapper).setShouldHideActivityDashboardCard(any(), any())
+        }
+}
diff --git a/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtilsTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtilsTest.kt
index 9788418728b6..27b01d4edbcb 100644
--- a/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtilsTest.kt
+++ b/WordPress/src/test/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/DashboardActivityLogCardFeatureUtilsTest.kt
@@ -11,13 +11,9 @@ import org.wordpress.android.BaseUnitTest
 import org.wordpress.android.fluxc.model.SiteModel
 import org.wordpress.android.ui.prefs.AppPrefsWrapper
 import org.wordpress.android.util.SiteUtilsWrapper
-import org.wordpress.android.util.config.DashboardCardActivityLogConfig
 
 @ExperimentalCoroutinesApi
 class DashboardActivityLogCardFeatureUtilsTest : BaseUnitTest() {
-    @Mock
-    private lateinit var dashboardCardActivityLogConfig: DashboardCardActivityLogConfig
-
     @Mock
     private lateinit var siteUtilsWrapper: SiteUtilsWrapper
 
@@ -32,7 +28,6 @@ class DashboardActivityLogCardFeatureUtilsTest : BaseUnitTest() {
     @Before
     fun setUp() {
         dashboardActivityLogCardFeatureUtils = DashboardActivityLogCardFeatureUtils(
-            dashboardCardActivityLogConfig,
             siteUtilsWrapper,
             appPrefsWrapper
         )
@@ -40,7 +35,6 @@ class DashboardActivityLogCardFeatureUtilsTest : BaseUnitTest() {
     }
 
     private fun setUpMocks() {
-        whenever(dashboardCardActivityLogConfig.isEnabled()).thenReturn(true)
         whenever(siteUtilsWrapper.isAccessedViaWPComRest(siteModel)).thenReturn(true)
         whenever(siteModel.hasCapabilityManageOptions).thenReturn(true)
         whenever(siteModel.isJetpackConnected).thenReturn(true)
@@ -48,16 +42,6 @@ class DashboardActivityLogCardFeatureUtilsTest : BaseUnitTest() {
         whenever(appPrefsWrapper.getShouldHideActivityDashboardCard(any())).thenReturn(false)
     }
 
-    @Test
-    fun `given feature flag is disabled, when isEnaled is called, then false is returned`() {
-        whenever(dashboardCardActivityLogConfig.isEnabled()).thenReturn(false)
-
-        val result = dashboardActivityLogCardFeatureUtils.shouldRequestActivityCard(siteModel)
-
-        Assertions.assertThat(result).isFalse
-    }
-
-
     @Test
     fun `given site accessed is not via wpComOrJetpack, when build is called, then null is returned`() {
         whenever(siteUtilsWrapper.isAccessedViaWPComRest(siteModel)).thenReturn(false)