Skip to content

Commit

Permalink
Merge branch 'develop' into feature/app-update-version-on-dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok authored Nov 2, 2023
2 parents 9329510 + 5bd9203 commit 995e0b5
Show file tree
Hide file tree
Showing 102 changed files with 6,647 additions and 190 deletions.
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/*
xcuserdata/
*.xcuserdata/*
/OpenEdX.xcodeproj/xcuserdata/
/OpenEdX.xcworkspace/xcuserdata/
/OpenEdX.xcworkspace/xcshareddata/swiftpm/Package.resolved
Expand All @@ -25,6 +26,15 @@ DerivedData/
*.perspectivev3
!default.perspectivev3

*.xcodeproj/*
**/xcuserdata/
**/*.xcuserdata/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings

## Obj-C/Swift specific
*.hmap

Expand Down Expand Up @@ -100,4 +110,4 @@ iOSInjectionProject/
xcode-frameworks

vendor/
.bundle/
.bundle/
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class SignInViewModel: ObservableObject {
let user = try await interactor.login(username: username, password: password)
analytics.setUserID("\(user.id)")
analytics.userLogin(method: .password)
router.showMainScreen()
router.showMainOrWhatsNewScreen()
} catch let error {
isShowProgress = false
if error.isUpdateRequeiredError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class SignUpViewModel: ObservableObject {
analytics.setUserID("\(user.id)")
analytics.registrationSuccess()
isShowProgress = false
router.showMainScreen()
router.showMainOrWhatsNewScreen()

} catch let error {
isShowProgress = false
Expand Down
42 changes: 21 additions & 21 deletions Authorization/AuthorizationTests/AuthorizationMock.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 1.8.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 2.1.2 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down Expand Up @@ -767,9 +767,9 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock {
perform?(`controllers`)
}

open func showMainScreen() {
addInvocation(.m_showMainScreen)
let perform = methodPerformValue(.m_showMainScreen) as? () -> Void
open func showMainOrWhatsNewScreen() {
addInvocation(.m_showMainOrWhatsNewScreen)
let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void
perform?()
}

Expand Down Expand Up @@ -823,7 +823,7 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock {
case m_backWithFade
case m_dismiss__animated_animated(Parameter<Bool>)
case m_removeLastView__controllers_controllers(Parameter<Int>)
case m_showMainScreen
case m_showMainOrWhatsNewScreen
case m_showLoginScreen
case m_showRegisterScreen
case m_showForgotPasswordScreen
Expand Down Expand Up @@ -861,7 +861,7 @@ 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_showMainScreen, .m_showMainScreen): return .match
case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match

case (.m_showLoginScreen, .m_showLoginScreen): return .match

Expand Down Expand Up @@ -914,7 +914,7 @@ 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_showMainScreen: return 0
case .m_showMainOrWhatsNewScreen: return 0
case .m_showLoginScreen: return 0
case .m_showRegisterScreen: return 0
case .m_showForgotPasswordScreen: return 0
Expand All @@ -932,7 +932,7 @@ 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_showMainScreen: return ".showMainScreen()"
case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()"
case .m_showLoginScreen: return ".showLoginScreen()"
case .m_showRegisterScreen: return ".showRegisterScreen()"
case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()"
Expand Down Expand Up @@ -964,7 +964,7 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock {
public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)}
public static func dismiss(animated: Parameter<Bool>) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))}
public static func removeLastView(controllers: Parameter<Int>) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))}
public static func showMainScreen() -> Verify { return Verify(method: .m_showMainScreen)}
public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)}
public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)}
public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)}
public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)}
Expand Down Expand Up @@ -996,8 +996,8 @@ open class AuthorizationRouterMock: AuthorizationRouter, Mock {
public static func removeLastView(controllers: Parameter<Int>, perform: @escaping (Int) -> Void) -> Perform {
return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform)
}
public static func showMainScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showMainScreen, performs: perform)
public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform)
}
public static func showLoginScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showLoginScreen, performs: perform)
Expand Down Expand Up @@ -1169,9 +1169,9 @@ open class BaseRouterMock: BaseRouter, Mock {
perform?(`controllers`)
}

open func showMainScreen() {
addInvocation(.m_showMainScreen)
let perform = methodPerformValue(.m_showMainScreen) as? () -> Void
open func showMainOrWhatsNewScreen() {
addInvocation(.m_showMainOrWhatsNewScreen)
let perform = methodPerformValue(.m_showMainOrWhatsNewScreen) as? () -> Void
perform?()
}

Expand Down Expand Up @@ -1224,7 +1224,7 @@ open class BaseRouterMock: BaseRouter, Mock {
case m_backWithFade
case m_dismiss__animated_animated(Parameter<Bool>)
case m_removeLastView__controllers_controllers(Parameter<Int>)
case m_showMainScreen
case m_showMainOrWhatsNewScreen
case m_showLoginScreen
case m_showRegisterScreen
case m_showForgotPasswordScreen
Expand Down Expand Up @@ -1257,7 +1257,7 @@ 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_showMainScreen, .m_showMainScreen): return .match
case (.m_showMainOrWhatsNewScreen, .m_showMainOrWhatsNewScreen): return .match

case (.m_showLoginScreen, .m_showLoginScreen): return .match

Expand Down Expand Up @@ -1309,7 +1309,7 @@ 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_showMainScreen: return 0
case .m_showMainOrWhatsNewScreen: return 0
case .m_showLoginScreen: return 0
case .m_showRegisterScreen: return 0
case .m_showForgotPasswordScreen: return 0
Expand All @@ -1326,7 +1326,7 @@ 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_showMainScreen: return ".showMainScreen()"
case .m_showMainOrWhatsNewScreen: return ".showMainOrWhatsNewScreen()"
case .m_showLoginScreen: return ".showLoginScreen()"
case .m_showRegisterScreen: return ".showRegisterScreen()"
case .m_showForgotPasswordScreen: return ".showForgotPasswordScreen()"
Expand Down Expand Up @@ -1357,7 +1357,7 @@ open class BaseRouterMock: BaseRouter, Mock {
public static func backWithFade() -> Verify { return Verify(method: .m_backWithFade)}
public static func dismiss(animated: Parameter<Bool>) -> Verify { return Verify(method: .m_dismiss__animated_animated(`animated`))}
public static func removeLastView(controllers: Parameter<Int>) -> Verify { return Verify(method: .m_removeLastView__controllers_controllers(`controllers`))}
public static func showMainScreen() -> Verify { return Verify(method: .m_showMainScreen)}
public static func showMainOrWhatsNewScreen() -> Verify { return Verify(method: .m_showMainOrWhatsNewScreen)}
public static func showLoginScreen() -> Verify { return Verify(method: .m_showLoginScreen)}
public static func showRegisterScreen() -> Verify { return Verify(method: .m_showRegisterScreen)}
public static func showForgotPasswordScreen() -> Verify { return Verify(method: .m_showForgotPasswordScreen)}
Expand Down Expand Up @@ -1386,8 +1386,8 @@ open class BaseRouterMock: BaseRouter, Mock {
public static func removeLastView(controllers: Parameter<Int>, perform: @escaping (Int) -> Void) -> Perform {
return Perform(method: .m_removeLastView__controllers_controllers(`controllers`), performs: perform)
}
public static func showMainScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showMainScreen, performs: perform)
public static func showMainOrWhatsNewScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showMainOrWhatsNewScreen, performs: perform)
}
public static func showLoginScreen(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_showLoginScreen, performs: perform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "email", password: "")

Verify(interactor, 0, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, AuthLocalization.Error.invalidEmailAddress)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand All @@ -59,7 +59,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "[email protected]", password: "")

Verify(interactor, 0, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, AuthLocalization.Error.invalidPasswordLenght)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand All @@ -85,7 +85,7 @@ final class SignInViewModelTests: XCTestCase {

Verify(interactor, 1, .login(username: .any, password: .any))
Verify(analytics, .userLogin(method: .any))
Verify(router, 1, .showMainScreen())
Verify(router, 1, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, nil)
XCTAssertEqual(viewModel.isShowProgress, true)
Expand Down Expand Up @@ -113,7 +113,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "[email protected]", password: "password123")

Verify(interactor, 1, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, validationErrorMessage)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand All @@ -137,7 +137,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "[email protected]", password: "password123")

Verify(interactor, 1, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.invalidCredentials)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand All @@ -161,7 +161,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "[email protected]", password: "password123")

Verify(interactor, 1, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.unknownError)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand All @@ -187,7 +187,7 @@ final class SignInViewModelTests: XCTestCase {
await viewModel.login(username: "[email protected]", password: "password123")

Verify(interactor, 1, .login(username: .any, password: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.slowOrNoInternetConnection)
XCTAssertEqual(viewModel.isShowProgress, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ final class SignUpViewModelTests: XCTestCase {

Verify(interactor, 1, .validateRegistrationFields(fields: .any))
Verify(interactor, 1, .registerUser(fields: .any))
Verify(router, 1, .showMainScreen())
Verify(router, 1, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.isShowProgress, false)
XCTAssertEqual(viewModel.showError, false)
Expand Down Expand Up @@ -164,7 +164,7 @@ final class SignUpViewModelTests: XCTestCase {

Verify(interactor, 1, .validateRegistrationFields(fields: .any))
Verify(interactor, 0, .registerUser(fields: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.isShowProgress, false)
XCTAssertEqual(viewModel.showError, false)
Expand Down Expand Up @@ -192,7 +192,7 @@ final class SignUpViewModelTests: XCTestCase {

Verify(interactor, 1, .validateRegistrationFields(fields: .any))
Verify(interactor, 1, .registerUser(fields: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.isShowProgress, false)
XCTAssertEqual(viewModel.showError, true)
Expand Down Expand Up @@ -220,7 +220,7 @@ final class SignUpViewModelTests: XCTestCase {

Verify(interactor, 1, .validateRegistrationFields(fields: .any))
Verify(interactor, 1, .registerUser(fields: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.isShowProgress, false)
XCTAssertEqual(viewModel.showError, true)
Expand Down Expand Up @@ -250,7 +250,7 @@ final class SignUpViewModelTests: XCTestCase {

Verify(interactor, 1, .validateRegistrationFields(fields: .any))
Verify(interactor, 1, .registerUser(fields: .any))
Verify(router, 0, .showMainScreen())
Verify(router, 0, .showMainOrWhatsNewScreen())

XCTAssertEqual(viewModel.isShowProgress, false)
XCTAssertEqual(viewModel.showError, true)
Expand Down
4 changes: 2 additions & 2 deletions Authorization/Mockfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sourceryCommand: null
sourceryTemplate: null
sourceryCommand: mint run krzysztofzablocki/[email protected] sourcery
sourceryTemplate: ../MockTemplate.swifttemplate
unit.tests.mock:
sources:
include:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "youtubeplayerkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SvenTiigi/YouTubePlayerKit",
"state" : {
"revision" : "1fe4c8b07a61d50c2fd276e1d9c8087583c7638a",
"version" : "1.5.3"
}
}
],
"version" : 2
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "youtubeplayerkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SvenTiigi/YouTubePlayerKit",
"state" : {
"revision" : "1fe4c8b07a61d50c2fd276e1d9c8087583c7638a",
"version" : "1.5.3"
}
}
],
"version" : 2
}
4 changes: 2 additions & 2 deletions Core/Core/Configuration/BaseRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public protocol BaseRouter {

func removeLastView(controllers: Int)

func showMainScreen()
func showMainOrWhatsNewScreen()

func showLoginScreen()

Expand Down Expand Up @@ -73,7 +73,7 @@ open class BaseRouterMock: BaseRouter {

public func dismiss(animated: Bool) {}

public func showMainScreen() {}
public func showMainOrWhatsNewScreen() {}

public func showLoginScreen() {}

Expand Down
Loading

0 comments on commit 995e0b5

Please sign in to comment.