Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
04e161f
Remove .showLinkMailView from Login.storyboard
mindgraffiti Mar 18, 2020
c8ebc5b
Remove .showLinkMailView storyboardID from EmailMagicLink.storyboard
mindgraffiti Mar 18, 2020
93f9828
Xcode updating the metadata for EmailMagicLink.storyboard
mindgraffiti Mar 18, 2020
ddb322b
Delete segues `.showLinkMailView` and `SignupEmailViewController`
mindgraffiti Mar 18, 2020
e11c23e
Remove segues using showLinkMailView
mindgraffiti Mar 18, 2020
7ffaf5f
Remove enum case showLinkMailView
mindgraffiti Mar 18, 2020
e4f1b0e
Bump podspec to beta.15
mindgraffiti Mar 18, 2020
9fc623e
Instantiate the correct Storyboard, `emailMagicLink`
mindgraffiti Mar 18, 2020
115b2e4
Define the raw string values for storyboards
mindgraffiti Mar 18, 2020
19a7984
Merge branch 'develop' into issue/211-remove-showLinkMailView
mindgraffiti Mar 20, 2020
77e9cbc
Merge branch 'develop' into issue/fancy-buttons-hotfix
mindgraffiti Mar 23, 2020
707de41
Restore NUX button configurations for button insets
mindgraffiti Mar 23, 2020
40fcbd9
Bump podspec
mindgraffiti Mar 23, 2020
119478e
Skip the beta for hotfixes
mindgraffiti Mar 23, 2020
c742722
Merge branch 'develop' into issue/211-remove-showLinkMailView
mindgraffiti Mar 23, 2020
b9c020a
Merge branch 'issue/fancy-buttons-hotfix' into issue/211-remove-showL…
mindgraffiti Mar 23, 2020
ee78b1d
Bump podspec to 1.11.2-beta.1
mindgraffiti Mar 23, 2020
a1a4f8e
Pass the loginFields from one viewcontroller to another
mindgraffiti Mar 23, 2020
0ef3707
Delete `prepareForSegue` method, it should no longer be used
mindgraffiti Mar 23, 2020
12866fc
Change related storyboard to use convenience method
mindgraffiti Mar 23, 2020
8c81706
Pass all loginFields from the SignupEmailVC to the NUXLinkMailVC
mindgraffiti Mar 23, 2020
36b35e9
Revert "Merge branch 'issue/fancy-buttons-hotfix' into issue/211-remo…
mindgraffiti Mar 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressAuthenticator"
s.version = "1.11.0"
s.version = "1.11.2-beta.1"
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."

s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ import AuthenticationServices
return false
}

