diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 0fece9b53..6e993b60a 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -102,7 +102,7 @@ public struct SignInView: View { if !viewModel.config.features.startupScreenEnabled { Button(AuthLocalization.SignIn.registerBtn) { viewModel.trackSignUpClicked() - viewModel.router.showRegisterScreen() + viewModel.router.showRegisterScreen(sourceScreen: viewModel.sourceScreen) }.foregroundColor(Theme.Colors.accentColor) Spacer() diff --git a/Authorization/Authorization/Presentation/Login/SignInViewModel.swift b/Authorization/Authorization/Presentation/Login/SignInViewModel.swift index a2439a10b..43ab029d8 100644 --- a/Authorization/Authorization/Presentation/Login/SignInViewModel.swift +++ b/Authorization/Authorization/Presentation/Login/SignInViewModel.swift @@ -19,6 +19,8 @@ public class SignInViewModel: ObservableObject { @Published private(set) var isShowProgress = false @Published private(set) var showError: Bool = false @Published private(set) var showAlert: Bool = false + public var sourceScreen: LogistrationSourceScreen = .default + var errorMessage: String? { didSet { withAnimation { @@ -77,7 +79,7 @@ public class SignInViewModel: ObservableObject { let user = try await interactor.login(username: username, password: password) analytics.setUserID("\(user.id)") analytics.userLogin(method: .password) - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen) } catch let error { failure(error) } @@ -108,7 +110,7 @@ public class SignInViewModel: ObservableObject { let user = try await interactor.login(externalToken: externalToken, backend: backend) analytics.setUserID("\(user.id)") analytics.userLogin(method: authMethod) - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen) } catch let error { failure(error, authMethod: authMethod) } diff --git a/Authorization/Authorization/Presentation/Registration/SignUpViewModel.swift b/Authorization/Authorization/Presentation/Registration/SignUpViewModel.swift index 927651b7d..3c10ef333 100644 --- a/Authorization/Authorization/Presentation/Registration/SignUpViewModel.swift +++ b/Authorization/Authorization/Presentation/Registration/SignUpViewModel.swift @@ -19,6 +19,8 @@ public class SignUpViewModel: ObservableObject { @Published var scrollTo: Int? @Published var showError: Bool = false @Published var thirdPartyAuthSuccess: Bool = false + public var sourceScreen: LogistrationSourceScreen = .default + var errorMessage: String? { didSet { withAnimation { @@ -114,7 +116,7 @@ public class SignUpViewModel: ObservableObject { analytics.setUserID("\(user.id)") analytics.registrationSuccess() isShowProgress = false - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen) } catch let error { isShowProgress = false @@ -171,7 +173,7 @@ public class SignUpViewModel: ObservableObject { analytics.setUserID("\(user.id)") analytics.userLogin(method: authMethod) isShowProgress = false - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen) } catch { update(fullName: response.name, email: response.email) self.externalToken = response.token diff --git a/Authorization/Authorization/Presentation/Startup/LogistrationBottomView.swift b/Authorization/Authorization/Presentation/Startup/LogistrationBottomView.swift index 8bd82e445..0cc373448 100644 --- a/Authorization/Authorization/Presentation/Startup/LogistrationBottomView.swift +++ b/Authorization/Authorization/Presentation/Startup/LogistrationBottomView.swift @@ -13,25 +13,27 @@ import Theme public struct LogistrationBottomView: View { @ObservedObject private var viewModel: StartupViewModel + private var sourceScreen: LogistrationSourceScreen @Environment(\.isHorizontal) private var isHorizontal - public init(viewModel: StartupViewModel) { + public init(viewModel: StartupViewModel, sourceScreen: LogistrationSourceScreen) { self.viewModel = viewModel + self.sourceScreen = sourceScreen } public var body: some View { VStack(alignment: .leading) { HStack(spacing: 24) { StyledButton(AuthLocalization.SignIn.registerBtn) { - viewModel.router.showRegisterScreen() + viewModel.router.showRegisterScreen(sourceScreen: sourceScreen) viewModel.tracksignUpClicked() } .frame(maxWidth: .infinity) StyledButton( AuthLocalization.SignIn.logInTitle, - action: { viewModel.router.showLoginScreen() }, + action: { viewModel.router.showLoginScreen(sourceScreen: sourceScreen) }, color: .white, textColor: Theme.Colors.accentColor, borderColor: Theme.Colors.textInputStroke @@ -52,12 +54,12 @@ struct LogistrationBottomView_Previews: PreviewProvider { router: AuthorizationRouterMock(), analytics: AuthorizationAnalyticsMock() ) - LogistrationBottomView(viewModel: vm) + LogistrationBottomView(viewModel: vm, sourceScreen: .startup) .preferredColorScheme(.light) .previewDisplayName("StartupView Light") .loadFonts() - LogistrationBottomView(viewModel: vm) + LogistrationBottomView(viewModel: vm, sourceScreen: .startup) .preferredColorScheme(.dark) .previewDisplayName("StartupView Dark") .loadFonts() diff --git a/Authorization/Authorization/Presentation/Startup/StartupView.swift b/Authorization/Authorization/Presentation/Startup/StartupView.swift index 8cfc50347..94e655e22 100644 --- a/Authorization/Authorization/Presentation/Startup/StartupView.swift +++ b/Authorization/Authorization/Presentation/Startup/StartupView.swift @@ -53,7 +53,10 @@ public struct StartupView: View { .padding(.top, 1) TextField(AuthLocalization.Startup.searchPlaceholder, text: $searchQuery, onCommit: { if searchQuery.isEmpty { return } - viewModel.router.showDiscoveryScreen(searchQuery: searchQuery, fromStartupScreen: true) + viewModel.router.showDiscoveryScreen( + searchQuery: searchQuery, + sourceScreen: LogistrationSourceScreen.startup + ) }) .autocapitalization(.none) .autocorrectionDisabled() @@ -71,7 +74,10 @@ public struct StartupView: View { ) Button { - viewModel.router.showDiscoveryScreen(searchQuery: searchQuery, fromStartupScreen: true) + viewModel.router.showDiscoveryScreen ( + searchQuery: searchQuery, + sourceScreen: LogistrationSourceScreen.startup + ) } label: { Text(AuthLocalization.Startup.exploreAllCourses) .underline() @@ -83,7 +89,7 @@ public struct StartupView: View { } .padding(.horizontal, isHorizontal ? 10 : 24) - LogistrationBottomView(viewModel: viewModel) + LogistrationBottomView(viewModel: viewModel, sourceScreen: .startup) } .padding(.top, 10) .padding(.bottom, 2) diff --git a/Authorization/AuthorizationTests/AuthorizationMock.generated.swift b/Authorization/AuthorizationTests/AuthorizationMock.generated.swift index d6a968438..c2bca8452 100644 --- a/Authorization/AuthorizationTests/AuthorizationMock.generated.swift +++ b/Authorization/AuthorizationTests/AuthorizationMock.generated.swift @@ -816,10 +816,10 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -828,16 +828,16 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -846,10 +846,10 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -884,12 +884,12 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -924,20 +924,29 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -985,12 +994,12 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -1005,12 +1014,12 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -1039,12 +1048,12 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -1073,23 +1082,23 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) @@ -1252,10 +1261,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -1264,16 +1273,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -1282,10 +1291,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -1319,12 +1328,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -1354,20 +1363,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -1414,12 +1432,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -1433,12 +1451,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -1466,12 +1484,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -1497,23 +1515,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/Core/Core/Configuration/BaseRouter.swift b/Core/Core/Configuration/BaseRouter.swift index a153aa067..70e5fb008 100644 --- a/Core/Core/Configuration/BaseRouter.swift +++ b/Core/Core/Configuration/BaseRouter.swift @@ -21,17 +21,17 @@ public protocol BaseRouter { func removeLastView(controllers: Int) - func showMainOrWhatsNewScreen() + func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) func showStartupScreen() - func showLoginScreen() + func showLoginScreen(sourceScreen: LogistrationSourceScreen) - func showRegisterScreen() + func showRegisterScreen(sourceScreen: LogistrationSourceScreen) func showForgotPasswordScreen() - func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) + func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) func presentAlert( alertTitle: String, @@ -77,17 +77,17 @@ open class BaseRouterMock: BaseRouter { public func dismiss(animated: Bool) {} - public func showMainOrWhatsNewScreen() {} + public func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) {} public func showStartupScreen() {} - public func showLoginScreen() {} + public func showLoginScreen(sourceScreen: LogistrationSourceScreen) {} - public func showRegisterScreen() {} + public func showRegisterScreen(sourceScreen: LogistrationSourceScreen) {} public func showForgotPasswordScreen() {} - public func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) {} + public func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) {} public func backToRoot(animated: Bool) {} diff --git a/Core/Core/Configuration/Config/FeaturesConfig.swift b/Core/Core/Configuration/Config/FeaturesConfig.swift index eec9e9853..bafdc3b83 100644 --- a/Core/Core/Configuration/Config/FeaturesConfig.swift +++ b/Core/Core/Configuration/Config/FeaturesConfig.swift @@ -17,8 +17,8 @@ public class FeaturesConfig: NSObject { public var startupScreenEnabled: Bool init(dictionary: [String: Any]) { - whatNewEnabled = dictionary[FeaturesKeys.whatNewEnabled.rawValue] as? Bool ?? false - startupScreenEnabled = dictionary[FeaturesKeys.startupScreenEnabled.rawValue] as? Bool ?? false + whatNewEnabled = true//dictionary[FeaturesKeys.whatNewEnabled.rawValue] as? Bool ?? false + startupScreenEnabled = true//dictionary[FeaturesKeys.startupScreenEnabled.rawValue] as? Bool ?? false super.init() } } diff --git a/Core/Core/Constants.swift b/Core/Core/Constants.swift index 5b8f44996..867a76fb3 100644 --- a/Core/Core/Constants.swift +++ b/Core/Core/Constants.swift @@ -12,3 +12,10 @@ public struct Constants { public static let GrantTypePassword = "password" public static let GrantTypeRefreshToken = "refresh_token" } + +public enum LogistrationSourceScreen: Equatable { + case `default` + case startup + case discovery + case courseDetail(String, String) +} diff --git a/Course/Course/Presentation/Details/CourseDetailsView.swift b/Course/Course/Presentation/Details/CourseDetailsView.swift index a0d53b779..ac034d867 100644 --- a/Course/Course/Presentation/Details/CourseDetailsView.swift +++ b/Course/Course/Presentation/Details/CourseDetailsView.swift @@ -10,6 +10,8 @@ import Core import Kingfisher import WebKit import Theme +import Authorization +import Swinject public struct CourseDetailsView: View { @@ -142,6 +144,12 @@ public struct CourseDetailsView: View { Spacer(minLength: 84) } } + if let model = Container.shared.resolve(StartupViewModel.self), !viewModel.loggenInUser { + LogistrationBottomView( + viewModel: model, + sourceScreen: .courseDetail(courseID, viewModel.courseDetails?.courseTitle ?? "") + ) + } }.padding(.top, 8) .navigationBarHidden(false) .navigationBarBackButtonHidden(false) @@ -200,8 +208,12 @@ private struct CourseStateView: View { switch viewModel.courseState() { case .enrollOpen: StyledButton(CourseLocalization.Details.enrollNow, action: { - Task { - await viewModel.enrollToCourse(id: courseDetails.courseID) + if !viewModel.loggenInUser { + viewModel.router.showRegisterScreen(sourceScreen: .courseDetail(courseDetails.courseID, courseDetails.courseTitle)) + } else { + Task { + await viewModel.enrollToCourse(id: courseDetails.courseID) + } } }) .padding(16) diff --git a/Course/Course/Presentation/Details/CourseDetailsViewModel.swift b/Course/Course/Presentation/Details/CourseDetailsViewModel.swift index ac2283d17..2acb7f653 100644 --- a/Course/Course/Presentation/Details/CourseDetailsViewModel.swift +++ b/Course/Course/Presentation/Details/CourseDetailsViewModel.swift @@ -8,6 +8,7 @@ import Foundation import Core import SwiftUI +import Swinject public enum CourseState { case enrollOpen @@ -36,6 +37,11 @@ public class CourseDetailsViewModel: ObservableObject { let cssInjector: CSSInjector let connectivity: ConnectivityProtocol + var loggenInUser: Bool { + guard let container = Container.shared.resolve(CoreStorage.self) else { return false } + return !(container.user?.username?.isEmpty ?? true) + } + public init( interactor: CourseInteractorProtocol, router: CourseRouter, diff --git a/Course/CourseTests/CourseMock.generated.swift b/Course/CourseTests/CourseMock.generated.swift index ef2212269..210cfff39 100644 --- a/Course/CourseTests/CourseMock.generated.swift +++ b/Course/CourseTests/CourseMock.generated.swift @@ -539,10 +539,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -551,16 +551,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -569,10 +569,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -606,12 +606,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -641,20 +641,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -701,12 +710,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -720,12 +729,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -753,12 +762,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -784,23 +793,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/Dashboard/DashboardTests/DashboardMock.generated.swift b/Dashboard/DashboardTests/DashboardMock.generated.swift index 70acae430..f5c74c668 100644 --- a/Dashboard/DashboardTests/DashboardMock.generated.swift +++ b/Dashboard/DashboardTests/DashboardMock.generated.swift @@ -539,10 +539,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -551,16 +551,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -569,10 +569,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -606,12 +606,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -641,20 +641,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -701,12 +710,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -720,12 +729,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -753,12 +762,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -784,23 +793,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/Discovery/Discovery/Presentation/DiscoveryView.swift b/Discovery/Discovery/Presentation/DiscoveryView.swift index d7c8c8266..fb43fa63d 100644 --- a/Discovery/Discovery/Presentation/DiscoveryView.swift +++ b/Discovery/Discovery/Presentation/DiscoveryView.swift @@ -8,6 +8,8 @@ import SwiftUI import Core import Theme +import Authorization +import Swinject public struct DiscoveryView: View { @@ -17,7 +19,7 @@ public struct DiscoveryView: View { @State private var searchQuery: String = "" @State private var isRefreshing: Bool = false - private var fromStartupScreen: Bool = false + private var sourceScreen: LogistrationSourceScreen @Environment (\.isHorizontal) private var isHorizontal @Environment(\.presentationMode) private var presentationMode @@ -37,12 +39,12 @@ public struct DiscoveryView: View { viewModel: DiscoveryViewModel, router: DiscoveryRouter, searchQuery: String? = nil, - fromStartupScreen: Bool = false + sourceScreen: LogistrationSourceScreen = .default ) { self._viewModel = StateObject(wrappedValue: { viewModel }()) self.router = router - self.fromStartupScreen = fromStartupScreen self._searchQuery = State(initialValue: searchQuery ?? "") + self.sourceScreen = sourceScreen } public var body: some View { @@ -136,6 +138,13 @@ public struct DiscoveryView: View { } .frameLimit() }.accessibilityAction {} + + if let model = Container.shared.resolve(StartupViewModel.self), !viewModel.loggenInUser { + LogistrationBottomView( + viewModel: model, + sourceScreen: .discovery + ) + } }.padding(.top, 8) // MARK: - Offline mode SnackBar @@ -161,7 +170,7 @@ public struct DiscoveryView: View { } } } - .navigationBarHidden(fromStartupScreen ? false : true) + .navigationBarHidden(sourceScreen != .startup) .onFirstAppear { if !(searchQuery.isEmpty) { router.showDiscoverySearch(searchQuery: searchQuery) @@ -169,6 +178,9 @@ public struct DiscoveryView: View { } Task { await viewModel.discovery(page: 1) + if case let .courseDetail(courseID, courseTitle) = sourceScreen { + viewModel.router.showCourseDetais(courseID: courseID, title: courseTitle) + } } viewModel.setupNotifications() } diff --git a/Discovery/Discovery/Presentation/DiscoveryViewModel.swift b/Discovery/Discovery/Presentation/DiscoveryViewModel.swift index ec8268ae1..ab94cfe7c 100644 --- a/Discovery/Discovery/Presentation/DiscoveryViewModel.swift +++ b/Discovery/Discovery/Presentation/DiscoveryViewModel.swift @@ -8,6 +8,8 @@ import Combine import Core import SwiftUI +import Swinject +import Authorization public class DiscoveryViewModel: ObservableObject { @@ -20,6 +22,11 @@ public class DiscoveryViewModel: ObservableObject { @Published var courses: [CourseItem] = [] @Published var showError: Bool = false + var loggenInUser: Bool { + guard let container = Container.shared.resolve(CoreStorage.self) else { return false } + return !(container.user?.username?.isEmpty ?? true) + } + var errorMessage: String? { didSet { withAnimation { diff --git a/Discovery/DiscoveryTests/DiscoveryMock.generated.swift b/Discovery/DiscoveryTests/DiscoveryMock.generated.swift index b4d088a28..72b350de5 100644 --- a/Discovery/DiscoveryTests/DiscoveryMock.generated.swift +++ b/Discovery/DiscoveryTests/DiscoveryMock.generated.swift @@ -539,10 +539,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -551,16 +551,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -569,10 +569,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -606,12 +606,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -641,20 +641,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -701,12 +710,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -720,12 +729,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -753,12 +762,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -784,23 +793,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/Discussion/DiscussionTests/DiscussionMock.generated.swift b/Discussion/DiscussionTests/DiscussionMock.generated.swift index 1afce2ae3..6d998a133 100644 --- a/Discussion/DiscussionTests/DiscussionMock.generated.swift +++ b/Discussion/DiscussionTests/DiscussionMock.generated.swift @@ -539,10 +539,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -551,16 +551,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -569,10 +569,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -606,12 +606,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -641,20 +641,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -701,12 +710,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -720,12 +729,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -753,12 +762,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -784,23 +793,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) @@ -2116,10 +2125,10 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -2128,16 +2137,16 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -2146,10 +2155,10 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -2189,12 +2198,12 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -2262,20 +2271,29 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -2328,12 +2346,12 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -2353,12 +2371,12 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -2392,12 +2410,12 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -2441,23 +2459,23 @@ open class DiscussionRouterMock: DiscussionRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/OpenEdX/Router.swift b/OpenEdX/Router.swift index 264508884..970f6cf97 100644 --- a/OpenEdX/Router.swift +++ b/OpenEdX/Router.swift @@ -58,12 +58,13 @@ public class Router: AuthorizationRouter, navigationController.setViewControllers(viewControllers, animated: true) } - public func showMainOrWhatsNewScreen() { + public func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { showToolBar() var storage = Container.shared.resolve(WhatsNewStorage.self)! let config = Container.shared.resolve(ConfigProtocol.self)! let viewModel = WhatsNewViewModel(storage: storage) + viewModel.sourceScreen = sourceScreen let whatsNew = WhatsNewView(router: Container.shared.resolve(WhatsNewRouter.self)!, viewModel: viewModel) let shouldShowWhatsNew = viewModel.shouldShowWhatsNew() @@ -76,14 +77,18 @@ public class Router: AuthorizationRouter, navigationController.setViewControllers([controller], animated: true) } else { let viewModel = Container.shared.resolve(MainScreenViewModel.self)! + viewModel.sourceScreen = sourceScreen let controller = UIHostingController(rootView: MainScreenView(viewModel: viewModel)) navigationController.viewControllers = [controller] navigationController.setViewControllers([controller], animated: true) } } - public func showLoginScreen() { - let view = SignInView(viewModel: Container.shared.resolve(SignInViewModel.self)!) + public func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + guard let viewModel = Container.shared.resolve(SignInViewModel.self) else { return } + + viewModel.sourceScreen = sourceScreen + let view = SignInView(viewModel: viewModel) let controller = UIHostingController(rootView: view) navigationController.pushViewController(controller, animated: true) } @@ -165,8 +170,11 @@ public class Router: AuthorizationRouter, navigationController.present(view, animated: true) } - public func showRegisterScreen() { - let view = SignUpView(viewModel: Container.shared.resolve(SignUpViewModel.self)!) + public func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + guard let viewModel = Container.shared.resolve(SignUpViewModel.self) else { return } + + viewModel.sourceScreen = sourceScreen + let view = SignUpView(viewModel: viewModel) let controller = UIHostingController(rootView: view) navigationController.pushViewController(controller, animated: true) } @@ -195,12 +203,12 @@ public class Router: AuthorizationRouter, navigationController.pushFade(viewController: controller) } - public func showDiscoveryScreen(searchQuery: String? = nil, fromStartupScreen: Bool = false) { + public func showDiscoveryScreen(searchQuery: String? = nil, sourceScreen: LogistrationSourceScreen) { let view = DiscoveryView( viewModel: Container.shared.resolve(DiscoveryViewModel.self)!, router: Container.shared.resolve(DiscoveryRouter.self)!, searchQuery: searchQuery, - fromStartupScreen: fromStartupScreen + sourceScreen: sourceScreen ) let controller = UIHostingController(rootView: view) navigationController.pushViewController(controller, animated: true) diff --git a/OpenEdX/View/MainScreenView.swift b/OpenEdX/View/MainScreenView.swift index c7aeedba7..6f26a929e 100644 --- a/OpenEdX/View/MainScreenView.swift +++ b/OpenEdX/View/MainScreenView.swift @@ -42,8 +42,11 @@ struct MainScreenView: View { var body: some View { TabView(selection: $selection) { ZStack { - DiscoveryView(viewModel: Container.shared.resolve(DiscoveryViewModel.self)!, - router: Container.shared.resolve(DiscoveryRouter.self)!) + DiscoveryView( + viewModel: Container.shared.resolve(DiscoveryViewModel.self)!, + router: Container.shared.resolve(DiscoveryRouter.self)!, + sourceScreen: viewModel.sourceScreen + ) if updateAvaliable { UpdateNotificationView(config: viewModel.config) } diff --git a/OpenEdX/View/MainScreenViewModel.swift b/OpenEdX/View/MainScreenViewModel.swift index d45b3503c..5726fa1de 100644 --- a/OpenEdX/View/MainScreenViewModel.swift +++ b/OpenEdX/View/MainScreenViewModel.swift @@ -14,6 +14,7 @@ class MainScreenViewModel: ObservableObject { private let analytics: MainScreenAnalytics let config: ConfigProtocol let profileInteractor: ProfileInteractorProtocol + var sourceScreen: LogistrationSourceScreen = .default init(analytics: MainScreenAnalytics, config: ConfigProtocol, profileInteractor: ProfileInteractorProtocol) { self.analytics = analytics diff --git a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountViewModel.swift b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountViewModel.swift index c5f464d6d..2cece2de0 100644 --- a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountViewModel.swift +++ b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountViewModel.swift @@ -40,7 +40,7 @@ public class DeleteAccountViewModel: ObservableObject { do { if try await interactor.deleteAccount(password: password) { isShowProgress = false - router.showLoginScreen() + router.showLoginScreen(sourceScreen: .default) } else { isShowProgress = false incorrectPassword = true diff --git a/Profile/ProfileTests/ProfileMock.generated.swift b/Profile/ProfileTests/ProfileMock.generated.swift index 69aff547e..5b85e5b1a 100644 --- a/Profile/ProfileTests/ProfileMock.generated.swift +++ b/Profile/ProfileTests/ProfileMock.generated.swift @@ -539,10 +539,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -551,16 +551,16 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -569,10 +569,10 @@ open class BaseRouterMock: BaseRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -606,12 +606,12 @@ open class BaseRouterMock: BaseRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -641,20 +641,29 @@ open class BaseRouterMock: BaseRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -701,12 +710,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -720,12 +729,12 @@ open class BaseRouterMock: BaseRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -753,12 +762,12 @@ open class BaseRouterMock: BaseRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -784,23 +793,23 @@ open class BaseRouterMock: BaseRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) @@ -2447,10 +2456,10 @@ open class ProfileRouterMock: ProfileRouter, Mock { perform?(`controllers`) } - open func showMainOrWhatsNewScreen() { - addInvocation(.m_showMainOrWhatsNewScreen) - let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void - perform?() + open func showMainOrWhatsNewScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showStartupScreen() { @@ -2459,16 +2468,16 @@ open class ProfileRouterMock: ProfileRouter, Mock { perform?() } - open func showLoginScreen() { - addInvocation(.m_showLoginScreen) - let perform = methodPerformValue(.m_showLoginScreen) as? () -> Void - perform?() + open func showLoginScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showLoginScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } - open func showRegisterScreen() { - addInvocation(.m_showRegisterScreen) - let perform = methodPerformValue(.m_showRegisterScreen) as? () -> Void - perform?() + open func showRegisterScreen(sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showRegisterScreen__sourceScreen_sourceScreen(Parameter.value(`sourceScreen`))) as? (LogistrationSourceScreen) -> Void + perform?(`sourceScreen`) } open func showForgotPasswordScreen() { @@ -2477,10 +2486,10 @@ open class ProfileRouterMock: ProfileRouter, Mock { perform?() } - open func showDiscoveryScreen(searchQuery: String?, fromStartupScreen: Bool) { - addInvocation(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) - let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter.value(`searchQuery`), Parameter.value(`fromStartupScreen`))) as? (String?, Bool) -> Void - perform?(`searchQuery`, `fromStartupScreen`) + open func showDiscoveryScreen(searchQuery: String?, sourceScreen: LogistrationSourceScreen) { + addInvocation(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) + let perform = methodPerformValue(.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter.value(`searchQuery`), Parameter.value(`sourceScreen`))) as? (String?, LogistrationSourceScreen) -> Void + perform?(`searchQuery`, `sourceScreen`) } open func presentAlert(alertTitle: String, alertMessage: String, positiveAction: String, onCloseTapped: @escaping () -> Void, okTapped: @escaping () -> Void, type: AlertViewType) { @@ -2518,12 +2527,12 @@ open class ProfileRouterMock: ProfileRouter, Mock { case m_backWithFade case m_dismiss__animated_animated(Parameter) case m_removeLastView__controllers_controllers(Parameter) - case m_showMainOrWhatsNewScreen + case m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(Parameter) case m_showStartupScreen - case m_showLoginScreen - case m_showRegisterScreen + case m_showLoginScreen__sourceScreen_sourceScreen(Parameter) + case m_showRegisterScreen__sourceScreen_sourceScreen(Parameter) case m_showForgotPasswordScreen - case m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(Parameter, Parameter) + case m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(Parameter, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter) case m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(Parameter, Parameter, Parameter, Parameter, Parameter, Parameter<() -> Void>, Parameter<() -> Void>, Parameter<() -> Void>) case m_presentView__transitionStyle_transitionStyleview_view(Parameter, Parameter) @@ -2569,20 +2578,29 @@ open class ProfileRouterMock: ProfileRouter, Mock { results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsControllers, rhs: rhsControllers, with: matcher), lhsControllers, rhsControllers, "controllers")) return Matcher.ComparisonResult(results) - case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match + case (.m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showStartupScreen, .m_showStartupScreen): return .match - case (.m_showLoginScreen, .m_showLoginScreen): return .match + case (.m_showLoginScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showLoginScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) - case (.m_showRegisterScreen, .m_showRegisterScreen): return .match + case (.m_showRegisterScreen__sourceScreen_sourceScreen(let lhsSourcescreen), .m_showRegisterScreen__sourceScreen_sourceScreen(let rhsSourcescreen)): + var results: [Matcher.ParameterComparisonResult] = [] + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) + return Matcher.ComparisonResult(results) case (.m_showForgotPasswordScreen, .m_showForgotPasswordScreen): return .match - case (.m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let lhsSearchquery, let lhsFromstartupscreen), .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(let rhsSearchquery, let rhsFromstartupscreen)): + case (.m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let lhsSearchquery, let lhsSourcescreen), .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(let rhsSearchquery, let rhsSourcescreen)): var results: [Matcher.ParameterComparisonResult] = [] results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSearchquery, rhs: rhsSearchquery, with: matcher), lhsSearchquery, rhsSearchquery, "searchQuery")) - results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsFromstartupscreen, rhs: rhsFromstartupscreen, with: matcher), lhsFromstartupscreen, rhsFromstartupscreen, "fromStartupScreen")) + results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsSourcescreen, rhs: rhsSourcescreen, with: matcher), lhsSourcescreen, rhsSourcescreen, "sourceScreen")) return Matcher.ComparisonResult(results) case (.m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let lhsAlerttitle, let lhsAlertmessage, let lhsPositiveaction, let lhsOnclosetapped, let lhsOktapped, let lhsType), .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(let rhsAlerttitle, let rhsAlertmessage, let rhsPositiveaction, let rhsOnclosetapped, let rhsOktapped, let rhsType)): @@ -2633,12 +2651,12 @@ open class ProfileRouterMock: ProfileRouter, Mock { case .m_backWithFade: return 0 case let .m_dismiss__animated_animated(p0): return p0.intValue case let .m_removeLastView__controllers_controllers(p0): return p0.intValue - case .m_showMainOrWhatsNewScreen: return 0 + case let .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showStartupScreen: return 0 - case .m_showLoginScreen: return 0 - case .m_showRegisterScreen: return 0 + case let .m_showLoginScreen__sourceScreen_sourceScreen(p0): return p0.intValue + case let .m_showRegisterScreen__sourceScreen_sourceScreen(p0): return p0.intValue case .m_showForgotPasswordScreen: return 0 - case let .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(p0, p1): return p0.intValue + p1.intValue + case let .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(p0, p1): return p0.intValue + p1.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(p0, p1, p2, p3, p4, p5): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue case let .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(p0, p1, p2, p3, p4, p5, p6, p7): return p0.intValue + p1.intValue + p2.intValue + p3.intValue + p4.intValue + p5.intValue + p6.intValue + p7.intValue case let .m_presentView__transitionStyle_transitionStyleview_view(p0, p1): return p0.intValue + p1.intValue @@ -2656,12 +2674,12 @@ open class ProfileRouterMock: ProfileRouter, Mock { case .m_backWithFade: return ".backWithFade()" case .m_dismiss__animated_animated: return ".dismiss(animated:)" case .m_removeLastView__controllers_controllers: return ".removeLastView(controllers:)" - case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()" + case .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen: return ".showMainOrWhatsNewScreen(sourceScreen:)" case .m_showStartupScreen: return ".showStartupScreen()" - case .m_showLoginScreen: return ".showLoginScreen()" - case .m_showRegisterScreen: return ".showRegisterScreen()" + case .m_showLoginScreen__sourceScreen_sourceScreen: return ".showLoginScreen(sourceScreen:)" + case .m_showRegisterScreen__sourceScreen_sourceScreen: return ".showRegisterScreen(sourceScreen:)" case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()" - case .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen: return ".showDiscoveryScreen(searchQuery:fromStartupScreen:)" + case .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen: return ".showDiscoveryScreen(searchQuery:sourceScreen:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type: return ".presentAlert(alertTitle:alertMessage:positiveAction:onCloseTapped:okTapped:type:)" case .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped: return ".presentAlert(alertTitle:alertMessage:nextSectionName:action:image:onCloseTapped:okTapped:nextSectionTapped:)" case .m_presentView__transitionStyle_transitionStyleview_view: return ".presentView(transitionStyle:view:)" @@ -2693,12 +2711,12 @@ open class ProfileRouterMock: ProfileRouter, Mock { public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)} public static func dismiss(animated: Parameter) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))} public static func removeLastView(controllers: Parameter) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))} - public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)} + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showStartupScreen() -> Verify { return Verify(method: .m_showStartupScreen)} - public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)} - public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)} + public static func showLoginScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`))} + public static func showRegisterScreen(sourceScreen: Parameter) -> Verify { return Verify(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`))} public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)} - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`))} + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter) -> Verify { return Verify(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`))} public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, nextSectionName: Parameter, action: Parameter, image: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, nextSectionTapped: Parameter<() -> Void>) -> Verify { return Verify(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagenextSectionName_nextSectionNameaction_actionimage_imageonCloseTapped_onCloseTappedokTapped_okTappednextSectionTapped_nextSectionTapped(`alertTitle`, `alertMessage`, `nextSectionName`, `action`, `image`, `onCloseTapped`, `okTapped`, `nextSectionTapped`))} public static func presentView(transitionStyle: Parameter, view: Parameter) -> Verify { return Verify(method: .m_presentView__transitionStyle_transitionStyleview_view(`transitionStyle`, `view`))} @@ -2736,23 +2754,23 @@ open class ProfileRouterMock: ProfileRouter, Mock { public static func removeLastView(controllers: Parameter, perform: @escaping (Int) -> Void) -> Perform { return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform) } - public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform) + public static func showMainOrWhatsNewScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showMainOrWhatsNewScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showStartupScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showStartupScreen, performs: perform) } - public static func showLoginScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showLoginScreen, performs: perform) + public static func showLoginScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showLoginScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } - public static func showRegisterScreen(perform: @escaping () -> Void) -> Perform { - return Perform(method: .m_showRegisterScreen, performs: perform) + public static func showRegisterScreen(sourceScreen: Parameter, perform: @escaping (LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showRegisterScreen__sourceScreen_sourceScreen(`sourceScreen`), performs: perform) } public static func showForgotPasswordScreen(perform: @escaping () -> Void) -> Perform { return Perform(method: .m_showForgotPasswordScreen, performs: perform) } - public static func showDiscoveryScreen(searchQuery: Parameter, fromStartupScreen: Parameter, perform: @escaping (String?, Bool) -> Void) -> Perform { - return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQueryfromStartupScreen_fromStartupScreen(`searchQuery`, `fromStartupScreen`), performs: perform) + public static func showDiscoveryScreen(searchQuery: Parameter, sourceScreen: Parameter, perform: @escaping (String?, LogistrationSourceScreen) -> Void) -> Perform { + return Perform(method: .m_showDiscoveryScreen__searchQuery_searchQuerysourceScreen_sourceScreen(`searchQuery`, `sourceScreen`), performs: perform) } public static func presentAlert(alertTitle: Parameter, alertMessage: Parameter, positiveAction: Parameter, onCloseTapped: Parameter<() -> Void>, okTapped: Parameter<() -> Void>, type: Parameter, perform: @escaping (String, String, String, @escaping () -> Void, @escaping () -> Void, AlertViewType) -> Void) -> Perform { return Perform(method: .m_presentAlert__alertTitle_alertTitlealertMessage_alertMessagepositiveAction_positiveActiononCloseTapped_onCloseTappedokTapped_okTappedtype_type(`alertTitle`, `alertMessage`, `positiveAction`, `onCloseTapped`, `okTapped`, `type`), performs: perform) diff --git a/WhatsNew/WhatsNew/Presentation/WhatsNewView.swift b/WhatsNew/WhatsNew/Presentation/WhatsNewView.swift index 19eab380b..cbc1cb42f 100644 --- a/WhatsNew/WhatsNew/Presentation/WhatsNewView.swift +++ b/WhatsNew/WhatsNew/Presentation/WhatsNewView.swift @@ -105,7 +105,7 @@ public struct WhatsNewView: View { index += 1 } } else { - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: viewModel.sourceScreen) } } ) @@ -135,7 +135,7 @@ public struct WhatsNewView: View { .toolbar { ToolbarItem(placement: .navigationBarTrailing, content: { Button(action: { - router.showMainOrWhatsNewScreen() + router.showMainOrWhatsNewScreen(sourceScreen: viewModel.sourceScreen) }, label: { Image(systemName: "xmark") .foregroundColor(Theme.Colors.accentColor) diff --git a/WhatsNew/WhatsNew/Presentation/WhatsNewViewModel.swift b/WhatsNew/WhatsNew/Presentation/WhatsNewViewModel.swift index 170472088..334511cef 100644 --- a/WhatsNew/WhatsNew/Presentation/WhatsNewViewModel.swift +++ b/WhatsNew/WhatsNew/Presentation/WhatsNewViewModel.swift @@ -13,6 +13,7 @@ public class WhatsNewViewModel: ObservableObject { @Published var index: Int = 0 @Published var newItems: [WhatsNewPage] = [] private let storage: WhatsNewStorage + public var sourceScreen: LogistrationSourceScreen = .default public init(storage: WhatsNewStorage) { self.storage = storage