diff --git a/FlowCrypt.xcodeproj/project.pbxproj b/FlowCrypt.xcodeproj/project.pbxproj index aea895c05..786d34444 100644 --- a/FlowCrypt.xcodeproj/project.pbxproj +++ b/FlowCrypt.xcodeproj/project.pbxproj @@ -11,16 +11,13 @@ 04B472951ECE29F600B8266F /* MyMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B472921ECE29F600B8266F /* MyMenuViewController.swift */; }; 04B472961ECE29F600B8266F /* SideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B472931ECE29F600B8266F /* SideMenuNavigationController.swift */; }; 211392A5266511E6009202EC /* PubLookup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211392A4266511E6009202EC /* PubLookup.swift */; }; - 21489B6B267B7BD800BDE4AC /* FilesManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B6A267B7BD800BDE4AC /* FilesManagerTests.swift */; }; - 21489B6C267B7C6A00BDE4AC /* FilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215897E7267A553200423694 /* FilesManager.swift */; }; - 21489B6E267B7D5000BDE4AC /* FileMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B6D267B7D5000BDE4AC /* FileMock.swift */; }; - 215897E8267A553300423694 /* FilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215897E7267A553200423694 /* FilesManager.swift */; }; - 2196A2202684B9BE001B9E00 /* URLExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2196A21F2684B9BE001B9E00 /* URLExtension.swift */; }; 21489B78267CB42400BDE4AC /* ClientConfigurationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B77267CB42400BDE4AC /* ClientConfigurationProvider.swift */; }; 21489B7A267CB4DF00BDE4AC /* ClientConfigurationObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B79267CB4DF00BDE4AC /* ClientConfigurationObject.swift */; }; 21489B7C267CBA0E00BDE4AC /* ClientConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B7B267CBA0E00BDE4AC /* ClientConfiguration.swift */; }; 21489B80267CC39E00BDE4AC /* OrganisationalRulesService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B7F267CC39E00BDE4AC /* OrganisationalRulesService.swift */; }; 21489B83267CC99C00BDE4AC /* OrganisationalRulesServiceError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21489B82267CC99C00BDE4AC /* OrganisationalRulesServiceError.swift */; }; + 215897E8267A553300423694 /* FilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215897E7267A553200423694 /* FilesManager.swift */; }; + 2196A2202684B9BE001B9E00 /* URLExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2196A21F2684B9BE001B9E00 /* URLExtension.swift */; }; 21C7DEFC26669A3700C44800 /* CalendarExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C7DEFB26669A3700C44800 /* CalendarExtension.swift */; }; 21C7DEFE26669CE100C44800 /* DateFormattingExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F56BD3723438C7000A7371A /* DateFormattingExtensions.swift */; }; 21C7DF0526697DA500C44800 /* PromiseKitExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C7DF0426697DA500C44800 /* PromiseKitExtension.swift */; }; @@ -109,7 +106,7 @@ 9F7E5137267AA51B00CE37C3 /* AlertsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7E5136267AA51B00CE37C3 /* AlertsFactory.swift */; }; 9F8220D526336626004B2009 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8220D426336626004B2009 /* Logger.swift */; }; 9F82779823737E0900E19C07 /* MessageViewDecorator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82779723737E0900E19C07 /* MessageViewDecorator.swift */; }; - 9F82D352256D74FA0069A702 /* InboxViewControllerContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82D351256D74FA0069A702 /* InboxViewControllerContainer.swift */; }; + 9F82D352256D74FA0069A702 /* InboxViewContainerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F82D351256D74FA0069A702 /* InboxViewContainerController.swift */; }; 9F92EE72236F165E009BE0D7 /* EncryptedStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F92EE71236F165E009BE0D7 /* EncryptedStorage.swift */; }; 9F9361A52573CE260009912F /* MessageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9361A42573CE260009912F /* MessageProvider.swift */; }; 9F9362062573D0C80009912F /* Gmail+MessagesList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9362052573D0C80009912F /* Gmail+MessagesList.swift */; }; @@ -366,13 +363,13 @@ 211392A4266511E6009202EC /* PubLookup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PubLookup.swift; sourceTree = ""; }; 21489B6A267B7BD800BDE4AC /* FilesManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesManagerTests.swift; sourceTree = ""; }; 21489B6D267B7D5000BDE4AC /* FileMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileMock.swift; sourceTree = ""; }; - 215897E7267A553200423694 /* FilesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesManager.swift; sourceTree = ""; }; - 2196A21F2684B9BE001B9E00 /* URLExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLExtension.swift; sourceTree = ""; }; 21489B77267CB42400BDE4AC /* ClientConfigurationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientConfigurationProvider.swift; sourceTree = ""; }; 21489B79267CB4DF00BDE4AC /* ClientConfigurationObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientConfigurationObject.swift; sourceTree = ""; }; 21489B7B267CBA0E00BDE4AC /* ClientConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientConfiguration.swift; sourceTree = ""; }; 21489B7F267CC39E00BDE4AC /* OrganisationalRulesService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganisationalRulesService.swift; sourceTree = ""; }; 21489B82267CC99C00BDE4AC /* OrganisationalRulesServiceError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganisationalRulesServiceError.swift; sourceTree = ""; }; + 215897E7267A553200423694 /* FilesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesManager.swift; sourceTree = ""; }; + 2196A21F2684B9BE001B9E00 /* URLExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLExtension.swift; sourceTree = ""; }; 21C7DEFB26669A3700C44800 /* CalendarExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarExtension.swift; sourceTree = ""; }; 21C7DF0426697DA500C44800 /* PromiseKitExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromiseKitExtension.swift; sourceTree = ""; }; 21C7DF08266C0D8F00C44800 /* EnterpriseServerApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterpriseServerApi.swift; sourceTree = ""; }; @@ -513,7 +510,7 @@ 9F82779923737E1900E19C07 /* MessageSenderNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSenderNode.swift; sourceTree = ""; }; 9F82779B23737E2A00E19C07 /* MessageSubjectNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSubjectNode.swift; sourceTree = ""; }; 9F82779D23737E3800E19C07 /* MessageTextSubjectNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageTextSubjectNode.swift; sourceTree = ""; }; - 9F82D351256D74FA0069A702 /* InboxViewControllerContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxViewControllerContainer.swift; sourceTree = ""; }; + 9F82D351256D74FA0069A702 /* InboxViewContainerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxViewContainerController.swift; sourceTree = ""; }; 9F8D5E61236B04E300186E43 /* CellNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellNode.swift; sourceTree = ""; }; 9F92EE6F236F144C009BE0D7 /* TextFieldCellNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldCellNode.swift; sourceTree = ""; }; 9F92EE71236F165E009BE0D7 /* EncryptedStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedStorage.swift; sourceTree = ""; }; @@ -783,14 +780,6 @@ path = FilesManager; sourceTree = ""; }; - 215897E6267A551300423694 /* FilesManager */ = { - isa = PBXGroup; - children = ( - 215897E7267A553200423694 /* FilesManager.swift */, - ); - path = FilesManager; - sourceTree = ""; - }; 21489B81267CC3BC00BDE4AC /* Organisational Rules Service */ = { isa = PBXGroup; children = ( @@ -801,6 +790,14 @@ path = "Organisational Rules Service"; sourceTree = ""; }; + 215897E6267A551300423694 /* FilesManager */ = { + isa = PBXGroup; + children = ( + 215897E7267A553200423694 /* FilesManager.swift */, + ); + path = FilesManager; + sourceTree = ""; + }; 21CE25D32650034500ADFF4B /* WKDURLs */ = { isa = PBXGroup; children = ( @@ -931,9 +928,9 @@ 5A39F43B239ECFA0001F4607 /* KeySettings */ = { isa = PBXGroup; children = ( + 5ADEDCB423A4262600EC495E /* Key List */, D29A0002240C140500C1387D /* Key Detail Info */, D29A0003240C141200C1387D /* Public Key */, - 5ADEDCB423A4262600EC495E /* Key List */, 5ADEDCB723A426E900EC495E /* Key Details */, ); path = KeySettings; @@ -1147,7 +1144,7 @@ 9F4300A52571016400791CFB /* Container */ = { isa = PBXGroup; children = ( - 9F82D351256D74FA0069A702 /* InboxViewControllerContainer.swift */, + 9F82D351256D74FA0069A702 /* InboxViewContainerController.swift */, 9F4300CB2571045B00791CFB /* InboxViewControllerContainerDecorator.swift */, ); path = Container; @@ -2525,7 +2522,7 @@ 9FC7EAB3266A404D00F3BF5D /* PassPhraseObject.swift in Sources */, 9F31AB8C23298B3F00CF87EA /* Imap+retry.swift in Sources */, 9F79229426696B9300DA3D80 /* KeyDataStorage.swift in Sources */, - 9F82D352256D74FA0069A702 /* InboxViewControllerContainer.swift in Sources */, + 9F82D352256D74FA0069A702 /* InboxViewContainerController.swift in Sources */, D227C0E3250538100070F805 /* LocalFoldersProvider.swift in Sources */, 9FA405C7265AEBA50084D133 /* SetupGenerateKeyViewController.swift in Sources */, 9F6EE1552597399D0059BA51 /* BackupProvider.swift in Sources */, diff --git a/FlowCrypt/Common UI/View Controllers/WebViewController.swift b/FlowCrypt/Common UI/View Controllers/WebViewController.swift index c33fc7891..bfebc88a3 100644 --- a/FlowCrypt/Common UI/View Controllers/WebViewController.swift +++ b/FlowCrypt/Common UI/View Controllers/WebViewController.swift @@ -9,6 +9,9 @@ import UIKit import WebKit +/** + * InApp WebViewController to show web content. Used for showing privacy policy etc in splash screen and settings + */ final class WebViewController: UIViewController { private lazy var webView = WKWebView() diff --git a/FlowCrypt/Controllers/Bootstrap/BootstrapViewController.swift b/FlowCrypt/Controllers/Bootstrap/BootstrapViewController.swift index 8016f4214..00f3b82e0 100644 --- a/FlowCrypt/Controllers/Bootstrap/BootstrapViewController.swift +++ b/FlowCrypt/Controllers/Bootstrap/BootstrapViewController.swift @@ -8,14 +8,14 @@ import UIKit +/** + * View controller with activity indicator which is presented before all AppStartup activity finished (setup Core, migration of the DB...) + */ final class BootstrapViewController: UIViewController { - let imap = Imap.shared - var completion: ((Error?) -> Void)? - override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .backgroundColor - let activityIndicator = UIActivityIndicatorView(style: .gray) + let activityIndicator = UIActivityIndicatorView(style: .medium) activityIndicator.startAnimating() view.addSubview(activityIndicator) activityIndicator.center = view.center diff --git a/FlowCrypt/Controllers/Compose/ComposeViewController.swift b/FlowCrypt/Controllers/Compose/ComposeViewController.swift index 08ee7a173..c9d9941e9 100644 --- a/FlowCrypt/Controllers/Compose/ComposeViewController.swift +++ b/FlowCrypt/Controllers/Compose/ComposeViewController.swift @@ -7,6 +7,11 @@ import FlowCryptCommon import FlowCryptUI import Promises +/** + * View controller to compose the message and send it + * - User can be redirected here from *InboxViewController* by tapping on *+* + * - Or from *MessageViewController* controller by tapping on *reply* + */ final class ComposeViewController: TableNodeViewController { struct Recipient { let email: String diff --git a/FlowCrypt/Controllers/Inbox/Container/InboxViewControllerContainer.swift b/FlowCrypt/Controllers/Inbox/Container/InboxViewContainerController.swift similarity index 94% rename from FlowCrypt/Controllers/Inbox/Container/InboxViewControllerContainer.swift rename to FlowCrypt/Controllers/Inbox/Container/InboxViewContainerController.swift index 1750f2492..8c4cb1563 100644 --- a/FlowCrypt/Controllers/Inbox/Container/InboxViewControllerContainer.swift +++ b/FlowCrypt/Controllers/Inbox/Container/InboxViewContainerController.swift @@ -10,9 +10,11 @@ import AsyncDisplayKit import FlowCryptCommon import FlowCryptUI -// MARK: - InboxViewControllerContainer -// Used to fetch folders and get correct path for "inbox" folder -final class InboxViewControllerContainer: TableNodeViewController { +/** + * View controller which serves as intermediate controller + * - Used to fetch folders and get correct path for "inbox" folder + */ +final class InboxViewContainerController: TableNodeViewController { private let inbox = "inbox" private enum InboxViewControllerContainerError: Error { @@ -102,7 +104,7 @@ final class InboxViewControllerContainer: TableNodeViewController { } } -extension InboxViewControllerContainer: ASTableDelegate, ASTableDataSource { +extension InboxViewContainerController: ASTableDelegate, ASTableDataSource { func tableNode(_ tableNode: ASTableNode, numberOfRowsInSection section: Int) -> Int { switch state { case .empty, .loading: diff --git a/FlowCrypt/Controllers/Inbox/InboxViewController.swift b/FlowCrypt/Controllers/Inbox/InboxViewController.swift index bdc5a6703..5b5a08f82 100644 --- a/FlowCrypt/Controllers/Inbox/InboxViewController.swift +++ b/FlowCrypt/Controllers/Inbox/InboxViewController.swift @@ -7,6 +7,11 @@ import FlowCryptCommon import FlowCryptUI import Promises +/** + * View controller which shows message list of selected folder or inbox + * - Initial view controller of the *main flow* when user is already signed in + * - User can be redirected here via selecting folder from menu *MyMenuViewController* + */ final class InboxViewController: ASDKViewController { private enum Constants { static let numberOfMessagesToLoad = 50 diff --git a/FlowCrypt/Controllers/Msg/MessageViewController.swift b/FlowCrypt/Controllers/Msg/MessageViewController.swift index d09328065..bb731b789 100644 --- a/FlowCrypt/Controllers/Msg/MessageViewController.swift +++ b/FlowCrypt/Controllers/Msg/MessageViewController.swift @@ -7,6 +7,10 @@ import FlowCryptCommon import FlowCryptUI import Promises +/** + * View controller to render an email message (sender, subject, message body, attachments) + * Also contains buttons to archive, move to trash, move to inbox, mark as unread, and reply + */ final class MessageViewController: TableNodeViewController { struct Input { var objMessage: Message diff --git a/FlowCrypt/Controllers/Search/SearchViewController.swift b/FlowCrypt/Controllers/Search/SearchViewController.swift index c1d2d0dad..31ea6395a 100644 --- a/FlowCrypt/Controllers/Search/SearchViewController.swift +++ b/FlowCrypt/Controllers/Search/SearchViewController.swift @@ -10,6 +10,10 @@ import AsyncDisplayKit import FlowCryptCommon import FlowCryptUI +/** + * View controller to search messages in folders + * - User can be redirected here from *InboxViewController* by tapping on search icon + */ final class SearchViewController: TableNodeViewController { private enum Constants { // TODO: - Ticket - Add pagination for SearchViewController diff --git a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift index d0e2233d9..b40ac03b7 100644 --- a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift +++ b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift @@ -9,6 +9,10 @@ import AsyncDisplayKit import FlowCryptUI +/** + * View controller which shows details about a contact and the public key recorded for it + * - User can be redirected here from settings *ContactsListViewController* by tapping on a particular contact + */ final class ContactDetailViewController: TableNodeViewController { typealias ContactDetailAction = (Action) -> Void diff --git a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactsListViewController.swift b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactsListViewController.swift index 9729a38aa..6105ff505 100644 --- a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactsListViewController.swift +++ b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactsListViewController.swift @@ -10,6 +10,11 @@ import AsyncDisplayKit import FlowCryptCommon import FlowCryptUI +/** + * View controller which shows saved user contacts list + * - User can be redirected here from settings *SettingsViewController* + * - By tapping on a particular contact, user will be forwarded to *ContactDetailViewController* + */ final class ContactsListViewController: TableNodeViewController { private let decorator: ContactsListDecoratorType private let contactsProvider: LocalContactsProviderType diff --git a/FlowCrypt/Controllers/Settings/KeyLegal/LegalViewController.swift b/FlowCrypt/Controllers/Settings/KeyLegal/LegalViewController.swift index e4c1c85e9..218a24fbb 100644 --- a/FlowCrypt/Controllers/Settings/KeyLegal/LegalViewController.swift +++ b/FlowCrypt/Controllers/Settings/KeyLegal/LegalViewController.swift @@ -8,6 +8,10 @@ import UIKit +/** + * View controller which shows legal information (privacy, license, sources, terms) + * - User can be redirected here from settings *SettingsViewController* + */ final class LegalViewController: UIViewController { private let provider: LegalViewControllersProviderType private lazy var segment: SegmentedViewController = SegmentedViewController( diff --git a/FlowCrypt/Controllers/Settings/KeySettings/Key Detail Info/KeyDetailInfoViewController.swift b/FlowCrypt/Controllers/Settings/KeySettings/Key Detail Info/KeyDetailInfoViewController.swift index c0c714b9f..6de221596 100644 --- a/FlowCrypt/Controllers/Settings/KeySettings/Key Detail Info/KeyDetailInfoViewController.swift +++ b/FlowCrypt/Controllers/Settings/KeySettings/Key Detail Info/KeyDetailInfoViewController.swift @@ -9,6 +9,10 @@ import AsyncDisplayKit import FlowCryptUI +/** + * View controller which shows information about our own private and public key details (key words, fingerprint ...) + * - User can be redirected here from *KeyDetailViewController* + */ final class KeyDetailInfoViewController: TableNodeViewController { enum Parts: Int, CaseIterable { case keyWord, fingerptint, longId, date, users, separator diff --git a/FlowCrypt/Controllers/Settings/KeySettings/Key Details/KeyDetailViewController.swift b/FlowCrypt/Controllers/Settings/KeySettings/Key Details/KeyDetailViewController.swift index 414a7135b..920b38649 100644 --- a/FlowCrypt/Controllers/Settings/KeySettings/Key Details/KeyDetailViewController.swift +++ b/FlowCrypt/Controllers/Settings/KeySettings/Key Details/KeyDetailViewController.swift @@ -9,6 +9,10 @@ import AsyncDisplayKit import FlowCryptUI +/** + * View controller which shows possible option for the keys, like show it's public part, details, copy or share it. + * - User can be redirected here from *KeyDetailViewController* + */ final class KeyDetailViewController: TableNodeViewController { enum Parts: Int, CaseIterable { case description, publicInfo, keyDetails, copy, save, privateInfo diff --git a/FlowCrypt/Controllers/Settings/KeySettings/Key List/KeySettingsViewController.swift b/FlowCrypt/Controllers/Settings/KeySettings/Key List/KeySettingsViewController.swift index f8277d2b9..1818e34d0 100644 --- a/FlowCrypt/Controllers/Settings/KeySettings/Key List/KeySettingsViewController.swift +++ b/FlowCrypt/Controllers/Settings/KeySettings/Key List/KeySettingsViewController.swift @@ -9,6 +9,12 @@ import AsyncDisplayKit import FlowCryptUI +/** + * View controller shows list of user keys + * - User can be redirected here from settings *SettingsViewController* + * - User can proceed to importing keys *SetupManuallyImportKeyViewController* + * - User can see detail information for the key in *KeyDetailViewController* + */ final class KeySettingsViewController: TableNodeViewController { private var keys: [KeyDetails] = [] private let decorator: KeySettingsViewDecoratorType diff --git a/FlowCrypt/Controllers/Settings/KeySettings/Public Key/PublicKeyDetailViewController.swift b/FlowCrypt/Controllers/Settings/KeySettings/Public Key/PublicKeyDetailViewController.swift index 27a25ed07..e587cf129 100644 --- a/FlowCrypt/Controllers/Settings/KeySettings/Public Key/PublicKeyDetailViewController.swift +++ b/FlowCrypt/Controllers/Settings/KeySettings/Public Key/PublicKeyDetailViewController.swift @@ -9,6 +9,10 @@ import AsyncDisplayKit import FlowCryptUI +/** + * View controller which shows information about public key + * - User can be redirected here from *KeyDetailViewController* + */ final class PublicKeyDetailViewController: TableNodeViewController { private let text: String diff --git a/FlowCrypt/Controllers/Settings/Settings List/SettingsViewController.swift b/FlowCrypt/Controllers/Settings/Settings List/SettingsViewController.swift index 8ef99d8e3..59d8ee368 100644 --- a/FlowCrypt/Controllers/Settings/Settings List/SettingsViewController.swift +++ b/FlowCrypt/Controllers/Settings/Settings List/SettingsViewController.swift @@ -9,6 +9,12 @@ import AsyncDisplayKit import FlowCryptUI +/** + * User settings view controller + * - Shows list of possible settings(backups, privacy, contacts, keys, atteseter, notifications, legal, experimental) + * - User can be redirected here from side menu + * - Tap on each row will navigate user to appropriate settings controller + */ final class SettingsViewController: TableNodeViewController { private enum Settings: Int, CaseIterable { case backups, privacy, contacts, keys, atteseter, notifications, legal, experimental diff --git a/FlowCrypt/Controllers/Setup/SetupBackupsViewController.swift b/FlowCrypt/Controllers/Setup/SetupBackupsViewController.swift index 70fe1f718..b019332d6 100644 --- a/FlowCrypt/Controllers/Setup/SetupBackupsViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupBackupsViewController.swift @@ -6,6 +6,15 @@ import AsyncDisplayKit import FlowCryptUI import Promises +/** + * Scene which is responsible for recovering user account with backups from inbox and entered pass phrase + * (typically used for end-users, enterprises tend to either import manually or with EKM) + * - User is sent here from **SetupInitialViewController** if there was key backups found in inbox + * - User will be prompted to enter his pass phrase + * - Pass phrase can be saved in memory for 4 hours or in encrypted local storage + * - In case entered pass phrase matches with backups, user will be redirected to **main flow** (inbox view) + */ + final class SetupBackupsViewController: TableNodeViewController, PassPhraseSaveable { private enum Parts: Int, CaseIterable { case title, description, passPhrase, divider, saveLocally, saveInMemory, action, optionalAction diff --git a/FlowCrypt/Controllers/Setup/SetupGenerateKeyViewController.swift b/FlowCrypt/Controllers/Setup/SetupGenerateKeyViewController.swift index c255ae242..a0f9f70fb 100644 --- a/FlowCrypt/Controllers/Setup/SetupGenerateKeyViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupGenerateKeyViewController.swift @@ -22,6 +22,13 @@ enum CreateKeyError: Error { case conformingPassPhraseError } +/** + * Controller which is responsible for generating a new key during setup + * - User is sent here from **SetupInitialViewController** in case there are no backups found + * - Here user can enter a pass phrase (can be saved in memory or in encrypted storage) and generate a key + * - After key is generated, user will be redirected to **main flow** (inbox view) + */ + final class SetupGenerateKeyViewController: TableNodeViewController, PassPhraseSaveable { enum Parts: Int, CaseIterable { case title, description, passPhrase, divider, saveLocally, saveInMemory, action, subtitle diff --git a/FlowCrypt/Controllers/Setup/SetupInitialViewController.swift b/FlowCrypt/Controllers/Setup/SetupInitialViewController.swift index ceea78488..fac5b7e4a 100644 --- a/FlowCrypt/Controllers/Setup/SetupInitialViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupInitialViewController.swift @@ -9,6 +9,14 @@ import AsyncDisplayKit import FlowCryptUI +/** + * Initial controller for setup flow which is responsible for searching backups and + * then redirecting user to appropriate setup flow. + * - In case backup keys are found, user will be redirected to **SetupBackupsViewController** + * - In case there are no backups, user will have two options presented in this view: + * - Import key - **SetupManuallyImportKeyViewController** + * - Create new key - **SetupGenerateKeyViewController** + */ final class SetupInitialViewController: TableNodeViewController { private enum Parts: Int, CaseIterable { case title, description, createKey, importKey, anotherAccount diff --git a/FlowCrypt/Controllers/Setup/SetupManuallyEnterPassPhraseViewController.swift b/FlowCrypt/Controllers/Setup/SetupManuallyEnterPassPhraseViewController.swift index fb8ab5fb4..38caabeb3 100644 --- a/FlowCrypt/Controllers/Setup/SetupManuallyEnterPassPhraseViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupManuallyEnterPassPhraseViewController.swift @@ -9,6 +9,11 @@ import AsyncDisplayKit import FlowCryptUI +/** + * Controller which is responsible for entering pass phrase after key/keys was imported or pasted + * User will be sent here from **SetupManuallyImportKeyViewController** from setup flow or from settings + * After user enters pass phrase sccessfully, account will be set up and they will be sent to main flow (inbox view) + */ final class SetupManuallyEnterPassPhraseViewController: TableNodeViewController, PassPhraseSaveable { private enum Parts: Int, CaseIterable { case title, description, passPhrase, divider, saveLocally, saveInMemory, enterPhrase, chooseAnother diff --git a/FlowCrypt/Controllers/Setup/SetupManuallyImportKeyViewController.swift b/FlowCrypt/Controllers/Setup/SetupManuallyImportKeyViewController.swift index 7765d1100..2a9c26593 100644 --- a/FlowCrypt/Controllers/Setup/SetupManuallyImportKeyViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupManuallyImportKeyViewController.swift @@ -10,6 +10,13 @@ import AsyncDisplayKit import FlowCryptUI import MobileCoreServices +/** + * Controller which is responsible for importing key from a file or to paste it from pasteBoard + * - User can reach this screen: + * - when there are no backups found from **SetupInitialViewController** in setup flow + * - or from key settings **KeySettingsViewController** + * - After key is added user will be redirected to **SetupManuallyEnterPassPhraseViewController** + */ final class SetupManuallyImportKeyViewController: TableNodeViewController { private enum Parts: Int, CaseIterable { case title, description, fileImport, pasteBoardImport diff --git a/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift b/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift index 581efe7b2..0cd27d8da 100644 --- a/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift +++ b/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift @@ -14,6 +14,12 @@ protocol SideMenuViewController { func didOpen() } +/** + * Navigation Controller inherited from ENSideMenuNavigationController + * - Encapsulates logic of status bar appearance, burger menu width, offsets and etc + * - Responsible for disabling gestures on side controllers when menu is shown + * - Adds menu button or back button as part of navigation item, based on pushed controller + */ final class SideMenuNavigationController: ENSideMenuNavigationController { private var isStatusBarHidden = false { didSet { @@ -47,7 +53,7 @@ final class SideMenuNavigationController: ENSideMenuNavigationController { convenience init() { let menu = MyMenuViewController() - let contentViewController = InboxViewControllerContainer() + let contentViewController = InboxViewContainerController() self.init(menuViewController: menu, contentViewController: contentViewController) menuViewContoller = menu sideMenu = ENSideMenu(sourceView: view, menuViewController: menu, menuPosition: .left).then { diff --git a/FlowCrypt/Controllers/SideMenu/Menu/MyMenuViewController.swift b/FlowCrypt/Controllers/SideMenu/Menu/MyMenuViewController.swift index 94230ced4..92813605c 100644 --- a/FlowCrypt/Controllers/SideMenu/Menu/MyMenuViewController.swift +++ b/FlowCrypt/Controllers/SideMenu/Menu/MyMenuViewController.swift @@ -6,6 +6,13 @@ import AsyncDisplayKit import FlowCryptUI import Promises +/** + * Menu view controller + * Represents User folders and menu buttons like log out and settings + * User see this screen when taps the burger menu + * On tap on each folder user should be redirected to `InboxViewController` with selected folder + * On settings tap user will be redirected to `SettingsViewController` + */ final class MyMenuViewController: ASDKViewController { private enum Constants { static let allMail = "folder_all_mail".localized diff --git a/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift b/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift index 4f5d470a1..4ae2ba9ee 100644 --- a/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift +++ b/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift @@ -17,6 +17,9 @@ final class MainNavigationController: ASNavigationController { } } +/** + * Default styled UINavigationController for the app + */ extension MainNavigationController: UINavigationControllerDelegate { func navigationController(_: UINavigationController, willShow viewController: UIViewController, animated _: Bool) { viewController.navigationItem.hidesBackButton = true diff --git a/FlowCrypt/Controllers/SignIn Other/EmailProviderViewController.swift b/FlowCrypt/Controllers/SignIn Other/EmailProviderViewController.swift index 657a4d3ee..8eb52faf5 100644 --- a/FlowCrypt/Controllers/SignIn Other/EmailProviderViewController.swift +++ b/FlowCrypt/Controllers/SignIn Other/EmailProviderViewController.swift @@ -10,6 +10,11 @@ import AsyncDisplayKit import FlowCryptUI import Promises +/** + * Controller that gives a possibility for the user to enter information about his email provider like, account, imap/smtp information + * - User redirects here from SignInViewController + * - After successful connection user will be redirected to *setup flow* which would typically means *SetupInitialViewController* + */ final class EmailProviderViewController: TableNodeViewController { private enum UserError: Error { case password @@ -261,10 +266,11 @@ extension EmailProviderViewController { } private func buttonNode() -> ButtonCellNode { - ButtonCellNode( + let input = ButtonCellNode.Input( title: decorator.connectButtonTitle, insets: decorator.connectButtonInsets - ) { [weak self] in + ) + return ButtonCellNode(input: input) { [weak self] in self?.connect() } } diff --git a/FlowCrypt/Controllers/SignIn/SignInViewController.swift b/FlowCrypt/Controllers/SignIn/SignInViewController.swift index 79ae91558..c0a367fb2 100644 --- a/FlowCrypt/Controllers/SignIn/SignInViewController.swift +++ b/FlowCrypt/Controllers/SignIn/SignInViewController.swift @@ -6,6 +6,14 @@ import AsyncDisplayKit import FlowCryptCommon import FlowCryptUI +/** + * Sign in controller + * - User can sign in with: + * - Gmail + * - Outlook (not implemented yet) + * - Other email provider (*EmailProviderViewController*) + * - User can also check privacy, terms and security links via *WebViewController* + */ final class SignInViewController: TableNodeViewController { enum AppLinks: String, CaseIterable {