Skip to content

Commit d4900bb

Browse files
authored
[POS Settings] Remove feature flag (#16200)
2 parents 29da7a1 + 0971db8 commit d4900bb

File tree

4 files changed

+7
-129
lines changed

4 files changed

+7
-129
lines changed

Modules/Sources/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
9090
return true
9191
case .pointOfSaleOrdersi2:
9292
return true
93-
case .pointOfSaleSettingsi1:
94-
return true
9593
case .orderAddressMapSearch:
9694
return true
9795
case .pointOfSaleHistoricalOrdersi1:

Modules/Sources/Experiments/FeatureFlag.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ public enum FeatureFlag: Int {
187187
///
188188
case pointOfSaleOrdersi2
189189

190-
/// Enables the entry point for Point of Sale Settings
191-
///
192-
case pointOfSaleSettingsi1
193-
194190
/// Enables the CTA to search for an address in the map in order details > shipping address.
195191
///
196192
case orderAddressMapSearch

Modules/Sources/PointOfSale/Presentation/CartView.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import WooFoundation
33

44
struct CartView: View {
55
@Environment(PointOfSaleAggregateModel.self) private var posModel
6-
@Environment(\.posFeatureFlags) private var featureFlags
76
@Environment(\.posAnalytics) private var analytics
87
private let viewHelper = CartViewHelper()
98

@@ -23,10 +22,6 @@ struct CartView: View {
2322
abs(offSetPosition) < maxOffset
2423
}
2524

26-
private var isPOSSettingsEnabled: Bool {
27-
featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1)
28-
}
29-
3025
@State private var showBarcodeScanningModal: Bool = false
3126

3227
var body: some View {
@@ -142,10 +137,6 @@ private extension CartView {
142137
"pos.cartView.cartTitle",
143138
value: "Cart",
144139
comment: "Title at the header for the Cart view.")
145-
static let addItemsToCartHint = NSLocalizedString(
146-
"pos.cartView.addItemsToCartHint",
147-
value: "Tap on a product to \n add it to the cart",
148-
comment: "Hint to add products to the Cart when this is empty.")
149140
static let addItemsToCartOrScanHint = NSLocalizedString(
150141
"pos.cartView.addItemsToCartOrScanHint",
151142
value: "Tap on a product to \n add it to the cart, or ",
@@ -206,7 +197,7 @@ private extension CartView {
206197
// SwiftUI doesn't allow us to absolutely pin a view to the centre then position other views relative to it
207198
// Instead, we can centre the text, and then put the image in an offset overlay. Offsetting from the top
208199
// avoids issues when the text size is changed through dynamic type.
209-
Text(isPOSSettingsEnabled ? Localization.addItemsToCartOrScanHint : Localization.addItemsToCartHint)
200+
Text(Localization.addItemsToCartOrScanHint)
210201
.font(Constants.secondaryFont)
211202
.foregroundColor(Color.posOnSurfaceVariantLowest)
212203
.multilineTextAlignment(.center)
@@ -217,7 +208,6 @@ private extension CartView {
217208
.offset(y: -(Constants.shoppingBagImageSize + Constants.emptyViewImageTextSpacing))
218209
.aspectRatio(contentMode: .fit)
219210
}
220-
if isPOSSettingsEnabled {
221211
Button(action: {
222212
analytics.track(.pointOfSaleEmptyCartSetupScannerTapped)
223213
showBarcodeScanningModal = true
@@ -229,7 +219,6 @@ private extension CartView {
229219
Image(systemName: "barcode.viewfinder")
230220
}
231221
})
232-
}
233222
Spacer()
234223
}
235224
.background(backgroundColor.ignoresSafeArea(.all))

Modules/Sources/PointOfSale/Presentation/POSFloatingControlView.swift

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@ struct POSFloatingControlView: View {
2525
self._showSettings = showSettings
2626
}
2727

28-
private var isPOSSettingsEnabled: Bool {
29-
featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1)
30-
}
31-
3228
var body: some View {
3329
HStack {
3430
Menu {
35-
if isPOSSettingsEnabled {
36-
compactOptions()
37-
} else {
38-
completeOptions()
39-
}
31+
menuOptions()
4032
} label: {
4133
VStack {
4234
Spacer()
@@ -76,7 +68,7 @@ struct POSFloatingControlView: View {
7668
}
7769

7870
private extension POSFloatingControlView {
79-
@ViewBuilder private func compactOptions() -> some View {
71+
@ViewBuilder private func menuOptions() -> some View {
8072
Button {
8173
analytics.track(.pointOfSaleExitMenuItemTapped)
8274
showExitPOSModal = true
@@ -86,87 +78,15 @@ private extension POSFloatingControlView {
8678
icon: { Image(systemName: "rectangle.portrait.and.arrow.forward") }
8779
)
8880
}
89-
if featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) {
90-
Button {
91-
analytics.track(.pointOfSaleSettingsMenuItemTapped)
92-
showSettings = true
93-
} label: {
94-
Label(
95-
title: { Text(Localization.settings) },
96-
icon: { Image(systemName: "gearshape") }
97-
)
98-
}
99-
}
100-
101-
if featureFlags.isFeatureFlagEnabled(.pointOfSaleHistoricalOrdersi1) {
102-
Button {
103-
analytics.track(event: WooAnalyticsEvent.PointOfSale.ordersMenuItemTapped())
104-
showOrders = true
105-
} label: {
106-
Label(
107-
title: { Text(Localization.orders) },
108-
icon: { Image(systemName: "text.document") }
109-
)
110-
}
111-
}
112-
}
113-
114-
@ViewBuilder private func completeOptions() -> some View {
11581
Button {
116-
analytics.track(.pointOfSaleExitMenuItemTapped)
117-
showExitPOSModal = true
82+
analytics.track(.pointOfSaleSettingsMenuItemTapped)
83+
showSettings = true
11884
} label: {
11985
Label(
120-
title: { Text(Localization.exitPointOfSale) },
121-
icon: { Image(systemName: "rectangle.portrait.and.arrow.forward") }
86+
title: { Text(Localization.settings) },
87+
icon: { Image(systemName: "gearshape") }
12288
)
12389
}
124-
Button {
125-
analytics.track(.pointOfSaleGetSupportTapped)
126-
showSupport = true
127-
} label: {
128-
Label(
129-
title: { Text(Localization.getSupport) },
130-
icon: { Image(systemName: "questionmark.circle") }
131-
)
132-
}
133-
Button {
134-
showDocumentation = true
135-
analytics.track(.pointOfSaleViewDocsTapped)
136-
} label: {
137-
Label(
138-
title: { Text(Localization.viewDocumentation) },
139-
icon: { Image(systemName: "info.circle") }
140-
)
141-
}
142-
Button {
143-
showProductRestrictionsModal = true
144-
analytics.track(.pointOfSaleSimpleProductsExplanationDialogShown)
145-
} label: {
146-
Label(
147-
title: { Text(Localization.productRestrictionsInfo) },
148-
icon: { Image(systemName: "magnifyingglass") })
149-
}
150-
Button {
151-
showBarcodeScanningModal = true
152-
analytics.track(.pointOfSaleBarcodeScanningMenuItemTapped)
153-
} label: {
154-
Label(
155-
title: {
156-
Text(Localization.barcodeScanningSetup)
157-
},
158-
icon: { Image(systemName: "barcode.viewfinder") })
159-
}
160-
if featureFlags.isFeatureFlagEnabled(.pointOfSaleSettingsi1) {
161-
Button {
162-
showSettings = true
163-
} label: {
164-
Label(
165-
title: { Text(Localization.settings) },
166-
icon: { Image(systemName: "gearshape") }
167-
)
168-
}
169-
}
17090

17191
if featureFlags.isFeatureFlagEnabled(.pointOfSaleHistoricalOrdersi1) {
17292
Button {
@@ -228,31 +148,6 @@ private extension POSFloatingControlView {
228148
"The action is confirmed in a modal."
229149
)
230150

231-
static let getSupport = NSLocalizedString(
232-
"pointOfSale.floatingButtons.getSupport.button.title",
233-
value: "Get Support",
234-
comment: "The title of the menu button to get support for Point of Sale, shown in a popover menu."
235-
)
236-
237-
static let viewDocumentation = NSLocalizedString(
238-
"pointOfSale.floatingButtons.viewDocumentation.button.title",
239-
value: "Documentation",
240-
comment: "The title of the menu button to read Point of Sale documentation, shown in a popover menu."
241-
)
242-
243-
static let productRestrictionsInfo = NSLocalizedString(
244-
"pointOfSale.floatingButtons.productRestrictionsInfo.button.title",
245-
value: "Where are my products?",
246-
comment: "The title of the menu button to view product restrictions info, shown in a popover menu. " +
247-
"We only show simple and variable products in POS, this shows a modal to help explain that limitation."
248-
)
249-
250-
static let barcodeScanningSetup = NSLocalizedString(
251-
"pointOfSale.floatingButtons.barcodeScanningSetup.button.title",
252-
value: "Initial barcode scanner setup",
253-
comment: "The title of the menu button to start a barcode scanner setup flow."
254-
)
255-
256151
static let settings = NSLocalizedString(
257152
"pointOfSale.floatingButtons.settings.button.title",
258153
value: "Settings",

0 commit comments

Comments
 (0)