Backed out changeset c0ed259d0df3 (bug 1910484) for causing bug 1916227

This commit is contained in:
Noemi Erli 2024-09-09 16:47:18 +03:00
Родитель 54078024f2
Коммит ba348d7295
6 изменённых файлов: 23 добавлений и 32 удалений

Просмотреть файл

@ -34,6 +34,7 @@ import org.mozilla.fenix.databinding.QuicksettingsProtectionsPanelBinding
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.trackingprotection.CookieBannerUIMode
import org.mozilla.fenix.trackingprotection.CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED
import org.mozilla.fenix.trackingprotection.CookieBannerUIMode.SITE_NOT_SUPPORTED
import org.mozilla.fenix.trackingprotection.ProtectionsState
import org.mozilla.fenix.utils.Settings
@ -111,6 +112,7 @@ class ProtectionsView(
FirefoxTheme {
if (cookieBannerMode in listOf(
REQUEST_UNSUPPORTED_SITE_SUBMITTED,
SITE_NOT_SUPPORTED,
)
) {
CookieBannerItem(

Просмотреть файл

@ -102,13 +102,9 @@ class CookieBannerHandlingDetailsView(
R.string.reduce_cookie_banner_details_panel_title_on_for_site_1,
shortUrl,
)
CookieBannerUIMode.SITE_NOT_SUPPORTED -> {
val appName = context.getString(R.string.app_name)
context.getString(
R.string.cookie_banner_handling_details_site_is_not_supported_title_3,
appName,
)
}
CookieBannerUIMode.SITE_NOT_SUPPORTED -> context.getString(
R.string.cookie_banner_handling_details_site_is_not_supported_title_2,
)
else -> ""
}
binding.title.text = title
@ -129,7 +125,8 @@ class CookieBannerHandlingDetailsView(
appName,
)
CookieBannerUIMode.SITE_NOT_SUPPORTED -> context.getString(
R.string.reduce_cookie_banner_details_panel_title_unsupported_site_request_3,
R.string.reduce_cookie_banner_details_panel_title_unsupported_site_request_2,
appName,
)
else -> ""
}

Просмотреть файл

@ -159,7 +159,7 @@ enum class CookieBannerUIMode(
* SITE_NOT_SUPPORTED - The domain is not supported by cookie banner handling.
*/
SITE_NOT_SUPPORTED(
R.string.reduce_cookie_banner_unsupported_site_1,
R.string.reduce_cookie_banner_unsupported_site,
R.drawable.ic_cookies_disabled,
),

Просмотреть файл

@ -67,14 +67,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:background="@android:color/transparent"
android:gravity="center"
android:minHeight="48dp"
android:text="@string/cookie_banner_handling_details_site_is_not_supported_cancel_button"
android:layout_marginEnd="16dp"
android:textAllCaps="false"
android:textColor="@color/accent_high_contrast_private_theme"
android:textAllCaps="true"
android:textColor="@color/fx_mobile_text_color_accent"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -85,14 +85,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:background="@android:color/transparent"
android:gravity="center"
android:minHeight="48dp"
android:layout_marginEnd="16dp"
android:text="@string/cookie_banner_handling_details_site_is_not_supported_request_support_button_3"
android:textAllCaps="false"
android:textColor="@color/accent_high_contrast_private_theme"
android:text="@string/cookie_banner_handling_details_site_is_not_supported_request_support_button_2"
android:textAllCaps="true"
android:textColor="@color/fx_mobile_text_color_accent"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"

Просмотреть файл

@ -545,13 +545,9 @@
<!-- Text for cancel button indicating that cookie banner reduction is not supported for the current site, this is shown as part of the cookie banner details view. -->
<string name="cookie_banner_handling_details_site_is_not_supported_cancel_button">Cancel</string>
<!-- Text for request support button indicating that cookie banner reduction is not supported for the current site, this is shown as part of the cookie banner details view. -->
<string name="cookie_banner_handling_details_site_is_not_supported_request_support_button_2" moz:RemovedIn="130" tools:ignore="UnusedResources">Send request</string>
<!-- Text for request support button indicating that cookie banner reduction is not supported for the current site, this is shown as part of the cookie banner details view. -->
<string name="cookie_banner_handling_details_site_is_not_supported_request_support_button_3">Ask to add site</string>
<string name="cookie_banner_handling_details_site_is_not_supported_request_support_button_2">Send request</string>
<!-- Text for title indicating that cookie banner reduction is not supported for the current site, this is shown as part of the cookie banner details view. -->
<string name="cookie_banner_handling_details_site_is_not_supported_title_2" moz:RemovedIn="130" tools:ignore="UnusedResources">Request support for this site?</string>
<!-- Text for title indicating that cookie banner reduction is not supported for the current site, this is shown as part of the cookie banner details view. The first parameter is the application name -->
<string name="cookie_banner_handling_details_site_is_not_supported_title_3">Ask %1$s to auto refuse cookies</string>
<string name="cookie_banner_handling_details_site_is_not_supported_title_2">Request support for this site?</string>
<!-- Label for the snackBar, after the user reports with success a website where cookie banner reducer did not work -->
<string name="cookie_banner_handling_report_site_snack_bar_text_2">Request sent</string>
<!-- Text for indicating cookie banner handling is on this site, this is shown as part of the protections panel with the tracking protection toggle -->
@ -559,17 +555,13 @@
<!-- Text for indicating that a request for unsupported site was sent to Nimbus (it's a Mozilla library for experiments), this is shown as part of the protections panel with the tracking protection toggle -->
<string name="reduce_cookie_banner_unsupported_site_request_submitted_2">Support request sent</string>
<!-- Text for indicating cookie banner handling is currently not supported for this site, this is shown as part of the protections panel with the tracking protection toggle -->
<string name="reduce_cookie_banner_unsupported_site" moz:RemovedIn="130" tools:ignore="UnusedResources">Site currently not supported</string>
<!-- Text for indicating cookie banner handling is currently not supported for this site, this is shown as part of the protections panel with the tracking protection toggle -->
<string name="reduce_cookie_banner_unsupported_site_1">Site not supported</string>
<string name="reduce_cookie_banner_unsupported_site">Site currently not supported</string>
<!-- Title text for a detail explanation indicating cookie banner handling is on this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site-->
<string name="reduce_cookie_banner_details_panel_title_on_for_site_1">Turn on Cookie Banner Blocker for %1$s?</string>
<!-- Title text for a detail explanation indicating cookie banner handling is off this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site-->
<string name="reduce_cookie_banner_details_panel_title_off_for_site_1">Turn off Cookie Banner Blocker for %1$s?</string>
<!-- Title text for a detail explanation indicating cookie banner reducer didn't work for the current site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is the application name-->
<string name="reduce_cookie_banner_details_panel_title_unsupported_site_request_2" moz:RemovedIn="130" tools:ignore="UnusedResources">%1$s cant automatically reject cookie requests on this site. You can send a request to support this site in the future.</string>
<!-- Title text for a detail explanation indicating cookie banner reducer didn't work for the current site, this is shown as part of the cookie banner panel in the toolbar.-->
<string name="reduce_cookie_banner_details_panel_title_unsupported_site_request_3">We cant auto refuse cookie pop-ups on this site right now.</string>
<string name="reduce_cookie_banner_details_panel_title_unsupported_site_request_2">%1$s cant automatically reject cookie requests on this site. You can send a request to support this site in the future.</string>
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is off for a site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is the application name -->
<string name="reduce_cookie_banner_details_panel_description_off_for_site_1">Turn off and %1$s will clear cookies and reload this site. This may sign you out or empty shopping carts.</string>
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is the application name -->

Просмотреть файл

@ -107,7 +107,6 @@ class CookieBannerHandlingDetailsViewTest {
@Test
fun `GIVEN cookie banner handling mode is site not supported WHEN biding title THEN title view must have the expected string`() =
runTestOnMain {
val appName = testContext.getString(R.string.app_name)
coEvery { publicSuffixList.getPublicSuffixPlusOne(any()) } returns CompletableDeferred("mozilla.org")
val websiteUrl = "https://mozilla.org"
@ -116,8 +115,7 @@ class CookieBannerHandlingDetailsViewTest {
val expectedText =
testContext.getString(
R.string.cookie_banner_handling_details_site_is_not_supported_title_3,
appName,
R.string.cookie_banner_handling_details_site_is_not_supported_title_2,
)
assertEquals(expectedText, view.binding.title.text)
@ -174,9 +172,11 @@ class CookieBannerHandlingDetailsViewTest {
fun `GIVEN cookie banner handling mode is site not supported WHEN biding description THEN description view must have the expected string`() {
view.bindDescription(state = CookieBannerUIMode.SITE_NOT_SUPPORTED)
val appName = testContext.getString(R.string.app_name)
val expectedText =
testContext.getString(
R.string.reduce_cookie_banner_details_panel_title_unsupported_site_request_3,
R.string.reduce_cookie_banner_details_panel_title_unsupported_site_request_2,
appName,
)
assertEquals(expectedText, view.binding.details.text)