diff --git a/enzevalos_iphone.xcodeproj/project.pbxproj b/enzevalos_iphone.xcodeproj/project.pbxproj index 8e0d407d344792489a23016dccc6e02753d2defe..e6905e90923eec20143baf91e040ce12ec76ab3f 100644 --- a/enzevalos_iphone.xcodeproj/project.pbxproj +++ b/enzevalos_iphone.xcodeproj/project.pbxproj @@ -96,6 +96,7 @@ 479C649A21F45DAF00A01071 /* HideShowPasswordTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 479C649821F45DAF00A01071 /* HideShowPasswordTextField.swift */; }; 479C649B21F45DAF00A01071 /* PasswordToggleVisibilityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 479C649921F45DAF00A01071 /* PasswordToggleVisibilityView.swift */; }; 47A2A56E2350A4EF0013883D /* MoreInformationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A2A56D2350A4EF0013883D /* MoreInformationViewController.swift */; }; + 47A2A57223599D180013883D /* FeedbackButtonHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A2A57123599D180013883D /* FeedbackButtonHelper.swift */; }; 47A5D6E22294BF3B0084F81D /* TempKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A5D6E12294BF3A0084F81D /* TempKey.swift */; }; 47A5D6E42294BFF50084F81D /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A5D6E32294BFF50084F81D /* Logger.swift */; }; 47C036FF2347C0F5006295E8 /* ImportKeyOverviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C036FE2347C0F4006295E8 /* ImportKeyOverviewController.swift */; }; @@ -349,6 +350,7 @@ 479C649821F45DAF00A01071 /* HideShowPasswordTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HideShowPasswordTextField.swift; sourceTree = "<group>"; }; 479C649921F45DAF00A01071 /* PasswordToggleVisibilityView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordToggleVisibilityView.swift; sourceTree = "<group>"; }; 47A2A56D2350A4EF0013883D /* MoreInformationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreInformationViewController.swift; sourceTree = "<group>"; }; + 47A2A57123599D180013883D /* FeedbackButtonHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackButtonHelper.swift; sourceTree = "<group>"; }; 47A5D6D52294B4830084F81D /* GTMAppAuth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GTMAppAuth.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 47A5D6DB2294B5220084F81D /* libz.1.1.3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.1.1.3.tbd; path = usr/lib/libz.1.1.3.tbd; sourceTree = SDKROOT; }; 47A5D6DD2294B5480084F81D /* AppAuth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AppAuth.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -969,6 +971,7 @@ A17FDFF2202C685800F7BA89 /* StudySettings.swift */, 47D1302A1F7CEE6D007B14DF /* DebugSettings.swift */, A111F6AB1FA77AF80060AFDE /* Logging */, + 47A2A57123599D180013883D /* FeedbackButtonHelper.swift */, ); name = "debug and study"; sourceTree = "<group>"; @@ -1576,6 +1579,7 @@ F18B44621E73286C0080C041 /* ReadVENDelegate.swift in Sources */, 475B00421F7BB6D6006CDD41 /* PersistentKey+CoreDataClass.swift in Sources */, A10DAA5721F37600005D8BBB /* IntroInfoButton.swift in Sources */, + 47A2A57223599D180013883D /* FeedbackButtonHelper.swift in Sources */, 3EC35F2420037651008BDF95 /* InvitationHelper.swift in Sources */, A1B49E6421E55ECD00ED86FC /* IntroPageViewController.swift in Sources */, A1D5076F1E80257A00B68B38 /* KeyViewController.swift in Sources */, diff --git a/enzevalos_iphone/Base.lproj/Main.storyboard b/enzevalos_iphone/Base.lproj/Main.storyboard index 04981b1796c4e8dd0055598d75e45add354f57f3..39c78cdb74814713876fb78d5820b7ef8819c150 100644 --- a/enzevalos_iphone/Base.lproj/Main.storyboard +++ b/enzevalos_iphone/Base.lproj/Main.storyboard @@ -16,7 +16,7 @@ <objects> <tableViewController storyboardIdentifier="UITableViewController-Ouw-WD-EV6" id="Ouw-WD-EV6" customClass="ReadViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="8" sectionFooterHeight="1" id="oZT-OA-Re5"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <sections> @@ -825,7 +825,7 @@ <objects> <tableViewController storyboardIdentifier="UITableViewController-ooe-0X-glz" id="ooe-0X-glz" customClass="ListViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="ipK-4X-lVA"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <prototypes> @@ -911,7 +911,7 @@ <objects> <tableViewController storyboardIdentifier="UITableViewController-8Di-x2-cWQ" useStoryboardIdentifierAsRestorationIdentifier="YES" id="8Di-x2-cWQ" customClass="ContactViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="lK7-ug-OyQ"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> @@ -1287,7 +1287,7 @@ <rect key="frame" x="0.0" y="809.33333333333337" width="414" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hTc-vs-AIl" id="pJ9-4e-7at"> - <rect key="frame" x="0.0" y="0.0" width="376" height="43.666666666666664"/> + <rect key="frame" x="0.0" y="0.0" width="388" height="43.666666666666664"/> <autoresizingMask key="autoresizingMask"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ll6-yF-xkq"> @@ -1356,7 +1356,7 @@ <objects> <viewController id="jYD-fk-aIP" customClass="KeyViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="ZAH-bZ-S6n"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <edgeInsets key="layoutMargins" top="10" left="20" bottom="10" right="20"/> @@ -1539,7 +1539,7 @@ <objects> <tableViewController storyboardIdentifier="exportInfoViewController" id="7Pd-d5-0wz" customClass="ExportInfoViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" dataMode="prototypes" style="grouped" separatorStyle="default" sectionIndexMinimumDisplayRowCount="1" rowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="2Uv-bd-pB1"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> @@ -2027,7 +2027,7 @@ Um deine sicheren E-Mails auch auf einem anderen Gerät lesen zu können, muss d </connections> </barButtonItem> <button key="titleView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="iUk-lk-1LN"> - <rect key="frame" x="162" y="6" width="91" height="32"/> + <rect key="frame" x="161.66666666666666" y="6" width="91" height="32"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <connections> <action selector="iconButtonPressed:" destination="4Ey-v4-VeB" eventType="touchUpInside" id="Opj-Y1-Vtg"/> @@ -2228,9 +2228,9 @@ Um deine sicheren E-Mails auch auf einem anderen Gerät lesen zu können, muss d </scene> </scenes> <inferredMetricsTieBreakers> - <segue reference="3Wb-uL-BB5"/> + <segue reference="Sm1-yp-Umv"/> <segue reference="td8-VW-Wrt"/> - <segue reference="btx-4o-o0r"/> + <segue reference="DcR-GX-scc"/> <segue reference="NPH-pL-mw2"/> <segue reference="Fv4-FT-5gV"/> <segue reference="PxQ-Nb-6Fq"/> diff --git a/enzevalos_iphone/FeedbackButtonHelper.swift b/enzevalos_iphone/FeedbackButtonHelper.swift new file mode 100644 index 0000000000000000000000000000000000000000..1030ce821d766c870293505a286c7fc97ae7e80d --- /dev/null +++ b/enzevalos_iphone/FeedbackButtonHelper.swift @@ -0,0 +1,38 @@ +// +// FeedbackButtonHelper.swift +// enzevalos_iphone +// +// Created by Oliver Wiese on 18.10.19. +// Copyright © 2019 fu-berlin. All rights reserved. +// + +import Foundation + +enum ViewName: String { + case Inbox, Read +} + +class FeedbackButtonHelper { + + static let Name = NSLocalizedString("Feedback.Name", comment: "Feedback") + + static func composeFeedback(view: ViewName, navigationController: UINavigationController?) { + let receiver = SUPPORT_MAIL_ADR + let subject = String(format: NSLocalizedString("Feedback.Mail.Subject", comment: "Feedback"), view.rawValue) + let body = String(format: NSLocalizedString("Feedback.Mail.Body", comment: ""), view.rawValue) + let mail = EphemeralMail(to: NSSet(object: receiver), subject: subject, body: String(format: body, StudySettings.studyID)) + if let navi = navigationController, let sendController = FeedbackButtonHelper.createSendViewController(navigationController: navi) { + sendController.prefilledMail = mail + sendController.isFeedback = true + } + } + + private static func createSendViewController(navigationController: UINavigationController) -> SendViewController? { + let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main) + if let viewController = mainStoryboard.instantiateViewController(withIdentifier: "SendViewController") as? SendViewController { + navigationController.pushViewController(viewController, animated: true) + return viewController + } + return nil + } +} diff --git a/enzevalos_iphone/SendViewController.swift b/enzevalos_iphone/SendViewController.swift index 1f5f3a65d472b87af539a8b3eeac6cfaaf6d65cc..3dc731e96584ccfc5c2b8a34139bf2d5eb611f1b 100644 --- a/enzevalos_iphone/SendViewController.swift +++ b/enzevalos_iphone/SendViewController.swift @@ -69,6 +69,8 @@ class SendViewController: UIViewController { var contactsWithRepealedKeys: [String] = [] var composesTravelFollowUpReminder: Bool = false + var isFeedback = false + var presentTravelDialog: Bool { for contact in (dataDelegate.entriesWithRepealedKeys(toText) + dataDelegate.entriesWithRepealedKeys(ccText)) { if !contactsWithRepealedKeys.contains(contact) && !composesTravelFollowUpReminder { @@ -645,11 +647,19 @@ class SendViewController: UIViewController { } controller?.dismissAction = { [weak self] in - self?.dismiss(animated: true, completion: nil) + if self?.isFeedback ?? false{ + self?.navigationController?.popViewController(animated: true) + } else { + self?.navigationController?.dismiss(animated: true, completion: nil) + } } } else { - self.navigationController?.dismiss(animated: true, completion: nil) + if isFeedback { + self.navigationController?.popViewController(animated: true) + } else { + self.navigationController?.dismiss(animated: true, completion: nil) + } return } } @@ -811,7 +821,11 @@ class SendViewController: UIViewController { if let delegate = self?.sendViewDelegate { delegate.compositionDiscarded() } - self?.navigationController?.dismiss(animated: true, completion: nil) + if self?.isFeedback ?? false { + self?.navigationController?.popViewController(animated: true) + } else { + self?.navigationController?.dismiss(animated: true, completion: nil) + } })) alert.addAction(UIAlertAction(title: NSLocalizedString("SaveAsDraft", comment: "save the written E-Mail as draft"), style: .default, handler: { [weak self] (action: UIAlertAction!) -> Void in self?.mailHandler.createDraft(toEntrys as NSArray as! [String], ccEntrys: ccEntrys as NSArray as! [String], bccEntrys: [], subject: subject, message: message, callback: { [weak self] (error: Error?) -> Void in @@ -821,7 +835,11 @@ class SendViewController: UIViewController { if let delegate = self?.sendViewDelegate { delegate.compositionSavedAsDraft() } - self?.navigationController?.dismiss(animated: true, completion: nil) + if self?.isFeedback ?? false { + self?.navigationController?.popViewController(animated: true) + } else { + self?.navigationController?.dismiss(animated: true, completion: nil) + } } }) })) diff --git a/enzevalos_iphone/de.lproj/Localizable.strings b/enzevalos_iphone/de.lproj/Localizable.strings index 7dcf4a385d272cd5cd86426dc695e13d57e72b1e..4bd479c6cddac4e1d75dabebd2a84fbcaa117ac5 100644 --- a/enzevalos_iphone/de.lproj/Localizable.strings +++ b/enzevalos_iphone/de.lproj/Localizable.strings @@ -345,3 +345,6 @@ "Information.Links.EFF.Windows" = "Mail-Verschlüsselung Windows"; "Information.Links.Video.DE" = "Video: einfache Erklärung"; "Information.Links.Video.ENG" = "Video: einfache Erklärung (in englisch)"; +"Feedback.Mail.Subject" = "[Letterbox] Feedback über %@"; +"Feedback.Mail.Body" = "Wie verständlich sind die Texte [sehr verständlich: 1 bis sehr unverständlich 5]? \n\n\n Was kann verbessert werden? (von konrkete Verbesserungsvorschläge für Texte bis hin zu Hinweisen über Unklarheiten oder weitere Erklärungen."; +"Feedback.Name" = "Feedback"; diff --git a/enzevalos_iphone/en.lproj/Localizable.strings b/enzevalos_iphone/en.lproj/Localizable.strings index b0dfa36443637a678b5d611497403ccdd7e07b4f..43f90b08aa9776fd9743463a6349fa13f1464f11 100644 --- a/enzevalos_iphone/en.lproj/Localizable.strings +++ b/enzevalos_iphone/en.lproj/Localizable.strings @@ -315,5 +315,6 @@ "Information.Links.EFF.Windows" = "Mail encryption on on Windows"; "Information.Links.Video.DE" = "Video: simple explaination (in German)"; "Information.Links.Video.ENG" = "Video: simple explaination"; - - +"Feedback.Mail.Subject" = "[Letterbox] Feedback about %@"; +"Feedback.Mail.Body" = "Wie verständlich sind die Texte [sehr verständlich: 1 bis sehr unverständlich 5]? \n\n\n Was kann verbessert werden? (von konrkete Verbesserungsvorschläge für Texte bis hin zu Hinweisen über Unklarheiten oder weitere Erklärungen."; +"Feedback.Name" = "Feedback";