Skip to content

Commit 0539180

Browse files
committed
Merge branch 'trunk' into feature/18375-update_wpkit
2 parents aefb059 + cfeca95 commit 0539180

22 files changed

+184
-122
lines changed

Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def wordpress_ui
4747
end
4848

4949
def wordpress_kit
50-
# pod 'WordPressKit', '~> 4.51.0'
50+
pod 'WordPressKit', '~> 4.52.0-beta'
5151
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => ''
52-
pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => 'feature/18375-fix_prompt_date'
52+
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
5353
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => ''
5454
# pod 'WordPressKit', :path => '../WordPressKit-iOS'
5555
end
@@ -210,7 +210,7 @@ abstract_target 'Apps' do
210210

211211
pod 'NSURL+IDN', '~> 0.4'
212212

213-
pod 'WPMediaPicker', '~> 1.8.3'
213+
pod 'WPMediaPicker', '~> 1.8.4-beta.1'
214214
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :tag => '1.7.0'
215215
## while PR is in review:
216216
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :branch => ''

Podfile.lock

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ PODS:
499499
- CocoaLumberjack (~> 3.4)
500500
- FormatterKit/TimeIntervalFormatter (~> 1.8)
501501
- WordPressUI (1.12.5)
502-
- WPMediaPicker (1.8.3)
502+
- WPMediaPicker (1.8.4-beta.1)
503503
- wpxmlrpc (0.9.0)
504504
- Yoga (1.14.0)
505505
- ZendeskCommonUISDK (6.1.2)
@@ -591,18 +591,19 @@ DEPENDENCIES:
591591
- SVProgressHUD (= 2.2.5)
592592
- WordPress-Editor-iOS (~> 1.19.8)
593593
- WordPressAuthenticator (~> 2.0.0)
594-
- WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, branch `feature/18375-fix_prompt_date`)
594+
- WordPressKit (~> 4.52.0-beta)
595595
- WordPressMocks (~> 0.0.15)
596596
- WordPressShared (~> 1.17.1)
597597
- WordPressUI (~> 1.12.5)
598-
- WPMediaPicker (~> 1.8.3)
598+
- WPMediaPicker (~> 1.8.4-beta.1)
599599
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.75.0/third-party-podspecs/Yoga.podspec.json`)
600600
- ZendeskSupportSDK (= 5.3.0)
601601
- ZIPFoundation (~> 0.9.8)
602602

603603
SPEC REPOS:
604604
https://github.com/wordpress-mobile/cocoapods-specs.git:
605605
- WordPressAuthenticator
606+
- WordPressKit
606607
trunk:
607608
- Alamofire
608609
- AlamofireImage
@@ -752,9 +753,6 @@ EXTERNAL SOURCES:
752753
:git: https://github.com/wordpress-mobile/gutenberg-mobile.git
753754
:submodules: true
754755
:tag: v1.75.0
755-
WordPressKit:
756-
:branch: feature/18375-fix_prompt_date
757-
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git
758756
Yoga:
759757
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.75.0/third-party-podspecs/Yoga.podspec.json
760758

@@ -770,9 +768,6 @@ CHECKOUT OPTIONS:
770768
:git: https://github.com/wordpress-mobile/gutenberg-mobile.git
771769
:submodules: true
772770
:tag: v1.75.0
773-
WordPressKit:
774-
:commit: 954576e0f99cd598eb8f093308f89e967d44453f
775-
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git
776771

777772
SPEC CHECKSUMS:
778773
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
@@ -858,11 +853,11 @@ SPEC CHECKSUMS:
858853
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
859854
WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345
860855
WordPressAuthenticator: 5163f732e4e529781f931f158f54b1a1545bc536
861-
WordPressKit: 1af05d9ab2a434290be54b091094e54af081fc58
856+
WordPressKit: cc1e5b12e92232d977664682ac69110852fc4ce7
862857
WordPressMocks: 6b52b0764d9939408151367dd9c6e8a910877f4d
863858
WordPressShared: 0c4bc5e25765732fcf5d07f28c81970ab28493fb
864859
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
865-
WPMediaPicker: 0f4f20c7f661b46d33283f1ac2adceb98718fffa
860+
WPMediaPicker: 547b19abb9361a0a70ac7df4399502b3d59f1f3b
866861
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
867862
Yoga: 2ca978c40e0fd6d7f54bcb1602bc0cbbc79454a7
868863
ZendeskCommonUISDK: 5f0a83f412e07ae23701f18c412fe783b3249ef5
@@ -874,6 +869,6 @@ SPEC CHECKSUMS:
874869
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
875870
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37
876871

877-
PODFILE CHECKSUM: 655bca8e1838d45b018f7ff12fcfde786b1bdf1a
872+
PODFILE CHECKSUM: d7bc9c0d041c5f2d6e109c77b2bf02d28f5f81c0
878873

879874
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
19.9
22
-----
3-
3+
* [*] Site Settings: we fixed an issue that prevented the site title to be updated when it changed in Site Settings [#18543]
4+
* [*] Media Picker: Fixed an issue where the empty state view was being displayed incorrectly. [#18471]
45

56
19.8
67
-----
Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,11 @@
1-
21
extension Post {
32

4-
func prepareForPrompt(_ prompt: Prompt?) {
3+
func prepareForPrompt(_ prompt: BloggingPrompt?) {
54
guard let prompt = prompt else {
65
return
76
}
8-
postTitle = prompt.postTitle
9-
let pullquoteBlock = getPullquoteBlock(title: prompt.promptText,
10-
promptUrl: prompt.promptUrl?.absoluteString,
11-
answerUrl: prompt.answerUrl?.absoluteString,
12-
answerCount: prompt.answerCount)
13-
content = pullquoteBlock + Strings.emptyParagraph
7+
postTitle = prompt.title
8+
content = prompt.content
149
}
1510

1611
}
17-
18-
// MARK: - Private methods
19-
20-
private extension Post {
21-
22-
func getPullquoteBlock(title: String,
23-
promptUrl: String?,
24-
answerUrl: String?,
25-
answerCount: Int) -> String {
26-
let answerFormat = answerCount == 1 ? Strings.answerInfoSingularFormat : Strings.answerInfoPluralFormat
27-
let answerText = String(format: answerFormat, answerCount)
28-
let promptUrlHtml = getUrlHtml(url: promptUrl, urlText: Strings.prompt)
29-
let answerUrlHtml = getUrlHtml(url: answerUrl, urlText: answerText)
30-
let separatorText = promptUrlHtml.isEmpty || answerUrlHtml.isEmpty ? "" : ""
31-
let subtitleHtml = promptUrlHtml.isEmpty && answerUrlHtml.isEmpty ? "" : "<cite>\(promptUrlHtml)\(separatorText)\(answerUrlHtml)</cite>"
32-
return """
33-
<!-- wp:pullquote -->
34-
<figure class="wp-block-pullquote"><blockquote><p>\(title)</p>\(subtitleHtml)</blockquote></figure>
35-
<!-- /wp:pullquote -->
36-
"""
37-
}
38-
39-
func getUrlHtml(url: String?, urlText: String) -> String {
40-
guard let url = url else {
41-
return ""
42-
}
43-
return "<a href=\"\(url)\">\(urlText)</a>"
44-
}
45-
46-
// MARK: - Strings
47-
48-
struct Strings {
49-
static let prompt = NSLocalizedString("Prompt", comment: "Prompt link text in a new blogging prompts post")
50-
static let answerInfoSingularFormat = NSLocalizedString("%1$d answer", comment: "Singular format string for displaying the number of users that answered the blogging prompt.")
51-
static let answerInfoPluralFormat = NSLocalizedString("%1$d answers", comment: "Plural format string for displaying the number of users that answered the blogging prompt.")
52-
static let emptyParagraph = """
53-
<!-- wp:paragraph -->
54-
<p></p>
55-
<!-- /wp:paragraph -->
56-
"""
57-
}
58-
59-
}
60-
61-
// MARK: - Temporary prompt object
62-
63-
// TODO: Remove after prompt object is created and use that
64-
struct Prompt {
65-
let postTitle: String
66-
let promptText: String
67-
let promptUrl: URL?
68-
let answerUrl: URL?
69-
let answerCount: Int
70-
71-
static let examplePrompt = Prompt(postTitle: "Cast the movie of my life",
72-
promptText: "Cast the movie of your life.",
73-
promptUrl: URL(string: "https://wordpress.com"),
74-
answerUrl: URL(string: "https://wordpress.com"),
75-
answerCount: 19)
76-
}

WordPress/Classes/Services/BloggingPromptsService.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ struct BloggingPrompt {
7575
let displayAvatarURLs: [URL]
7676
let attribution: String
7777

78+
static let examplePrompt = BloggingPrompt(
79+
promptID: 239,
80+
text: "Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.",
81+
title: "Prompt number 1",
82+
content: "<!-- wp:pullquote -->\n<figure class=\"wp-block-pullquote\"><blockquote><p>Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.</p><cite>(courtesy of plinky.com)</cite></blockquote></figure>\n<!-- /wp:pullquote -->",
83+
date: Date(),
84+
answered: false,
85+
answerCount: 5,
86+
displayAvatarURLs: []
87+
)
88+
}
89+
90+
extension BloggingPrompt {
7891
init(with remotePrompt: RemoteBloggingPrompt) {
7992
promptID = remotePrompt.promptID
8093
text = remotePrompt.text

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ final class BlogDashboardViewController: UIViewController {
164164
switch element {
165165
case .setupQuickStart, .removeQuickStart:
166166
self.loadCardsFromCache()
167-
case .stats:
167+
case .stats, .mediaScreen:
168168
if self.embeddedInScrollView {
169169
self.mySiteScrollView?.scrollToTop(animated: true)
170170
} else {

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Quick Actions/DashboardQuickActionsCardCell.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,23 @@ extension DashboardQuickActionsCardCell {
138138
let element = info[QuickStartTourGuide.notificationElementKey] as? QuickStartTourElement {
139139

140140
switch element {
141-
case .noSuchElement:
142-
self?.statsButton.shouldShowSpotlight = false
143141
case .stats:
144142
guard QuickStartTourGuide.shared.entryPointForCurrentTour == .blogDashboard else {
145143
return
146144
}
147145

148-
self?.statsButton.shouldShowSpotlight = true
149146
self?.autoScrollToStatsButton()
147+
case .mediaScreen:
148+
guard QuickStartTourGuide.shared.entryPointForCurrentTour == .blogDashboard else {
149+
return
150+
}
151+
152+
self?.autoScrollToMediaButton()
150153
default:
151154
break
152155
}
156+
self?.statsButton.shouldShowSpotlight = element == .stats
157+
self?.mediaButton.shouldShowSpotlight = element == .mediaScreen
153158
}
154159
}
155160
}
@@ -161,6 +166,10 @@ extension DashboardQuickActionsCardCell {
161166
private func autoScrollToStatsButton() {
162167
scrollView.scrollHorizontallyToView(statsButton, animated: true)
163168
}
169+
170+
private func autoScrollToMediaButton() {
171+
scrollView.scrollHorizontallyToView(mediaButton, animated: true)
172+
}
164173
}
165174

166175
extension DashboardQuickActionsCardCell {

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+FancyAlerts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension BlogDetailsViewController {
1515

1616
if let info = notification.userInfo?[QuickStartTourGuide.notificationElementKey] as? QuickStartTourElement {
1717
switch info {
18-
case .stats:
18+
case .stats, .mediaScreen:
1919
guard QuickStartTourGuide.shared.entryPointForCurrentTour == .blogDetails else {
2020
return
2121
}

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ typedef NS_ENUM(NSInteger, QuickStartTourElement) {
7373
QuickStartTourElementNotifications = 22,
7474
QuickStartTourElementSetupQuickStart = 23,
7575
QuickStartTourElementRemoveQuickStart = 24,
76+
QuickStartTourElementMediaScreen = 25,
77+
QuickStartTourElementMediaUpload = 26,
7678
};
7779

7880
typedef NS_ENUM(NSUInteger, BlogDetailsNavigationSource) {

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ - (BlogDetailsSection *)publishTypeSectionViewModel
900900
callback:^{
901901
[weakSelf showMediaLibraryFromSource:BlogDetailsNavigationSourceRow];
902902
}];
903+
mediaRow.quickStartIdentifier = QuickStartTourElementMediaScreen;
903904
[rows addObject:mediaRow];
904905

905906
BlogDetailsRow *pagesRow = [[BlogDetailsRow alloc] initWithTitle:NSLocalizedString(@"Pages", @"Noun. Title. Links to the blog's Pages screen.")
@@ -1437,7 +1438,7 @@ - (void)showMediaLibraryFromSource:(BlogDetailsNavigationSource)source
14371438
controller.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
14381439
[self showDetailViewController:controller sender:self];
14391440

1440-
[[QuickStartTourGuide shared] visited:QuickStartTourElementBlogDetailNavigation];
1441+
[[QuickStartTourGuide shared] visited:QuickStartTourElementMediaScreen];
14411442
}
14421443

14431444
- (void)showPeople

0 commit comments

Comments
 (0)