From 6d2753fa06de648a53a61285d4d5079e188bc8dc Mon Sep 17 00:00:00 2001 From: Huong Do Date: Wed, 2 Jul 2025 14:41:24 +0700 Subject: [PATCH 1/2] Enable done button even when no changes are made in payment settings --- .../ShippingLabelPaymentMethodsViewModel.swift | 2 +- .../WooShippingPaymentMethodsView.swift | 9 ++++++--- WooCommerce/WooCommerce.xcodeproj/project.pbxproj | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Payment Methods/ShippingLabelPaymentMethodsViewModel.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Payment Methods/ShippingLabelPaymentMethodsViewModel.swift index 8464c2b839e..7359f59498e 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Payment Methods/ShippingLabelPaymentMethodsViewModel.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Payment Methods/ShippingLabelPaymentMethodsViewModel.swift @@ -16,7 +16,7 @@ final class ShippingLabelPaymentMethodsViewModel: ObservableObject { /// Shipping Label account settings from the remote API /// - private var accountSettings: ShippingLabelAccountSettings + private(set) var accountSettings: ShippingLabelAccountSettings @Published var selectedPaymentMethodID: Int64 @Published var isEmailReceiptsEnabled: Bool diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShippingPaymentMethod/WooShippingPaymentMethodsView.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShippingPaymentMethod/WooShippingPaymentMethodsView.swift index a15d3bb42a0..555e5f594a9 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShippingPaymentMethod/WooShippingPaymentMethodsView.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShippingPaymentMethod/WooShippingPaymentMethodsView.swift @@ -62,12 +62,15 @@ struct WooShippingPaymentMethodsView: View { .toggleStyle(.switch) Button(Localization.confirmButton) { - Task { - await confirmPaymentMethod() + if viewModel.isDoneButtonEnabled() { + Task { + await confirmPaymentMethod() + } + } else { + onAccountSettingsUpdate(viewModel.accountSettings) } } .buttonStyle(PrimaryLoadingButtonStyle(isLoading: viewModel.isUpdating)) - .disabled(viewModel.isDoneButtonEnabled() == false) } } } diff --git a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj index 044f13f6243..2f8d1bc777d 100644 --- a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj +++ b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj @@ -5704,7 +5704,7 @@ DE02ABBD2B578D0E008E0AC4 /* CreditCardType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreditCardType.swift; sourceTree = ""; }; DE02ABBF2B57D333008E0AC4 /* BlazeConfirmPaymentViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlazeConfirmPaymentViewModelTests.swift; sourceTree = ""; }; DE02ABC12B5903AB008E0AC4 /* BlazeCampaignCreationErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlazeCampaignCreationErrorView.swift; sourceTree = ""; }; - DE02B64E2E12766B00B79E0D /* CollapsibleShipmentItemCardViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CollapsibleShipmentItemCardViewModelTests.swift; path = "WooCommerceTests/ViewRelated/Shipping Label/WooShipping Create Shipping Labels/Split shipments/CollapsibleShipmentItemCardViewModelTests.swift"; sourceTree = ""; }; + DE02B64E2E12766B00B79E0D /* CollapsibleShipmentItemCardViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsibleShipmentItemCardViewModelTests.swift; sourceTree = ""; }; DE02C65B2D5A0B9F0089850D /* FailedProductImageCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FailedProductImageCollectionViewCell.swift; sourceTree = ""; }; DE02C65D2D5A0C5D0089850D /* FailedProductImageCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FailedProductImageCollectionViewCell.xib; sourceTree = ""; }; DE06D65F2D64699D00419FFA /* AuthenticatedWebViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticatedWebViewModelTests.swift; sourceTree = ""; }; @@ -10552,7 +10552,6 @@ B56DB3BD2049BFAA00D4AA8E = { isa = PBXGroup; children = ( - DE02B64E2E12766B00B79E0D /* CollapsibleShipmentItemCardViewModelTests.swift */, 3F3689E22DCB1B470065B48F /* Modules */, D8FBFF1622D4CC2F006E3336 /* docs */, 8CA4F6DC220B24EB00A47B5D /* config */, @@ -13975,6 +13974,7 @@ EEBB9B3E2D8FE5AC008D6CE5 /* Split shipments */ = { isa = PBXGroup; children = ( + DE02B64E2E12766B00B79E0D /* CollapsibleShipmentItemCardViewModelTests.swift */, EEBB9B3F2D8FE5B4008D6CE5 /* WooShippingSplitShipmentsViewModelTests.swift */, ); path = "Split shipments"; From 66bae3cbd9a692a93909dcc8fda85ab686e546e7 Mon Sep 17 00:00:00 2001 From: Huong Do Date: Wed, 2 Jul 2025 14:57:43 +0700 Subject: [PATCH 2/2] Update release notes --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0b3fb0221d2..ba93be880e6 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -6,6 +6,7 @@ - [*] Shipping Labels: Improve UI of Split shipments screen. [https://github.com/woocommerce/woocommerce-ios/pull/15838] - [*] POS: icon button with confirmation step used for clearing the cart [https://github.com/woocommerce/woocommerce-ios/pull/15829] - [*] Shipping Labels: Fixed a portion of layout issues caused by bigger accessibility content size categories. [https://github.com/woocommerce/woocommerce-ios/pull/15844] +- [*] Shipping Labels: Enable the confirm button on the payment method sheet even when there are no changes. [https://github.com/woocommerce/woocommerce-ios/pull/15856] 22.7 -----