mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 05:36:57 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -17,6 +17,7 @@
|
||||
import SwiftUI
|
||||
|
||||
// MARK: Data
|
||||
|
||||
struct SoftLogoutCredentials {
|
||||
let userId: String
|
||||
let homeserverName: String
|
||||
|
||||
+2
-3
@@ -17,10 +17,9 @@
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationSoftLogoutViewModelType = StateStoreViewModel<AuthenticationSoftLogoutViewState,
|
||||
Never,
|
||||
AuthenticationSoftLogoutViewAction>
|
||||
Never,
|
||||
AuthenticationSoftLogoutViewAction>
|
||||
class AuthenticationSoftLogoutViewModel: AuthenticationSoftLogoutViewModelType, AuthenticationSoftLogoutViewModelProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
|
||||
protocol AuthenticationSoftLogoutViewModelProtocol {
|
||||
|
||||
var callback: (@MainActor (AuthenticationSoftLogoutViewModelResult) -> Void)? { get set }
|
||||
var context: AuthenticationSoftLogoutViewModelType.Context { get }
|
||||
|
||||
|
||||
+2
-3
@@ -14,8 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CommonKit
|
||||
import SwiftUI
|
||||
|
||||
struct AuthenticationSoftLogoutCoordinatorParameters {
|
||||
let navigationRouter: NavigationRouterType
|
||||
@@ -50,7 +50,6 @@ enum AuthenticationSoftLogoutCoordinatorResult: CustomStringConvertible {
|
||||
}
|
||||
|
||||
final class AuthenticationSoftLogoutCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -107,7 +106,7 @@ final class AuthenticationSoftLogoutCoordinator: Coordinator, Presentable {
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return self.authenticationSoftLogoutHostingController
|
||||
authenticationSoftLogoutHostingController
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -36,7 +36,7 @@ enum MockAuthenticationSoftLogoutScreenState: MockScreenState, CaseIterable {
|
||||
}
|
||||
|
||||
/// Generate the view struct for the screen state.
|
||||
var screenView: ([Any], AnyView) {
|
||||
var screenView: ([Any], AnyView) {
|
||||
let viewModel: AuthenticationSoftLogoutViewModel
|
||||
let credentials = SoftLogoutCredentials(userId: "@mock:matrix.org",
|
||||
homeserverName: "matrix.org",
|
||||
|
||||
+1
-2
@@ -14,8 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
import XCTest
|
||||
|
||||
class AuthenticationSoftLogoutUITests: MockScreenTestCase {
|
||||
func testEmptyPassword() {
|
||||
@@ -185,5 +185,4 @@ class AuthenticationSoftLogoutUITests: MockScreenTestCase {
|
||||
|
||||
XCTAssertFalse(app.staticTexts["messageLabel2"].exists, "The message 2 should not be shown.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -19,7 +19,6 @@ import XCTest
|
||||
@testable import RiotSwiftUI
|
||||
|
||||
class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
|
||||
@MainActor func testInitialStateForMatrixOrg() async {
|
||||
let credentials = SoftLogoutCredentials(userId: "mock_user_id",
|
||||
homeserverName: "https://matrix.org",
|
||||
@@ -55,5 +54,4 @@ class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
XCTAssert(context.viewState.showLoginForm, "The view model should show login form for the given homeserver.")
|
||||
XCTAssertFalse(context.viewState.showRecoverEncryptionKeysMessage, "The view model should not show recover encryption keys message.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-4
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct AuthenticationSoftLogoutScreen: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -153,7 +152,7 @@ struct AuthenticationSoftLogoutScreen: View {
|
||||
configuration: UIKitTextInputConfiguration(returnKeyType: .done,
|
||||
isSecureTextEntry: true),
|
||||
onCommit: login)
|
||||
.accessibilityIdentifier("passwordTextField")
|
||||
.accessibilityIdentifier("passwordTextField")
|
||||
}
|
||||
|
||||
/// A list of SSO buttons that can be used for login.
|
||||
@@ -188,7 +187,6 @@ struct AuthenticationSoftLogoutScreen: View {
|
||||
func clearData() {
|
||||
viewModel.send(viewAction: .clearAllData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user