Fixes #734 - Add a "View logs" option to the report a problem screen

Move bug report and log viewer responsibility to a separate flow coordinator. Reuse it as a child coordinator in the authentication, userSessionFlow and settings flow coordinators.
This commit is contained in:
Stefan Ceriu
2024-01-23 10:13:48 +02:00
committed by GitHub
parent dd28261e1f
commit 31286c75fc
38 changed files with 541 additions and 143 deletions
@@ -34,9 +34,13 @@ class AuthenticationCoordinator: CoordinatorProtocol {
private var cancellables = Set<AnyCancellable>()
private var oidcPresenter: OIDCAuthenticationPresenter?
// periphery: ignore - used to store the coordinator to avoid deallocation
private var appLockFlowCoordinator: AppLockSetupFlowCoordinator?
// periphery:ignore - retaining purpose
private var bugReportFlowCoordinator: BugReportFlowCoordinator?
weak var delegate: AuthenticationCoordinatorDelegate?
init(authenticationService: AuthenticationServiceProxyProtocol,
@@ -94,24 +98,12 @@ class AuthenticationCoordinator: CoordinatorProtocol {
}
private func showReportProblemScreen() {
let feedbackNavigationStackCoordinator = NavigationStackCoordinator()
let parameters = BugReportScreenCoordinatorParameters(bugReportService: bugReportService,
userID: nil,
deviceID: nil,
userIndicatorController: ServiceLocator.shared.userIndicatorController,
screenshot: nil,
isModallyPresented: true)
let coordinator = BugReportScreenCoordinator(parameters: parameters)
coordinator.completion = { [weak self] _ in
self?.navigationStackCoordinator.setSheetCoordinator(nil)
}
feedbackNavigationStackCoordinator.setRootCoordinator(coordinator)
navigationStackCoordinator.setSheetCoordinator(feedbackNavigationStackCoordinator, animated: true)
bugReportFlowCoordinator = BugReportFlowCoordinator(parameters: .init(presentationMode: .sheet(navigationStackCoordinator),
userIndicatorController: ServiceLocator.shared.userIndicatorController,
bugReportService: bugReportService,
userID: nil,
deviceID: nil))
bugReportFlowCoordinator?.start()
}
private func startAuthentication() async {