Move feedback section to main screen

This commit is contained in:
Davide De Rosa 2019-04-15 14:29:31 +02:00
parent 1d47650a16
commit a6745ceec7
6 changed files with 50 additions and 54 deletions

View File

@ -35,14 +35,11 @@ class AboutViewController: UITableViewController, TableModelHost {
model.add(.info) model.add(.info)
model.add(.web) model.add(.web)
model.add(.share) model.add(.share)
model.add(.feedback)
model.setHeader(L10n.About.Sections.Web.header, for: .web) model.setHeader(L10n.About.Sections.Web.header, for: .web)
model.setHeader(L10n.About.Sections.Share.header, for: .share) model.setHeader(L10n.About.Sections.Share.header, for: .share)
model.setHeader(L10n.About.Sections.Feedback.header, for: .feedback)
model.set([.version], in: .info) model.set([.version], in: .info)
model.set([.website, .faq, .disclaimer, .privacyPolicy], in: .web) model.set([.website, .faq, .disclaimer, .privacyPolicy], in: .web)
model.set([.shareTwitter, .shareGeneric], in: .share) model.set([.shareTwitter, .shareGeneric], in: .share)
model.set([.joinCommunity, .writeReview], in: .feedback)
return model return model
}() }()
@ -100,15 +97,6 @@ class AboutViewController: UITableViewController, TableModelHost {
present(vc, animated: true, completion: nil) present(vc, animated: true, completion: nil)
} }
private func postSupportRequest() {
UIApplication.shared.open(AppConstants.URLs.subreddit, options: [:], completionHandler: nil)
}
private func writeReview() {
let url = AppConstants.URLs.review(withId: GroupConstants.App.appId)
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
@IBAction private func dismiss() { @IBAction private func dismiss() {
dismiss(animated: true, completion: nil) dismiss(animated: true, completion: nil)
} }
@ -123,8 +111,6 @@ extension AboutViewController {
case web case web
case share case share
case feedback
} }
enum RowType: Int { enum RowType: Int {
@ -141,10 +127,6 @@ extension AboutViewController {
case shareTwitter case shareTwitter
case shareGeneric case shareGeneric
case joinCommunity
case writeReview
} }
override func numberOfSections(in tableView: UITableView) -> Int { override func numberOfSections(in tableView: UITableView) -> Int {
@ -200,16 +182,6 @@ extension AboutViewController {
let cell = Cells.setting.dequeue(from: tableView, for: indexPath) let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.About.Cells.ShareGeneric.caption cell.leftText = L10n.About.Cells.ShareGeneric.caption
return cell return cell
case .joinCommunity:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.About.Cells.JoinCommunity.caption
return cell
case .writeReview:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.About.Cells.WriteReview.caption
return cell
} }
} }
@ -235,12 +207,6 @@ extension AboutViewController {
case .shareGeneric: case .shareGeneric:
inviteFriend(sender: tableView.cellForRow(at: indexPath)) inviteFriend(sender: tableView.cellForRow(at: indexPath))
case .joinCommunity:
postSupportRequest()
case .writeReview:
writeReview()
} }
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
} }

View File

