Skip to content

Commit abaff29

Browse files
committed
Fix: #4847 - Changed progress view title and message for saving variation
1 parent 7e8d0aa commit abaff29

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductFormViewController+Helpers.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ extension ProductFormViewController {
8484
// MARK: - Progress
8585

8686
/// Progress view for save action.
87+
///
8788
func showSavingProgress(_ messageType: SaveMessageType) {
8889
switch messageType {
8990
case .publish:

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductFormViewController.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,15 @@ private extension ProductFormViewController {
617617
//
618618
private extension ProductFormViewController {
619619
func saveProduct(status: ProductStatus? = nil) {
620-
let productStatus = status ?? product.status
620+
var productStatus = status ?? product.status
621+
622+
// Set productStatus to custom type for saving a variation
623+
// This will change Progress view title and message for variation save action.
624+
// Fix for the issue: https://github.com/woocommerce/woocommerce-ios/issues/4847
625+
if let _ = self.viewModel.productionVariationID {
626+
productStatus = .custom("variation")
627+
}
628+
621629
let messageType = viewModel.saveMessageType(for: productStatus)
622630
showSavingProgress(messageType)
623631
saveImagesAndProductRemotely(status: status)

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductFormViewModelProtocol.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ extension ProductFormViewModelProtocol {
153153

154154
/// Returns `.publish` when the product does not exists remotely and it's gonna be published for the first time.
155155
/// Returns `.publish` when the product is going to be published from a different status (eg: from draft).
156+
/// Returns `.saveVariation` when saving a variation
156157
/// Returns `.save` for any other case.
157158
///
158159
func saveMessageType(for productStatus: ProductStatus) -> SaveMessageType {

0 commit comments

Comments
 (0)