Skip to content

Commit 6d9c7c1

Browse files
committed
Merge remote-tracking branch 'origin/develop' into issue/tableviewcell-extension
2 parents 82acc1a + f31cad4 commit 6d9c7c1

File tree

9 files changed

+115
-40
lines changed

9 files changed

+115
-40
lines changed

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ target 'WooCommerce' do
1818
#
1919
pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :tag => '0.2.3'
2020
pod 'Gridicons', '0.15'
21-
pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => '58ed623'
21+
pod 'WordPressAuthenticator', '~> 1.0'
2222

2323

2424
# External Libraries

Podfile.lock

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ PODS:
1313
- CocoaLumberjack/Default
1414
- CocoaLumberjack/Swift (3.4.2):
1515
- CocoaLumberjack/Default
16-
- Crashlytics (3.10.3):
17-
- Fabric (~> 1.7.8)
18-
- Fabric (1.7.8)
16+
- Crashlytics (3.10.4):
17+
- Fabric (~> 1.7.9)
18+
- Fabric (1.7.9)
1919
- FormatterKit/Resources (1.8.2)
2020
- FormatterKit/TimeIntervalFormatter (1.8.2):
2121
- FormatterKit/Resources
@@ -38,7 +38,7 @@ PODS:
3838
- Reachability (3.2)
3939
- SVProgressHUD (2.2.5)
4040
- UIDeviceIdentifier (0.5.0)
41-
- WordPressAuthenticator (1.0.0):
41+
- WordPressAuthenticator (1.0.1):
4242
- 1PasswordExtension (= 1.8.5)
4343
- Alamofire (= 4.7.2)
4444
- CocoaLumberjack (= 3.4.2)
@@ -62,7 +62,7 @@ PODS:
6262
- WordPressShared (1.0.8):
6363
- CocoaLumberjack (~> 3.4)
6464
- FormatterKit/TimeIntervalFormatter (= 1.8.2)
65-
- WordPressUI (1.0.5)
65+
- WordPressUI (1.0.6)
6666
- wpxmlrpc (0.8.3)
6767

6868
DEPENDENCIES:
@@ -72,7 +72,7 @@ DEPENDENCIES:
7272
- Crashlytics (~> 3.10)
7373
- Gridicons (= 0.15)
7474
- KeychainAccess (~> 3.1)
75-
- WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `58ed623`)
75+
- WordPressAuthenticator (~> 1.0)
7676

7777
SPEC REPOS:
7878
https://github.com/cocoapods/specs.git:
@@ -92,6 +92,7 @@ SPEC REPOS:
9292
- Reachability
9393
- SVProgressHUD
9494
- UIDeviceIdentifier
95+
- WordPressAuthenticator
9596
- WordPressKit
9697
- WordPressShared
9798
- WordPressUI
@@ -101,25 +102,19 @@ EXTERNAL SOURCES:
101102
Automattic-Tracks-iOS:
102103
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
103104
:tag: 0.2.3
104-
WordPressAuthenticator:
105-
:commit: 58ed623
106-
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
107105

108106
CHECKOUT OPTIONS:
109107
Automattic-Tracks-iOS:
110108
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
111109
:tag: 0.2.3
112-
WordPressAuthenticator:
113-
:commit: 58ed623
114-
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
115110