@ -52,6 +52,7 @@ class OrganizerViewController: UITableViewController, TableModelHost {
model.add(.siri) model.add(.siri)
} }
model.add(.support) model.add(.support)
model.add(.feedback)
model.add(.about) model.add(.about)
model.add(.destruction) model.add(.destruction)
model.setHeader(L10n.Service.Sections.Vpn.header, for: .vpn) model.setHeader(L10n.Service.Sections.Vpn.header, for: .vpn)
@ -65,8 +66,10 @@ class OrganizerViewController: UITableViewController, TableModelHost {
model.set([.siriShortcuts], in: .siri) model.set([.siriShortcuts], in: .siri)
} }
model.setHeader(L10n.Organizer.Sections.Support.header, for: .support) model.setHeader(L10n.Organizer.Sections.Support.header, for: .support)
model.setHeader(L10n.Organizer.Sections.Feedback.header, for: .feedback)
model.set([.connectionStatus], in: .vpn) model.set([.connectionStatus], in: .vpn)
model.set([.donate, .patreon, .translate], in: .support) model.set([.donate, .patreon, .translate], in: .support)
model.set([.joinCommunity, .writeReview], in: .feedback)
model.set([.openAbout], in: .about) model.set([.openAbout], in: .about)
model.set([.uninstall], in: .destruction) model.set([.uninstall], in: .destruction)
if AppConstants.Flags.isBeta { if AppConstants.Flags.isBeta {
@ -315,6 +318,11 @@ class OrganizerViewController: UITableViewController, TableModelHost {
UIApplication.shared.open(AppConstants.URLs.subreddit, options: [:], completionHandler: nil) UIApplication.shared.open(AppConstants.URLs.subreddit, options: [:], completionHandler: nil)
} }
private func writeReview() {
let url = AppConstants.URLs.review(withId: GroupConstants.App.appId)
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
// //
private func testDisplayLog() { private func testDisplayLog() {
@ -350,6 +358,8 @@ extension OrganizerViewController {
case siri case siri
case support case support
case feedback
case about case about
@ -374,6 +384,10 @@ extension OrganizerViewController {
case patreon case patreon
case translate case translate
case joinCommunity
case writeReview
case openAbout case openAbout
@ -452,6 +466,16 @@ extension OrganizerViewController {
let cell = Cells.setting.dequeue(from: tableView, for: indexPath) let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Organizer.Cells.Translate.caption cell.leftText = L10n.Organizer.Cells.Translate.caption
return cell return cell
case .joinCommunity:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Organizer.Cells.JoinCommunity.caption
return cell
case .writeReview:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Organizer.Cells.WriteReview.caption
return cell
case .openAbout: case .openAbout:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath) let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
@ -502,6 +526,12 @@ extension OrganizerViewController {
case .translate: case .translate:
offerTranslation() offerTranslation()
case .joinCommunity:
subscribeSubreddit()
case .writeReview:
writeReview()
case .openAbout: case .openAbout:
about() about()

View File

@ -830,7 +830,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
case .joinCommunity: case .joinCommunity:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath) let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.About.Cells.JoinCommunity.caption cell.leftText = L10n.Organizer.Cells.JoinCommunity.caption
return cell return cell
case .reportIssue: case .reportIssue:
@ -1035,7 +1035,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
} }
model.setHeader(L10n.Service.Sections.Trusted.header, for: .trusted) model.setHeader(L10n.Service.Sections.Trusted.header, for: .trusted)
model.setHeader(L10n.Service.Sections.Diagnostics.header, for: .diagnostics) model.setHeader(L10n.Service.Sections.Diagnostics.header, for: .diagnostics)
model.setHeader(L10n.About.Sections.Feedback.header, for: .feedback) model.setHeader(L10n.Organizer.Sections.Feedback.header, for: .feedback)
} }
// footers // footers

View File

@ -44,10 +44,13 @@
"organizer.sections.siri.header" = "Siri"; "organizer.sections.siri.header" = "Siri";
"organizer.sections.siri.footer" = "Get help from Siri to speed up your most common interactions with the app."; "organizer.sections.siri.footer" = "Get help from Siri to speed up your most common interactions with the app.";
"organizer.sections.support.header" = "Support"; "organizer.sections.support.header" = "Support";
"organizer.sections.feedback.header" = "Feedback";
"organizer.cells.profile.value.current" = "In use"; "organizer.cells.profile.value.current" = "In use";
"organizer.cells.add_provider.caption" = "Add new provider"; "organizer.cells.add_provider.caption" = "Add new provider";
"organizer.cells.add_host.caption" = "Add new host"; "organizer.cells.add_host.caption" = "Add new host";
"organizer.cells.siri_shortcuts.caption" = "Manage shortcuts"; "organizer.cells.siri_shortcuts.caption" = "Manage shortcuts";
"organizer.cells.join_community.caption" = "Join community";
"organizer.cells.write_review.caption" = "Write a review";
"organizer.cells.donate.caption" = "Make a donation"; "organizer.cells.donate.caption" = "Make a donation";
"organizer.cells.patreon.caption" = "Support me on Patreon"; "organizer.cells.patreon.caption" = "Support me on Patreon";
"organizer.cells.translate.caption" = "Offer to translate"; "organizer.cells.translate.caption" = "Offer to translate";
@ -245,15 +248,12 @@
"about.title" = "About"; "about.title" = "About";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Share"; "about.sections.share.header" = "Share";
"about.sections.feedback.header" = "Feedback";
"about.cells.website.caption" = "Home page"; "about.cells.website.caption" = "Home page";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";
"about.cells.disclaimer.caption" = "Disclaimer"; "about.cells.disclaimer.caption" = "Disclaimer";
"about.cells.privacy_policy.caption" = "Privacy policy"; "about.cells.privacy_policy.caption" = "Privacy policy";
"about.cells.share_twitter.caption" = "Tweet about it!"; "about.cells.share_twitter.caption" = "Tweet about it!";
"about.cells.share_generic.caption" = "Invite a friend"; "about.cells.share_generic.caption" = "Invite a friend";
"about.cells.join_community.caption" = "Join community";
"about.cells.write_review.caption" = "Write a review";
"donation.title" = "Donate"; "donation.title" = "Donate";
"donation.sections.one_time.header" = "One time"; "donation.sections.one_time.header" = "One time";

View File

@ -44,10 +44,13 @@
"organizer.sections.siri.header" = "Siri"; "organizer.sections.siri.header" = "Siri";
"organizer.sections.siri.footer" = "Chiedi aiuto a Siri per velocizzare le tue interazioni più frequenti con l'app."; "organizer.sections.siri.footer" = "Chiedi aiuto a Siri per velocizzare le tue interazioni più frequenti con l'app.";
"organizer.sections.support.header" = "Supporto"; "organizer.sections.support.header" = "Supporto";
"organizer.sections.feedback.header" = "Feedback";
"organizer.cells.profile.value.current" = "In uso"; "organizer.cells.profile.value.current" = "In uso";
"organizer.cells.add_provider.caption" = "Aggiungi provider"; "organizer.cells.add_provider.caption" = "Aggiungi provider";
"organizer.cells.add_host.caption" = "Aggiungi host"; "organizer.cells.add_host.caption" = "Aggiungi host";
"organizer.cells.siri_shortcuts.caption" = "Gestisci comandi rapidi"; "organizer.cells.siri_shortcuts.caption" = "Gestisci comandi rapidi";
"organizer.cells.join_community.caption" = "Entra nella community";
"organizer.cells.write_review.caption" = "Scrivi una recensione";
"organizer.cells.donate.caption" = "Fai una donazione"; "organizer.cells.donate.caption" = "Fai una donazione";
"organizer.cells.patreon.caption" = "Supportami su Patreon"; "organizer.cells.patreon.caption" = "Supportami su Patreon";
"organizer.cells.translate.caption" = "Offri una traduzione"; "organizer.cells.translate.caption" = "Offri una traduzione";
@ -238,15 +241,12 @@
"about.title" = "Informazioni su"; "about.title" = "Informazioni su";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Condividi"; "about.sections.share.header" = "Condividi";
"about.sections.feedback.header" = "Feedback";
"about.cells.website.caption" = "Home page"; "about.cells.website.caption" = "Home page";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";
"about.cells.disclaimer.caption" = "Disclaimer"; "about.cells.disclaimer.caption" = "Disclaimer";
"about.cells.privacy_policy.caption" = "Privacy policy"; "about.cells.privacy_policy.caption" = "Privacy policy";
"about.cells.share_twitter.caption" = "Manda un Tweet!"; "about.cells.share_twitter.caption" = "Manda un Tweet!";
"about.cells.share_generic.caption" = "Invita un amico"; "about.cells.share_generic.caption" = "Invita un amico";
"about.cells.join_community.caption" = "Entra nella community";
"about.cells.write_review.caption" = "Scrivi una recensione";
"donation.title" = "Donazione"; "donation.title" = "Donazione";
"donation.sections.one_time.header" = "Unica"; "donation.sections.one_time.header" = "Unica";

View File

@ -24,10 +24,6 @@ public enum L10n {
/// FAQ /// FAQ
public static let caption = L10n.tr("Localizable", "about.cells.faq.caption") public static let caption = L10n.tr("Localizable", "about.cells.faq.caption")
} }
public enum JoinCommunity {
/// Join community
public static let caption = L10n.tr("Localizable", "about.cells.join_community.caption")
}
public enum PrivacyPolicy { public enum PrivacyPolicy {
/// Privacy policy /// Privacy policy
public static let caption = L10n.tr("Localizable", "about.cells.privacy_policy.caption") public static let caption = L10n.tr("Localizable", "about.cells.privacy_policy.caption")
@ -44,16 +40,8 @@ public enum L10n {
/// Home page /// Home page
public static let caption = L10n.tr("Localizable", "about.cells.website.caption") public static let caption = L10n.tr("Localizable", "about.cells.website.caption")
} }
public enum WriteReview {
/// Write a review
public static let caption = L10n.tr("Localizable", "about.cells.write_review.caption")
}
} }
public enum Sections { public enum Sections {
public enum Feedback {
/// Feedback
public static let header = L10n.tr("Localizable", "about.sections.feedback.header")
}
public enum Share { public enum Share {
/// Share /// Share
public static let header = L10n.tr("Localizable", "about.sections.share.header") public static let header = L10n.tr("Localizable", "about.sections.share.header")
@ -453,6 +441,10 @@ public enum L10n {
/// Make a donation /// Make a donation
public static let caption = L10n.tr("Localizable", "organizer.cells.donate.caption") public static let caption = L10n.tr("Localizable", "organizer.cells.donate.caption")
} }
public enum JoinCommunity {
/// Join community
public static let caption = L10n.tr("Localizable", "organizer.cells.join_community.caption")
}
public enum Patreon { public enum Patreon {
/// Support me on Patreon /// Support me on Patreon
public static let caption = L10n.tr("Localizable", "organizer.cells.patreon.caption") public static let caption = L10n.tr("Localizable", "organizer.cells.patreon.caption")
@ -475,8 +467,16 @@ public enum L10n {
/// Remove VPN configuration /// Remove VPN configuration
public static let caption = L10n.tr("Localizable", "organizer.cells.uninstall.caption") public static let caption = L10n.tr("Localizable", "organizer.cells.uninstall.caption")
} }
public enum WriteReview {
/// Write a review
public static let caption = L10n.tr("Localizable", "organizer.cells.write_review.caption")
}
} }
public enum Sections { public enum Sections {
public enum Feedback {
/// Feedback
public static let header = L10n.tr("Localizable", "organizer.sections.feedback.header")
}
public enum Hosts { public enum Hosts {
/// Import hosts from raw .ovpn configuration files. /// Import hosts from raw .ovpn configuration files.
public static let footer = L10n.tr("Localizable", "organizer.sections.hosts.footer") public static let footer = L10n.tr("Localizable", "organizer.sections.hosts.footer")