diff --git a/Experiments/Experiments/DefaultFeatureFlagService.swift b/Experiments/Experiments/DefaultFeatureFlagService.swift index c8fbce41199..b8f4d81f5d6 100644 --- a/Experiments/Experiments/DefaultFeatureFlagService.swift +++ b/Experiments/Experiments/DefaultFeatureFlagService.swift @@ -60,8 +60,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService { case .applicationPasswordAuthenticationForSiteCredentialLogin: // Enable this to test application password authentication (WIP) return false - case .generateAllVariations: - return buildConfig == .localDeveloper || buildConfig == .alpha case .productsBulkEditing: return buildConfig == .localDeveloper || buildConfig == .alpha case .domainSettings: diff --git a/Experiments/Experiments/FeatureFlag.swift b/Experiments/Experiments/FeatureFlag.swift index 661b17da974..741d029a352 100644 --- a/Experiments/Experiments/FeatureFlag.swift +++ b/Experiments/Experiments/FeatureFlag.swift @@ -142,10 +142,6 @@ public enum FeatureFlag: Int { /// case applicationPasswordAuthenticationForSiteCredentialLogin - /// Allows merchants to create all variations from a single button - /// - case generateAllVariations - /// Bulk editing of status and price in products list /// case productsBulkEditing diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 72b7323eec5..3f9a4f77274 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -2,6 +2,7 @@ 11.9 ----- +- [**] Now you can generate all possible variations for a product's attributes [https://github.com/woocommerce/woocommerce-ios/pull/8619] - [*] Mobile payments: fixed card reader manuals links. [https://github.com/woocommerce/woocommerce-ios/pull/8628] 11.8 diff --git a/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateAllVariationsUseCase.swift b/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateAllVariationsUseCase.swift index 493dd9aad06..b68e180b20b 100644 --- a/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateAllVariationsUseCase.swift +++ b/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateAllVariationsUseCase.swift @@ -58,11 +58,11 @@ final class GenerateAllVariationsUseCase { onStateChanged(.creating) self.createVariationsRemotely(for: product, variations: variationsToGenerate) { result in switch result { - case .success(let generatedVariations): + case .success(let allVariations): // Updates the current product with the up-to-date list of variations IDs. // This is needed in order to reflect variations count changes back to other screens. - let updatedProduct = product.copy(variations: product.variations + generatedVariations.map { $0.productVariationID }) + let updatedProduct = product.copy(variations: allVariations.map { $0.productVariationID }) onStateChanged(.finished(true, updatedProduct)) case .failure(let error): diff --git a/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateVariationsOptionPresenter.swift b/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateVariationsOptionPresenter.swift index d8057b8ff24..1bba0a77660 100644 --- a/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateVariationsOptionPresenter.swift +++ b/WooCommerce/Classes/ViewRelated/Products/Variations/GenerateVariationsOptionPresenter.swift @@ -28,10 +28,6 @@ final class GenerateVariationsOptionsPresenter { /// Displays a bottom sheet allowing the merchant to choose whether to generate one variation or to generate all variations. /// func presentGenerationOptions(sourceView: UIView, onCompletion: @escaping (_ selectedOption: Option) -> Void) { - guard ServiceLocator.featureFlagService.isFeatureFlagEnabled(.generateAllVariations) else { - return onCompletion(.single) - } - let viewProperties = BottomSheetListSelectorViewProperties(title: Localization.addVariationAction) let command = GenerateVariationsSelectorCommand(selected: nil) { [analytics, baseViewController] option in baseViewController.dismiss(animated: true) diff --git a/WooCommerce/Classes/ViewRelated/Products/Variations/ProductVariationsViewController.swift b/WooCommerce/Classes/ViewRelated/Products/Variations/ProductVariationsViewController.swift index 4220e99fe96..09c5994c720 100644 --- a/WooCommerce/Classes/ViewRelated/Products/Variations/ProductVariationsViewController.swift +++ b/WooCommerce/Classes/ViewRelated/Products/Variations/ProductVariationsViewController.swift @@ -284,8 +284,7 @@ private extension ProductVariationsViewController { // private extension ProductVariationsViewController { func configureTopStackView() { - let title = featureFlagService.isFeatureFlagEnabled(.generateAllVariations) ? Localization.addVariationAction : Localization.generateVariationAction - addTopButton(title: title, + addTopButton(title: Localization.generateVariationAction, insets: .init(top: 16, left: 16, bottom: 8, right: 16), hasBottomBorder: true, actionSelector: #selector(addButtonTapped), diff --git a/Yosemite/Yosemite/Stores/ProductVariationStore.swift b/Yosemite/Yosemite/Stores/ProductVariationStore.swift index 70b1d8afadc..30f1071ae08 100644 --- a/Yosemite/Yosemite/Stores/ProductVariationStore.swift +++ b/Yosemite/Yosemite/Stores/ProductVariationStore.swift @@ -168,6 +168,7 @@ private extension ProductVariationStore { } /// Bulk creates the provided array of product variations. + /// Returns all product variations on it's completion block. /// func createProductVariations(siteID: Int64, productID: Int64,