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
8 changes: 8 additions & 0 deletions Modules/Sources/Yosemite/Stores/ProductStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ public enum ProductUpdateError: Error, Equatable {
case duplicatedSKU
case invalidSKU
case invalidGlobalUniqueIdentifier
case invalidOrDuplicatedGlobalUniqueID
case passwordCannotBeUpdated
case notFoundInStorage
case variationInvalidImageId
Expand All @@ -1394,6 +1395,7 @@ public enum ProductUpdateError: Error, Equatable {

private enum ErrorCode: String {
case invalidSKU = "product_invalid_sku"
case invalidOrDuplicatedGlobalUniqueID = "product_invalid_global_unique_id"
case variationInvalidImageId = "woocommerce_variation_invalid_image_id"
case invalidMaxQuantity = "woocommerce_rest_invalid_max_quantity"
case invalidMinQuantity = "woocommerce_rest_invalid_min_quantity"
Expand All @@ -1408,6 +1410,8 @@ public enum ProductUpdateError: Error, Equatable {
return .variationInvalidImageId
case .invalidMaxQuantity, .invalidMinQuantity, .invalidVariationMaxQuantity, .invalidVariationMinQuantity:
return .generic(message: message ?? "")
case .invalidOrDuplicatedGlobalUniqueID:
return .invalidOrDuplicatedGlobalUniqueID
}
}
}
Expand All @@ -1426,6 +1430,10 @@ extension ProductUpdateError: LocalizedError {
return NSLocalizedString("productInventorySettings.invalidGlobalUniqueIdentifier.error",
value: "Please enter only numbers and hyphens (-).",
comment: "The message of the alert when there is an error updating the product global unique identifier")
case .invalidOrDuplicatedGlobalUniqueID:
return NSLocalizedString("productInventorySettings.error.invalidOrDuplicatedGlobalUniqueID",
value: "Invalid or duplicated GTIN, UPC, EAN or ISBN.",
comment: "Error message when saving an invalid or duplicated product global unique ID")
case .generic(let message):
return message
case .unknown(let error):
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
23.3
-----
- [*] Order details: Display only physical items in the Shipping Labels section. [https://github.com/woocommerce/woocommerce-ios/pull/16127]
- [*] Product form: Display user-friendly error message when saving duplicated GTIN/UPC/EAN/ISBN. [https://github.com/woocommerce/woocommerce-ios/pull/16146]
- [internal] Address deprecated view modifiers usage following iOS17 API updates [https://github.com/woocommerce/woocommerce-ios/pull/16080]
- [internal] POS Modularization: Removed direct ServiceLocator usage within POS by requiring complex Woo app target dependencies to be injected via POS dependency protocols, and moved reusable dependencies to WooFoundation and Yosemite [https://github.com/woocommerce/woocommerce-ios/pull/16132]

Expand Down
Loading