Skip to content

Commit 0c26781

Browse files
committed
Merge branch 'trunk' into issue/17845-move-add-new-insight-card
2 parents 14953bb + 9fc374b commit 0c26781

14 files changed

Lines changed: 317 additions & 136 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -eu
2+
3+
# FIXIT-13.1: Temporary fix until we're on the Xcode 13.1 VM
4+
echo "--- :rubygems: Fixing Ruby Setup"
5+
gem install bundler
6+
7+
echo "--- :arrow_down: Installing Release Dependencies"
8+
brew update # Update homebrew to temporarily fix a bintray issue
9+
brew install imagemagick
10+
brew install ghostscript
11+
12+
echo "--- :rubygems: Setting up Gems"
13+
install_gems
14+
15+
echo "--- :cocoapods: Setting up Pods"
16+
install_cocoapods
17+
18+
echo "--- :closed_lock_with_key: Installing Secrets"
19+
bundle exec fastlane run configure_apply
20+
21+
echo "--- :hammer_and_wrench: Building"
22+
bundle exec fastlane build_and_upload_jetpack_for_app_store
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -eu
2+
3+
# FIXIT-13.1: Temporary fix until we're on the Xcode 13.1 VM
4+
echo "--- :rubygems: Fixing Ruby Setup"
5+
gem install bundler
6+
7+
echo "--- :arrow_down: Installing Release Dependencies"
8+
brew update # Update homebrew to temporarily fix a bintray issue
9+
brew install imagemagick
10+
brew install ghostscript
11+
12+
echo "--- :rubygems: Setting up Gems"
13+
install_gems
14+
15+
echo "--- :cocoapods: Setting up Pods"
16+
install_cocoapods
17+
18+
echo "--- :closed_lock_with_key: Installing Secrets"
19+
bundle exec fastlane run configure_apply
20+
21+
echo "--- :hammer_and_wrench: Building"
22+
bundle exec fastlane build_and_upload_app_center skip_confirm:true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -eu
2+
3+
# FIXIT-13.1: Temporary fix until we're on the Xcode 13.1 VM
4+
echo "--- :rubygems: Fixing Ruby Setup"
5+
gem install bundler
6+
7+
echo "--- :arrow_down: Installing Release Dependencies"
8+
brew update # Update homebrew to temporarily fix a bintray issue
9+
brew install imagemagick
10+
brew install ghostscript
11+
12+
echo "--- :rubygems: Setting up Gems"
13+
install_gems
14+
15+
echo "--- :cocoapods: Setting up Pods"
16+
install_cocoapods
17+
18+
echo "--- :closed_lock_with_key: Installing Secrets"
19+
bundle exec fastlane run configure_apply
20+
21+
echo "--- :hammer_and_wrench: Building"
22+
bundle exec fastlane build_and_upload_app_store_connect skip_confirm:true create_gh_release:true

.buildkite/release-builds.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This pipeline is meant to be run via the Buildkite API, and is only used for release builds
2+
3+
# Nodes with values to reuse in the pipeline.
4+
common_params:
5+
# Common plugin settings to use with the `plugins` key.
6+
- &common_plugins
7+
- automattic/bash-cache#v1.5.0
8+
- automattic/git-s3-cache#v1.1.0:
9+
bucket: "a8c-repo-mirrors"
10+
repo: "wordpress-mobile/wordpress-ios/"
11+
# Common environment values to use with the `env` key.
12+
- &common_env
13+
IMAGE_ID: xcode-13
14+
15+
steps:
16+
17+
- label: "🛠 WordPress Release Build (App Store Connect)"
18+
command: ".buildkite/commands/release-build-wordpress.sh"
19+
env: *common_env
20+
plugins: *common_plugins
21+
notify:
22+
- slack: "#build-and-ship"
23+
24+
- label: "🛠 WordPress Release Build (App Center)"
25+
command: ".buildkite/commands/release-build-wordpress-internal.sh"
26+
env: *common_env
27+
plugins: *common_plugins
28+
notify:
29+
- slack: "#build-and-ship"
30+
31+
- label: "🛠 Jetpack Release Build (App Store Connect)"
32+
command: ".buildkite/commands/release-build-jetpack.sh"
33+
env: *common_env
34+
plugins: *common_plugins
35+
notify:
36+
- slack: "#build-and-ship"

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ abstract_target 'Apps' do
169169
## Gutenberg (React Native)
170170
## =====================
171171
##
172-
gutenberg :tag => 'v1.71.0-alpha2'
172+
gutenberg :tag => 'v1.71.0'
173173

