Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
2 changes: 0 additions & 2 deletions Modules/Sources/Experiments/DefaultFeatureFlagService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
return true
case .pointOfSaleOrdersi2:
return true
case .pointOfSaleSettingsi1:
return true
case .orderAddressMapSearch:
return true
case .pointOfSaleHistoricalOrdersi1:
Expand Down
4 changes: 0 additions & 4 deletions Modules/Sources/Experiments/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions WooCommerce/Classes/POS/Presentation/CartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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 {
Expand Down Expand Up @@ -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 ",
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -229,7 +219,6 @@ private extension CartView {
Image(systemName: "barcode.viewfinder")
}
})
}
Spacer()
}
.background(backgroundColor.ignoresSafeArea(.all))
Expand Down
117 changes: 6 additions & 111 deletions WooCommerce/Classes/POS/Presentation/POSFloatingControlView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,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()
Expand Down Expand Up @@ -75,7 +67,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
Expand All @@ -85,87 +77,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 {
Expand Down Expand Up @@ -227,31 +147,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",
Expand Down
Loading