116111
SPEC CHECKSUMS:
117112
1PasswordExtension: 0e95bdea64ec8ff2f4f693be5467a09fac42a83d
118113
Alamofire: e4fa87002c137ba2d8d634d2c51fabcda0d5c223
119114
Automattic-Tracks-iOS: d8c6c6c1351b1905a73e45f431b15598d71963b5
120115
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
121-
Crashlytics: 2aea305161a2122492698c75af27f2b98aa49a25
122-
Fabric: fba4684a95df789565b0b27fc5b6e68f1755af32
116+
Crashlytics: 915a7787b84f635fb2a81f92a90e265c2c413f76
117+
Fabric: a2917d3895e4c1569b9c3170de7320ea1b1e6661
123118
FormatterKit: 4b8f29acc9b872d5d12a63efb560661e8f2e1b98
124119
GoogleSignInRepacked: d357702618c555f38923576924661325eb1ef22b
125120
GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
@@ -131,12 +126,12 @@ SPEC CHECKSUMS:
131126
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
132127
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
133128
UIDeviceIdentifier: a959a6d4f51036b4180dd31fb26483a820f1cc46
134-
WordPressAuthenticator: 4c802aa18781858253daf984f873e3efe0dac7ef
129+
WordPressAuthenticator: 60c07bcfb6f1578afaf17621ae4393d688c2ede9
135130
WordPressKit: a24baaa783c3a221f2d9a51c19318cbb27333373
136131
WordPressShared: 063e1e8b1a7aaf635abf17f091a2d235a068abdc
137-
WordPressUI: ab90086350f1e26bf39e578e443d0abf0347e542
132+
WordPressUI: af141587ec444f9af753a00605bd0d3f14d8d8a3
138133
wpxmlrpc: bfc572f62ce7ee897f6f38b098d2ba08732ecef4
139134

140-
PODFILE CHECKSUM: b0058ebc467be802babc234b85e02282da5d9d42
135+
PODFILE CHECKSUM: 60104ed4eaf82cee487f83818dceb80f392ce97f
141136

142137
COCOAPODS: 1.5.3

WooCommerce/Classes/AppDelegate.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,18 @@ private extension AppDelegate {
116116
UINavigationBar.appearance().isTranslucent = false
117117
UINavigationBar.appearance().tintColor = .white
118118
UIApplication.shared.statusBarStyle = .lightContent
119+
120+
UIButton.appearance().setTitleColor(StyleManager.wooCommerceBrandColor, for: .normal)
119121
}
120122

121123
/// Sets up FancyButton's UIAppearance.
122124
///
123125
func setupFancyButtonAppearance() {
124126
let appearance = FancyButton.appearance()
125-
appearance.titleFont = UIFont.font(forStyle: .headline, weight: .bold)
126127
appearance.primaryNormalBackgroundColor = StyleManager.buttonPrimaryColor
127128
appearance.primaryNormalBorderColor = StyleManager.buttonPrimaryHighlightedColor
128129
appearance.primaryHighlightBackgroundColor = StyleManager.buttonPrimaryHighlightedColor
129130
appearance.primaryHighlightBorderColor = StyleManager.buttonPrimaryHighlightedColor
130-
appearance.disabledBorderColor = StyleManager.buttonPrimaryHighlightedColor
131-
appearance.disabledBackgroundColor = StyleManager.buttonPrimaryHighlightedColor
132131
}
133132

134133
/// Sets up the WordPress Authenticator.

WooCommerce/Classes/Authentication/AuthenticationManager.swift

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,23 @@ class AuthenticationManager {
1919
googleLoginClientId: ApiCredentials.googleClientId,
2020
googleLoginServerClientId: ApiCredentials.googleServerId,
2121
googleLoginScheme: ApiCredentials.googleAuthScheme,
22-
userAgent: UserAgent.defaultUserAgent,
23-
supportNotificationIndicatorFeatureFlag: false)
24-
25-
WordPressAuthenticator.initialize(configuration: configuration)
22+
userAgent: UserAgent.defaultUserAgent)
23+
24+
let style = WordPressAuthenticatorStyle(primaryNormalBackgroundColor: StyleManager.buttonPrimaryColor,
25+
primaryNormalBorderColor: StyleManager.buttonPrimaryHighlightedColor,
26+
primaryHighlightBackgroundColor: StyleManager.buttonPrimaryHighlightedColor,
27+
primaryHighlightBorderColor: StyleManager.buttonPrimaryHighlightedColor,
28+
secondaryNormalBackgroundColor: StyleManager.buttonSecondaryColor,
29+
secondaryNormalBorderColor: StyleManager.buttonSecondaryHighlightedColor,
30+
secondaryHighlightBackgroundColor: StyleManager.buttonSecondaryHighlightedColor,
31+
secondaryHighlightBorderColor: StyleManager.buttonSecondaryHighlightedColor,
32+
disabledBackgroundColor: StyleManager.buttonDisabledColor,
33+
disabledBorderColor: StyleManager.buttonDisabledHighlightedColor,
34+
primaryTitleColor: StyleManager.buttonPrimaryTitleColor,
35+
secondaryTitleColor: StyleManager.buttonSecondaryTitleColor,
36+
disabledTitleColor: StyleManager.buttonDisabledTitleColor)
37+
38+
WordPressAuthenticator.initialize(configuration: configuration, style: style)
2639
WordPressAuthenticator.shared.delegate = self
2740
}
2841

