mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
Feature/4772 add accessibility declaration
This commit is contained in:
committed by
Frank Rotermund
parent
42214cad99
commit
f8348a66d0
@@ -35,6 +35,8 @@ enum AuthenticationLoginViewModelResult: CustomStringConvertible {
|
||||
case qrLogin
|
||||
/// bwi: register info
|
||||
case register
|
||||
/// bwi #4772: accessibility declaration
|
||||
case accessibilityDeclaration
|
||||
|
||||
/// A string representation of the result, ignoring any associated values that could leak PII.
|
||||
var description: String {
|
||||
@@ -55,6 +57,8 @@ enum AuthenticationLoginViewModelResult: CustomStringConvertible {
|
||||
return "qrLogin"
|
||||
case .register:
|
||||
return "register"
|
||||
case .accessibilityDeclaration:
|
||||
return "accessibilityDeclaration"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,6 +122,8 @@ enum AuthenticationLoginViewAction {
|
||||
case qrLogin
|
||||
/// bwi: register info
|
||||
case register
|
||||
/// bwi #4772: accessibility declaration
|
||||
case accessibilityDeclaration
|
||||
}
|
||||
|
||||
enum AuthenticationLoginErrorType: Hashable {
|
||||
|
||||
@@ -54,6 +54,8 @@ class AuthenticationLoginViewModel: AuthenticationLoginViewModelType, Authentica
|
||||
Task { await callback?(.qrLogin) }
|
||||
case .register:
|
||||
Task { await callback?(.register) }
|
||||
case .accessibilityDeclaration:
|
||||
Task { await callback?(.accessibilityDeclaration) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,8 @@ final class AuthenticationLoginCoordinator: Coordinator, Presentable {
|
||||
case .register:
|
||||
// bwi: show info alert
|
||||
self.authenticationLoginViewModel.displayInfoAlert(.register)
|
||||
case .accessibilityDeclaration:
|
||||
self.showAccessibilityDeclaration()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,6 +327,13 @@ final class AuthenticationLoginCoordinator: Coordinator, Presentable {
|
||||
}
|
||||
}
|
||||
|
||||
/// bwi #4772 show accessibility declaration
|
||||
@MainActor private func showAccessibilityDeclaration() {
|
||||
MXLog.debug("[AuthenticationLoginCoordinator] showAccessibilityDeclaration")
|
||||
let accessibilityDeclarationViewController = AccessibilityDeclarationViewController.makeViewController()
|
||||
navigationRouter.push(accessibilityDeclarationViewController, animated: true, popCompletion: nil)
|
||||
}
|
||||
|
||||
/// Updates the view model to reflect any changes made to the homeserver.
|
||||
@MainActor private func updateViewModel() {
|
||||
let homeserver = authenticationService.state.homeserver
|
||||
|
||||
@@ -93,6 +93,13 @@ struct AuthenticationLoginScreen: View {
|
||||
.readableFrame()
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
|
||||
if BWIBuildSettings.shared.bumLoginFlowLayout && BWIBuildSettings.shared.bwiShowAccessibilityDeclaration {
|
||||
accessibilityDeclaration
|
||||
.frame(alignment: .bottom)
|
||||
.padding(.bottom, 10)
|
||||
}
|
||||
|
||||
if BWIBuildSettings.shared.bumLoginFlowLayout {
|
||||
dataPrivacyForm
|
||||
.frame(alignment: .bottom)
|
||||
@@ -305,6 +312,19 @@ struct AuthenticationLoginScreen: View {
|
||||
return BWIBuildSettings.shared.bwiLoginFlowLayout ? BWIL10n.authUserIdPlaceholder : BWIL10n.authenticationLoginUsername
|
||||
}
|
||||
}
|
||||
|
||||
// bwi: Accessibility declaration
|
||||
var accessibilityDeclaration: some View {
|
||||
Button(action: {
|
||||
viewModel.send(viewAction: .accessibilityDeclaration)
|
||||
}, label: {
|
||||
Text(BWIL10n.bwiAccessibilityDeclarationButtonTitle)
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(.blue)
|
||||
.underline()
|
||||
})
|
||||
.padding([.horizontal], 20)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user