Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
devinreams committed Aug 29, 2018
2 parents 04115ba + a90c084 commit 8593cc6
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 5 deletions.
23 changes: 23 additions & 0 deletions docs/release-notes.md
@@ -1,5 +1,28 @@
# Release Notes

## 1.2 (Build 2016)

_Date: 2018-08-27_

**PLEASE NOTE: YOU MAY EXPERIENCE A CRASH!** We're aware of an issue when you open the app it immediately crashes (and are working to gather more data and fix it). If this does happen, please re-open the app and continue testing everything else from there. Thank you!

It's been a month since our launch and we've been working hard to replace the old way of logging in with Firefox Accounts and fixing some bugs. For new users, they'll encounter a smoother and clearer experience. For existing users with the app already installed, you'll just need to sign in once again.

Here's the full list of changes:

- Introduced the OAuth login flow to replace the "old" way of signing in
- Added a "migration path" so users with the app sign back in and store data properly
- The app clears your local storage and cache when you disconnect your account
- You can now "pull to refresh" to force a sync when looking at an empty list
- We fixed some alignment bugs for iPhone SEs running iOS 10
- The autolock feature has been hardened as to when and how it locks the app
- The app no longer dynamically adjusts the navigation bar sizes so it can be usable
- If you type a very long search term you can "Cancel" and clear it as expected now
- We improved the small arrows next to links
- You can now "Ask a Question" from the settings screen to contact us directly

Thanks to all our open source contributors that helped make this release possible.

## 1.2 (Build 1939)

_Date: 2018-08-22_
Expand Down
25 changes: 25 additions & 0 deletions lockbox-ios/Action/AccountAction.swift
Expand Up @@ -29,3 +29,28 @@ extension AccountAction: Equatable {
}
}
}

extension AccountAction: TelemetryAction {
var eventMethod: TelemetryEventMethod {
switch self {
case .oauthRedirect(let URL):
return .signIn
case .clear:
return .disconnect
case .oauthSignInMessageRead:
return .show
}
}

var eventObject: TelemetryEventObject {
return .account
}

var value: String? {
return nil
}

var extras: [String: Any?]? {
return nil
}
}
3 changes: 2 additions & 1 deletion lockbox-ios/Action/TelemetryAction.swift
Expand Up @@ -19,7 +19,7 @@ enum TelemetryEventCategory: String {
}

enum TelemetryEventMethod: String {
case tap, startup, foreground, background, settingChanged, show
case tap, startup, foreground, background, settingChanged, show, signIn, disconnect
}

enum TelemetryEventObject: String {
Expand All @@ -45,6 +45,7 @@ enum TelemetryEventObject: String {
case loginFxa = "login_fxa"
case loginOnboardingConfirmation = "login_onboarding_confirmation"
case loginLearnMore = "login_learn_more"
case account = "account"
}

enum ExtraKey: String {
Expand Down
25 changes: 23 additions & 2 deletions lockbox-ios/View/StaticURLWebView.swift
Expand Up @@ -13,7 +13,8 @@ class StaticURLWebView: UIViewController {
private var presenter: StaticURLPresenter?

var returnRoute: RouteAction
private var webView = WKWebView()
public var webView: WKWebView?
public var activityIndicator: UIActivityIndicatorView?

init(urlString: String, title: String, returnRoute: RouteAction) {
self.urlString = urlString
Expand All @@ -34,14 +35,27 @@ class StaticURLWebView: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
let webView = WKWebView(frame: self.view.frame)
self.styleNavigationBar()

self.view = webView
self.view.addSubview(webView)
webView.navigationDelegate = self

if let url = URL(string: self.urlString) {
webView.load(URLRequest(url: url))
}

self.webView = webView

let indicator = UIActivityIndicatorView()
indicator.center = self.view.center
indicator.hidesWhenStopped = true
indicator.activityIndicatorViewStyle = .gray
indicator.transform = CGAffineTransform(scaleX: 3, y: 3) // Increase the size of the indicator
indicator.startAnimating()
self.view.addSubview(indicator)
self.activityIndicator = indicator

self.presenter?.onViewReady()
}

Expand All @@ -68,6 +82,13 @@ class StaticURLWebView: UIViewController {
}
}

extension StaticURLWebView: WKNavigationDelegate {
func webView(_ webView: WKWebView,
didFinish navigation: WKNavigation!) {
self.activityIndicator?.stopAnimating()
}
}

extension StaticURLWebView: StaticURLViewProtocol {
var closeTapped: Observable<Void>? {
return self.navigationItem.leftBarButtonItem?.rx.tap.asObservable()
Expand Down
13 changes: 12 additions & 1 deletion lockbox-iosTests/StaticURLWebViewSpec.swift
Expand Up @@ -32,7 +32,7 @@ class StaticURLWebViewSpec: QuickSpec {
}

it("loads url") {
let webView = self.subject.view as! WKWebView
let webView = self.subject.webView as! WKWebView
expect(webView.url).to(equal(URL(string: self.url)))
}

Expand All @@ -54,6 +54,17 @@ class StaticURLWebViewSpec: QuickSpec {

expect(voidObserver.events.count).to(equal(1))
}

it("sets the activity indicator") {
let indicator = self.subject.activityIndicator as! UIActivityIndicatorView
expect(indicator.isAnimating).to(beTrue())
}

it("navigating resets the indicator") {
self.subject.webView(self.subject.webView!, didFinish: nil)
let indicator = self.subject.activityIndicator as! UIActivityIndicatorView
expect(indicator.isAnimating).to(beFalse())
}
}
}
}
2 changes: 1 addition & 1 deletion lockbox-iosTests/TelemetryStoreSpec.swift
Expand Up @@ -58,7 +58,7 @@ class TelemetryStoreSpec: QuickSpec {
}

it("does not pass through non-ItemDetailDisplayActions") {
self.dispatcher.fakeRegistration.onNext(AccountAction.clear)
self.dispatcher.fakeRegistration.onNext(DataStoreAction.lock)

expect(telemetryObserver.events.count).to(equal(0))
}
Expand Down

0 comments on commit 8593cc6

Please sign in to comment.