Skip to content

Commit f3f719e

Browse files
committed
Merge branch 'trunk' of github.com:wordpress-mobile/WordPress-iOS into task/site-image-size
2 parents 26b430b + 07b1ae8 commit f3f719e

24 files changed

+74
-19
lines changed

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ abstract_target 'Apps' do
218218

219219
pod 'NSURL+IDN', '~> 0.4'
220220

221-
pod 'WPMediaPicker', '~> 1.8.4'
221+
pod 'WPMediaPicker', '~> 1.8.7-beta.1'
222222
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :tag => '1.7.0'
223223
## while PR is in review:
224224
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :branch => ''

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ PODS:
512512
- CocoaLumberjack (~> 3.4)
513513
- FormatterKit/TimeIntervalFormatter (~> 1.8)
514514
- WordPressUI (1.12.5)
515-
- WPMediaPicker (1.8.6)
515+
- WPMediaPicker (1.8.7-beta.1)
516516
- wpxmlrpc (0.9.0)
517517
- Yoga (1.14.0)
518518
- ZendeskCommonUISDK (6.1.2)
@@ -605,7 +605,7 @@ DEPENDENCIES:
605605
- WordPressKit (>= 4.58.2, ~> 4.58)
606606
- WordPressShared (~> 1.18.0)
607607
- WordPressUI (~> 1.12.5)
608-
- WPMediaPicker (~> 1.8.4)
608+
- WPMediaPicker (~> 1.8.7-beta.1)
609609
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.0/third-party-podspecs/Yoga.podspec.json`)
610610
- ZendeskSupportSDK (= 5.3.0)
611611
- ZIPFoundation (~> 0.9.8)
@@ -868,7 +868,7 @@ SPEC CHECKSUMS:
868868
WordPressKit: d8bc00bce09273fc241cf171b0e61ef8f4f29479
869869
WordPressShared: e5a479220643f46dc4d7726ef8dd45f18bf0c53b
870870
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
871-
WPMediaPicker: 749ebfa75fb2b6df4f5e5d9d0847e9512ad74d28
871+
WPMediaPicker: 59135aebb058a95a507045f93e478516729e5c0f
872872
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
873873
Yoga: 2ca978c40e0fd6d7f54bcb1602bc0cbbc79454a7
874874
ZendeskCommonUISDK: 5f0a83f412e07ae23701f18c412fe783b3249ef5
@@ -880,6 +880,6 @@ SPEC CHECKSUMS:
880880
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
881881
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37
882882

883-
PODFILE CHECKSUM: 879b8a4d9da3b3bad6cfed2de24977912ce560b0
883+
PODFILE CHECKSUM: 936784ec2e9d8246acccd6b123c0ba5b1b6e13b9
884884

885885
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
21.2
22
-----
33
* [*] [internal] Refactored fetching posts in the Reader tab. [#19539]
4-
4+
* [*] Fixed an issue where the message "No media matching your search" for the media picker is not visible [#19555]
55

66
21.1
77
-----

WordPress/Classes/ViewRelated/Views/NoResultsViewController.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ import Reachability
9898
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
9999
super.viewWillTransition(to: size, with: coordinator)
100100
setAccessoryViewsVisibility()
101-
}
102-
103-
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
101+
// `traitCollectionDidChange` is not fired for iOS 16.0 + Media adding flow. The reason why the constraints update call was moved to here.
102+
// Since `viewWillTransition` is always called when the orientation changes (portrait | landscape), it will work for all scenarios.
104103
DispatchQueue.main.async {
105104
self.configureTitleViewConstraints()
106105
}
@@ -481,12 +480,13 @@ private extension NoResultsViewController {
481480
let titleLabelTopConstraint = titleLabelTopConstraint else {
482481
return
483482
}
484-
483+
titleLabelTopConstraint.constant = TitleLabelConstraints.topLandscape
485484
NSLayoutConstraint.activate([titleLabelTopConstraint, titleLabelMaxWidthConstraint, titleLabelCenterXConstraint])
486485
}
487486
}
488487

489488
func resetTitleViewConstraints() {
489+
titleLabelTopConstraint?.isActive = false
490490
titleLabelTrailingConstraint?.isActive = false
491491
titleLabelLeadingConstraint?.isActive = false
492492
titleLabelMaxWidthConstraint?.isActive = false
@@ -517,6 +517,7 @@ private extension NoResultsViewController {
517517

518518
struct TitleLabelConstraints {
519519
static let top = CGFloat(64)
520+
static let topLandscape = CGFloat(32)
520521
static let leading = CGFloat(38)
521522
static let trailing = CGFloat(-38)
522523
static let maxWidth = CGFloat(360)

WordPress/Jetpack/JetpackDebug.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<array>
1313
<string>webcredentials:wordpress.com</string>
1414
<string>applinks:apps.wordpress.com</string>
15+
<string>applinks:wordpress.com</string>
16+
<string>applinks:public-api.wordpress.com</string>
17+
<string>applinks:links.wp.a8cmail.com</string>
18+
<string>applinks:*.wordpress.com</string>
1519
</array>
1620
<key>com.apple.security.application-groups</key>
1721
<array>

WordPress/Jetpack/JetpackRelease-Alpha.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<array>
99
<string>webcredentials:wordpress.com</string>
1010
<string>applinks:apps.wordpress.com</string>
11+
<string>applinks:wordpress.com</string>
12+
<string>applinks:public-api.wordpress.com</string>
13+
<string>applinks:links.wp.a8cmail.com</string>
14+
<string>applinks:*.wordpress.com</string>
1115
</array>
1216
<key>com.apple.security.application-groups</key>
1317
<array>

WordPress/Jetpack/JetpackRelease-Internal.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<array>
99
<string>webcredentials:wordpress.com</string>
1010
<string>applinks:apps.wordpress.com</string>
11+
<string>applinks:wordpress.com</string>
12+
<string>applinks:public-api.wordpress.com</string>
13+
<string>applinks:links.wp.a8cmail.com</string>
14+
<string>applinks:*.wordpress.com</string>
1115
</array>
1216
<key>com.apple.security.application-groups</key>
1317
<array>

WordPress/Jetpack/JetpackRelease.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<array>
1313
<string>webcredentials:wordpress.com</string>
1414
<string>applinks:apps.wordpress.com</string>
15+
<string>applinks:wordpress.com</string>
16+
<string>applinks:public-api.wordpress.com</string>
17+
<string>applinks:links.wp.a8cmail.com</string>
18+
<string>applinks:*.wordpress.com</string>
1519
</array>
1620
<key>com.apple.security.application-groups</key>
1721
<array>

WordPress/WordPressTest/ViewRelated/Views/Controllers/NoResultsViewControllerTests.swift

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class NoResultsViewControllerTests: XCTestCase {
1010
This is a long Text. This is a long Text. This is a long Text. This is a long Text. This is a long Text.
1111
This is a long Text. This is a long Text. This is a long Text. This is a long Text. This is a long Text.
1212
"""
13+
static let noResultsText = "No media matching your search"
1314
static let iPhoneSeSize = CGSize(width: 320, height: 568)
1415
static let iPadProSize = CGSize(width: 1024, height: 1366)
1516
static let resultViewMaxWidth: CGFloat = 360
@@ -20,13 +21,13 @@ class NoResultsViewControllerTests: XCTestCase {
2021
private var parentViewController: UIViewController!
2122

2223
override func setUpWithError() throws {
23-
self.resultViewController = NoResultsViewController.controller()
24-
self.parentViewController = UIViewController()
24+
resultViewController = NoResultsViewController.controller()
25+
parentViewController = UIViewController()
2526
}
2627

2728
override func tearDownWithError() throws {
28-
self.resultViewController = nil
29-
self.parentViewController = nil
29+
resultViewController = nil
30+
parentViewController = nil
3031
}
3132

3233
func testTitleLabelWidthForLongTextInSmallScreen() {
@@ -91,6 +92,20 @@ class NoResultsViewControllerTests: XCTestCase {
9192
XCTAssertTrue(resultViewController.subtitleTextView.frame.width <= Constants.resultViewMaxWidth)
9293
}
9394

95+
func testTitleLabelWidthForNoSearchResults() {
96+
// Given
97+
let parentViewSize = Constants.iPadProSize
98+
parentViewController.view.frame = CGRect(origin: .zero, size: parentViewSize)
99+
100+
// When
101+
resultViewController.configureForNoSearchResults(title: Constants.noResultsText)
102+
addResultViewControllerToParent()
103+
104+
// Then
105+
XCTAssertEqual(resultViewController.titleLabel.text, Constants.noResultsText)
106+
XCTAssertTrue(resultViewController.noResultsView.isHidden)
107+
XCTAssertLessThanOrEqual(resultViewController.titleLabel.frame.width, parentViewSize.width)
108+
}
94109
}
95110

96111
private extension NoResultsViewControllerTests {

config/Version.internal.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
VERSION_SHORT=21.1
22

33
// Internal long version example: VERSION_LONG=9.9.0.20180423
4-
VERSION_LONG=21.1.0.20221109
4+
VERSION_LONG=21.1.0.20221111

0 commit comments

Comments
 (0)