@@ -58,6 +71,14 @@ class AuthenticationManager {
5871
// MARK: - WordPressAuthenticator Delegate
5972
//
6073
extension AuthenticationManager: WordPressAuthenticatorDelegate {
74+
func presentSupportRequest(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) {
75+
// TODO: wire Zendesk
76+
}
77+
78+
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) {
79+
// TODO: wire Zendesk
80+
}
81+
6182

6283
/// Indicates if the active Authenticator can be dismissed or not.
6384
///

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class StorePickerViewController: UIViewController {
1616
///
1717
@IBOutlet private var noResultsLabel: UILabel! {
1818
didSet {
19-
noResultsLabel.font = UIFont.font(forStyle: .subheadline, weight: .regular)
19+
noResultsLabel.font = StyleManager.subheadlineFont
2020
noResultsLabel.textColor = StyleManager.wooGreyTextMin
2121
}
2222
}
@@ -58,7 +58,7 @@ class StorePickerViewController: UIViewController {
5858

5959

6060

61-
// MARK: - Overriden Methods
61+
// MARK: - Overridden Methods
6262

6363
override func viewDidLoad() {
6464
super.viewDidLoad()

WooCommerce/Classes/Authentication/Prologue/LoginPrologueViewController.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ private extension LoginPrologueViewController {
8282
func setupDisclaimerLabel() {
8383
disclaimerTextView.attributedText = disclaimerAttributedText
8484
disclaimerTextView.textContainerInset = .zero
85+
disclaimerTextView.linkTextAttributes = [
86+
NSAttributedStringKey.foregroundColor.rawValue: StyleManager.wooCommerceBrandColor,
87+
NSAttributedStringKey.underlineColor.rawValue: StyleManager.wooCommerceBrandColor,
88+
NSAttributedStringKey.underlineStyle.rawValue: NSUnderlineStyle.styleSingle.rawValue
89+
]
8590
}
8691

8792
func setupLoginButton() {
@@ -118,8 +123,7 @@ extension LoginPrologueViewController {
118123
/// Proceeds with the Login Flow.
119124
///
120125
@IBAction func loginWasPressed() {
121-
let loginViewController = WordPressAuthenticator.signinForWordPress()
122-
loginViewController.restrictToWPCom = true
126+
let loginViewController = WordPressAuthenticator.signinForWPCom()
123127
loginViewController.offerSignupOption = false
124128

125129
navigationController?.pushViewController(loginViewController, animated: true)
@@ -136,14 +140,16 @@ private extension LoginPrologueViewController {
136140
///
137141
var disclaimerAttributedText: NSAttributedString {
138142
let disclaimerText = NSLocalizedString("This app requires Jetpack to be able to connect to your WooCommerce Store.\nRead the ", comment: "Login Disclaimer Text and Jetpack config instructions")
139-
let disclaimerAttributes: [NSAttributedStringKey: Any] = [
143+
let disclaimerAttributes: [NSAttributedStringKey: Any] = [
140144
.font: UIFont.font(forStyle: .caption1, weight: .thin),
141145
.foregroundColor: UIColor.black
142146
]
143147

144148
let readText = NSLocalizedString("configuration instructions", comment: "Login Disclaimer Linked Text")
145-
var readAttributes = disclaimerAttributes
146-
readAttributes[.link] = URL(string: WooConstants.jetpackSetupUrl)
149+
let readAttributes: [NSAttributedStringKey: Any] = [
150+
.link: URL(string: WooConstants.jetpackSetupUrl) as Any,
151+
.font: UIFont.font(forStyle: .caption1, weight: .thin)
152+
]
147153
let readAttrText = NSMutableAttributedString(string: readText, attributes: readAttributes)
148154

149155
let endSentenceText = "."

WooCommerce/Classes/Authentication/Prologue/LoginPrologueViewController.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="o29-Vv-KDs" userLabel="Container View">
3939
<rect key="frame" x="0.0" y="601.66666666666663" width="375" height="176.33333333333337"/>
4040
<subviews>
41-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6pL-xH-OzE" customClass="FancyButton" customModule="WordPressUI">
41+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6pL-xH-OzE" customClass="NUXButton" customModule="WordPressAuthenticator">
4242
<rect key="frame" x="20" y="106.33333333333337" width="335" height="50"/>
4343
<color key="backgroundColor" red="0.58823529409999997" green="0.34509803919999998" blue="0.54117647059999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4444
<constraints>

WooCommerce/Classes/Styles/Style.swift

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@ import UIKit
44
// MARK: - Style defines the basic API of a Woo Skin.
55
//
66
protocol Style {
7+
var alternativeLoginsTitleFont: UIFont { get }
78
var buttonPrimaryColor: UIColor { get }
89
var buttonPrimaryHighlightedColor: UIColor { get }
10+
var buttonPrimaryTitleColor: UIColor { get }
11+
var buttonSecondaryColor: UIColor { get }
12+
var buttonSecondaryHighlightedColor: UIColor { get }
13+
var buttonSecondaryTitleColor: UIColor { get }
14+
var buttonDisabledColor: UIColor { get }
15+
var buttonDisabledHighlightedColor: UIColor { get }
16+
var buttonDisabledTitleColor: UIColor { get }
17+
var cellSeparatorColor: UIColor { get }
918
var defaultTextColor: UIColor { get }
1019
var sectionTitleColor: UIColor { get }
1120
var statusDangerColor: UIColor { get }
@@ -16,18 +25,27 @@ protocol Style {
1625
var statusPrimaryBoldColor: UIColor { get }
1726
var statusSuccessColor: UIColor { get }
1827
var statusSuccessBoldColor: UIColor { get }
28+
var subheadlineFont: UIFont { get }
1929
var tableViewBackgroundColor: UIColor { get }
2030
var wooCommerceBrandColor: UIColor { get }
21-
var cellSeparatorColor: UIColor { get }
2231
var wooGreyMid: UIColor { get }
2332
var wooGreyTextMin: UIColor { get }
2433
}
2534

2635
// MARK: - WooCommerce's Default Style
2736
//
2837
class DefaultStyle: Style {
38+
let alternativeLoginsTitleFont = UIFont.font(forStyle: .subheadline, weight: .semibold)
2939
let buttonPrimaryColor = UIColor(red: 0x96/255.0, green: 0x58/255.0, blue: 0x8A/255.0, alpha: 0xFF/255.0)
3040
let buttonPrimaryHighlightedColor = UIColor(red: 0x6E/255.0, green: 0x29/255.0, blue: 0x67/255.0, alpha: 0xFF/255.0)
41+
let buttonPrimaryTitleColor = UIColor.white
42+
let buttonSecondaryColor = UIColor.white
43+
let buttonSecondaryHighlightedColor = UIColor.gray
44+
let buttonSecondaryTitleColor = UIColor.gray
45+
let buttonDisabledColor = UIColor.white
46+
let buttonDisabledHighlightedColor = UIColor(red: 233.0/255.0, green: 239.0/255.0, blue: 234.0/255.0, alpha: 1.0)
47+
let buttonDisabledTitleColor = UIColor(red: 233.0/255.0, green: 239.0/255.0, blue: 234.0/255.0, alpha: 1.0)
48+
let cellSeparatorColor = UIColor.lightGray
3149
let defaultTextColor = UIColor.black
3250
let sectionTitleColor = UIColor.darkGray
3351
let statusDangerColor = UIColor(red: 255.0/255.0, green: 230.0/255.0, blue: 229.0/255.0, alpha: 1.0)
@@ -38,9 +56,9 @@ class DefaultStyle: Style {
3856
let statusPrimaryBoldColor = UIColor(red: 188.0/255.0, green: 222.0/255.0, blue: 238.0/255.0, alpha: 1.0)
3957
let statusSuccessColor = UIColor(red: 239.00/255.0, green: 249.0/255.0, blue: 230.0/255.0, alpha: 1.0)
4058
let statusSuccessBoldColor = UIColor(red: 201.0/255.0, green: 233.0/255.0, blue: 169.0/255.0, alpha: 1.0)
59+
let subheadlineFont = UIFont.font(forStyle: .subheadline, weight: .regular)
4160
let tableViewBackgroundColor = UIColor(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
4261
let wooCommerceBrandColor = UIColor(red: 0x96/255.0, green: 0x58/255.0, blue: 0x8A/255.0, alpha: 0xFF/255.0)
43-
let cellSeparatorColor = UIColor.lightGray
4462
let wooGreyMid = UIColor(red: 150.0/255.0, green: 150.0/255.0, blue: 150.0/255.0, alpha: 1.0)
4563
let wooGreyTextMin = UIColor(red: 89.0/255.0, green: 89.0/255.0, blue: 89.0/255.0, alpha: 1.0)
4664
}
@@ -63,6 +81,10 @@ class StyleManager {
6381
}
6482
}
6583

84+
static var alternativeLoginsTitleFont: UIFont {
85+
return active.alternativeLoginsTitleFont
86+
}
87+
6688
static var buttonPrimaryColor: UIColor {
6789
return active.buttonPrimaryColor
6890
}
@@ -71,6 +93,38 @@ class StyleManager {
7193
return active.buttonPrimaryHighlightedColor
7294
}
7395

96+
static var buttonPrimaryTitleColor: UIColor {
97+
return active.buttonPrimaryTitleColor
98+
}
99+
100+
static var buttonSecondaryColor: UIColor {
101+
return active.buttonSecondaryColor
102+
}
103+
104+
static var buttonSecondaryHighlightedColor: UIColor {
105+
return active.buttonSecondaryHighlightedColor
106+
}
107+
108+
static var buttonSecondaryTitleColor: UIColor {
109+
return active.buttonSecondaryTitleColor
110+
}
111+
112+
static var buttonDisabledColor: UIColor {
113+
return active.buttonDisabledColor
114+
}
115+
116+
static var buttonDisabledHighlightedColor: UIColor {
117+
return active.buttonDisabledHighlightedColor
118+
}
119+
120+
static var buttonDisabledTitleColor: UIColor {
121+
return active.buttonDisabledTitleColor
122+
}
123+
124+
static var cellSeparatorColor: UIColor {
125+
return active.cellSeparatorColor
126+
}
127+
74128
static var defaultTextColor: UIColor {
75129
return active.defaultTextColor
76130
}
@@ -111,6 +165,10 @@ class StyleManager {
111165
return active.sectionTitleColor
112166
}
113167

168+
static var subheadlineFont: UIFont {
169+
return active.subheadlineFont
170+
}
171+
114172
static var tableViewBackgroundColor: UIColor {
115173
return active.tableViewBackgroundColor
116174
}
@@ -119,10 +177,6 @@ class StyleManager {
119177
return active.wooCommerceBrandColor
120178
}
121179

122-
static var cellSeparatorColor: UIColor {
123-
return active.cellSeparatorColor
124-
}
125-
126180
static var wooGreyMid: UIColor {
127181
return active.wooGreyMid
128182
}

Yosemite/YosemiteTests/Tools/ResultsControllerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ResultsControllerTests: XCTestCase {
2626
}
2727

2828

29-
// MARK: - Overriden Methods
29+
// MARK: - Overridden Methods
3030

3131
override func setUp() {
3232
super.setUp()

0 commit comments

Comments
 (0)