174174
## Third party libraries
175175
## =====================

Podfile.lock

Lines changed: 99 additions & 99 deletions
Large diffs are not rendered by default.

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-----
33
* [*] Site creation: Fixed bug where sites created within the app were not given the correct time zone, leading to post scheduling issues. [#17821]
44
* [*] Block editor: Replacing the media for an image set as featured prompts to update the featured image [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3930]
5+
* [***] Block editor: Font size and line-height support for text-based blocks used in block-based themes [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4519]
56
* [**] Some of the screens of the app has a new, fresh and more modern visual, including the initial one: My Site. [#17812]
67
* [**] Notifications: added a button to mark all notifications in the selected filter as read. [#17840]
78
* [**] People: you can now manage Email Followers on the People section! [#17854]

WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ typedef NS_ENUM(NSUInteger, ReaderCommentsSource) {
3131
/// Navigates to the specified comment when the view appears
3232
@property (nonatomic, strong) NSNumber *navigateToCommentID;
3333

34+
35+
// Comment moderation support.
36+
@property (nonatomic, assign, readwrite) BOOL commentModified;
37+
- (void)refreshAfterCommentModeration;
38+
3439
@end

WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.m

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ - (void)viewDidLoad
144144
{
145145
[super viewDidLoad];
146146
self.view.backgroundColor = [UIColor murielBasicBackground];
147+
self.commentModified = NO;
147148

148149
[self checkIfLoggedIn];
149150

@@ -195,6 +196,11 @@ - (void)viewWillDisappear:(BOOL)animated
195196
{
196197
[super viewWillDisappear:animated];
197198
[self dismissNotice];
199+
200+
if (self.commentModified) {
201+
// Don't post the notification until the view is being dismissed to avoid purging cached comments prematurely.
202+
[self postCommentModifiedNotification];
203+
}
198204

199205
#pragma clang diagnostic push
200206
#pragma clang diagnostic ignored "-Wunused-result"
@@ -933,6 +939,12 @@ - (void)refreshNoResultsView
933939
[self.noResultsViewController didMoveToParentViewController:self];
934940
}
935941

942+
- (void)refreshAfterCommentModeration
943+
{
944+
[self.tableViewHandler refreshTableView];
945+
[self refreshNoResultsView];
946+
}
947+
936948
- (void)updateTableViewForAttachments
937949
{
938950
[self.tableView performBatchUpdates:nil completion:nil];
@@ -1199,9 +1211,11 @@ - (NSFetchRequest *)fetchRequest
11991211
return nil;
12001212
}
12011213

1202-
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:NSStringFromClass([Comment class])];
1203-
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"post = %@", self.post];
1214+
// Moderated comments could still be cached, so filter out non-approved comments.
1215+
NSString *approvedStatus = [Comment descriptionFor:CommentStatusTypeApproved];
12041216

1217+
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:NSStringFromClass([Comment class])];
1218+
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"post = %@ AND status = %@", self.post, approvedStatus];
12051219
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"hierarchy" ascending:YES];
12061220
[fetchRequest setSortDescriptors:@[sortDescriptor]];
12071221

@@ -1225,12 +1239,6 @@ - (void)configureCell:(UITableViewCell *)aCell atIndexPath:(NSIndexPath *)indexP
12251239
}
12261240

12271241
Comment *comment = [self.tableViewHandler.resultsController objectAtIndexPath:indexPath];
1228-
// The user may have moderated a comment, but it is not removed from the post yet.
1229-
// So check the status to be sure only Approved comments are displayed.
1230-
if (![comment.status isEqualToString:[Comment descriptionFor:CommentStatusTypeApproved]]) {
1231-
return;
1232-
}
1233-
12341242
if ([self newCommentThreadEnabled]) {
12351243
CommentContentTableViewCell *cell = (CommentContentTableViewCell *)aCell;
12361244
[self configureContentCell:cell comment:comment indexPath:indexPath handler:self.tableViewHandler];
@@ -1290,8 +1298,6 @@ - (void)configureCell:(UITableViewCell *)aCell atIndexPath:(NSIndexPath *)indexP
12901298
};
12911299
}
12921300

