mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Let members edit their profile and invite others (#12)
* Add HealthChat API and extended profile services Expose OpenID tokens and homeserver credentials from the client proxy, and add fork-only services for the HealthChat member directory backend (api.healthchat.ch) plus a service that reads MSC4133 extended profile fields directly from the homeserver. Groundwork for the members tab and the profile screens. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Show extended profile details on the profile screens Add a UserProfileScreenHook that lets the fork inject an extra Form section below the header of the user profile and room member details screens. The HealthChat implementation loads the MSC4133 extended profile fields and renders them with tappable phone/email/website links, hiding the section entirely for profiles without any fields. Strings live in a new fork-only HealthChat.strings table (de/en/fr, generated as HealthChatL10n via SwiftGen) since Untranslated.strings pins the English bundle. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Add a member directory tab Add a HomeTabsHook that lets the fork append an extra tab to the home tab bar, and a HealthChat members flow behind it: a directory of all approved members from the HealthChat API with server-side search, pending-approval and error states, chat shortcuts and pushed member profiles. Chats and calls are handed back to the session flow via the hook's actions publisher. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Let members edit their profile and invite others Add a native profile editor for the HealthChat extended profile fields (13 fields plus avatar, saved as a partial diff through the HealthChat API so displayname derivation and Zitadel sync stay server-side), an invitation sheet (email plus personal note) and a profile-completeness hint on the member directory. A new UserDetailsEditScreenHook lets the fork substitute the profile editor behind the settings user row — the stock display-name editor would let users edit a value the next profile update derives away. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS
This commit is contained in:
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
struct HealthChatInviteMemberScreenCoordinatorParameters {
|
||||
let apiService: HealthChatAPIServiceProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
|
||||
enum HealthChatInviteMemberScreenCoordinatorAction {
|
||||
case dismiss
|
||||
}
|
||||
|
||||
final class HealthChatInviteMemberScreenCoordinator: CoordinatorProtocol {
|
||||
private let viewModel: HealthChatInviteMemberScreenViewModelProtocol
|
||||
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
private let actionsSubject: PassthroughSubject<HealthChatInviteMemberScreenCoordinatorAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<HealthChatInviteMemberScreenCoordinatorAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init(parameters: HealthChatInviteMemberScreenCoordinatorParameters) {
|
||||
viewModel = HealthChatInviteMemberScreenViewModel(apiService: parameters.apiService,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
func start() {
|
||||
viewModel.actionsPublisher.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
case .dismiss:
|
||||
actionsSubject.send(.dismiss)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(HealthChatInviteMemberScreen(context: viewModel.context))
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum HealthChatInviteMemberScreenViewModelAction {
|
||||
case dismiss
|
||||
}
|
||||
|
||||
struct HealthChatInviteMemberScreenViewState: BindableState {
|
||||
/// The backend requires a personal note of at least this many characters.
|
||||
static let minimumNoteLength = 10
|
||||
|
||||
var bindings = HealthChatInviteMemberScreenViewStateBindings()
|
||||
|
||||
var canSend: Bool {
|
||||
isEmailValid && isNoteValid
|
||||
}
|
||||
|
||||
var isEmailValid: Bool {
|
||||
let email = bindings.email.trimmingCharacters(in: .whitespaces)
|
||||
let components = email.split(separator: "@")
|
||||
return components.count == 2 && components[1].contains(".")
|
||||
}
|
||||
|
||||
var isNoteValid: Bool {
|
||||
bindings.personalNote.trimmingCharacters(in: .whitespacesAndNewlines).count >= Self.minimumNoteLength
|
||||
}
|
||||
}
|
||||
|
||||
struct HealthChatInviteMemberScreenViewStateBindings {
|
||||
var email = ""
|
||||
var personalNote = ""
|
||||
|
||||
var alertInfo: AlertInfo<HealthChatInviteMemberScreenAlertType>?
|
||||
}
|
||||
|
||||
enum HealthChatInviteMemberScreenAlertType: Hashable {
|
||||
case sendFailed
|
||||
}
|
||||
|
||||
enum HealthChatInviteMemberScreenViewAction {
|
||||
case send
|
||||
case cancel
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias HealthChatInviteMemberScreenViewModelType = StateStoreViewModelV2<HealthChatInviteMemberScreenViewState, HealthChatInviteMemberScreenViewAction>
|
||||
|
||||
class HealthChatInviteMemberScreenViewModel: HealthChatInviteMemberScreenViewModelType, HealthChatInviteMemberScreenViewModelProtocol {
|
||||
private let apiService: HealthChatAPIServiceProtocol
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
|
||||
private let actionsSubject: PassthroughSubject<HealthChatInviteMemberScreenViewModelAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<HealthChatInviteMemberScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init(apiService: HealthChatAPIServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.apiService = apiService
|
||||
self.userIndicatorController = userIndicatorController
|
||||
|
||||
super.init(initialViewState: HealthChatInviteMemberScreenViewState(), mediaProvider: nil)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
override func process(viewAction: HealthChatInviteMemberScreenViewAction) {
|
||||
switch viewAction {
|
||||
case .send:
|
||||
Task { await sendInvitation() }
|
||||
case .cancel:
|
||||
actionsSubject.send(.dismiss)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func sendInvitation() async {
|
||||
let indicatorID = "\(Self.self)-Sending"
|
||||
defer { userIndicatorController.retractIndicatorWithId(indicatorID) }
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: indicatorID,
|
||||
type: .modal(progress: .indeterminate, interactiveDismissDisabled: true, allowsInteraction: false),
|
||||
title: L10n.commonLoading,
|
||||
persistent: true),
|
||||
delay: .milliseconds(100))
|
||||
|
||||
let email = state.bindings.email.trimmingCharacters(in: .whitespaces)
|
||||
let personalNote = state.bindings.personalNote.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
|
||||
switch await apiService.inviteMember(email: email, personalNote: personalNote) {
|
||||
case .success:
|
||||
userIndicatorController.submitIndicator(UserIndicator(title: HealthChatL10n.screenInviteMemberSuccess, icon: \.check))
|
||||
actionsSubject.send(.dismiss)
|
||||
case .failure:
|
||||
state.bindings.alertInfo = .init(id: .sendFailed)
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
|
||||
@MainActor
|
||||
protocol HealthChatInviteMemberScreenViewModelProtocol {
|
||||
var actionsPublisher: AnyPublisher<HealthChatInviteMemberScreenViewModelAction, Never> { get }
|
||||
var context: HealthChatInviteMemberScreenViewModelType.Context { get }
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct HealthChatInviteMemberScreen: View {
|
||||
@Bindable var context: HealthChatInviteMemberScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
ListRow(label: .plain(title: HealthChatL10n.screenInviteMemberEmailPlaceholder),
|
||||
kind: .textField(text: $context.email, axis: .horizontal))
|
||||
.keyboardType(.emailAddress)
|
||||
.textInputAutocapitalization(.never)
|
||||
.autocorrectionDisabled()
|
||||
}
|
||||
|
||||
Section {
|
||||
ListRow(label: .plain(title: HealthChatL10n.screenInviteMemberNotePlaceholder),
|
||||
kind: .textField(text: $context.personalNote, axis: .vertical))
|
||||
.lineLimit(4...)
|
||||
} footer: {
|
||||
Text(HealthChatL10n.screenInviteMemberNoteFooter)
|
||||
.compoundListSectionFooter()
|
||||
}
|
||||
}
|
||||
.compoundList()
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.navigationTitle(HealthChatL10n.screenInviteMemberTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button(L10n.actionCancel) {
|
||||
context.send(viewAction: .cancel)
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(L10n.actionSend) {
|
||||
context.send(viewAction: .send)
|
||||
}
|
||||
.disabled(!context.viewState.canSend)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct HealthChatInviteMemberScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = HealthChatInviteMemberScreenViewModel(apiService: HealthChatAPIServiceMock(),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
static var previews: some View {
|
||||
ElementNavigationStack {
|
||||
HealthChatInviteMemberScreen(context: viewModel.context)
|
||||
}
|
||||
.previewDisplayName("Invite")
|
||||
}
|
||||
}
|
||||
+6
@@ -18,6 +18,8 @@ struct HealthChatMemberDirectoryScreenCoordinatorParameters {
|
||||
enum HealthChatMemberDirectoryScreenCoordinatorAction {
|
||||
case selectMember(userID: String)
|
||||
case presentRoom(roomID: String)
|
||||
case editProfile
|
||||
case invite
|
||||
}
|
||||
|
||||
final class HealthChatMemberDirectoryScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -45,6 +47,10 @@ final class HealthChatMemberDirectoryScreenCoordinator: CoordinatorProtocol {
|
||||
actionsSubject.send(.selectMember(userID: userID))
|
||||
case .presentRoom(let roomID):
|
||||
actionsSubject.send(.presentRoom(roomID: roomID))
|
||||
case .editProfile:
|
||||
actionsSubject.send(.editProfile)
|
||||
case .invite:
|
||||
actionsSubject.send(.invite)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
+10
@@ -10,6 +10,8 @@ import Foundation
|
||||
enum HealthChatMemberDirectoryScreenViewModelAction {
|
||||
case selectMember(userID: String)
|
||||
case presentRoom(roomID: String)
|
||||
case editProfile
|
||||
case invite
|
||||
}
|
||||
|
||||
nonisolated enum HealthChatMemberDirectoryScreenContent: Equatable {
|
||||
@@ -22,6 +24,12 @@ nonisolated enum HealthChatMemberDirectoryScreenContent: Equatable {
|
||||
struct HealthChatMemberDirectoryScreenViewState: BindableState {
|
||||
var content: HealthChatMemberDirectoryScreenContent = .loading
|
||||
|
||||
/// Inviting others is only available to approved accounts.
|
||||
var isApproved = false
|
||||
|
||||
/// The hint shown while the own profile is missing required fields.
|
||||
var completenessMessage: String?
|
||||
|
||||
var bindings = HealthChatMemberDirectoryScreenViewStateBindings()
|
||||
}
|
||||
|
||||
@@ -38,4 +46,6 @@ enum HealthChatMemberDirectoryScreenViewAction {
|
||||
case retry
|
||||
case selectMember(HealthChatMember)
|
||||
case startChat(HealthChatMember)
|
||||
case editProfile
|
||||
case invite
|
||||
}
|
||||
|
||||
+18
@@ -64,6 +64,10 @@ class HealthChatMemberDirectoryScreenViewModel: HealthChatMemberDirectoryScreenV
|
||||
actionsSubject.send(.selectMember(userID: member.userID))
|
||||
case .startChat(let member):
|
||||
Task { await startChat(with: member) }
|
||||
case .editProfile:
|
||||
actionsSubject.send(.editProfile)
|
||||
case .invite:
|
||||
actionsSubject.send(.invite)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +84,13 @@ class HealthChatMemberDirectoryScreenViewModel: HealthChatMemberDirectoryScreenV
|
||||
|
||||
switch result {
|
||||
case .success(let response) where !response.isApproved:
|
||||
state.isApproved = false
|
||||
state.completenessMessage = nil
|
||||
state.content = .pendingApproval(message: response.pendingMessage ?? HealthChatL10n.screenMemberDirectoryPendingApproval)
|
||||
case .success(let response):
|
||||
state.isApproved = true
|
||||
await updateCompletenessMessage()
|
||||
guard !Task.isCancelled else { return }
|
||||
state.content = .members(response.users)
|
||||
case .failure:
|
||||
state.content = .failure
|
||||
@@ -89,6 +98,15 @@ class HealthChatMemberDirectoryScreenViewModel: HealthChatMemberDirectoryScreenV
|
||||
}
|
||||
}
|
||||
|
||||
private func updateCompletenessMessage() async {
|
||||
// Best-effort hint — a failed check just hides it.
|
||||
guard case let .success(completeness) = await apiService.profileCompleteness() else {
|
||||
state.completenessMessage = nil
|
||||
return
|
||||
}
|
||||
state.completenessMessage = completeness.isComplete ? nil : completeness.message
|
||||
}
|
||||
|
||||
private func startChat(with member: HealthChatMember) async {
|
||||
switch clientProxy.directRoomForUserID(member.userID) {
|
||||
case .success(let roomID?):
|
||||
|
||||
+52
@@ -18,9 +18,33 @@ struct HealthChatMemberDirectoryScreen: View {
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.searchController(query: $context.searchQuery,
|
||||
placeholder: HealthChatL10n.screenMemberDirectorySearchPlaceholder)
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
context.send(viewAction: .editProfile)
|
||||
} label: {
|
||||
CompoundIcon(\.edit)
|
||||
}
|
||||
.accessibilityLabel(L10n.screenEditProfileTitle)
|
||||
}
|
||||
|
||||
if context.viewState.isApproved {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
context.send(viewAction: .invite)
|
||||
} label: {
|
||||
CompoundIcon(\.userAdd)
|
||||
}
|
||||
.accessibilityLabel(HealthChatL10n.screenInviteMemberTitle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@ViewBuilder
|
||||
@@ -42,6 +66,15 @@ struct HealthChatMemberDirectoryScreen: View {
|
||||
|
||||
private func memberList(_ members: [HealthChatMember]) -> some View {
|
||||
Form {
|
||||
if let completenessMessage = context.viewState.completenessMessage {
|
||||
Section {
|
||||
ListRow(label: .default(title: completenessMessage, icon: \.info),
|
||||
kind: .button {
|
||||
context.send(viewAction: .editProfile)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
ForEach(members) { member in
|
||||
HealthChatMemberListRow(member: member, mediaProvider: context.mediaProvider) {
|
||||
@@ -91,6 +124,7 @@ struct HealthChatMemberDirectoryScreen: View {
|
||||
|
||||
struct HealthChatMemberDirectoryScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let loadedViewModel = makeViewModel(configuration: .members)
|
||||
static let incompleteProfileViewModel = makeViewModel(configuration: .incompleteProfile)
|
||||
static let pendingViewModel = makeViewModel(configuration: .pendingApproval)
|
||||
static let failureViewModel = makeViewModel(configuration: .failure)
|
||||
|
||||
@@ -101,6 +135,12 @@ struct HealthChatMemberDirectoryScreen_Previews: PreviewProvider, TestablePrevie
|
||||
.snapshotPreferences(expect: loadedViewModel.context.observe(\.viewState.content).map { $0 != .loading })
|
||||
.previewDisplayName("Members")
|
||||
|
||||
ElementNavigationStack {
|
||||
HealthChatMemberDirectoryScreen(context: incompleteProfileViewModel.context)
|
||||
}
|
||||
.snapshotPreferences(expect: incompleteProfileViewModel.context.observe(\.viewState.completenessMessage).map { $0 != nil })
|
||||
.previewDisplayName("Incomplete profile")
|
||||
|
||||
ElementNavigationStack {
|
||||
HealthChatMemberDirectoryScreen(context: pendingViewModel.context)
|
||||
}
|
||||
@@ -116,6 +156,7 @@ struct HealthChatMemberDirectoryScreen_Previews: PreviewProvider, TestablePrevie
|
||||
|
||||
enum PreviewConfiguration {
|
||||
case members
|
||||
case incompleteProfile
|
||||
case pendingApproval
|
||||
case failure
|
||||
}
|
||||
@@ -149,6 +190,17 @@ struct HealthChatMemberDirectoryScreen_Previews: PreviewProvider, TestablePrevie
|
||||
apiService.membersSearchQueryReturnValue = .success(.init(users: members ?? [],
|
||||
isApproved: true,
|
||||
pendingMessage: nil))
|
||||
apiService.profileCompletenessReturnValue = try? .success(JSONDecoder().decode(HealthChatProfileCompleteness.self,
|
||||
from: Data(#"{ "isComplete": true }"#.utf8)))
|
||||
case .incompleteProfile:
|
||||
let member = try? JSONDecoder().decode(HealthChatMember.self, from: Data("""
|
||||
{ "userId": "@alice:healthchat.ch", "displayName": "Dr. Alice Alpha", "specialty": "Physiotherapie" }
|
||||
""".utf8))
|
||||
apiService.membersSearchQueryReturnValue = .success(.init(users: member.map { [$0] } ?? [],
|
||||
isApproved: true,
|
||||
pendingMessage: nil))
|
||||
apiService.profileCompletenessReturnValue = try? .success(JSONDecoder().decode(HealthChatProfileCompleteness.self,
|
||||
from: Data(#"{ "isComplete": false, "message": "Profil unvollständig – Fehlende Angaben: Fachgebiet, Ort" }"#.utf8)))
|
||||
case .pendingApproval:
|
||||
apiService.membersSearchQueryReturnValue = .success(.init(users: [],
|
||||
isApproved: false,
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
struct HealthChatProfileEditScreenCoordinatorParameters {
|
||||
let orientationManager: OrientationManagerProtocol
|
||||
let userSession: UserSessionProtocol
|
||||
let apiService: HealthChatAPIServiceProtocol
|
||||
let mediaUploadingPreprocessor: MediaUploadingPreprocessor
|
||||
weak var navigationStackCoordinator: NavigationStackCoordinator?
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
|
||||
final class HealthChatProfileEditScreenCoordinator: CoordinatorProtocol, UserDetailsEditCoordinatorProtocol {
|
||||
private let parameters: HealthChatProfileEditScreenCoordinatorParameters
|
||||
private let viewModel: HealthChatProfileEditScreenViewModelProtocol
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
private let actionsSubject: PassthroughSubject<RoomDetailsEditScreenCoordinatorAction, Never> = .init()
|
||||
var actions: AnyPublisher<RoomDetailsEditScreenCoordinatorAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init(parameters: HealthChatProfileEditScreenCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
viewModel = HealthChatProfileEditScreenViewModel(userSession: parameters.userSession,
|
||||
apiService: parameters.apiService,
|
||||
mediaUploadingPreprocessor: parameters.mediaUploadingPreprocessor,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
func start() {
|
||||
viewModel.actionsPublisher
|
||||
.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .dismiss:
|
||||
actionsSubject.send(.dismiss)
|
||||
case .displayCameraPicker:
|
||||
displayMediaPickerWithMode(.init(source: .camera, selectionType: .single))
|
||||
case .displayMediaPicker:
|
||||
displayMediaPickerWithMode(.init(source: .photoLibrary, selectionType: .single))
|
||||
case .displayFilePicker:
|
||||
displayMediaPickerWithMode(.init(source: .documents(types: [.image]), selectionType: .single))
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(HealthChatProfileEditScreen(context: viewModel.context))
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private func displayMediaPickerWithMode(_ mode: MediaPickerScreenMode) {
|
||||
let stackCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode,
|
||||
userIndicatorController: parameters.userIndicatorController,
|
||||
orientationManager: parameters.orientationManager) { [weak self] action in
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
case .cancel:
|
||||
parameters.navigationStackCoordinator?.setSheetCoordinator(nil)
|
||||
case .selectedMediaAtURLs(let urls):
|
||||
guard urls.count == 1,
|
||||
let url = urls.first else {
|
||||
fatalError("Received an invalid number of URLs")
|
||||
}
|
||||
|
||||
parameters.navigationStackCoordinator?.setSheetCoordinator(nil)
|
||||
viewModel.didSelectMediaURL(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
stackCoordinator.setRootCoordinator(mediaPickerCoordinator)
|
||||
parameters.navigationStackCoordinator?.setSheetCoordinator(stackCoordinator)
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum HealthChatProfileEditScreenViewModelAction {
|
||||
case dismiss
|
||||
case displayCameraPicker
|
||||
case displayMediaPicker
|
||||
case displayFilePicker
|
||||
}
|
||||
|
||||
struct HealthChatProfileEditScreenViewState: BindableState {
|
||||
var initialProfile: HealthChatMember?
|
||||
var loadFailed = false
|
||||
|
||||
var canEditAvatar = false
|
||||
var selectedAvatarURL: URL?
|
||||
var localMedia: MediaInfo?
|
||||
|
||||
var bindings = HealthChatProfileEditScreenViewStateBindings()
|
||||
|
||||
var avatarDidChange: Bool {
|
||||
localMedia != nil || selectedAvatarURL != initialProfile?.avatarURL
|
||||
}
|
||||
|
||||
/// The changed text fields as a partial update, nil when nothing changed.
|
||||
var fieldsUpdate: HealthChatProfileUpdate? {
|
||||
guard let initialProfile else { return nil }
|
||||
|
||||
var update = HealthChatProfileUpdate()
|
||||
// nil leaves a field unchanged server-side, an empty string clears it.
|
||||
func diff(_ binding: String, _ initialValue: String?) -> String? {
|
||||
let value = binding.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
return value == (initialValue ?? "") ? nil : value
|
||||
}
|
||||
|
||||
update.title = diff(bindings.title, initialProfile.title)
|
||||
update.firstName = diff(bindings.firstName, initialProfile.firstName)
|
||||
update.lastName = diff(bindings.lastName, initialProfile.lastName)
|
||||
update.specialty = diff(bindings.specialty, initialProfile.specialty)
|
||||
update.practiceName = diff(bindings.practiceName, initialProfile.practiceName)
|
||||
update.businessCity = diff(bindings.businessCity, initialProfile.businessCity)
|
||||
update.businessEmail = diff(bindings.businessEmail, initialProfile.businessEmail)
|
||||
update.businessTel = diff(bindings.businessTel, initialProfile.businessTel)
|
||||
update.furtherInfo = diff(bindings.furtherInfo, initialProfile.furtherInfo)
|
||||
update.street = diff(bindings.street, initialProfile.street)
|
||||
update.houseNumber = diff(bindings.houseNumber, initialProfile.houseNumber)
|
||||
update.postalCode = diff(bindings.postalCode, initialProfile.postalCode)
|
||||
update.website = diff(bindings.website, initialProfile.website)
|
||||
|
||||
return update == HealthChatProfileUpdate() ? nil : update
|
||||
}
|
||||
|
||||
/// First name, last name, speciality, practice and city are required (web client parity).
|
||||
var requiredFieldsAreValid: Bool {
|
||||
let requiredFields = [bindings.firstName, bindings.lastName, bindings.specialty,
|
||||
bindings.practiceName, bindings.businessCity]
|
||||
guard requiredFields.allSatisfy({ !$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty }) else {
|
||||
return false
|
||||
}
|
||||
|
||||
let website = bindings.website.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
return website.isEmpty || URL(string: website) != nil
|
||||
}
|
||||
|
||||
var canSave: Bool {
|
||||
initialProfile != nil && requiredFieldsAreValid && (avatarDidChange || fieldsUpdate != nil)
|
||||
}
|
||||
|
||||
var showDeleteImageAction: Bool {
|
||||
localMedia != nil || selectedAvatarURL != nil
|
||||
}
|
||||
}
|
||||
|
||||
struct HealthChatProfileEditScreenViewStateBindings {
|
||||
var title = ""
|
||||
var firstName = ""
|
||||
var lastName = ""
|
||||
var specialty = ""
|
||||
var practiceName = ""
|
||||
var businessCity = ""
|
||||
var businessEmail = ""
|
||||
var businessTel = ""
|
||||
var furtherInfo = ""
|
||||
var street = ""
|
||||
var houseNumber = ""
|
||||
var postalCode = ""
|
||||
var website = ""
|
||||
|
||||
var showMediaSheet = false
|
||||
|
||||
var alertInfo: AlertInfo<HealthChatProfileEditScreenAlertType>?
|
||||
}
|
||||
|
||||
enum HealthChatProfileEditScreenAlertType {
|
||||
case failedProcessingMedia
|
||||
case unsavedChanges
|
||||
case saveError
|
||||
case unknown
|
||||
}
|
||||
|
||||
enum HealthChatProfileEditScreenViewAction {
|
||||
case cancel
|
||||
case save
|
||||
case retry
|
||||
case presentMediaSource
|
||||
case displayCameraPicker
|
||||
case displayMediaPicker
|
||||
case displayFilePicker
|
||||
case removeImage
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias HealthChatProfileEditScreenViewModelType = StateStoreViewModelV2<HealthChatProfileEditScreenViewState, HealthChatProfileEditScreenViewAction>
|
||||
|
||||
class HealthChatProfileEditScreenViewModel: HealthChatProfileEditScreenViewModelType, HealthChatProfileEditScreenViewModelProtocol {
|
||||
private let clientProxy: ClientProxyProtocol
|
||||
private let apiService: HealthChatAPIServiceProtocol
|
||||
private let mediaUploadingPreprocessor: MediaUploadingPreprocessor
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
|
||||
private let actionsSubject: PassthroughSubject<HealthChatProfileEditScreenViewModelAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<HealthChatProfileEditScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init(userSession: UserSessionProtocol,
|
||||
apiService: HealthChatAPIServiceProtocol,
|
||||
mediaUploadingPreprocessor: MediaUploadingPreprocessor,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
clientProxy = userSession.clientProxy
|
||||
self.apiService = apiService
|
||||
self.mediaUploadingPreprocessor = mediaUploadingPreprocessor
|
||||
self.userIndicatorController = userIndicatorController
|
||||
|
||||
super.init(initialViewState: HealthChatProfileEditScreenViewState(), mediaProvider: userSession.mediaProvider)
|
||||
|
||||
Task { await loadProfile() }
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
override func process(viewAction: HealthChatProfileEditScreenViewAction) {
|
||||
switch viewAction {
|
||||
case .cancel:
|
||||
showUnsavedChangesAlert() // The cancel button is only shown when there are unsaved changes.
|
||||
case .save:
|
||||
Task { await saveProfile() }
|
||||
case .retry:
|
||||
Task { await loadProfile() }
|
||||
case .presentMediaSource:
|
||||
state.bindings.showMediaSheet = true
|
||||
case .displayCameraPicker:
|
||||
actionsSubject.send(.displayCameraPicker)
|
||||
case .displayMediaPicker:
|
||||
actionsSubject.send(.displayMediaPicker)
|
||||
case .displayFilePicker:
|
||||
actionsSubject.send(.displayFilePicker)
|
||||
case .removeImage:
|
||||
state.localMedia = nil
|
||||
state.selectedAvatarURL = nil
|
||||
}
|
||||
}
|
||||
|
||||
func didSelectMediaURL(url: URL) {
|
||||
Task {
|
||||
let userIndicatorID = UUID().uuidString
|
||||
defer { userIndicatorController.retractIndicatorWithId(userIndicatorID) }
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID,
|
||||
type: .modal(progress: .indeterminate, interactiveDismissDisabled: true, allowsInteraction: false),
|
||||
title: L10n.commonLoading,
|
||||
persistent: true))
|
||||
|
||||
guard case let .success(maxUploadSize) = await clientProxy.maxMediaUploadSize else {
|
||||
MXLog.error("Failed to get max upload size")
|
||||
state.bindings.alertInfo = .init(id: .unknown)
|
||||
return
|
||||
}
|
||||
let mediaResult = await mediaUploadingPreprocessor.processMedia(at: url, maxUploadSize: maxUploadSize)
|
||||
|
||||
switch mediaResult {
|
||||
case .success(.image):
|
||||
state.localMedia = try? mediaResult.get()
|
||||
case .failure, .success:
|
||||
state.bindings.alertInfo = .init(id: .failedProcessingMedia)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func loadProfile() async {
|
||||
state.loadFailed = false
|
||||
|
||||
state.canEditAvatar = await clientProxy.capabilities.canChangeAvatar()
|
||||
|
||||
switch await apiService.ownProfile() {
|
||||
case .success(let profile):
|
||||
state.selectedAvatarURL = profile.avatarURL
|
||||
state.bindings.title = profile.title ?? ""
|
||||
state.bindings.firstName = profile.firstName ?? ""
|
||||
state.bindings.lastName = profile.lastName ?? ""
|
||||
state.bindings.specialty = profile.specialty ?? ""
|
||||
state.bindings.practiceName = profile.practiceName ?? ""
|
||||
state.bindings.businessCity = profile.businessCity ?? ""
|
||||
state.bindings.businessEmail = profile.businessEmail ?? ""
|
||||
state.bindings.businessTel = profile.businessTel ?? ""
|
||||
state.bindings.furtherInfo = profile.furtherInfo ?? ""
|
||||
state.bindings.street = profile.street ?? ""
|
||||
state.bindings.houseNumber = profile.houseNumber ?? ""
|
||||
state.bindings.postalCode = profile.postalCode ?? ""
|
||||
state.bindings.website = profile.website ?? ""
|
||||
state.initialProfile = profile
|
||||
case .failure:
|
||||
state.loadFailed = true
|
||||
}
|
||||
}
|
||||
|
||||
private func showUnsavedChangesAlert() {
|
||||
state.bindings.alertInfo = .init(id: .unsavedChanges,
|
||||
title: L10n.dialogUnsavedChangesTitle,
|
||||
message: L10n.dialogUnsavedChangesDescription,
|
||||
primaryButton: .init(title: L10n.actionSave) { Task { await self.saveProfile() } },
|
||||
secondaryButton: .init(title: L10n.actionDiscard, role: .cancel) { self.actionsSubject.send(.dismiss) })
|
||||
}
|
||||
|
||||
private func saveProfile() async {
|
||||
let userIndicatorID = UUID().uuidString
|
||||
defer { userIndicatorController.retractIndicatorWithId(userIndicatorID) }
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID,
|
||||
type: .modal(progress: .indeterminate, interactiveDismissDisabled: true, allowsInteraction: false),
|
||||
title: L10n.screenEditProfileUpdatingDetails,
|
||||
persistent: true))
|
||||
|
||||
do {
|
||||
if state.avatarDidChange {
|
||||
try await saveAvatar()
|
||||
}
|
||||
|
||||
// The fields go second so the derived display name reflects the latest names.
|
||||
if let update = state.fieldsUpdate {
|
||||
try await apiService.updateOwnProfile(update).get()
|
||||
}
|
||||
|
||||
actionsSubject.send(.dismiss)
|
||||
} catch {
|
||||
MXLog.error("Failed saving the HealthChat profile with error: \(error)")
|
||||
state.bindings.alertInfo = .init(id: .saveError,
|
||||
title: L10n.screenEditProfileErrorTitle,
|
||||
message: L10n.screenEditProfileError)
|
||||
}
|
||||
}
|
||||
|
||||
private func saveAvatar() async throws {
|
||||
if let localMedia = state.localMedia {
|
||||
try await clientProxy.setUserAvatar(media: localMedia).get()
|
||||
} else if state.selectedAvatarURL == nil {
|
||||
try await clientProxy.removeUserAvatar().get()
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
protocol HealthChatProfileEditScreenViewModelProtocol {
|
||||
var actionsPublisher: AnyPublisher<HealthChatProfileEditScreenViewModelAction, Never> { get }
|
||||
var context: HealthChatProfileEditScreenViewModelType.Context { get }
|
||||
|
||||
func didSelectMediaURL(url: URL)
|
||||
}
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// Copyright 2026 Novaloop AG
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct HealthChatProfileEditScreen: View {
|
||||
@Bindable var context: HealthChatProfileEditScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
content
|
||||
.navigationTitle(L10n.screenEditProfileTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarBackButtonHidden(context.viewState.canSave)
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@ViewBuilder
|
||||
private var content: some View {
|
||||
if context.viewState.loadFailed {
|
||||
failureView
|
||||
} else {
|
||||
form
|
||||
}
|
||||
}
|
||||
|
||||
private var form: some View {
|
||||
Form {
|
||||
Section {
|
||||
avatar
|
||||
}
|
||||
|
||||
Section {
|
||||
textFieldRow(HealthChatL10n.commonAcademicTitle, text: $context.title)
|
||||
textFieldRow(requiredLabel(HealthChatL10n.commonFirstName), text: $context.firstName)
|
||||
textFieldRow(requiredLabel(HealthChatL10n.commonLastName), text: $context.lastName)
|
||||
} header: {
|
||||
Text(HealthChatL10n.screenProfileEditSectionPersonal)
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
|
||||
Section {
|
||||
textFieldRow(requiredLabel(HealthChatL10n.commonSpecialty), text: $context.specialty)
|
||||
textFieldRow(requiredLabel(HealthChatL10n.commonPracticeName), text: $context.practiceName)
|
||||
textFieldRow(requiredLabel(HealthChatL10n.commonCity), text: $context.businessCity)
|
||||
textFieldRow(HealthChatL10n.commonFurtherInfo, text: $context.furtherInfo, axis: .vertical)
|
||||
} header: {
|
||||
Text(HealthChatL10n.screenProfileEditSectionProfessional)
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
|
||||
Section {
|
||||
textFieldRow(HealthChatL10n.commonBusinessEmail, text: $context.businessEmail)
|
||||
textFieldRow(HealthChatL10n.commonBusinessTel, text: $context.businessTel)
|
||||
} header: {
|
||||
Text(HealthChatL10n.screenProfileEditSectionContact)
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
|
||||
Section {
|
||||
textFieldRow(HealthChatL10n.commonStreet, text: $context.street)
|
||||
textFieldRow(HealthChatL10n.commonHouseNumber, text: $context.houseNumber)
|
||||
textFieldRow(HealthChatL10n.commonPostalCode, text: $context.postalCode)
|
||||
textFieldRow(HealthChatL10n.commonWebsite, text: $context.website)
|
||||
} header: {
|
||||
Text(HealthChatL10n.screenProfileEditSectionAddress)
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
}
|
||||
.compoundList()
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.disabled(context.viewState.initialProfile == nil)
|
||||
}
|
||||
|
||||
private var failureView: some View {
|
||||
VStack(spacing: 16) {
|
||||
BigIcon(icon: \.error)
|
||||
|
||||
Text(L10n.commonSomethingWentWrong)
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Button(L10n.actionRetry) {
|
||||
context.send(viewAction: .retry)
|
||||
}
|
||||
.buttonStyle(.compound(.secondary, size: .medium))
|
||||
.fixedSize()
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.padding(16)
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
if context.viewState.canSave {
|
||||
Button(L10n.actionCancel) {
|
||||
context.send(viewAction: .cancel)
|
||||
}
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(L10n.actionSave) {
|
||||
context.send(viewAction: .save)
|
||||
}
|
||||
.disabled(!context.viewState.canSave)
|
||||
}
|
||||
}
|
||||
|
||||
private var avatar: some View {
|
||||
Button {
|
||||
context.send(viewAction: .presentMediaSource)
|
||||
} label: {
|
||||
OverridableAvatarImage(overrideURL: context.viewState.localMedia?.thumbnailURL,
|
||||
url: context.viewState.selectedAvatarURL,
|
||||
name: context.viewState.initialProfile?.displayName,
|
||||
contentID: context.viewState.initialProfile?.userID ?? "",
|
||||
shape: .circle,
|
||||
avatarSize: .user(on: .editUserDetails),
|
||||
mediaProvider: context.mediaProvider)
|
||||
.confirmationDialog("", isPresented: $context.showMediaSheet) {
|
||||
mediaActionSheet
|
||||
}
|
||||
}
|
||||
.buttonStyle(EditAvatarButtonStyle())
|
||||
.disabled(!context.viewState.canEditAvatar)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.listRowBackground(Color.clear)
|
||||
}
|
||||
|
||||
private func textFieldRow(_ label: String, text: Binding<String>, axis: Axis = .horizontal) -> some View {
|
||||
ListRow(label: .plain(title: label),
|
||||
kind: .textField(text: text, axis: axis))
|
||||
}
|
||||
|
||||
private func requiredLabel(_ label: String) -> String {
|
||||
"\(label) *"
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var mediaActionSheet: some View {
|
||||
Button {
|
||||
context.send(viewAction: .displayCameraPicker)
|
||||
} label: {
|
||||
Text(L10n.actionTakePhoto)
|
||||
}
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .displayMediaPicker)
|
||||
} label: {
|
||||
Text(L10n.actionChoosePhoto)
|
||||
}
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .displayFilePicker)
|
||||
} label: {
|
||||
Text(L10n.actionChooseFile)
|
||||
}
|
||||
|
||||
if context.viewState.showDeleteImageAction {
|
||||
Button(role: .destructive) {
|
||||
context.send(viewAction: .removeImage)
|
||||
} label: {
|
||||
Text(L10n.actionRemove)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct HealthChatProfileEditScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = makeViewModel()
|
||||
|
||||
static var previews: some View {
|
||||
ElementNavigationStack {
|
||||
HealthChatProfileEditScreen(context: viewModel.context)
|
||||
}
|
||||
.snapshotPreferences(expect: viewModel.context.observe(\.viewState.initialProfile).map { $0 != nil })
|
||||
.previewDisplayName("Profile")
|
||||
}
|
||||
|
||||
static func makeViewModel() -> HealthChatProfileEditScreenViewModel {
|
||||
let apiService = HealthChatAPIServiceMock()
|
||||
let member = try? JSONDecoder().decode(HealthChatMember.self, from: Data("""
|
||||
{
|
||||
"userId": "@alice:healthchat.ch",
|
||||
"displayName": "Dr. Alice Alpha",
|
||||
"title": "Dr. med.",
|
||||
"firstName": "Alice",
|
||||
"lastName": "Alpha",
|
||||
"specialty": "Physiotherapie",
|
||||
"practiceName": "Praxis Alpha",
|
||||
"businessCity": "Zürich",
|
||||
"businessEmail": "praxis@example.ch",
|
||||
"businessTel": "+41 44 123 45 67",
|
||||
"street": "Friedaustrasse",
|
||||
"houseNumber": "17",
|
||||
"postalCode": "8003",
|
||||
"website": "https://example.ch"
|
||||
}
|
||||
""".utf8))
|
||||
if let member {
|
||||
apiService.ownProfileReturnValue = .success(member)
|
||||
}
|
||||
|
||||
return HealthChatProfileEditScreenViewModel(userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init()))),
|
||||
apiService: apiService,
|
||||
mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: .volatile()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user