RoomMemberDetailsScreen (#727)

* generated files

* Revert "generated files"

This reverts commit f62c1dbcd9e505083ad4ff17532e2c054e253187.

* renaming files to RoomMembersList

* completed the renaming of the list files

* added generated files

* basic setup of the view and the mock

* added a new mock with a avatar

* share/copy link

* copyUserLink implemented

* removed unimplemented tests

* block user UI

* navigation to room member details added

* implemented but we require a sync from the Rust side

* adjusted some UI test screens

* alert for unblocking

* completed

* some tests

* changelog

* some unit tests

* improved the tests

* removed unused comment

* Update ElementX/Sources/Services/Room/RoomProxy.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* optional displayName

* removing toggle

* removed cancel title

* Update UnitTests/Sources/RoomMemberDetailsViewModelTests.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* removing Group

* pr suggestion

* better naming

* removed capitalizingFirstLetter

* Update ElementX/Sources/Other/Extensions/Alert.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* trailing closure

* removed useless catch clause

* naming conformed to ignore

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-03-24 20:27:47 +01:00
committed by GitHub
parent 9cd38d1a4c
commit 8daa23b27a
41 changed files with 835 additions and 94 deletions
@@ -78,7 +78,51 @@ class RoomMemberProxyMock: RoomMemberProxyProtocol {
set(value) { underlyingNormalizedPowerLevel = value }
}
var underlyingNormalizedPowerLevel: Int!
var isAccountOwner: Bool {
get { return underlyingIsAccountOwner }
set(value) { underlyingIsAccountOwner = value }
}
var underlyingIsAccountOwner: Bool!
var isIgnored: Bool {
get { return underlyingIsIgnored }
set(value) { underlyingIsIgnored = value }
}
var underlyingIsIgnored: Bool!
//MARK: - ignoreUser
var ignoreUserCallsCount = 0
var ignoreUserCalled: Bool {
return ignoreUserCallsCount > 0
}
var ignoreUserReturnValue: Result<Void, RoomMemberProxyError>!
var ignoreUserClosure: (() async -> Result<Void, RoomMemberProxyError>)?
func ignoreUser() async -> Result<Void, RoomMemberProxyError> {
ignoreUserCallsCount += 1
if let ignoreUserClosure = ignoreUserClosure {
return await ignoreUserClosure()
} else {
return ignoreUserReturnValue
}
}
//MARK: - unignoreUser
var unignoreUserCallsCount = 0
var unignoreUserCalled: Bool {
return unignoreUserCallsCount > 0
}
var unignoreUserReturnValue: Result<Void, RoomMemberProxyError>!
var unignoreUserClosure: (() async -> Result<Void, RoomMemberProxyError>)?
func unignoreUser() async -> Result<Void, RoomMemberProxyError> {
unignoreUserCallsCount += 1
if let unignoreUserClosure = unignoreUserClosure {
return await unignoreUserClosure()
} else {
return unignoreUserReturnValue
}
}
}
class RoomProxyMock: RoomProxyProtocol {
var id: String {