Skip to content

Commit

Permalink
Rename report flow param from prompt to reload-three-times-within-20-…
Browse files Browse the repository at this point in the history
…seconds
  • Loading branch information
CrisBarreiro committed Dec 10, 2024
1 parent 9bb4b31 commit ec86572
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import com.duckduckgo.brokensite.api.ReportFlow as BrokenSiteModelReportFlow
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.DASHBOARD
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.MENU
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.PROMPT
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.TOGGLE_DASHBOARD
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.TOGGLE_MENU
import com.duckduckgo.browser.api.brokensite.BrokenSiteOpenerContext
Expand Down Expand Up @@ -288,7 +288,7 @@ private fun MutableLiveData<ViewState>.setProtectionsState(state: SiteProtection
private fun ReportFlow.mapToBrokenSiteModelReportFlow(): BrokenSiteModelReportFlow = when (this) {
MENU -> BrokenSiteModelReportFlow.MENU
DASHBOARD -> BrokenSiteModelReportFlow.DASHBOARD
PROMPT -> BrokenSiteModelReportFlow.PROMPT
RELOAD_THREE_TIMES_WITHIN_20_SECONDS -> BrokenSiteModelReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
TOGGLE_MENU -> BrokenSiteModelReportFlow.TOGGLE_MENU
TOGGLE_DASHBOARD -> BrokenSiteModelReportFlow.TOGGLE_DASHBOARD
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import com.duckduckgo.brokensite.api.BrokenSiteSender
import com.duckduckgo.brokensite.api.ReportFlow
import com.duckduckgo.brokensite.api.ReportFlow.DASHBOARD
import com.duckduckgo.brokensite.api.ReportFlow.MENU
import com.duckduckgo.brokensite.api.ReportFlow.PROMPT
import com.duckduckgo.brokensite.api.ReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
import com.duckduckgo.brokensite.api.ReportFlow.TOGGLE_DASHBOARD
import com.duckduckgo.brokensite.api.ReportFlow.TOGGLE_MENU
import com.duckduckgo.browser.api.WebViewVersionProvider
Expand Down Expand Up @@ -231,7 +231,7 @@ class BrokenSiteSubmitter @Inject constructor(
private fun ReportFlow.toStringValue(): String = when (this) {
DASHBOARD -> "dashboard"
MENU -> "menu"
PROMPT -> "prompt"
TOGGLE_DASHBOARD -> "on_protections_off_dashboard_main"
TOGGLE_MENU -> "on_protections_off_menu"
RELOAD_THREE_TIMES_WITHIN_20_SECONDS -> "reload-three-times-within-20-seconds"
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ import com.duckduckgo.autofill.api.domain.app.LoginTriggerType
import com.duckduckgo.autofill.api.emailprotection.EmailInjector
import com.duckduckgo.browser.api.WebViewVersionProvider
import com.duckduckgo.browser.api.brokensite.BrokenSiteData
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.PROMPT
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
import com.duckduckgo.common.ui.DuckDuckGoFragment
import com.duckduckgo.common.ui.store.BrowserAppTheme
import com.duckduckgo.common.ui.view.DaxDialog
Expand Down Expand Up @@ -1921,7 +1921,7 @@ class BrowserTabFragment :

if (webBrokenSiteForm.shouldUseWebBrokenSiteForm()) {
val reportFlow = when (data.reportFlow) {
PROMPT -> BrokenSiteFormReportFlow.PROMPT
RELOAD_THREE_TIMES_WITHIN_20_SECONDS -> BrokenSiteFormReportFlow.PROMPT
else -> BrokenSiteFormReportFlow.MENU
}
globalActivityStarter.startIntent(context, BrokenSiteForm(tabId = tabId, reportFlow = reportFlow))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ import com.duckduckgo.brokensite.api.BrokenSitePrompt
import com.duckduckgo.browser.api.UserBrowserProperties
import com.duckduckgo.browser.api.brokensite.BrokenSiteData
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.MENU
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.PROMPT
import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
import com.duckduckgo.common.utils.AppUrl
import com.duckduckgo.common.utils.ConflatedJob
import com.duckduckgo.common.utils.DispatcherProvider
Expand Down Expand Up @@ -3484,7 +3484,7 @@ class BrowserTabViewModel @Inject constructor(

private fun onBrokenSiteCtaOkButtonClicked(cta: BrokenSitePromptDialogCta): Command? {
viewModelScope.launch {
command.value = BrokenSiteFeedback(BrokenSiteData.fromSite(site, reportFlow = PROMPT))
command.value = BrokenSiteFeedback(BrokenSiteData.fromSite(site, reportFlow = RELOAD_THREE_TIMES_WITHIN_20_SECONDS))
command.value = HideBrokenSitePromptCta(cta)
}
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ data class BrokenSite(
val jsPerformance: List<Double>?,
)

enum class ReportFlow { DASHBOARD, MENU, PROMPT, TOGGLE_DASHBOARD, TOGGLE_MENU }
enum class ReportFlow { DASHBOARD, MENU, TOGGLE_DASHBOARD, TOGGLE_MENU, RELOAD_THREE_TIMES_WITHIN_20_SECONDS }
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data class BrokenSiteData(
val openerContext: BrokenSiteOpenerContext?,
val jsPerformance: DoubleArray?,
) {
enum class ReportFlow { MENU, DASHBOARD, PROMPT, TOGGLE_DASHBOARD, TOGGLE_MENU }
enum class ReportFlow { MENU, DASHBOARD, TOGGLE_DASHBOARD, TOGGLE_MENU, RELOAD_THREE_TIMES_WITHIN_20_SECONDS }

companion object {
fun fromSite(site: Site?, reportFlow: ReportFlow): BrokenSiteData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class PrivacyDashboardHybridActivity : DuckDuckGoActivity() {
is BrokenSiteForm -> {
when (params.reportFlow) {
BrokenSiteForm.BrokenSiteFormReportFlow.MENU -> ReportFlow.MENU
BrokenSiteForm.BrokenSiteFormReportFlow.PROMPT -> ReportFlow.PROMPT
BrokenSiteForm.BrokenSiteFormReportFlow.PROMPT -> ReportFlow.RELOAD_THREE_TIMES_WITHIN_20_SECONDS
}
}
else -> ReportFlow.DASHBOARD
Expand Down

0 comments on commit ec86572

Please sign in to comment.