From 769ab260ef52c7310d18dc53df9cc2a2e4c0c93e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 29 May 2023 15:24:52 +1000 Subject: [PATCH 1/4] Use WordPress-UI version 1.13 and above, resolves to 1.13.0 --- Podfile | 2 +- Podfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Podfile b/Podfile index 1051f46696d..41766883435 100644 --- a/Podfile +++ b/Podfile @@ -90,7 +90,7 @@ target 'WooCommerce' do wordpress_shared - pod 'WordPressUI', '~> 1.12.5' + pod 'WordPressUI', '~> 1.13-beta' # pod 'WordPressUI', :git => 'https://github.com/wordpress-mobile/WordPressUI-iOS.git', :branch => '' aztec diff --git a/Podfile.lock b/Podfile.lock index 78ea5da9043..4aa7212824b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -54,7 +54,7 @@ PODS: - WordPressShared (~> 2.0-beta) - wpxmlrpc (~> 0.10) - WordPressShared (2.1.0) - - WordPressUI (1.12.5) + - WordPressUI (1.13.0) - Wormholy (1.6.6) - WPMediaPicker (1.8.1) - wpxmlrpc (0.10.0) @@ -85,7 +85,7 @@ DEPENDENCIES: - WordPress-Editor-iOS (~> 1.11.0) - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, branch `trunk`) - WordPressShared (~> 2.1) - - WordPressUI (~> 1.12.5) + - WordPressUI (~> 1.13-beta) - Wormholy (~> 1.6.6) - WPMediaPicker (~> 1.8.1) - ZendeskSupportSDK (~> 6.0) @@ -161,7 +161,7 @@ SPEC CHECKSUMS: WordPressAuthenticator: 8a27a3c61ca0d740df66f260902aa2ca8528c61b WordPressKit: b65a51863982d8166897bea8b753f1fc51732aad WordPressShared: 0aa459e5257a77184db87805a998f447443c9706 - WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac + WordPressUI: 9951bdade87c8c64b50535aaed2a53a11d0c52ee Wormholy: 09da0b876f9276031fd47383627cb75e194fc068 WPMediaPicker: 9011a0ec1f468c039af7485c244576b4c9889a0f wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd @@ -173,6 +173,6 @@ SPEC CHECKSUMS: ZendeskSupportProvidersSDK: 685b5d185af47ced0ec40564ec46355c838bbd06 ZendeskSupportSDK: 92e6f9d334e81e9186f8a17583862350460a5393 -PODFILE CHECKSUM: 7ef16ee777d45b27a6ea41073fce0a707bda17a7 +PODFILE CHECKSUM: 08c354d1c2b7fcbef3508c1931f343661f463f8e COCOAPODS: 1.11.3 From 4248796510f88676b419d2631c4d7b43f0438e16 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 29 May 2023 15:25:52 +1000 Subject: [PATCH 2/4] Configure `PrivacyBannerViewController` to not be dismissable --- .../Settings/Privacy/PrivacyBannerViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift index 42ea09f345a..ec6c3c1e844 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift @@ -7,6 +7,12 @@ import WordPressUI /// final class PrivacyBannerViewController: UIHostingController { + // These are part of the `DrawerPresentable` protocol. + // We define them here instead than in the existing extension that defines the protocol conformance so that we can make the stored constants. + // Otherwise, since extensions don't allow for stored properties, they would have had to be computed vars. + let allowsTapToDismiss = false + let allowsDragToDismiss = false + /// Tracks the banner view intrinsic height. /// Needed to enable it's scrolling when it grows bigger than the screen. /// From 41c68ef7f6fe8c84cbc8226fe1bc56301b931521 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 29 May 2023 15:26:41 +1000 Subject: [PATCH 3/4] Remove no longer needed workaround to block privacy banner dismissal Superseded by the changes in 7c1deb93812812582618984c84670284a176148a and 729e70da2eee3f18e26ab7359a33e177745497e0 --- .../Settings/Privacy/PrivacyBannerPresenter.swift | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift index 52d42c94b7c..2274313b29d 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift @@ -100,15 +100,3 @@ extension PrivacyBannerPresenter { static let retry = NSLocalizedString("Retry", comment: "Retry title on the notice action button") } } - -extension BottomSheetViewController { - /// Temporary hack to prevent the `PrivacyBannerViewController` to be dismissed. - /// This should be changed once https://github.com/wordpress-mobile/WordPressUI-iOS/pull/126 is merged. - /// - public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { - if children.first is PrivacyBannerViewController { - return - } - super.dismiss(animated: flag, completion: completion) - } -} From 88ed395e79e327b1f715895c0d337cde32afe86b Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 31 May 2023 20:44:51 +1000 Subject: [PATCH 4/4] Set `allowsUserTransition` to `false` for privacy banner --- .../Privacy/PrivacyBannerViewController.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift index ec6c3c1e844..5e9ba3ca7d9 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerViewController.swift @@ -7,12 +7,6 @@ import WordPressUI /// final class PrivacyBannerViewController: UIHostingController { - // These are part of the `DrawerPresentable` protocol. - // We define them here instead than in the existing extension that defines the protocol conformance so that we can make the stored constants. - // Otherwise, since extensions don't allow for stored properties, they would have had to be computed vars. - let allowsTapToDismiss = false - let allowsDragToDismiss = false - /// Tracks the banner view intrinsic height. /// Needed to enable it's scrolling when it grows bigger than the screen. /// @@ -49,6 +43,11 @@ extension PrivacyBannerViewController: DrawerPresentable { var expandedHeight: DrawerHeight { return .contentHeight(bannerIntrinsicHeight) } + + // We want the user to dimiss this only by completing the flow, not by tapping, dragging, or collapsing. + var allowsDragToDismiss: Bool { false } + var allowsTapToDismiss: Bool { false } + var allowsUserTransition: Bool { false } } /// Banner View for the privacy settings.