Split support requests

- Generic support on Reddit
- Debug log via email
This commit is contained in:
Davide De Rosa 2018-10-18 15:57:59 +02:00
parent 176d2dd025
commit 23e27535c6
5 changed files with 28 additions and 31 deletions

View File

@ -46,14 +46,11 @@ class IssueReporter: NSObject {
self.viewController = viewController
let alert = Macros.alert(L10n.IssueReporter.title, L10n.IssueReporter.message)
alert.addDefaultAction(L10n.IssueReporter.Buttons.withLog) {
alert.addDefaultAction(L10n.IssueReporter.Buttons.accept) {
VPN.shared.requestDebugLog(fallback: AppConstants.Log.debugSnapshot) {
self.composeEmail(withDebugLog: $0)
}
}
alert.addAction(UIAlertAction(title: L10n.IssueReporter.Buttons.withoutLog, style: .default) { (action) in
self.composeEmail(withDebugLog: nil)
})
alert.addCancelAction(L10n.Global.cancel)
viewController.present(alert, animated: true, completion: nil)
}

View File

@ -39,7 +39,7 @@ class AboutViewController: UITableViewController, TableModelHost {
model.setHeader(L10n.About.Sections.Feedback.header, for: .feedback)
model.set([.version, .credits, .disclaimer, .website], in: .info)
model.set([.sourcePassepartout, .sourceTunnelKit], in: .source)
model.set([.discussReddit, .reportIssue, .writeReview], in: .feedback)
model.set([.requestSupport, .submitDebugLog, .writeReview], in: .feedback)
return model
}()
@ -82,7 +82,7 @@ class AboutViewController: UITableViewController, TableModelHost {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
private func discussReddit() {
private func requestRedditSupport() {
UIApplication.shared.open(AppConstants.URLs.subreddit, options: [:], completionHandler: nil)
}
@ -146,9 +146,9 @@ extension AboutViewController {
case sourceTunnelKit
case discussReddit
case requestSupport
case reportIssue
case submitDebugLog
case writeReview
}
@ -202,12 +202,12 @@ extension AboutViewController {
cell.leftText = GroupConstants.App.tunnelKitName
return cell
case .discussReddit:
case .requestSupport:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.About.Cells.DiscussReddit.caption
cell.leftText = L10n.About.Cells.RequestSupport.caption
return cell
case .reportIssue:
case .submitDebugLog:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.IssueReporter.title
return cell
@ -239,10 +239,10 @@ extension AboutViewController {
case .sourceTunnelKit:
visitRepository(AppConstants.Repos.tunnelKit)
case .discussReddit:
discussReddit()
case .requestSupport:
requestRedditSupport()
case .reportIssue:
case .submitDebugLog:
reportIssue()
case .writeReview:

View File

@ -111,7 +111,7 @@ class OrganizerViewController: UITableViewController, TableModelHost {
if !didShowSubreddit && !TransientStore.shared.didHandleSubreddit {
didShowSubreddit = true
let alert = Macros.alert(L10n.About.Cells.DiscussReddit.caption, L10n.Reddit.message)
let alert = Macros.alert(L10n.Reddit.title, L10n.Reddit.message)
alert.addDefaultAction(L10n.Reddit.Buttons.subscribe) {
TransientStore.shared.didHandleSubreddit = true
self.subscribeSubreddit()

View File

@ -27,6 +27,7 @@
"global.cancel" = "Cancel";
"global.next" = "Next";
"reddit.title" = "Reddit";
"reddit.message" = "Did you know that Passepartout has a subreddit? Subscribe for updates or to discuss issues, features, new platforms or whatever you like.\n\nIt's also a great way to show you care about this project.";
"reddit.buttons.subscribe" = "Subscribe now!";
"reddit.buttons.remind" = "Remind me later";
@ -160,12 +161,11 @@
"vpn.inactive" = "Inactive";
"vpn.disabled" = "Disabled";
"issue_reporter.title" = "Report an issue";
"issue_reporter.message" = "Do you want to attach the debug log of your latest connections? The log is crucial to resolve your connectivity issues and is completely anonymous.";
"issue_reporter.buttons.with_log" = "Attach debug log";
"issue_reporter.buttons.without_log" = "Omit debug log";
"issue_reporter.title" = "Submit debug log";
"issue_reporter.message" = "The debug log of your latest connections is crucial to resolve your connectivity issues and is completely anonymous.";
"issue_reporter.buttons.accept" = "I understand";
"issue_reporter.alerts.email_not_configured.message" = "No e-mail account is configured.";
"issue_reporter.email.subject" = "%@ - Report issue";
"issue_reporter.email.subject" = "%@ - Debug log";
"issue_reporter.email.body" = "Hi,\n\ndescription of the issue:\n\n%@\n\nRegards";
"about.title" = "About";
@ -173,7 +173,7 @@
"about.sections.source.header" = "Source code";
"about.sections.feedback.header" = "Feedback";
"about.cells.version.caption" = "Version";
"about.cells.discuss_reddit.caption" = "Discuss on Reddit";
"about.cells.request_support.caption" = "Request support";
"about.cells.write_review.caption" = "Write a review";
"about.cells.website.caption" = "Visit website";

View File

@ -14,9 +14,9 @@ internal enum L10n {
internal enum Cells {
internal enum DiscussReddit {
/// Discuss on Reddit
internal static let caption = L10n.tr("Localizable", "about.cells.discuss_reddit.caption")
internal enum RequestSupport {
/// Request support
internal static let caption = L10n.tr("Localizable", "about.cells.request_support.caption")
}
internal enum Version {
@ -288,9 +288,9 @@ internal enum L10n {
}
internal enum IssueReporter {
/// Do you want to attach the debug log of your latest connections? The log is crucial to resolve your connectivity issues and is completely anonymous.
/// The debug log of your latest connections is crucial to resolve your connectivity issues and is completely anonymous.
internal static let message = L10n.tr("Localizable", "issue_reporter.message")
/// Report an issue
/// Submit debug log
internal static let title = L10n.tr("Localizable", "issue_reporter.title")
internal enum Alerts {
@ -302,10 +302,8 @@ internal enum L10n {
}
internal enum Buttons {
/// Attach debug log
internal static let withLog = L10n.tr("Localizable", "issue_reporter.buttons.with_log")
/// Omit debug log
internal static let withoutLog = L10n.tr("Localizable", "issue_reporter.buttons.without_log")
/// I understand
internal static let accept = L10n.tr("Localizable", "issue_reporter.buttons.accept")
}
internal enum Email {
@ -313,7 +311,7 @@ internal enum L10n {
internal static func body(_ p1: String) -> String {
return L10n.tr("Localizable", "issue_reporter.email.body", p1)
}
/// %@ - Report issue
/// %@ - Debug log
internal static func subject(_ p1: String) -> String {
return L10n.tr("Localizable", "issue_reporter.email.subject", p1)
}
@ -408,6 +406,8 @@ internal enum L10n {
internal enum Reddit {
/// Did you know that Passepartout has a subreddit? Subscribe for updates or to discuss issues, features, new platforms or whatever you like.\n\nIt's also a great way to show you care about this project.
internal static let message = L10n.tr("Localizable", "reddit.message")
/// Reddit
internal static let title = L10n.tr("Localizable", "reddit.title")
internal enum Buttons {
/// Don't ask again