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 3, 2024
1 parent b29350e commit 837c2e7
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.BrokenSiteOpenerContext
import com.duckduckgo.common.utils.SingleLiveEvent
import com.duckduckgo.common.utils.extractDomain
Expand Down Expand Up @@ -286,5 +286,5 @@ 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
}
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.browser.api.WebViewVersionProvider
import com.duckduckgo.common.utils.DispatcherProvider
import com.duckduckgo.common.utils.absoluteString
Expand Down Expand Up @@ -221,5 +221,5 @@ class BrokenSiteSubmitter @Inject constructor(
private fun ReportFlow.toStringValue(): String = when (this) {
DASHBOARD -> "dashboard"
MENU -> "menu"
PROMPT -> "prompt"
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 @@ -1909,7 +1909,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, reportFlow))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,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 @@ -3467,7 +3467,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 }
enum class ReportFlow { DASHBOARD, 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 }
enum class ReportFlow { MENU, DASHBOARD, 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 @@ -99,7 +99,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
}
}
}
Expand Down

0 comments on commit 837c2e7

Please sign in to comment.