-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added UnrecoverableError support and retry links #419
Conversation
} | ||
} else { | ||
view.secondaryButton?.onPress = { _ in | ||
UIApplication.shared.openURL(URL(string: "https://auth0.com/docs/")!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are asking about implementation, we already have a button in place so better to use vs removing the button and messing around with NSLinkAttributeName
.
If you are asking why does it link to auth0/docs, this is the behaviour in Android.
auth0/Lock.Android#407
Lock/UnrecoverableErrorView.swift
Outdated
actionButton.button?.setTitleColor(UIColor(red:0.04, green:0.53, blue:0.69, alpha:1.0), for: .normal) | ||
actionButton.button?.titleLabel?.font = actionLabel.font | ||
|
||
if !canRetry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the positive first then the rest since its cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Lock/UnrecoverableErrorView.swift
Outdated
|
||
if !canRetry { | ||
actionLabel.text = "Please contact ".i18n(key: "com.auth0.lock.error.unrecoverable.support.title", comment: "Support label") | ||
actionButton.title = "support.".i18n(key: "com.auth0.lock.error.unrecoverable.support.action", comment: "Support action") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why splitting the error message instead of using formatting and a single button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the main title needs a little more love since Please retry
seems a bit odd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be far simpler to use a secondaryButton
, I was adhering to the original design which is consistent with Android.
I agree the title is a little sparse, I also feel in general this has been designed like a mobile web page vs a native app.
I think it would be better to have the call to action using a PrimaryButton
.
However in the past when I've played with the design you then say it doesn't match the original design...
abd8f48
to
3432197
Compare
Lock/OptionBuildable.swift
Outdated
@@ -36,6 +36,9 @@ public protocol OptionBuildable: Options { | |||
/// Privacy Policy URL. By default is Auth0's. | |||
var privacyPolicyURL: URL { get set } | |||
|
|||
/// Support URL. By default this is not set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support page url that will be displayed (Inside Safari) when an unrecoverable error occurs and the user taps the "Contact Support" button in the error screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default no page should be displayed, not even auth0's so the button should be hidden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hidden by default, only visible when supportURL is populated as per last screenshot. Will update the docheader though.
Lock/OptionBuildable.swift
Outdated
@@ -136,4 +139,16 @@ public extension OptionBuildable { | |||
} | |||
} | |||
|
|||
/// SupportURL. By default is not set. | |||
var support: String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it be nullable and call it supportPage
since it might be odd to have just support
7b8b70c
to
2e977ee
Compare
6dbfc06
to
98f78f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Texts are ok and equal to the other's sdks. I left you a few comments.
Lock/Base.lproj/Lock.strings
Outdated
// Recoverable error message | ||
"com.auth0.lock.error.recoverable.message" = "Please check your internet connection."; | ||
// Recoverable error button | ||
"com.auth0.lock.error.recoverable.retry.button" = "Retry"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key should be named com.auth0.lock.error.recoverable.button
(without the retry
), to be similar to the "contact support" one: com.auth0.lock.error.unrecoverable.button
return url.absoluteString | ||
} | ||
set { | ||
guard let value = newValue, let url = URL(string: value) else { return } // FIXME: log error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's time to remove those notes and log the error? 😝 It can be in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One day :)
Unrecoverable assets added Added i18n Strings Update Tests
Simplified UnrecoverableErrorView Added optional 'supportURL' to be displayed on non recoverable errors Added Options Tests Updated UnrecoverableError Tests
636d2f2
to
914db26
Compare
Unrecoverable asset added
Added i18n Strings
Update Tests
Update SwiftLint