2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

Bug 1856913 - Refactor ReviewQualityCheckVendorsService and repackage ext

This commit is contained in:
rahulsainani 2023-10-04 12:06:53 +02:00 committed by mergify[bot]
parent 7bc745dc39
commit d85d8cc474
5 changed files with 9 additions and 12 deletions

View File

@ -25,11 +25,6 @@ interface ReviewQualityCheckVendorsService {
* Returns the list of product vendors in order.
*/
fun productVendors(): List<ProductVendor>
/**
* Returns the product's vendor.
*/
fun productVendor(): ProductVendor
}
/**
@ -59,8 +54,6 @@ class DefaultReviewQualityCheckVendorsService(
}
}
override fun productVendor(): ProductVendor = productVendors().first()
/**
* Creates list of product vendors using the firstVendor param as the first item in the list.
*/
@ -83,3 +76,9 @@ class DefaultReviewQualityCheckVendorsService(
}
}
}
/**
* Returns the first matching product vendor for the selected tab.
*/
fun ReviewQualityCheckVendorsService.productVendor(): ProductVendor =
productVendors().first()

View File

@ -26,9 +26,9 @@ import org.mozilla.fenix.compose.LinkText
import org.mozilla.fenix.compose.LinkTextState
import org.mozilla.fenix.compose.annotation.LightDarkPreview
import org.mozilla.fenix.compose.button.PrimaryButton
import org.mozilla.fenix.shopping.ext.displayName
import org.mozilla.fenix.shopping.store.ReviewQualityCheckState
import org.mozilla.fenix.shopping.store.ReviewQualityCheckState.ProductVendor
import org.mozilla.fenix.shopping.ui.ext.displayName
import org.mozilla.fenix.theme.FirefoxTheme
const val PLACEHOLDER_URL = "www.fakespot.com"

View File

@ -27,8 +27,8 @@ import org.mozilla.fenix.compose.LinkText
import org.mozilla.fenix.compose.LinkTextState
import org.mozilla.fenix.compose.annotation.LightDarkPreview
import org.mozilla.fenix.compose.parseHtml
import org.mozilla.fenix.shopping.ext.displayName
import org.mozilla.fenix.shopping.store.ReviewQualityCheckState
import org.mozilla.fenix.shopping.ui.ext.displayName
import org.mozilla.fenix.theme.FirefoxTheme
/**

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.shopping.ext
package org.mozilla.fenix.shopping.ui.ext
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource

View File

@ -15,6 +15,4 @@ class FakeReviewQualityCheckVendorsService(
),
) : ReviewQualityCheckVendorsService {
override fun productVendors(): List<ProductVendor> = productVendors
override fun productVendor(): ProductVendor = productVendors().first()
}