Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename report flow param from prompt to reload-three-times-within-20-seconds #5339

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also rename BrokenSiteForm.BrokenSiteFormReportFlow.PROMPT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only important thing is the string, but still, we should rename this for consistency. Done

}
}
}
Expand Down
Loading