Skip to content

Commit

Permalink
Merge pull request #294 from wordpress-mobile/feature/283-site-addres…
Browse files Browse the repository at this point in the history
…s-ii

UL&S: Site Address tableView and continue button
  • Loading branch information
mindgraffiti authored Jun 2, 2020
2 parents 050086d + 42fef10 commit e67b58c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 13 deletions.
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.18.0-beta.2"
s.version = "1.18.0-beta.3"
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 @@ -12,19 +12,34 @@ public struct WordPressAuthenticatorDisplayStrings {

public let siteLoginInstructions: String

/// Strings: primary call-to-action button titles.
///
public let continueButtonTitle: String

/// Designated initializer.
///
public init(emailLoginInstructions: String, jetpackLoginInstructions: String, siteLoginInstructions: String) {
public init(emailLoginInstructions: String,
jetpackLoginInstructions: String,
siteLoginInstructions: String,
continueButtonTitle: String) {
self.emailLoginInstructions = emailLoginInstructions
self.jetpackLoginInstructions = jetpackLoginInstructions
self.siteLoginInstructions = siteLoginInstructions
self.continueButtonTitle = continueButtonTitle
}
}

public extension WordPressAuthenticatorDisplayStrings {
static var defaultStrings: WordPressAuthenticatorDisplayStrings {
return WordPressAuthenticatorDisplayStrings(emailLoginInstructions: NSLocalizedString("Log in to your WordPress.com account with your email address.", comment: "Instruction text on the login's email address screen."),
jetpackLoginInstructions: NSLocalizedString("Log in to the WordPress.com account you used to connect Jetpack.", comment: "Instruction text on the login's email address screen."),
siteLoginInstructions: NSLocalizedString("Enter the address of the WordPress site you'd like to connect.", comment: "Instruction text on the login's site addresss screen."))
return WordPressAuthenticatorDisplayStrings(
emailLoginInstructions: NSLocalizedString("Log in to your WordPress.com account with your email address.",
comment: "Instruction text on the login's email address screen."),
jetpackLoginInstructions: NSLocalizedString("Log in to the WordPress.com account you used to connect Jetpack.",
comment: "Instruction text on the login's email address screen."),
siteLoginInstructions: NSLocalizedString("Enter the address of the WordPress site you'd like to connect.",
comment: "Instruction text on the login's site addresss screen."),
continueButtonTitle: NSLocalizedString("Continue",
comment: "The button title text when there is a next step for logging in or signing up.")
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,39 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="SiteAddress ViewController" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j39-aV-wLj">
<rect key="frame" x="35" y="87" width="307" height="148"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle0"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="KLl-Uz-wEP">
<rect key="frame" x="0.0" y="0.0" width="375" height="597"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<sections/>
<connections>
<outlet property="dataSource" destination="aQT-Gx-U3x" id="Sct-0G-HTk"/>
<outlet property="delegate" destination="aQT-Gx-U3x" id="2xB-Wr-Hdh"/>
</connections>
</tableView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ClH-Cn-49d" userLabel="Primary Button" customClass="NUXButton" customModule="WordPressAuthenticator" customModuleProvider="target">
<rect key="frame" x="20" y="617" width="335" height="30"/>
<state key="normal" title="Button"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isPrimary" value="YES"/>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="ClH-Cn-49d" firstAttribute="leading" secondItem="ihD-pY-rg9" secondAttribute="leading" constant="20" id="5s0-Xm-ncF"/>
<constraint firstItem="ihD-pY-rg9" firstAttribute="bottom" secondItem="ClH-Cn-49d" secondAttribute="bottom" constant="20" id="X4E-nI-Cd1"/>
<constraint firstItem="KLl-Uz-wEP" firstAttribute="leading" secondItem="ihD-pY-rg9" secondAttribute="leading" id="aEa-e4-q18"/>
<constraint firstItem="ihD-pY-rg9" firstAttribute="trailing" secondItem="ClH-Cn-49d" secondAttribute="trailing" constant="20" id="cDe-aY-Kjq"/>
<constraint firstItem="KLl-Uz-wEP" firstAttribute="trailing" secondItem="ihD-pY-rg9" secondAttribute="trailing" id="gAJ-a0-NzR"/>
<constraint firstItem="ClH-Cn-49d" firstAttribute="top" secondItem="KLl-Uz-wEP" secondAttribute="bottom" constant="20" id="oGY-bv-6gw"/>
<constraint firstItem="KLl-Uz-wEP" firstAttribute="top" secondItem="ihD-pY-rg9" secondAttribute="top" id="yJ3-xn-prH"/>
</constraints>
<viewLayoutGuide key="safeArea" id="ihD-pY-rg9"/>
</view>
<connections>
<outlet property="submitButton" destination="ClH-Cn-49d" id="kBa-QN-0oH"/>
<outlet property="tableView" destination="KLl-Uz-wEP" id="ntt-cX-m20"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ipm-G3-kY7" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,41 @@ import UIKit

/// SiteAddressViewController: log in by Site Address.
///
class SiteAddressViewController: UIViewController {
final class SiteAddressViewController: LoginViewController {

@IBOutlet private weak var tableView: UITableView!

var displayStrings: WordPressAuthenticatorDisplayStrings {
return WordPressAuthenticator.shared.displayStrings
}

override func viewDidLoad() {
super.viewDidLoad()

localizePrimaryButton()
}

func localizePrimaryButton() {
let primaryTitle = displayStrings.continueButtonTitle
submitButton?.setTitle(primaryTitle, for: .normal)
submitButton?.setTitle(primaryTitle, for: .highlighted)
}
}


// MARK: - UITableViewDataSource
extension SiteAddressViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return UITableViewCell()
}
}


// MARK: - UITableViewDelegate conformance
extension SiteAddressViewController: UITableViewDelegate {

}

0 comments on commit e67b58c

Please sign in to comment.