diff --git a/Modules/Sources/Experiments/DefaultFeatureFlagService.swift b/Modules/Sources/Experiments/DefaultFeatureFlagService.swift index 7d7154edf4a..fa9ec1cac1b 100644 --- a/Modules/Sources/Experiments/DefaultFeatureFlagService.swift +++ b/Modules/Sources/Experiments/DefaultFeatureFlagService.swift @@ -90,8 +90,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService { return true case .pointOfSaleOrdersi2: return true - case .pointOfSaleSettingsi1: - return true case .orderAddressMapSearch: return true case .pointOfSaleHistoricalOrdersi1: diff --git a/Modules/Sources/Experiments/FeatureFlag.swift b/Modules/Sources/Experiments/FeatureFlag.swift index 9ce41916142..c5734453d7a 100644 --- a/Modules/Sources/Experiments/FeatureFlag.swift +++ b/Modules/Sources/Experiments/FeatureFlag.swift @@ -187,10 +187,6 @@ public enum FeatureFlag: Int { /// case pointOfSaleOrdersi2 - /// Enables the entry point for Point of Sale Settings - /// - case pointOfSaleSettingsi1 - /// Enables the CTA to search for an address in the map in order details > shipping address. /// case orderAddressMapSearch diff --git a/Modules/Sources/PointOfSale/Presentation/CartView.swift b/Modules/Sources/PointOfSale/Presentation/CartView.swift index 2b76ed39e77..60fe0e30e7c 100644 --- a/Modules/Sources/PointOfSale/Presentation/CartView.swift +++ b/Modules/Sources/PointOfSale/Presentation/CartView.swift @@ -3,7 +3,6 @@ import WooFoundation struct CartView: View { @Environment(PointOfSaleAggregateModel.self) private var posModel - @Environment(\.posFeatureFlags) private var featureFlags @Environment(\.posAnalytics) private var analytics private let viewHelper = CartViewHelper() @@ -23,10 +22,6 @@ struct CartView: View { abs(offSetPosition) < maxOffset } - private var isPOSSettingsEnabled: Bool { - featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) - } - @State private var showBarcodeScanningModal: Bool = false var body: some View { @@ -142,10 +137,6 @@ private extension CartView { "pos.cartView.cartTitle", value: "Cart", comment: "Title at the header for the Cart view.") - static let addItemsToCartHint = NSLocalizedString( - "pos.cartView.addItemsToCartHint", - value: "Tap on a product to \n add it to the cart", - comment: "Hint to add products to the Cart when this is empty.") static let addItemsToCartOrScanHint = NSLocalizedString( "pos.cartView.addItemsToCartOrScanHint", value: "Tap on a product to \n add it to the cart, or ", @@ -206,7 +197,7 @@ private extension CartView { // SwiftUI doesn't allow us to absolutely pin a view to the centre then position other views relative to it // Instead, we can centre the text, and then put the image in an offset overlay. Offsetting from the top // avoids issues when the text size is changed through dynamic type. - Text(isPOSSettingsEnabled ? Localization.addItemsToCartOrScanHint : Localization.addItemsToCartHint) + Text(Localization.addItemsToCartOrScanHint) .font(Constants.secondaryFont) .foregroundColor(Color.posOnSurfaceVariantLowest) .multilineTextAlignment(.center) @@ -217,7 +208,6 @@ private extension CartView { .offset(y: -(Constants.shoppingBagImageSize + Constants.emptyViewImageTextSpacing)) .aspectRatio(contentMode: .fit) } - if isPOSSettingsEnabled { Button(action: { analytics.track(.pointOfSaleEmptyCartSetupScannerTapped) showBarcodeScanningModal = true @@ -229,7 +219,6 @@ private extension CartView { Image(systemName: "barcode.viewfinder") } }) - } Spacer() } .background(backgroundColor.ignoresSafeArea(.all)) diff --git a/Modules/Sources/PointOfSale/Presentation/POSFloatingControlView.swift b/Modules/Sources/PointOfSale/Presentation/POSFloatingControlView.swift index 952f1ca6ffb..e7c9686304e 100644 --- a/Modules/Sources/PointOfSale/Presentation/POSFloatingControlView.swift +++ b/Modules/Sources/PointOfSale/Presentation/POSFloatingControlView.swift @@ -25,18 +25,10 @@ struct POSFloatingControlView: View { self._showSettings = showSettings } - private var isPOSSettingsEnabled: Bool { - featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) - } - var body: some View { HStack { Menu { - if isPOSSettingsEnabled { - compactOptions() - } else { - completeOptions() - } + menuOptions() } label: { VStack { Spacer() @@ -76,7 +68,7 @@ struct POSFloatingControlView: View { } private extension POSFloatingControlView { - @ViewBuilder private func compactOptions() -> some View { + @ViewBuilder private func menuOptions() -> some View { Button { analytics.track(.pointOfSaleExitMenuItemTapped) showExitPOSModal = true @@ -86,87 +78,15 @@ private extension POSFloatingControlView { icon: { Image(systemName: "rectangle.portrait.and.arrow.forward") } ) } - if featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) { - Button { - analytics.track(.pointOfSaleSettingsMenuItemTapped) - showSettings = true - } label: { - Label( - title: { Text(Localization.settings) }, - icon: { Image(systemName: "gearshape") } - ) - } - } - - if featureFlags.isFeatureFlagEnabled(.pointOfSaleHistoricalOrdersi1) { - Button { - analytics.track(event: WooAnalyticsEvent.PointOfSale.ordersMenuItemTapped()) - showOrders = true - } label: { - Label( - title: { Text(Localization.orders) }, - icon: { Image(systemName: "text.document") } - ) - } - } - } - - @ViewBuilder private func completeOptions() -> some View { Button { - analytics.track(.pointOfSaleExitMenuItemTapped) - showExitPOSModal = true + analytics.track(.pointOfSaleSettingsMenuItemTapped) + showSettings = true } label: { Label( - title: { Text(Localization.exitPointOfSale) }, - icon: { Image(systemName: "rectangle.portrait.and.arrow.forward") } + title: { Text(Localization.settings) }, + icon: { Image(systemName: "gearshape") } ) } - Button { - analytics.track(.pointOfSaleGetSupportTapped) - showSupport = true - } label: { - Label( - title: { Text(Localization.getSupport) }, - icon: { Image(systemName: "questionmark.circle") } - ) - } - Button { - showDocumentation = true - analytics.track(.pointOfSaleViewDocsTapped) - } label: { - Label( - title: { Text(Localization.viewDocumentation) }, - icon: { Image(systemName: "info.circle") } - ) - } - Button { - showProductRestrictionsModal = true - analytics.track(.pointOfSaleSimpleProductsExplanationDialogShown) - } label: { - Label( - title: { Text(Localization.productRestrictionsInfo) }, - icon: { Image(systemName: "magnifyingglass") }) - } - Button { - showBarcodeScanningModal = true - analytics.track(.pointOfSaleBarcodeScanningMenuItemTapped) - } label: { - Label( - title: { - Text(Localization.barcodeScanningSetup) - }, - icon: { Image(systemName: "barcode.viewfinder") }) - } - if featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) { - Button { - showSettings = true - } label: { - Label( - title: { Text(Localization.settings) }, - icon: { Image(systemName: "gearshape") } - ) - } - } if featureFlags.isFeatureFlagEnabled(.pointOfSaleHistoricalOrdersi1) { Button { @@ -228,31 +148,6 @@ private extension POSFloatingControlView { "The action is confirmed in a modal." ) - static let getSupport = NSLocalizedString( - "pointOfSale.floatingButtons.getSupport.button.title", - value: "Get Support", - comment: "The title of the menu button to get support for Point of Sale, shown in a popover menu." - ) - - static let viewDocumentation = NSLocalizedString( - "pointOfSale.floatingButtons.viewDocumentation.button.title", - value: "Documentation", - comment: "The title of the menu button to read Point of Sale documentation, shown in a popover menu." - ) - - static let productRestrictionsInfo = NSLocalizedString( - "pointOfSale.floatingButtons.productRestrictionsInfo.button.title", - value: "Where are my products?", - comment: "The title of the menu button to view product restrictions info, shown in a popover menu. " + - "We only show simple and variable products in POS, this shows a modal to help explain that limitation." - ) - - static let barcodeScanningSetup = NSLocalizedString( - "pointOfSale.floatingButtons.barcodeScanningSetup.button.title", - value: "Initial barcode scanner setup", - comment: "The title of the menu button to start a barcode scanner setup flow." - ) - static let settings = NSLocalizedString( "pointOfSale.floatingButtons.settings.button.title", value: "Settings",