Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit dda865b

Browse files
authored
Merge pull request #725 from wordpress-mobile/wcios/config-site-address-login-only
New configuration for site address login only on the prologue screen
2 parents fcf4d75 + 5de7ae1 commit dda865b

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _None._
3838

3939
### New Features
4040

41-
_None._
41+
- New configuration for site address login only on the prologue screen. [#725]
4242

4343
### Bug Fixes
4444

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PODS:
2222
- SVProgressHUD (2.2.5)
2323
- SwiftLint (0.49.1)
2424
- UIDeviceIdentifier (2.2.0)
25-
- WordPressAuthenticator (5.1.0-beta.1):
25+
- WordPressAuthenticator (5.1.0-beta.2):
2626
- GoogleSignIn (~> 6.0.1)
2727
- Gridicons (~> 1.0)
2828
- "NSURL+IDN (= 0.4)"
@@ -94,7 +94,7 @@ SPEC CHECKSUMS:
9494
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
9595
SwiftLint: 32ee33ded0636d0905ef6911b2b67bbaeeedafa5
9696
UIDeviceIdentifier: f33af270ba9045ea18b31d9aab88e42a0082ea67
97-
WordPressAuthenticator: 95f698805ebbbe86c5721ce244e1302ea810326b
97+
WordPressAuthenticator: aac1a2435f3bb1435e0b8726debf38fcd440fd6b
9898
WordPressKit: 202f529323b079a344f7bc1493b7ebebfd9ed4b5
9999
WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb
100100
WordPressUI: 1cf47a3b78154faf69caa18569ee7ece1e510fa0

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressAuthenticator'
5-
s.version = '5.1.0-beta.1'
5+
s.version = '5.1.0-beta.2'
66

77
s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.'
88
s.description = <<-DESC

WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ public struct WordPressAuthenticatorConfiguration {
146146
///
147147
let useEnterEmailAddressAsStepValueForGetStartedVC: Bool
148148

149+
/// If enabled, the prologue screen should hide the WPCom login CTA and show only the entry point to site address login.
150+
///
151+
let enableSiteAddressLoginOnlyInPrologue: Bool
152+
149153
/// Designated Initializer
150154
///
151155
public init (wpcomClientId: String,
@@ -177,7 +181,8 @@ public struct WordPressAuthenticatorConfiguration {
177181
emphasizeEmailForWPComPassword: Bool = false,
178182
wpcomPasswordInstructions: String? = nil,
179183
skipXMLRPCCheckForSiteDiscovery: Bool = false,
180-
useEnterEmailAddressAsStepValueForGetStartedVC: Bool = false) {
184+
useEnterEmailAddressAsStepValueForGetStartedVC: Bool = false,
185+
enableSiteAddressLoginOnlyInPrologue: Bool = false) {
181186

182187
self.wpcomClientId = wpcomClientId
183188
self.wpcomSecret = wpcomSecret
@@ -209,5 +214,6 @@ public struct WordPressAuthenticatorConfiguration {
209214
self.wpcomPasswordInstructions = wpcomPasswordInstructions
210215
self.skipXMLRPCCheckForSiteDiscovery = skipXMLRPCCheckForSiteDiscovery
211216
self.useEnterEmailAddressAsStepValueForGetStartedVC = useEnterEmailAddressAsStepValueForGetStartedVC
217+
self.enableSiteAddressLoginOnlyInPrologue = enableSiteAddressLoginOnlyInPrologue
212218
}
213219
}

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class LoginPrologueViewController: LoginViewController {
271271
style: primaryButtonStyle,
272272
onTap: loginTapCallback())
273273
let enterYourSiteAddressButton = StackedButton(title: displayStrings.enterYourSiteAddressButtonTitle,
274-
isPrimary: false,
274+
isPrimary: configuration.enableSiteAddressLoginOnlyInPrologue,
275275
configureBodyFontForTitle: true,
276276
accessibilityIdentifier: "Prologue Self Hosted Button",
277277
style: secondaryButtonStyle,
@@ -288,18 +288,24 @@ class LoginPrologueViewController: LoginViewController {
288288
createSiteButton]
289289
} else if configuration.enableWPComLoginOnlyInPrologue {
290290
buttons = [continueWithWPButton]
291+
} else if configuration.enableSiteAddressLoginOnlyInPrologue && configuration.enableSiteCreation {
292+
buttons = [enterYourSiteAddressButton, createSiteButton]
293+
} else if configuration.enableSiteAddressLoginOnlyInPrologue {
294+
buttons = [enterYourSiteAddressButton]
291295
} else if configuration.enableSiteCreation {
292296
let createSiteButtonForBottomStackView = StackedButton(using: createSiteButton,
293297
stackView: .bottom)
294298
buttons = [continueWithWPButton,
295299
enterYourSiteAddressButton,
296300
createSiteButtonForBottomStackView]
297301
} else {
298-
WPAuthenticatorLogError("Failed to create `StackedButton`s in login progue screen.")
302+
WPAuthenticatorLogError("Failed to create `StackedButton`s in login prologue screen.")
299303
buttons = []
300304
}
301305

302-
let showDivider = configuration.enableWPComLoginOnlyInPrologue == false && configuration.enableSiteCreation == true
306+
let showDivider = configuration.enableWPComLoginOnlyInPrologue == false &&
307+
configuration.enableSiteCreation == true &&
308+
configuration.enableSiteAddressLoginOnlyInPrologue == false
303309
stackedButtonsViewController.setUpButtons(using: buttons, showDivider: showDivider)
304310
setButtonViewControllerBackground()
305311
}

0 commit comments

Comments
 (0)