Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ enum PointOfSaleBarcodeScannerType {
var analyticsName: String {
switch self {
case .starBSH20B:
return "Star_BSH_20B"
return "star_bsh_20b"
case .tera12002D:
return "Tera_1200_2D"
return "tera_1200_2d"
case .netum1228BC:
return "Netum_1228BC"
return "netum_1228bc"
case .other:
return "other"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ private extension PointOfSaleBarcodeScannerSetupCompleteView {
comment: "Title shown when scanner setup is successfully completed"
)
static let instruction = NSLocalizedString(
"pos.barcodeScannerSetup.complete.instruction",
value: "You are ready to start scanning products. \nRead more about barcode and QR code scanner support.",
comment: "Message shown when scanner setup is complete, with additional information link"
"pos.barcodeScannerSetup.complete.instruction.2",
value: "You are ready to start scanning products. Next time you need to connect your scanner, just turn it on and it will reconnect automatically.",
comment: "Message shown when scanner setup is complete"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ struct POSFloatingControlView: View {
ServiceLocator.analytics.track(.pointOfSaleBarcodeScanningMenuItemTapped)
} label: {
Label(
title: { Text(Localization.barcodeScanning) },
title: {
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.pointOfSaleBarcodeScanningi2) {
Text(Localization.barcodeScanningSetup)
} else {
Text(Localization.barcodeScanning)
}
},
icon: { Image(systemName: "barcode.viewfinder") })
}
}
Expand Down Expand Up @@ -173,6 +179,12 @@ private extension POSFloatingControlView {
value: "Barcode scanning",
comment: "The title of the menu button to view barcode scanner documentation, shown in a popover menu."
)

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."
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct PointOfSaleBarcodeScannerSetupFlowManagerTests {
// Then it tracks the scanner selected event
let event = mockAnalytics.events.first
#expect(event?.eventName == WooAnalyticsStat.pointOfSaleBarcodeScannerSetupScannerSelected.rawValue)
#expect(event?.properties["scanner"] as? String == "Star_BSH_20B")
#expect(event?.properties["scanner"] as? String == PointOfSaleBarcodeScannerType.starBSH20B.analyticsName)
}

@available(iOS 17.0, *)
Expand All @@ -42,7 +42,7 @@ struct PointOfSaleBarcodeScannerSetupFlowManagerTests {
// Then it tracks the dismissal event
let event = mockAnalytics.events.first
#expect(event?.eventName == WooAnalyticsStat.pointOfSaleBarcodeScannerSetupDismissed.rawValue)
#expect(event?.properties["scanner"] as? String == "Star_BSH_20B")
#expect(event?.properties["scanner"] as? String == PointOfSaleBarcodeScannerType.starBSH20B.analyticsName)
#expect(event?.properties["step"] as? String == "setup_barcode_hid")
}

Expand Down Expand Up @@ -84,7 +84,7 @@ struct PointOfSaleBarcodeScannerSetupFlowManagerTests {
// Then it tracks the scanner connected event
let event = mockAnalytics.events.first
#expect(event?.eventName == WooAnalyticsStat.pointOfSaleBarcodeScannerSetupScannerConnected.rawValue)
#expect(event?.properties["scanner"] as? String == "Netum_1228BC")
#expect(event?.properties["scanner"] as? String == PointOfSaleBarcodeScannerType.netum1228BC.analyticsName)
}

@available(iOS 17.0, *)
Expand Down