1293-
1294-
12951301
NSAttributedString *attrStr = [self cacheContentForComment:comment];
12961302
[cell configureCellWithComment:comment attributedString:attrStr];
12971303
}

WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ extension NSNotification.Name {
142142
WPAnalytics.trackReader(.readerArticleCommentsOpened, properties: properties)
143143
}
144144

145+
// MARK: - Notification
146+
147+
@objc func postCommentModifiedNotification() {
148+
NotificationCenter.default.post(name: .ReaderCommentModifiedNotification, object: nil)
149+
}
150+
145151
}
146152

147153
// MARK: - Popover Presentation Delegate
@@ -190,13 +196,13 @@ private extension ReaderCommentsViewController {
190196
return [
191197
[
192198
.unapprove { [weak self] in
193-
self?.moderateComment(comment, status: .pending, handler: handler)
199+
self?.moderateComment(comment, status: .pending)
194200
},
195201
.spam { [weak self] in
196-
self?.moderateComment(comment, status: .spam, handler: handler)
202+
self?.moderateComment(comment, status: .spam)
197203
},
198204
.trash { [weak self] in
199-
self?.moderateComment(comment, status: .unapproved, handler: handler)
205+
self?.moderateComment(comment, status: .unapproved)
200206
}
201207
],
202208
[
@@ -223,7 +229,7 @@ private extension ReaderCommentsViewController {
223229
CommentAnalytics.trackCommentEdited(comment: comment)
224230

225231
self?.commentService.uploadComment(comment, success: {
226-
NotificationCenter.default.post(name: .ReaderCommentModifiedNotification, object: nil)
232+
self?.commentModified = true
227233

228234
// update the thread again in case the approval status changed.
229235
tableView.reloadRows(at: [indexPath], with: .automatic)
@@ -237,23 +243,18 @@ private extension ReaderCommentsViewController {
237243
present(navigationControllerToPresent, animated: true)
238244
}
239245

240-
func moderateComment(_ comment: Comment, status: CommentStatusType, handler: WPTableViewHandler) {
246+
func moderateComment(_ comment: Comment, status: CommentStatusType) {
241247
let successBlock: (String) -> Void = { [weak self] noticeText in
242-
NotificationCenter.default.post(name: .ReaderCommentModifiedNotification, object: nil)
243-
244-
// Adjust the ReaderPost's comment count.
245-
if let post = self?.post, let commentCount = post.commentCount?.intValue {
246-
let adjustment = (status == .approved) ? 1 : -1
247-
post.commentCount = NSNumber(value: commentCount + adjustment)
248-
}
248+
self?.commentModified = true
249+
self?.refreshAfterCommentModeration()
249250

250-
// Refresh the UI. The table view handler is needed because the fetched results delegate is set to nil.
251-
handler.refreshTableViewPreservingOffset()
251+
// Dismiss any old notices to avoid stacked Undo notices.
252+
self?.dismissNotice()
252253

253254
// If the status is Approved, the user has undone a comment moderation.
254255
// So don't show the Undo option in this case.
255256
(status == .approved) ? self?.displayNotice(title: noticeText) :
256-
self?.showActionableNotice(title: noticeText, comment: comment, handler: handler)
257+
self?.showActionableNotice(title: noticeText, comment: comment)
257258
}
258259

259260
switch status {
@@ -288,12 +289,12 @@ private extension ReaderCommentsViewController {
288289
}
289290
}
290291

291-
func showActionableNotice(title: String, comment: Comment, handler: WPTableViewHandler) {
292+
func showActionableNotice(title: String, comment: Comment) {
292293
displayActionableNotice(title: title,
293294
actionTitle: .undoActionTitle,
294295
actionHandler: { [weak self] _ in
295296
// Set the Comment's status back to Approved when the user selects Undo on the notice.
296-
self?.moderateComment(comment, status: .approved, handler: handler)
297+
self?.moderateComment(comment, status: .approved)
297298
})
298299
}
299300

0 commit comments

Comments
 (0)