-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into issue/17837-enable-jetpack-install-full-plu…
…gin-ff
- Loading branch information
Showing
18 changed files
with
545 additions
and
35 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...dpress/android/ui/jpfullplugininstall/GetShowJetpackFullPluginInstallOnboardingUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.wordpress.android.ui.jpfullplugininstall | ||
|
||
import org.wordpress.android.fluxc.model.SiteModel | ||
import org.wordpress.android.ui.prefs.AppPrefsWrapper | ||
import org.wordpress.android.util.config.JetpackInstallFullPluginFeatureConfig | ||
import org.wordpress.android.util.extensions.isJetpackConnectedWithoutFullPlugin | ||
import javax.inject.Inject | ||
|
||
class GetShowJetpackFullPluginInstallOnboardingUseCase @Inject constructor( | ||
private val jetpackInstallFullPluginFeatureConfig: JetpackInstallFullPluginFeatureConfig, | ||
private val appPrefsWrapper: AppPrefsWrapper, | ||
) { | ||
fun execute(siteModel: SiteModel): Boolean = | ||
siteModel.id != 0 && | ||
jetpackInstallFullPluginFeatureConfig.isEnabled() && | ||
appPrefsWrapper.getShouldShowJetpackInstallOnboarding(siteModel.id) && | ||
siteModel.isJetpackConnectedWithoutFullPlugin() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...dpress/android/ui/jpfullplugininstall/install/JetpackFullPluginInstallAnalyticsTracker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.wordpress.android.ui.jpfullplugininstall.install | ||
|
||
import org.wordpress.android.analytics.AnalyticsTracker.Stat | ||
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper | ||
import javax.inject.Inject | ||
|
||
class JetpackFullPluginInstallAnalyticsTracker @Inject constructor( | ||
private val analyticsTracker: AnalyticsTrackerWrapper | ||
) { | ||
fun trackScreenShown(status: Status) { | ||
analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_VIEWED, | ||
mapOf(KEY_STATUS_PARAMETER to status.trackingValue) | ||
) | ||
} | ||
|
||
fun trackCancelButtonClicked(status: Status) { | ||
analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_CANCEL_TAPPED, | ||
mapOf(KEY_STATUS_PARAMETER to status.trackingValue) | ||
) | ||
} | ||
|
||
fun trackInstallButtonClicked() = analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_INSTALL_TAPPED, emptyMap() | ||
) | ||
|
||
fun trackRetryButtonClicked() = analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_RETRY_TAPPED, emptyMap() | ||
) | ||
|
||
fun trackJetpackInstallationSuccess() = analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_SUCCESS, emptyMap() | ||
) | ||
|
||
fun trackDoneButtonClicked() = analyticsTracker.track( | ||
Stat.JETPACK_INSTALL_FULL_PLUGIN_FLOW_DONE_TAPPED, emptyMap() | ||
) | ||
|
||
sealed class Status(val trackingValue: String) { | ||
object Initial : Status("initial") | ||
object Loading : Status("loading") | ||
object Error : Status("error") | ||
} | ||
} | ||
|
||
private const val KEY_STATUS_PARAMETER = "status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.