let storyboard = UIStoryboard(name: "EmailMagicLink", bundle: bundle)
let storyboard = Storyboard.emailMagicLink.instance
guard let loginController = storyboard.instantiateViewController(withIdentifier: "LinkAuthView") as? NUXLinkAuthViewController else {
DDLogInfo("App opened with authentication link but couldn't create login screen.")
return false
Expand Down
7 changes: 4 additions & 3 deletions WordPressAuthenticator/Extensions/UIStoryboard+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import Foundation

// MARK - Storyboard enum
enum Storyboard: String {
case login
case signup
case login = "Login"
case signup = "Signup"
case emailMagicLink = "EmailMagicLink"

var instance: UIStoryboard {
return UIStoryboard(name: self.rawValue.capitalized, bundle: WordPressAuthenticator.bundle)
return UIStoryboard(name: self.rawValue, bundle: WordPressAuthenticator.bundle)
}

/// Returns a view controller from a Storyboard
Expand Down
1 change: 0 additions & 1 deletion WordPressAuthenticator/NUX/NUXViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ open class NUXViewController: UIViewController, NUXViewControllerBase, UIViewCon
case showWPComLogin
case startMagicLinkFlow
case showMagicLink
case showLinkMailView
case show2FA
case showDomains
case showCreateSite
Expand Down
15 changes: 6 additions & 9 deletions WordPressAuthenticator/Signin/EmailMagicLink.storyboard
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -52,7 +49,7 @@
<!--Link Mail View Controller-->
<scene sceneID="zhV-IL-bW4">
<objects>
<viewController storyboardIdentifier="LinkMailView" extendedLayoutIncludesOpaqueBars="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="GSd-vy-rpZ" customClass="NUXLinkMailViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
<viewController storyboardIdentifier="NUXLinkMailViewController" extendedLayoutIncludesOpaqueBars="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="GSd-vy-rpZ" customClass="NUXLinkMailViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="s8Z-uG-nj5"/>
<viewControllerLayoutGuide type="bottom" id="vKK-Mm-0yR"/>
Expand Down Expand Up @@ -91,7 +88,7 @@
</mask>
</variation>
</label>
<button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="749" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Iy-9H-ykD" customClass="NUXButton" customModule="WordPressAuthenticator" >
<button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="749" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Iy-9H-ykD" customClass="NUXButton" customModule="WordPressAuthenticator">
<rect key="frame" x="114" y="306.5" width="75" height="34"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="34" id="tyz-kt-Arb"/>
Expand Down Expand Up @@ -122,7 +119,7 @@
</mask>
</variation>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b0O-LO-6ax" customClass="SubheadlineButton" customModule="WordPressAuthenticator" >
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b0O-LO-6ax" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
<rect key="frame" x="0.0" y="617" width="375" height="30"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
<state key="normal" title="Enter your password instead">
Expand Down
11 changes: 1 addition & 10 deletions WordPressAuthenticator/Signin/Login.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,6 @@
<outlet property="label" destination="CmN-ir-1YK" id="Xhc-3L-kvy"/>
<outlet property="sendLinkButton" destination="iIy-Sm-1r0" id="9My-fJ-l9S"/>
<outlet property="usePasswordButton" destination="B6x-b7-hU9" id="mB8-03-VBa"/>
<segue destination="Aii-0z-zLC" kind="show" identifier="showLinkMailView" id="xs3-qG-RaP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cja-vu-y88" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -1183,14 +1182,6 @@
</objects>
<point key="canvasLocation" x="794" y="1179"/>
</scene>
<!--LinkMailView-->
<scene sceneID="UUd-M2-Fvg">
<objects>
<viewControllerPlaceholder storyboardIdentifier="LinkMailView" storyboardName="EmailMagicLink" referencedIdentifier="LinkMailView" id="Aii-0z-zLC" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="WTT-3e-E71" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3355" y="255"/>
</scene>
<!--Login Username Password View Controller-->
<scene sceneID="b9v-Sc-w6J">
<objects>
Expand Down Expand Up @@ -1471,7 +1462,7 @@
<segue reference="N3P-wt-Rn3"/>
<segue reference="Njv-lY-Lyi"/>
<segue reference="2Of-BA-xqb"/>
<segue reference="UV4-XI-c0q"/>
<segue reference="0ao-yi-yZI"/>
<segue reference="4SK-mG-U33"/>
<segue reference="nCA-u7-fKm"/>
<segue reference="swV-lc-6gI"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,15 @@ class LoginLinkRequestViewController: LoginViewController {
@objc func didRequestAuthenticationLink() {
WordPressAuthenticator.track(.loginMagicLinkRequested)
WordPressAuthenticator.storeLoginInfoForTokenAuth(loginFields)
performSegue(withIdentifier: .showLinkMailView, sender: self)

guard let vc = NUXLinkMailViewController.instantiate(from: .emailMagicLink) else {
DDLogError("Failed to navigate to NUXLinkMailViewController")
return
}

vc.loginFields = self.loginFields
vc.loginFields.restrictToWPCom = true
navigationController?.pushViewController(vc, animated: true)
}

@IBAction func handleUsePasswordTapped(_ sender: UIButton) {
Expand Down
9 changes: 0 additions & 9 deletions WordPressAuthenticator/Signup/Signup.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
<outlet property="errorLabel" destination="EYw-oM-W1K" id="P2j-f2-bLo"/>
<outlet property="instructionLabel" destination="CPF-7g-0y5" id="Urr-Xa-YNp"/>
<outlet property="submitButton" destination="4Su-Zc-Omp" id="amJ-9P-tcO"/>
<segue destination="Je3-5O-NYu" kind="show" identifier="showLinkMailView" id="Yop-RV-xJa"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OAN-7g-PQl" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -179,14 +178,6 @@
</objects>
<point key="canvasLocation" x="-938" y="791"/>
</scene>
<!--LinkMailView-->
<scene sceneID="lKY-0n-z5h">
<objects>
<viewControllerPlaceholder storyboardIdentifier="LinkMailView" storyboardName="EmailMagicLink" referencedIdentifier="LinkMailView" id="Je3-5O-NYu" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="DAI-Ik-KtV" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-358" y="190"/>
</scene>
</scenes>
<resources>
<image name="icon-username-field" width="18" height="18"/>
Expand Down
20 changes: 10 additions & 10 deletions WordPressAuthenticator/Signup/SignupEmailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,6 @@ class SignupEmailViewController: LoginViewController, NUXKeyboardResponder {
})
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)
// Configure login flow to allow only .com login and prefill the email
if let destination = segue.destination as? LoginEmailViewController {
destination.loginFields.restrictToWPCom = true
destination.loginFields.username = loginFields.emailAddress
}
}

// MARK: - Send email

/// Makes the call to request a magic signup link be emailed to the user.
Expand All @@ -217,7 +208,16 @@ class SignupEmailViewController: LoginViewController, NUXKeyboardResponder {
private func didRequestSignupLink() {
WordPressAuthenticator.track(.signupMagicLinkRequested)
WordPressAuthenticator.storeLoginInfoForTokenAuth(loginFields)
performSegue(withIdentifier: "showLinkMailView", sender: nil)

guard let vc = NUXLinkMailViewController.instantiate(from: .emailMagicLink) else {
DDLogError("Failed to navigate to NUXLinkMailViewController")
return
}

vc.loginFields = loginFields
vc.loginFields.restrictToWPCom = true

navigationController?.pushViewController(vc, animated: true)
}

// MARK: - Action Handling
Expand Down