Skip to content

Commit 91de24f

Browse files
committed
Merge branch 'trunk' of github.com:wordpress-mobile/WordPress-iOS into feature/image-block-replace-featured-image-prompt
2 parents 7c69a00 + c27ea7c commit 91de24f

File tree

118 files changed

+3998
-2000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3998
-2000
lines changed

Podfile

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

4949
def wordpress_kit
50-
pod 'WordPressKit', '~> 4.46.0-beta'
50+
pod 'WordPressKit', '~> 4.46.0'
5151
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => ''
5252
# 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 => ''
@@ -210,15 +210,15 @@ abstract_target 'Apps' do
210210

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

213-
pod 'WPMediaPicker', '~> 1.8.2-beta.2'
213+
pod 'WPMediaPicker', '~> 1.8.2'
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 => ''
217217
# pod 'WPMediaPicker', :path => '../MediaPicker-iOS'
218218

219219
pod 'Gridicons', '~> 1.1.0'
220220

221-
pod 'WordPressAuthenticator', '~> 1.43.0-beta.2'
221+
pod 'WordPressAuthenticator', '~> 1.43.0'
222222
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
223223
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
224224
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'

Podfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ PODS:
454454
- WordPress-Aztec-iOS (1.19.7)
455455
- WordPress-Editor-iOS (1.19.7):
456456
- WordPress-Aztec-iOS (= 1.19.7)
457-
- WordPressAuthenticator (1.43.0-beta.2):
457+
- WordPressAuthenticator (1.43.0):
458458
- Alamofire (~> 4.8)
459459
- CocoaLumberjack (~> 3.5)
460460
- GoogleSignIn (~> 6.0.1)
@@ -465,7 +465,7 @@ PODS:
465465
- WordPressKit (~> 4.18-beta)
466466
- WordPressShared (~> 1.12-beta)
467467
- WordPressUI (~> 1.7-beta)
468-
- WordPressKit (4.46.0-beta.2):
468+
- WordPressKit (4.46.0):
469469
- Alamofire (~> 4.8.0)
470470
- CocoaLumberjack (~> 3.4)
471471
- NSObject-SafeExpectations (= 0.0.4)
@@ -477,7 +477,7 @@ PODS:
477477
- CocoaLumberjack (~> 3.4)
478478
- FormatterKit/TimeIntervalFormatter (~> 1.8)
479479
- WordPressUI (1.12.3)
480-
- WPMediaPicker (1.8.2-beta.2)
480+
- WPMediaPicker (1.8.2)
481481
- wpxmlrpc (0.9.0)
482482
- Yoga (1.14.0)
483483
- ZendeskCommonUISDK (6.1.1)
@@ -568,20 +568,19 @@ DEPENDENCIES:
568568
- Starscream (= 3.0.6)
569569
- SVProgressHUD (= 2.2.5)
570570
- WordPress-Editor-iOS (~> 1.19.7)
571-
- WordPressAuthenticator (~> 1.43.0-beta.2)
572-
- WordPressKit (~> 4.46.0-beta)
571+
- WordPressAuthenticator (~> 1.43.0)
572+
- WordPressKit (~> 4.46.0)
573573
- WordPressMocks (~> 0.0.15)
574574
- WordPressShared (~> 1.17.0)
575575
- WordPressUI (~> 1.12.3)
576-
- WPMediaPicker (~> 1.8.2-beta.2)
576+
- WPMediaPicker (~> 1.8.2)
577577
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/5132ac0f6f7c7f7c100b4a8b7d327f27961b7ceb/third-party-podspecs/Yoga.podspec.json`)
578578
- ZendeskSupportSDK (= 5.3.0)
579579
- ZIPFoundation (~> 0.9.8)
580580

581581
SPEC REPOS:
582582
https://github.com/wordpress-mobile/cocoapods-specs.git:
583583
- WordPressAuthenticator
584-
- WordPressKit
585584
trunk:
586585
- Alamofire
587586
- AlamofireImage
@@ -620,6 +619,7 @@ SPEC REPOS:
620619
- UIDeviceIdentifier
621620
- WordPress-Aztec-iOS
622621
- WordPress-Editor-iOS
622+
- WordPressKit
623623
- WordPressMocks
624624
- WordPressShared
625625
- WordPressUI
@@ -832,12 +832,12 @@ SPEC CHECKSUMS:
832832
UIDeviceIdentifier: d0fee204f467dacf8808b7ac14ce43affeb271a5
833833
WordPress-Aztec-iOS: 144f124148079084860368dfd27cb96e0952853e
834834
WordPress-Editor-iOS: 20551d5a5e51f29832064f08faaaae8e1da7e1e2
835-
WordPressAuthenticator: 0b3423546d92a976e3ce627d2e5a0350716b1f5b
836-
WordPressKit: e623ffb39b2b9d7730a9be63e26fa77929e6e43b
835+
WordPressAuthenticator: e4a43745a647e4dc4b35d21b1353bc4f07f9f3c9
836+
WordPressKit: 67cc1b0bda0d114c806a631ad726027d535d28a8
837837
WordPressMocks: 6b52b0764d9939408151367dd9c6e8a910877f4d
838838
WordPressShared: a4b0308a6345d4dda20c8f7ad9317df4246b4a00
839839
WordPressUI: 45591178e843ecb82e65e868ec766148befe9f9f
840-
WPMediaPicker: 95682a64d24d2a1de4e140e7da68da79030f8173
840+
WPMediaPicker: a34b708a7b995a0889bd5098e3b79f4a50a7a9bd
841841
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
842842
Yoga: 2ca978c40e0fd6d7f54bcb1602bc0cbbc79454a7
843843
ZendeskCommonUISDK: 5808802951ad2bb424f0bed4259dc3c0ce9b52ec
@@ -849,6 +849,6 @@ SPEC CHECKSUMS:
849849
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
850850
ZIPFoundation: e27423c004a5a1410c15933407747374e7c6cb6e
851851

852-
PODFILE CHECKSUM: bf128ac50c388099d5660ce06a507c04de42e5ca
852+
PODFILE CHECKSUM: f0253ef8904609003e5d16045c019f65547ab80d
853853

854854
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
19.2
22
-----
33
* [*] 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]
4+
* [**] Some of the screens of the app has a new, fresh and more modern visual, including the initial one: My Site. [#17812]
5+
46

57
19.1
68
-----

WordPress/Classes/Utility/ImmuTableViewController.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ final class ImmuTableViewController: UITableViewController, ImmuTablePresenter {
5959

6060
// MARK: - Table View Controller
6161

62+
init(controller: ImmuTableController, style: UITableView.Style) {
63+
self.controller = controller
64+
super.init(style: style)
65+
66+
title = controller.title
67+
registerRows(controller.immuTableRows)
68+
controller.refreshModel()
69+
}
70+
6271
init(controller: ImmuTableController) {
6372
self.controller = controller
6473
super.init(style: .grouped)

WordPress/Classes/Utility/WPImmuTableRows.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ struct EditableTextRow: ImmuTableRow {
9393
func configureCell(_ cell: UITableViewCell) {
9494
cell.textLabel?.text = title
9595
cell.detailTextLabel?.text = value
96+
cell.accessibilityLabel = title
97+
cell.accessibilityValue = value
98+
if cell.isUserInteractionEnabled {
99+
cell.accessibilityHint = NSLocalizedString("Tap to edit", comment: "Accessibility hint prompting the user to tap a table row to edit its value.")
100+
}
96101
cell.accessoryType = .disclosureIndicator
97102
if accessoryImage != nil {
98103
cell.accessoryView = UIImageView(image: accessoryImage)
@@ -129,6 +134,9 @@ struct TextRow: ImmuTableRow {
129134
func configureCell(_ cell: UITableViewCell) {
130135
cell.textLabel?.text = title
131136
cell.detailTextLabel?.text = value
137+
cell.accessibilityLabel = title
138+
cell.accessibilityValue = value
139+
132140
cell.selectionStyle = .none
133141

134142
WPStyleGuide.configureTableViewCell(cell)

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsSectionHeaderView.xib

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
77
<capability name="Named colors" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -15,7 +15,7 @@
1515
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1616
<subviews>
1717
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OEo-2z-Cmk">
18-
<rect key="frame" x="273" y="0.0" width="44" height="36"/>
18+
<rect key="frame" x="260" y="0.0" width="44" height="36"/>
1919
<accessibility key="accessibilityConfiguration" label="More menu"/>
2020
<constraints>
2121
<constraint firstAttribute="width" constant="44" id="NQj-8B-nY9"/>
@@ -26,7 +26,7 @@
2626
</connections>
2727
</button>
2828
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DATE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eUE-Sb-m3L">
29-
<rect key="frame" x="16" y="0.0" width="32.5" height="36"/>
29+
<rect key="frame" x="36" y="0.0" width="32.5" height="36"/>
3030
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
3131
<fontDescription key="fontDescription" type="system" pointSize="13"/>
3232
<color key="textColor" name="Gray50"/>
@@ -35,9 +35,9 @@
3535
</subviews>
3636
<color key="backgroundColor" red="0.9137254901960784" green="0.93725490196078431" blue="0.95294117647058818" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3737
<constraints>
38-
<constraint firstAttribute="trailingMargin" secondItem="OEo-2z-Cmk" secondAttribute="trailing" constant="-13" id="EWN-SE-Ilb"/>
38+
<constraint firstAttribute="leadingMargin" secondItem="eUE-Sb-m3L" secondAttribute="leading" constant="-20" id="Bi6-N7-44O"/>
39+
<constraint firstAttribute="trailingMargin" secondItem="OEo-2z-Cmk" secondAttribute="trailing" id="EWN-SE-Ilb"/>
3940
<constraint firstAttribute="bottom" secondItem="eUE-Sb-m3L" secondAttribute="bottom" id="ILT-ul-3i5"/>
40-
<constraint firstItem="eUE-Sb-m3L" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leadingMargin" id="LH1-C3-ah6"/>
4141
<constraint firstAttribute="bottom" secondItem="OEo-2z-Cmk" secondAttribute="bottom" id="a35-Lf-TpM"/>
4242
<constraint firstItem="eUE-Sb-m3L" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="oHh-OB-AWn"/>
4343
</constraints>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ extension BlogDetailsViewController {
99
return BlogDetailHeaderView(items: actionItems)
1010
}
1111

12+
@objc func configureQuickActions(cell: QuickActionsCell) {
13+
let actionItems = createActionItems()
14+
15+
cell.configure(with: actionItems)
16+
}
17+
1218
@objc
1319
func showSiteTitleSettings() {
1420
let hint = blog.isAdmin ? SiteTitleStrings.siteTitleHint : SiteTitleStrings.notAnAdminHint
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import UIKit
2+
3+
extension BlogDetailsViewController {
4+
@objc func quickActionsSectionViewModel() -> BlogDetailsSection {
5+
let row = BlogDetailsRow()
6+
row.callback = {}
7+
return BlogDetailsSection(title: nil,
8+
rows: [row],
9+
footerTitle: nil,
10+
category: .quickAction)
11+
}
12+
13+
@objc func isAccessibilityCategoryEnabled() -> Bool {
14+
tableView.traitCollection.preferredContentSizeCategory.isAccessibilityCategory
15+
}
16+
}
17+
18+
@objc class QuickActionsCell: UITableViewCell {
19+
private var actionRow: ActionRow!
20+
21+
func configure(with items: [ActionRow.Item]) {
22+
guard actionRow == nil else {
23+
return
24+
}
25+
26+
actionRow = ActionRow(items: items)
27+
contentView.addSubview(actionRow)
28+
29+
setupConstraints()
30+
setupCell()
31+
}
32+
33+
private func setupConstraints() {
34+
actionRow.translatesAutoresizingMaskIntoConstraints = false
35+
36+
let widthConstraint = actionRow.widthAnchor.constraint(equalToConstant: Constants.maxQuickActionsWidth)
37+
widthConstraint.priority = .defaultHigh
38+
39+
NSLayoutConstraint.activate([
40+
actionRow.topAnchor.constraint(equalTo: contentView.topAnchor),
41+
actionRow.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
42+
actionRow.leadingAnchor.constraint(greaterThanOrEqualTo: contentView.leadingAnchor),
43+
actionRow.centerXAnchor.constraint(equalTo: contentView.centerXAnchor),
44+
widthConstraint
45+
])
46+
}
47+
48+
private func setupCell() {
49+
selectionStyle = .none
50+
}
51+
52+
private enum Constants {
53+
static let maxQuickActionsWidth: CGFloat = 390
54+
}
55+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ typedef NS_ENUM(NSUInteger, BlogDetailsSectionCategory) {
1515
BlogDetailsSectionCategoryPersonalize,
1616
BlogDetailsSectionCategoryConfigure,
1717
BlogDetailsSectionCategoryExternal,
18-
BlogDetailsSectionCategoryRemoveSite
18+
BlogDetailsSectionCategoryRemoveSite,
19+
BlogDetailsSectionCategoryQuickAction
1920
};
2021

2122
typedef NS_ENUM(NSUInteger, BlogDetailsSubsection) {

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
static NSString *const BlogDetailsPlanCellIdentifier = @"BlogDetailsPlanCell";
2323
static NSString *const BlogDetailsSettingsCellIdentifier = @"BlogDetailsSettingsCell";
2424
static NSString *const BlogDetailsRemoveSiteCellIdentifier = @"BlogDetailsRemoveSiteCell";
25+
static NSString *const BlogDetailsQuickActionsCellIdentifier = @"BlogDetailsQuickActionsCell";
2526
static NSString *const BlogDetailsSectionHeaderViewIdentifier = @"BlogDetailsSectionHeaderView";
2627
static NSString *const QuickStartHeaderViewNibName = @"BlogDetailsSectionHeaderView";
2728
static NSString *const QuickStartListTitleCellNibName = @"QuickStartListTitleCell";
@@ -326,7 +327,7 @@ - (void)viewDidLoad
326327
{
327328
[super viewDidLoad];
328329

329-
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
330+
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleInsetGrouped];
330331
self.tableView.delegate = self;
331332
self.tableView.dataSource = self;
332333
self.tableView.translatesAutoresizingMaskIntoConstraints = false;
@@ -346,6 +347,7 @@ - (void)viewDidLoad
346347
[self.tableView registerClass:[WPTableViewCellValue1 class] forCellReuseIdentifier:BlogDetailsPlanCellIdentifier];
347348
[self.tableView registerClass:[WPTableViewCellValue1 class] forCellReuseIdentifier:BlogDetailsSettingsCellIdentifier];
348349
[self.tableView registerClass:[WPTableViewCell class] forCellReuseIdentifier:BlogDetailsRemoveSiteCellIdentifier];
350+
[self.tableView registerClass:[QuickActionsCell class] forCellReuseIdentifier:BlogDetailsQuickActionsCellIdentifier];
349351
UINib *qsHeaderViewNib = [UINib nibWithNibName:QuickStartHeaderViewNibName bundle:[NSBundle bundleForClass:[QuickStartListTitleCell class]]];
350352
[self.tableView registerNib:qsHeaderViewNib forHeaderFooterViewReuseIdentifier:BlogDetailsSectionHeaderViewIdentifier];
351353
UINib *qsTitleCellNib = [UINib nibWithNibName:QuickStartListTitleCellNibName bundle:[NSBundle bundleForClass:[QuickStartListTitleCell class]]];
@@ -751,6 +753,7 @@ - (void)configureTableViewData
751753
{
752754
NSMutableArray *marr = [NSMutableArray array];
753755

756+
[marr addObject:[self quickActionsSectionViewModel]];
754757
if ([DomainCreditEligibilityChecker canRedeemDomainCreditWithBlog:self.blog]) {
755758
if (!self.hasLoggedDomainCreditPromptShownEvent) {
756759
[WPAnalytics track:WPAnalyticsStatDomainCreditPromptShown];
@@ -1399,6 +1402,12 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
13991402
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
14001403
{
14011404
BlogDetailsSection *detailSection = [self.tableSections objectAtIndex:section];
1405+
1406+
/// For larger texts we don't show the quick actions row
1407+
if (detailSection.category == BlogDetailsSectionCategoryQuickAction && self.isAccessibilityCategoryEnabled) {
1408+
return 0;
1409+
}
1410+
14021411
return [detailSection.rows count];
14031412
}
14041413

@@ -1422,6 +1431,13 @@ - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPa
14221431
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
14231432
{
14241433
BlogDetailsSection *section = [self.tableSections objectAtIndex:indexPath.section];
1434+
1435+
if (section.category == BlogDetailsSectionCategoryQuickAction) {
1436+
QuickActionsCell *cell = [tableView dequeueReusableCellWithIdentifier:BlogDetailsQuickActionsCellIdentifier];
1437+
[self configureQuickActionsWithCell: cell];
1438+
return cell;
1439+
}
1440+
14251441
BlogDetailsRow *row = [section.rows objectAtIndex:indexPath.row];
14261442
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:row.identifier];
14271443
cell.accessibilityHint = row.accessibilityHint;
@@ -1483,12 +1499,8 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
14831499
BlogDetailsSection *section = [self.tableSections objectAtIndex:sectionNum];
14841500
if (section.showQuickStartMenu) {
14851501
return [self quickStartHeaderWithTitle:section.title];
1486-
} else if (sectionNum == 0 && [self.blog supports:BlogFeatureJetpackSettings]) {
1487-
// Jetpack header shouldn't have any padding
1488-
BlogDetailsSectionHeaderView *headerView = (BlogDetailsSectionHeaderView *)[tableView dequeueReusableHeaderFooterViewWithIdentifier:BlogDetailsSectionHeaderViewIdentifier];
1489-
headerView.ellipsisButton.hidden = YES;
1490-
headerView.title = @"";
1491-
return headerView;
1502+
} else if (sectionNum == 0) {
1503+
return nil;
14921504
}
14931505

14941506
return nil;

0 commit comments

Comments
 (0)