Bug 1856913 - Refactor ReviewQualityCheckVendorsService and repackage ext

fenix/120.0
rahulsainani 1 year ago committed by mergify[bot]
parent 7bc745dc39
commit d85d8cc474

@ -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()

@ -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"

@ -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
/**

@ -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

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

Loading…
Cancel
Save