Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -118,7 +118,7 @@ struct ProductBarcodeSetupInformation: View {
private var productSetupTextWithLink: AttributedString {
let mainContent = Localization.productBarcodeSetupMessage
let linkText = Localization.productBarcodeSetupLinkText
let link = Constants.detailsLink?.absoluteString ?? ""
let link = Constants.detailsLink.absoluteString

let content = String.localizedStringWithFormat(mainContent, linkText)
var attributedText = AttributedString(content)
Expand All @@ -136,7 +136,7 @@ struct ProductBarcodeSetupInformation: View {
}

private enum Constants {
static let detailsLink = URL(string: "https://woocommerce.com/document/barcode-and-qr-code-scanner/")
static let detailsLink = WooConstants.URLs.pointOfSaleBarcodeScannerDocumentation.asURL()
}

private enum Localization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
PointOfSaleBarcodeScannerSetup(isPresented: $showBarcodeScanningSetupModal)
}
.posFullScreenCover(isPresented: $showBarcodeScanningDocumentationModal) {
SafariView(url: WooConstants.URLs.pointOfSaleDocumentation.asURL())
SafariView(url: WooConstants.URLs.pointOfSaleBarcodeScannerDocumentation.asURL())
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions WooCommerce/Classes/System/WooConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ extension WooConstants {
///
case pointOfSaleDocumentation = "https://woocommerce.com/document/woo-mobile-app-point-of-sale-mode/"

/// URL for Point of Sale's barcode scanner documentation
///
case pointOfSaleBarcodeScannerDocumentation = "https://woocommerce.com/document/barcode-and-qr-code-scanner/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: from Povilas's effort to modularize POS, I wonder if we could separate the POS constants so that the POS code isn't dependent on the constants enums that are mostly used in the store management part of the app.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out, I've made a POSConstants on 2990f6b which copies the current usage of WooConstants, and moved the 2 documentation links we use for settings along with 4bb6fc5

Most likely we'll want to copy over as well the links regarding IPP, but I'll leave it out for the moment.


/// Temporary redirect URL for authenticated web view when authenticating WPCom automatically
///
case wpcomTempRedirectURL = "https://wordpress.com/mobile-redirect"
Expand Down